docs← Back to article

Markdown for LLMs

Anchor a rule to an article

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

Download this articlePlain text ↗
# Anchor a rule to an article

## Intent

I want to see from which article a rule was derived.

## Wrong form and why it stays silent

A fragment cannot be anchored to a made-up edition.

```text title="Incorrect form"
fragment F in Missing
```

## Correct form

```law
language "law.core" version "0.2";
package recipe.i02 version "1.0.0";
namespace "urn:recipe:i-sources:02";
source Act { kind policy; }
edition E of Act { language ru; officiality unofficial; materialization_status ABSTRACT_ONLY; in_force [@2026-01-01, infinity); }
fragment F in E { kind article; locator "article/1"; text ru unofficial """Заявление принимается."""; }
entity Person;
relation filed(p: Person);
relation accepted(p: Person);
@source(F)
rule Accept strict { for p: Person; when filed(p); then accepted(p); }
```

## Frozen execution scene

Below is a minimal reproducible scene.

| Facts | Question | Answer |
|---|---|---|
| filed | accepted | TRUE_ONLY |
| only the article text | accepted | NEITHER |
| filed, @source removed | accepted | TRUE_ONLY |

```python
>>> import runpy
>>> checks = runpy.run_path("docs/recipes/i-sources/resources/check.py")
>>> checks["anchors"](https://github.com/arxohq/law/blob/master/docs/recipes/i-sources/2)
True
```


A separate scene shows language 0.1 withdrawn from support: new 0.1 sources are refused, with no execution. The adapter pins exactly this refusal.

```lawtest
language "law.core" version "0.1";
package recipe.i02 version "1.0.0";
namespace "urn:recipe:i-sources:02";

test "withdrawn 0.1 refuses to lower" {
    given {
        context { legal_time @2026-09-13; decision_time @2026-09-13T09:00:00Z; knowledge_time @2026-09-13T09:00:00Z; timezone "UTC"; }
        assert filed(entity_ref("urn:recipe:i-sources:person"));
    }
    evaluate truth(accepted(entity_ref("urn:recipe:i-sources:person")));
    expect truth_status == TRUE_ONLY;
    expect evaluation_status == COMPUTED;
}
```

```python
>>> import runpy
>>> checks = runpy.run_path("docs/recipes/i-sources/resources/check.py")
>>> checks["legacy"](https://github.com/arxohq/law/blob/master/docs/recipes/i-sources/2)
True
```

## Counterfactual

The `teaches` mutation reproduces `LDC-E5102`. Counterfactual outcomes are also listed in the table and the sidecar.

## Boundary

An anchor does not prove correctness of the interpretation. A bare anchor carries only the positional StableId. Named attributes materialize an anchor node carrying the norm locus: relation and coverage with defaults, plus an exact quote. A bare name not declared by the package source model warns instead of tracing silently; an attribute value outside the closed dictionary is an error. The page uses a bare @source(F) and promises no dictionary checks beyond the named refusals.

Here a minimal checkable witness is left.

## Pitfall

Relation/coverage were once accepted as plain strings, and an unknown local anchor lost the trace. Re-measured: the strings are gone, the anchor node is emitted, a bare name warns, a wrong value is refused. A green check alone must not be declared a verified link.