# configuration/strings/validation.strings.ts

> 59 lines of code and 6 definitions.

Tree: Site tree
Language: typescript
Layer: product
Canonical: https://banes-lab.com/anatomy/tree#file-configuration-strings-validation-strings-ts
Source text: https://banes-lab.com/assets/sources/source.ab1ade140404224d377ec1a8fdfaa3570987adef2cf4fbee8ba5f5ca79c169ae.generated.txt

## Definitions

- `GATE_SAMPLE` (lexical_declaration, line 8)
- `POPULATION_SAMPLE` (lexical_declaration, line 11)
- `CONDITION_SAMPLE` (lexical_declaration, line 14)
- `GATE_DIAGRAM` (lexical_declaration, line 17)
- `CONDITION_DIAGRAM` (lexical_declaration, line 20)
- `VALIDATION_SECTION` (lexical_declaration, line 23, exported)

## Source

```typescript
import { GRAMMAR_VALIDATION_TAB, LIMITATION_SECTION_ID, VALIDATION_SECTION_ID } from "#core/ids/grammar.ids";
import { GRAMMAR_PAGE } from "#core/ids/page.ids";
import { PAG_LANGUAGE } from "#configuration/constants/code.constants";
import type { Section } from "#types/document.types";
import { VALIDATION_SECTION_ICON } from "#configuration/icons/grammar.icons";
import { tabLink } from "#assets/link.assets";

const GATE_SAMPLE =
    'HANDOFF GATE (evidence-bearing):\n  rule_id: "<NODE NAME>"   yields: <shape>\n  [check] <file> exists at <path>                    (evidence: the listing that shows it)\n  [check] <settings> conforms to <schema>            (evidence: the validator\'s report) over: <settings files> measured: <conforming> / <files>\n  [check] every <dependency> in <settings> resolves  (evidence: the resolution log)\n  ASSERT <count> above 0\n  REQUIRE <prior-node>.<output>\n  refuse: <destination> changed since it was read before PERSIST_ARTIFACT\n  standing: moved-set <the surfaces re-read since the node began>\n  result: pass → NODE <n+1> | <which check failed, what was found> → REPAIR (owner: <the earliest node that can supply the evidence>) | unknown → BLOCKED';

const POPULATION_SAMPLE =
    "# a verdict with no domain · passed over what?\n[check] every settings file conforms                (evidence: the validator's report)\n\n# a verdict beside its domain · zero of zero is not evidence\n[check] every settings file conforms                (evidence: the validator's report) over: <settings files> measured: 12 / 12\n[check] every settings file conforms                (evidence: the validator's report) over: <settings files> measured: 0 / 0    # empty · the gate fails\n\n# the three verdicts · unknown is routed, never absorbed into pass\nresult: pass → NODE 4 | schema mismatch → REPAIR (owner: NODE 2) | unknown → BLOCKED";

const CONDITION_SAMPLE =
    "# a judgement · its truth depends on the reader\n[check] the email looks valid\n[check] the data is good\n[check] everything worked\n\n# a condition · true or false against the artifact, with what settles it and what it ranged over\n[check] <record>.<email> matches <pattern>          (evidence: the match returned true)\n[check] <records> is non-empty                       (evidence: a count above zero)\n[check] every required field present in <record>    (evidence: no missing field named) over: <records> measured: <complete> / <records>\n[check] <output>.<count> equals <input>.<count>      (evidence: the two numbers)";

const GATE_DIAGRAM =
    'flowchart TB\n    node["A node yields its output"]\n    conditions["Three to five checks · each against the output"]\n    evidence["Each carries the evidence that decided it and the set it ranged over"]\n    refuse["A write is refused before it lands when its condition holds"]\n    verdict{"pass · fail · unknown"}\n    next["The next node\'s contract reads exactly that output"]\n    action["The result line · which check, what was found, which node owns the repair"]\n    blocked["BLOCKED · the answer is owed from outside the run"]\n    node --> conditions --> evidence --> refuse --> verdict\n    verdict -- pass --> next\n    verdict -- fail --> action\n    verdict -- unknown --> blocked';

const CONDITION_DIAGRAM =
    'flowchart LR\n    judgement["looks valid · a judgement"]\n    who["Its truth depends on the reader"]\n    condition["matches the pattern · a condition"]\n    what["True or false against the artifact"]\n    domain["Over a declared set · n of N"]\n    judgement --> who\n    condition --> what --> domain';

export const VALIDATION_SECTION: Section = {
    icon: VALIDATION_SECTION_ICON,
    id: VALIDATION_SECTION_ID,
    intro: "This section covers the handoff gate that closes every node. A gate holds three to five checks, each compared against the node's output and each carrying the evidence that decided it and the set it was measured over, as shown in <cite>a gate</cite> and <cite>at the boundary</cite>. Its result line has three arms, which send a pass to the next node, a failure to the node that owns the repair, and an unknown to blocked, as shown in <cite>verdict and domain</cite>. A judgement is rewritten as a comparison in <cite>judgement or check</cite>, and <cite>who decides</cite> shows the difference between the two. The gate is the verify stage of the loop, and its third arm is the rule described in unknown is not pass.",
    subsections: [
        {
            blocks: [
                {
                    application:
                        "In practice, every node closes on a gate of three to five checks, each written as a comparison against the node's output. A hard assertion and a prerequisite are marked as such, and where the node writes, the condition under which it refuses is named before the write. The result line carries all three arms, so a failed check names what was found and routes to the earliest node that can supply the missing evidence, and an unmeasured claim routes to blocked rather than reading as pass. The next node's contract reads exactly the output the gate confirmed.",
                    boundary: `A gate checks outcomes, never confidence. How sure the model is, or whether it understood, is not observable from outside, so a check about either belongs under <a href="${tabLink(GRAMMAR_PAGE, GRAMMAR_VALIDATION_TAB, LIMITATION_SECTION_ID)}">limits</a> rather than in a gate.`,
                    cause: "A condition that compares an artifact to a value gives the model, the developer and a script the same answer, while a condition that asks whether something looks right can give each of them a different one, and a verdict with no domain cannot say what it was true of.",
                    decision:
                        "The evidence is written beside each check, together with the set and the count measured over it wherever a check ranges over a set, rather than the verdict standing alone, so a green reads as coverage and not as silence.",
                    failureMode:
                        "A gate reads that the data looks good, the model reports the gate passed because the data looked good to it, and the next node consumes records that never matched the schema.",
                    kind: "lesson",
                    principle:
                        "For this reason a check is a comparison against the node's output, with its evidence, its population and its repair owner beside it, and unknown is a verdict of its own.",
                    problem:
                        "A vague check passes whatever the reader is inclined to pass, and a check with no domain passes over nothing.",
                    validation:
                        "To check this, rewrite each check as a comparison and name the artifact on each side and the set it ranged over. A check with no artifact on one side is a judgement and a check with no set is a verdict about nothing, so in either case the gate's green does not say whether the node closed.",
                },
                {
                    kind: "text",
                    text: "The count is bounded on both sides. With fewer than three checks the gate shows that something ran rather than that a unit closed, and with more than five the node holds several decisions and is several nodes. A gate that passes and a gate that was never evaluated produce the same silence, and the evidence beside each check tells them apart. A gate that passed over an empty set produces the same silence with a number attached, and the population beside the verdict exposes it. The result line applies fail fast at the node boundary, as described for a whole system in fail at the boundary, and its owner is the earliest node that can supply what the check lacked, so a repair invalidates forward from there and nothing earlier is redone.",
                },
                {
                    kind: "text",
                    text: "The refusal line stops the node before an irreversible write, because that is the only moment a refusal costs nothing. The standing line names the surfaces that moved beneath the verdict, and a non-empty moved set withdraws the verdict's standing to be quoted without touching the verdict itself, as derived in a report, not a checkbox. The markers form a closed set with one meaning each, marking a check, a hard assertion, or a prerequisite that a prior node must have yielded. Severity is not a marker, because severity orders repairs among failures and never softens a verdict, and there is no tier between fail and pass.",
                },
                { code: GATE_SAMPLE, kind: "code", language: PAG_LANGUAGE, title: "a gate" },
                { code: POPULATION_SAMPLE, kind: "code", language: PAG_LANGUAGE, title: "verdict and domain" },
                { code: CONDITION_SAMPLE, kind: "code", language: PAG_LANGUAGE, title: "judgement or check" },
                { caption: "at the boundary", kind: "mermaid", text: GATE_DIAGRAM },
                { caption: "who decides", kind: "mermaid", text: CONDITION_DIAGRAM },
            ],
            title: "Checkable, with evidence",
        },
    ],
    title: "Validation gates",
};
```
