# configuration/strings/principle.strings.ts

> 47 lines of code and 4 definitions.

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

## Definitions

- `INVARIANT_SAMPLE` (lexical_declaration, line 6)
- `CLOSING_SAMPLE` (lexical_declaration, line 9)
- `HOME_DIAGRAM` (lexical_declaration, line 12)
- `PRINCIPLE_SECTION` (lexical_declaration, line 15, exported)

## Source

```typescript
import { PAG_LANGUAGE } from "#configuration/constants/code.constants";
import { PRINCIPLE_SECTION_ICON } from "#configuration/icons/grammar.icons";
import { PRINCIPLE_SECTION_ID } from "#core/ids/grammar.ids";
import type { Section } from "#types/document.types";

const INVARIANT_SAMPLE =
    "# CROSS-NODE INVARIANTS  (each a record with four slots · a property nothing would object to declares its objector as none)\nINVARIANT one-writer-per-record: a record is written only by the party named on it over: every record on every shared surface binds: every party that writes a surface objector: [check] the anchored edit refuses a write outside the caller's span\nINVARIANT no-written-state: no party writes a status marker over: every item on the coordination surface binds: every party objector: [check] a scan for markers on every run\nINVARIANT handler-removes: an item is removed by a party in its reader set over: every closed item binds: every party objector: none\n\n# the scan reads the four slots and refuses a record missing one\n[check] every invariant names its set, its parties and its objector (evidence: the defect scan) over: <invariants> measured: <complete> / <invariants>";

const CLOSING_SAMPLE =
    "# a node's gate cites the invariant it holds rather than restating it\nHANDOFF GATE:\n  [check] the write landed inside the caller's span (evidence: the anchored edit's report)     # <one-writer-per-record>\n  [check] no marker written (evidence: the marker scan)                                          # <no-written-state>\n  [check] the removed item named this party in its reader set (evidence: the item's fence)     # <handler-removes> · objector none, so this check is the only watcher\n  result: pass → NODE 4 | span breached → REPAIR (owner: NODE 3) | unknown → BLOCKED";

const HOME_DIAGRAM =
    'flowchart LR\n    stated["One record per invariant · property, set, parties, objector"]\n    closing["The document\'s invariant block · holds it"]\n    role["The role · the invariants this party protects, by name"]\n    check["A gate check · the half an artifact can observe"]\n    closing --> stated\n    role --> stated\n    check --> stated';

export const PRINCIPLE_SECTION: Section = {
    icon: PRINCIPLE_SECTION_ICON,
    id: PRINCIPLE_SECTION_ID,
    intro: "A collaboration relies on invariants, and what each invariant has to carry is described in stating an invariant: the property in a form that could be false, the set it ranges over, the parties it binds, and the objector that would disagree if it stopped holding. <cite>invariant records</cite> shows the records, <cite>gate cites records</cite> shows a gate pointing at them, and <cite>three homes</cite> shows where each record is read.",
    subsections: [
        {
            blocks: [
                {
                    application:
                        "In practice, every invariant a collaboration relies on is declared as a record with four slots, and where nothing in any artifact would disagree, the objector is written as none, so the debt is declared rather than hidden. A gate check cites the record it holds, and a role names the invariants its party protects, as described in a seat is a contract. A block is never headed with a bare modifier and a list of bullets, because a bullet carries no set, no parties and no objector, which is why the scan refuses it.",
                    boundary: "The number of invariants grows with the number of parties and shared surfaces.",
                    cause: "A restatement is a copy, and a copy carries no edge back to the statement it copied; a bullet is a restatement with even the statement's slots dropped.",
                    decision:
                        "Each invariant is declared once as a record with four slots and pointed at from every place that needs it, rather than restated wherever a party reads it.",
                    failureMode:
                        "A document's closing lines, a role and a check each carry their own wording of one rule, one of them is edited, and the other two keep binding the old rule.",
                    kind: "lesson",
                    principle:
                        "For this reason an invariant has one statement, and every other mention of it is a pointer to that statement.",
                    problem:
                        "An invariant restated in every document that needs it becomes a set of copies that drift.",
                    validation:
                        "To check this, name for each gate check and role entry the invariant record it points at. A line that points at nothing is a copy, and the record it should point at is the finding. A record whose objector is none is the debt described in a tension has a mechanism, for a rule with no check.",
                },
                {
                    kind: "text",
                    text: "One statement has three homes that point at it. A document's invariant block holds the records, a role lists by name the invariants its party protects, and a gate check holds the half that an artifact can observe; where the objector is none, that check is the only watcher, and it says so. An invariant has to reach every party that needs it, and pointing is how it reaches them without a copy that can disagree, so the record is the unit that is derived again whenever the invariant changes.",
                },
                { code: INVARIANT_SAMPLE, kind: "code", language: PAG_LANGUAGE, title: "invariant records" },
                { code: CLOSING_SAMPLE, kind: "code", language: PAG_LANGUAGE, title: "gate cites records" },
                { caption: "three homes", kind: "mermaid", text: HOME_DIAGRAM },
            ],
            title: "Declared once, cited thrice",
        },
    ],
    title: "Orchestration invariants",
};
```
