docs← Back to article

Markdown for LLMs

A reading of another act

The source Markdown for this article. Copy it into your assistant or download it as a text file.

Download this articlePlain text ↗
# A reading of another act

## Intention

I want to give a consumer a public reading together with the full expansion of its rules.

The owner publishes a reading with its full rule expansion; the consumer chooses it without re-declaring the rules.

## Incorrect form and why it stays silent

```law title="Incorrect form"
interpretation Narrow of recipes.z.owner08::Clause { status disputed; include recipes.z.owner08::Allow; }
```

A cross-package include is forbidden by LDC-E0201: the import interface does not contain the original declaration and its full expansion. The owner includes the rule locally in a pub interpretation; the consumer refers to that reading through alternatives or extends.

## Correct form

```law
language "law.core" version "0.2";
package recipes.z.r08 version "0.1.0";
namespace "urn:recipe:z-interpretations:08";

source Standard { kind standard; jurisdiction "none"; }
edition Edition of Standard { language ru; officiality official; in_force [@2026-01-01, infinity); }
pub fragment Clause in Edition { kind paragraph; locator "1"; text ru official "Учебная норма допускает два прочтения."; }
pub entity Person;
pub relation registered(p: Person);
pub relation accepted(p: Person);
pub rule Allow strict { for p: Person; when registered(p); then accepted(p); }
pub interpretation Broad of Clause { status disputed; include Allow; }
```

## Frozen execution scene

| Facts and choice | Question | Answer |
|---|---|---|
| 1. owner without a choice | `accepted` | `NEITHER` / `COMPUTED` |
| 2. the owner's public reading chosen | `accepted` | `TRUE_ONLY` / `COMPUTED` |
| 3. consumer chose the foreign Broad | `accepted` | `TRUE_ONLY` / `COMPUTED` |
| 4. consumer chose its own Narrow | `accepted` | `FALSE_ONLY` / `COMPUTED` |

```law
test "owner without choice" {
    given {
        context {
            legal_time @2026-09-13;
            decision_time @2026-09-13T09:00:00+05:00;
            knowledge_time @2026-09-13T09:00:00+05:00;
            timezone "Asia/Almaty";

        }
        assert registered(entity_ref("urn:recipe:z-interpretations:08:p"));
    }
    evaluate truth(accepted(entity_ref("urn:recipe:z-interpretations:08:p")));
    expect truth_status == NEITHER;
    expect evaluation_status == COMPUTED;

}
```

```law
test "owner public reading chosen" {
    given {
        context {
            legal_time @2026-09-13;
            decision_time @2026-09-13T09:00:00+05:00;
            knowledge_time @2026-09-13T09:00:00+05:00;
            timezone "Asia/Almaty";
            interpretation Broad;
        }
        assert registered(entity_ref("urn:recipe:z-interpretations:08:p"));
    }
    evaluate truth(accepted(entity_ref("urn:recipe:z-interpretations:08:p")));
    expect truth_status == TRUE_ONLY;
    expect evaluation_status == COMPUTED;

}
```



An executable resource check from the repository root:

```python
>>> import runpy
>>> checks = runpy.run_path("docs/recipes/z-interpretations/resources/check.py")
>>> print(checks["check_export_boundary"]())
consumer loads clean; Broad TRUE_ONLY, Narrow FALSE_ONLY; lawc = lawref
```

The full consumer [main.law](https://github.com/arxohq/law/blob/master/docs/recipes/z-interpretations/resources/08-consumer/main.law) with [law.toml](https://github.com/arxohq/law/blob/master/docs/recipes/z-interpretations/resources/08-consumer/law.toml) and [law.lock](https://github.com/arxohq/law/blob/master/docs/recipes/z-interpretations/resources/08-consumer/law.lock). Its dependency [producer.law](https://github.com/arxohq/law/blob/master/docs/recipes/z-interpretations/resources/08-consumer/producer.law) is the same owner with the name `recipes.z.owner08` and namespace `urn:recipe:z-interpretations:08:owner`. The check verifies this match, the clean load, and two executable scenes [broad.lawtest](https://github.com/arxohq/law/blob/master/docs/recipes/z-interpretations/resources/08-consumer/broad.lawtest), [narrow.lawtest](https://github.com/arxohq/law/blob/master/docs/recipes/z-interpretations/resources/08-consumer/narrow.lawtest).

```law
language "law.core" version "0.2";
package recipes.z.r08 version "0.1.0";
namespace "urn:recipe:z-interpretations:08";

import recipes.z.owner08 version "0.1.0";
relation registered(p: recipes.z.owner08::Person);
relation accepted(p: recipes.z.owner08::Person);
rule Input strict { for p: recipes.z.owner08::Person; when registered(p); then recipes.z.owner08::registered(p); }
rule Output strict { for p: recipes.z.owner08::Person; when recipes.z.owner08::accepted(p); then accepted(p); }
rule Deny strict { for p: recipes.z.owner08::Person; when registered(p); then not accepted(p); }
interpretation Narrow of recipes.z.owner08::Clause { status disputed; include Deny; }
interpretation_group Meaning { alternatives recipes.z.owner08::Broad, Narrow; selection exactly_one; }
```

The lock file confirms the pin; loading the dependency through the standard resolver is clean, with no diagnostics. The schema now carries visibility, so the public Broad reading is part of the dependency's export set. Below are two executable consumer scenes: choosing the foreign Broad gives TRUE_ONLY, choosing the local Narrow gives FALSE_ONLY; both evaluators agree byte for byte.

```law
test "broad reading accepted across packages" {
    given {
        context {
            legal_time @2026-09-13;
            decision_time @2026-09-13T09:00:00+05:00;
            knowledge_time @2026-09-13T09:00:00+05:00;
            timezone "Asia/Almaty";
            interpretation recipes.z.owner08::Broad;
        }
        assert registered(entity_ref("urn:recipe:z-interpretations:08:consumer:p"));
    }
    evaluate truth(accepted(entity_ref("urn:recipe:z-interpretations:08:consumer:p")));
    expect truth_status == TRUE_ONLY;
    expect evaluation_status == COMPUTED;
}
```

```law
test "narrow reading refused across packages" {
    given {
        context {
            legal_time @2026-09-13;
            decision_time @2026-09-13T09:00:00+05:00;
            knowledge_time @2026-09-13T09:00:00+05:00;
            timezone "Asia/Almaty";
            interpretation Narrow;
        }
        assert registered(entity_ref("urn:recipe:z-interpretations:08:consumer:p"));
    }
    evaluate truth(accepted(entity_ref("urn:recipe:z-interpretations:08:consumer:p")));
    expect truth_status == FALSE_ONLY;
    expect evaluation_status == COMPUTED;
}
```

## Counterfactual

Sidecar mutation: `include Allow;` → `include recipes.z.r08::Allow;`; expected `LDC-E0201`. Additional scenes with fragment deletion are marked in the table; the outcome is checked by both evaluators.

## Boundary

A public rule by itself does not allow a foreign include. An external package and an exact version are presented by the dependency-resolution context; an of-reference to a public fragment is allowed, membership through include is not. The teaching consumer and its lock live in resources/08-consumer, entirely inside the book. The schema now carries visibility: the pinned consumer loads cleanly and executes both reading choices; the resource check pins the parity of both evaluators on both scenes.

## Pitfall

A qualified include across the boundary would lose generated nodes, so it is rejected; the consumer chooses Broad by the dependency's stable id and executes both choices with matching evaluators.