docs← Back to article

Markdown for LLMs

Turn on an executable policy

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

Download this articlePlain text ↗
# Turn on an executable policy

## Intent

I want to make acceptance of supports a mandatory input stage of the calculation.

The example rules are teaching material, not norms of a force-of-law act.

## Wrong form and why it stays silent

```text title="Incorrect form"
// Декларация Documents существует, значит она автоматически выбрана.
```

The policy is chosen by evidence_policy Documents in the context. Without a choice, support remains transport; with a choice, protected finding does not enter through a bare assert. Phase rules must not read normative conclusions.

## Correct form

```law
language "law.core" version "0.2";
package recipes.d.r10 version "0.1.0";
namespace "urn:recipe:d-evidence:10";

entity Person;
entity Record;
relation finding(p: Person) kind empirical;
relation eligible(p: Person) kind institutional;
relation edge(e: Text, d: Text, link: Text);
relation evidence_status(d: Text, state: Text);
relation authentic(d: Text, verifier: Text, outcome: Text);
relation available(d: Text);
relation current(d: Text);
relation accepted(e: Text);
rule Accept strict {
    for e: Text; for d: Text; for link: Text;
    when edge(e,d,link) and evidence_status(d,"verified")
      and authentic(d,"urn:recipe:verifier","verified") and available(d) and current(d);
    then accepted(e);
}
evidence policy Documents {
    profile "law.core.evidence-policy/0.1";
    accepts accepted; protects finding;
    input edge edge; input status evidence_status; input authentic authentic;
    input available available; input current current;
    rule Accept;
}
rule Use strict { for p: Person; when finding(p); then eligible(p); }
```

## Frozen execution scene

In the table P and Q are different entities of the page, C is a case; full identifiers are pinned in the scenes.

| Input on 13.09.2026 (a different date is named in the scene) | Question | Answer |
|---|---|---|
| policy chosen | `truth(eligible(P))` | `TRUE_ONLY` / `COMPUTED` |
| policy not chosen | `truth(eligible(P))` | `NEITHER` / `COMPUTED` |
| bare assertion of a protected fact | `truth(eligible(P))` | `NEITHER` / `COMPUTED` |
| bare assertion without a policy | `truth(eligible(P))` | `TRUE_ONLY` / `COMPUTED` |
| no pinned authenticity | `truth(eligible(P))` | `NEITHER` / `COMPUTED` |

```law
test "chosen policy admits supports" {
    given {
        context {
            legal_time @2026-09-13;
            decision_time @2026-09-13T09:00:00Z;
            knowledge_time @2026-09-13T09:00:00Z;
            timezone "UTC";
            evidence_policy Documents;
        }
        evidence Doc: Record {
    status verified; observed_at @2026-09-01T08:00:00Z;
    recorded_at @2026-09-01T09:00:00Z;
    valid [@2026-09-01, @2026-10-01);
    content_hash "sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa";
}
support Doc supports finding(entity_ref("urn:recipe:d-evidence:10:p"));
verification VDoc { evidence Doc; document_hash "sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa";
    verifier "urn:recipe:verifier"; outcome verified; recorded @2026-09-02T09:00:00Z;
}
    }
    evaluate truth(eligible(entity_ref("urn:recipe:d-evidence:10:p")));
    expect truth_status == TRUE_ONLY;
    expect evaluation_status == COMPUTED;

}
```

```law
test "missing policy leaves support transport" {
    given {
        context {
            legal_time @2026-09-13;
            decision_time @2026-09-13T09:00:00Z;
            knowledge_time @2026-09-13T09:00:00Z;
            timezone "UTC";
        }
        evidence Doc: Record {
    status verified; observed_at @2026-09-01T08:00:00Z;
    recorded_at @2026-09-01T09:00:00Z;
    valid [@2026-09-01, @2026-10-01);
    content_hash "sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa";
}
support Doc supports finding(entity_ref("urn:recipe:d-evidence:10:p"));
verification VDoc { evidence Doc; document_hash "sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa";
    verifier "urn:recipe:verifier"; outcome verified; recorded @2026-09-02T09:00:00Z;
}
    }
    evaluate truth(eligible(entity_ref("urn:recipe:d-evidence:10:p")));
    expect truth_status == NEITHER;
    expect evaluation_status == COMPUTED;

}
```

```law
test "bare assertion of protected predicate blocked" {
    given {
        context {
            legal_time @2026-09-13;
            decision_time @2026-09-13T09:00:00Z;
            knowledge_time @2026-09-13T09:00:00Z;
            timezone "UTC";
            evidence_policy Documents;
        }
        assert finding(entity_ref("urn:recipe:d-evidence:10:p"));
    }
    evaluate truth(eligible(entity_ref("urn:recipe:d-evidence:10:p")));
    expect truth_status == NEITHER;
    expect evaluation_status == COMPUTED;
    expect issue(PROTECTED_ASSERTION_BLOCKED);
}
```

```law
test "bare assertion passes without policy" {
    given {
        context {
            legal_time @2026-09-13;
            decision_time @2026-09-13T09:00:00Z;
            knowledge_time @2026-09-13T09:00:00Z;
            timezone "UTC";
        }
        assert finding(entity_ref("urn:recipe:d-evidence:10:p"));
    }
    evaluate truth(eligible(entity_ref("urn:recipe:d-evidence:10:p")));
    expect truth_status == TRUE_ONLY;
    expect evaluation_status == COMPUTED;

}
```

```law
test "missing pinned authenticity blocks support" {
    given {
        context {
            legal_time @2026-09-13;
            decision_time @2026-09-13T09:00:00Z;
            knowledge_time @2026-09-13T09:00:00Z;
            timezone "UTC";
            evidence_policy Documents;
        }
        evidence Doc: Record {
    status verified; observed_at @2026-09-01T08:00:00Z;
    recorded_at @2026-09-01T09:00:00Z;
    valid [@2026-09-01, @2026-10-01);
    content_hash "sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa";
}
support Doc supports finding(entity_ref("urn:recipe:d-evidence:10:p"));
    }
    evaluate truth(eligible(entity_ref("urn:recipe:d-evidence:10:p")));
    expect truth_status == NEITHER;
    expect evaluation_status == COMPUTED;

}
```

```python
>>> import runpy
>>> check = runpy.run_path("docs/recipes/d-evidence/resources/check.py")
>>> check["check_acceptance"](https://github.com/arxohq/law/blob/master/docs/recipes/d-evidence/10)
'Д10: принятие, отчёт и proof проверены; lawc = lawref'
```

## Counterfactual

Diagnostic mutation (check) — LDC-E4701.

Original fragment:

```text
and current(d);
```

Replacement:

```text
and current(d) and finding(entity_ref("urn:recipe:d-evidence:10:p"));
```

The paired scenes above pin the change of outcome.

## Boundary

The policy requires L3 and semanticVersion 0.2/0.3. theoryHash covers its rules; the manifest names policy/profile/hash. The normative phase does not tell its acceptance phase which facts to accept.

The syntax layer of this page is L0: it has only strict rules. That is not an execution limit: choosing EvidencePolicy requires an evaluation mode with an available L3 phase, which the scenes use. Without a chosen policy there is no evidenceAcceptance report and no three policy fields of the manifest.

## Pitfall

The policy is chosen by `evidence_policy Documents` in the context; without a choice, support remains transport. With a choice, protected finding does not enter through a bare assert.