# configuration/strings/system.strings.ts

> 86 lines of code and 5 definitions.

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

## Definitions

- `SLOT_SHAPE` (lexical_declaration, line 9)
- `DROP_IN_DIAGRAM` (lexical_declaration, line 12)
- `SLOT_DIAGRAM` (lexical_declaration, line 15)
- `ONBOARDING_SECTION` (lexical_declaration, line 18)
- `SYSTEM_SECTIONS` (lexical_declaration, line 91, exported)

## Source

```typescript
import { COVERAGE_TAB, GAP_SECTION_ID } from "#core/ids/architecture.ids";
import { ARCHITECTURE_PAGE } from "#core/ids/page.ids";
import { ONBOARDING_SECTION_ICON } from "#configuration/icons/system.icons";
import { ONBOARDING_SECTION_ID } from "#core/ids/system.ids";
import type { Section } from "#types/document.types";
import { TYPESCRIPT_LANGUAGE } from "#configuration/constants/code.constants";
import { tabLink } from "#assets/link.assets";

const SLOT_SHAPE =
    'export type SlotState = "RESOLVED" | "ABSENT" | "DEFERRED";\nexport type SlotValue = string | number | readonly string[] | null;\n\nexport interface Slot {\n    readonly state: SlotState;\n    readonly value: SlotValue;\n    readonly note: string;\n}\n\nexport const resolved = (value: Exclude<SlotValue, null>, note: string): Slot => ({ state: "RESOLVED", value, note });\nexport const absent = (note: string): Slot => ({ state: "ABSENT", value: null, note });\nexport const deferred = (note: string): Slot => ({ state: "DEFERRED", value: null, note });\n\nexport interface Binding {\n    readonly project: Readonly<Record<string, Slot>>;\n    readonly surface: Readonly<Record<string, Slot>>;\n    readonly convention: Readonly<Record<string, Slot>>;\n    readonly limits: Readonly<Record<string, Slot>>;\n    readonly execution: Readonly<Record<string, Slot>>;\n}\n\nexport const binding: Binding = {\n    project: {\n        root: resolved("<host-root>", "the host root relative to this package, the one value an adopter sets"),\n        policy_projection: absent("the host has not adopted the package, so no projection is written into its document"),\n        rollback_point: deferred("a reversible checkpoint will exist once the host is under version control"),\n    },\n    surface: { board: resolved("<board-file>", "the coordination board") },\n    convention: { nesting_cap: resolved("<depth>", "the placement depth cap from a governed root") },\n    limits: { file_cap: absent("no per-file cap; a host that wants one holds it in its own linter") },\n    execution: { compile: absent("nothing here compiles") },\n};';

const DROP_IN_DIAGRAM =
    'flowchart TB\n    subgraph governance["The governance folder · copied whole, never edited for a feature"]\n        policy["The behaviour policy · named rules given to the model first"]\n        checks["The checks · one file per rule, each proven to fire"]\n        cores["The cores · reasoning that names no project"]\n        binding["The binding · the one file that names this tree"]\n    end\n    code["The code · shaped by the grammar the checks parse"]\n    command["The one command · every check, fixer, generator and validator"]\n    binding -. resolves every slot the cores name .-> cores\n    checks -. parse .-> code\n    command --> checks\n    policy -. governs .-> code';

const SLOT_DIAGRAM =
    'flowchart LR\n    core["A core names a slot"]\n    binding{"What does the binding say?"}\n    resolved["Resolved · the branch runs against this tree\'s value"]\n    absent["Absent · the branch does not run, and says so"]\n    deferred["Deferred · the branch is blocked until the value exists"]\n    faked["Nothing declared · the branch runs against a guess"]\n    core --> binding\n    binding -- a value --> resolved\n    binding -- declared absent --> absent\n    binding -- declared deferred --> deferred\n    binding -. no declaration .-> faked';

const ONBOARDING_SECTION: Section = {
    icon: ONBOARDING_SECTION_ICON,
    id: ONBOARDING_SECTION_ID,
    intro: "Setting up the method in a new project means applying a template to one file of project details, not rebuilding the rules in a conversation. The whole governance set is a folder that names no project, plus one file that does, as shown in <cite>a drop-in</cite>. Adopting it means copying the folder and writing that one file, the binding shown in <cite>a binding</cite>, in which every fact about the host project is a slot in one of the three states shown in <cite>slot states</cite>. The gate is then green on an empty tree before the first line of code exists. All of this rests on one separation: the thinking is kept apart from the tools, which applies platform independence to a method and configuration externalization to its facts. The folder is generated from the template families the grammar page publishes.",
    subsections: [
        {
            blocks: [
                {
                    application:
                        "In practice, the reasoning stays in core documents that name no project, and the bindings stay in one adapter that fills every slot the cores leave open. A slot that nothing can fill is declared absent in the adapter, rather than left for a core to assume, and the part of the method that depends on it does not run. The set is proven on an empty tree first: a gate that is red before any code exists is reporting a problem with the binding, and a gate that is green there becomes the baseline every later failure is measured against.",
                    boundary:
                        "A catalogue inside a core document, such as a list of principles, patterns or examples, may assume things this project does not have. The mechanism carries over unchanged, and the catalogue is worked out again against what exists here. Replacing the mechanism would be the mistake; working out the catalogue again is the work.",
                    cause: "A core document that names a path is tied to the project that has that path, so the next project has to edit the core.",
                    decision:
                        "The method moves to a new project by rewriting one adapter, rather than by editing the core documents.",
                    failureMode:
                        "Every new project starts with a long conversation that rebuilds rules which already exist somewhere else, and rebuilds them slightly wrong.",
                    kind: "lesson",
                    principle:
                        "For this reason the core documents name no project, a single adapter binds them to one, and every missing piece is declared rather than patched over.",
                    problem: "A method written in one project's vocabulary does not carry over to the next project.",
                    validation:
                        "To check this, apply the set to an empty project. A red gate there points to a binding the adapter did not make. A green gate proves the binding and nothing more, because a check over an empty tree measures nothing.",
                },
                { caption: "a drop-in", kind: "mermaid", text: DROP_IN_DIAGRAM },
            ],
            title: "A template applied to a binding",
        },
        {
            blocks: [
                {
                    kind: "text",
                    text: "A core is a document that says what to do in terms of semantic operations and slots, the same shape the behaviour document has. It never names the tool that searches or the folder that holds the tests, because as soon as it does, it is tied to one project and the next project has to edit it. The adapter is the one file where those names live, and it is the only file rewritten when the set moves to another project.",
                },
                {
                    kind: "text",
                    text: `A slot is always in one of three states, and the third is the one that matters most. Resolved means this project has the thing, and its value is in the adapter. Absent means this project has nothing that corresponds to it, so the part of the method that depends on it does not run, and that is declared rather than faked. Deferred means the thing will exist but does not yet, so the dependent part is blocked rather than skipped, which answers a different question in the right way. An adapter in which every slot is resolved is hiding something. The checks this project does not have, such as a computed measure of worth, a detector for work that stops making progress and a calibrated confidence, are declared absent in the adapter so that nothing assumes them; the honest gaps lists them, and the architecture page arrives at <a href="${tabLink(ARCHITECTURE_PAGE, COVERAGE_TAB, GAP_SECTION_ID)}">the same declared absences</a> because an architecture is its predicate set.`,
                },
                { caption: "slot states", kind: "mermaid", text: SLOT_DIAGRAM },
            ],
            title: "Cores, one adapter, three slot states",
        },
        {
            blocks: [
                {
                    kind: "text",
                    text: "The template that generates the set keeps the mechanism and rewrites the content. A fact that would be wrong in the next project is turned into a slot. A statement written for one domain that holds for the whole kind is generalised to the kind. A mechanism that must know nothing about what it governs is made project-neutral. The generator then fills in the one binding and checks it in both directions, that every slot the cores name is bound and that every binding names a slot. It installs the set, runs the gate, and removes itself before the gate approves the tree. A generated project is therefore green when it arrives, with no edits by hand, and that is why every manual step in setting up a project counts as a manual runbook dependency rather than a chore.",
                },
                {
                    kind: "text",
                    text: "The checks read their contracts from the same templates the surfaces are created from, so there is a single source of truth that the check reads while it runs. A check that copied a schema into itself would hold a second copy with nothing keeping the two the same, and the drift would only show when the developer or the model created a new surface and it failed on its first run, wrong from the start because it followed a template that looked authoritative.",
                },
            ],
            title: "The generator removes itself",
        },
        {
            blocks: [
                {
                    kind: "text",
                    text: "The binding is a typed module rather than a written page, and its readable version is generated from the module, so the two cannot disagree, which is what self-describing architecture means for a binding. A slot is one record with three fields: a state from a fixed set, a value that is empty unless the state is resolved, and a note explaining why. A reader therefore sees the reason next to the value, and a mechanism sees the state before the value. The three constructors are the only way to create a slot, which is what stops a resolved slot from having no value and an absent slot from carrying an old one.",
                },
                {
                    kind: "text",
                    text: "Slots are grouped by who supplies them: what the host project supplies, what the package owns, the conventions, the limits and the commands that run things. A count of slots in each state is worked out when the page is rendered, so it cannot disagree with the table above it, and a binding whose count shows every slot resolved is the one to distrust.",
                },
                { code: SLOT_SHAPE, kind: "code", language: TYPESCRIPT_LANGUAGE, title: "a binding" },
            ],
            title: "The binding as a module",
        },
    ],
    title: "The drop-in",
};

export const SYSTEM_SECTIONS: readonly Section[] = [ONBOARDING_SECTION];
```
