# configuration/strings/exemplar.strings.ts

> 67 lines of code and 7 definitions.

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

## Definitions

- `HEADER_SAMPLE` (lexical_declaration, line 8)
- `NODE_SAMPLE` (lexical_declaration, line 11)
- `SPINE_SAMPLE` (lexical_declaration, line 14)
- `FAMILY_SAMPLE` (lexical_declaration, line 17)
- `WALK_DIAGRAM` (lexical_declaration, line 20)
- `WALK_VS_READ_DIAGRAM` (lexical_declaration, line 23)
- `EXEMPLAR_SECTION` (lexical_declaration, line 26, exported)

## Source

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

const HEADER_SAMPLE =
    "---\nname: {task_name}\ntype: DEBUG\nversion: 1.0.0\n---\n\nTHIS DEBUG RESOLVES a symptom to an evidence-scored root cause and one minimal fix by walking the ten-node loop across four reasoning layers\n\n%% META %%:\n    priority: EVIDENCE > ROOT_CAUSE > SPEED\n    trust: procedural_trace = TRUSTED, test_result = TRUSTED, prior_knowledge = UNTRUSTED, a_hypothesis = UNTRUSTED_UNTIL_SCORED\n    objective: {bug_report}\n    recursion_limit: {limits.max_fix_attempts}\n    parameters: every taxonomy, threshold and command resolves from {convention.*}, {limits.*} and {toolchain.*}, never typed\n\nTHE FOUR LAYERS · each answers one question about this document\n    substrate    how does a fix come to be            grounds the path from differential to fix\n    epistemic    how is the bug known                 orient · see · derive · project · act\n    conative     which line is worth pursuing         intent · constrain          mandatory, always\n    evaluative   is it fixed, and are we done         verify · commit · terminate mandatory, always\n\nYIELDS-SHAPE LEGEND · every decision resolves to a typed shape\n    set-theory → set or boolean   logic → boolean   graph → edge-list   optimisation → boolean or ranking\n    analysis → operation   computation → procedure   probability → a number in zero to one   dynamical-systems → boolean or counter";

const NODE_SAMPLE =
    '# NODE 2 — INTENT   [conative · teleology · optimisation · yields: ranking]\n@purpose: "extract the differential and rank the candidate lines by worth, so one line is traced and the rest are not"\n@axis_question: "which line is worth pursuing?"\n@cue: "rank before you trace"\n@mandatory\n\nCONTRACT:\n  input:        the session from NODE 1 · the symptom, what works, what breaks\n  transform:    detect the works-versus-breaks differential; rank the candidate lines by probability times severity minus cost\n  constraints:  a line is admissible only inside {limits.max_fix_attempts}\n  output:       <ranked>, and the selected line\n  handoff:      the selected line is the argmax of the admissible · yields a boolean over a ranking\n\nDECLARE tel: object\nSET tel = {\n  objective: "find and fix the root cause",          # yields: a set\n  utility:   FUNCTION(line) → probability(line) * severity(line),   # yields: a number\n  cost:      FUNCTION(line) → what tracing it costs,                # yields: a number\n  priority:  FUNCTION(ranked) → ranked[0] is admissible             # yields: a boolean over a ranking\n}\n\n# OUTPUT CONTRACT\nSET <ranked> = RANK <candidate lines> BY tel.utility - tel.cost\n\nHANDOFF GATE (evidence-bearing):\n  rule_id: "INTENT"   yields: ranking\n  [check] the selected line is the argmax of utility minus cost (evidence: the ranking)\n  [check] <ranked> holds more than one admissible line (evidence: a count above one)\n  [check] no line was traced before the ranking existed (evidence: the trace log starts after this gate)\n  result: pass → NODE 3 | one admissible line → REPAIR (owner: NODE 1) | unknown → BLOCKED';

const SPINE_SAMPLE =
    "# THE LOOP SPINE · declared once, every node cites it\n# node        layer       axis            yields                     transition out\n# orient      epistemic   ontology        a set, with evidence       sequences → intent\n# intent      conative    teleology       an objective, a ranking    GATE worth → see | redirect\n# see         epistemic   analysis        lenses, edges              sequences → derive\n# derive      epistemic   reasoning       claims                     sequences → project\n# project     epistemic   reasoning       an ordered graph           sequences → act\n# act         epistemic   formalisation   procedures                 sequences → constrain\n# constrain   conative    teleology       admissibility              GATE → verify | repair\n# verify      evaluative  verification    a report                   GATE evidence · refutes back to the earliest owner\n# commit      evaluative  representation  the artifact               sequences → terminate\n# terminate   evaluative  termination     stop                       GATE stop → STOP | blocked → ask\n\n# REPAIR EDGE · verify fails backward to the earliest node that can supply the missing evidence, bounded by {recursion_limit}\n# a repair invalidates every dependent record forward · nothing downstream is restored";

const FAMILY_SAMPLE =
    '# the families · each a document type, each walked by the model and axis its type declares\nCHECKLIST      pattern-cycle  formalisation   a plan, produced by owned nodes\nDEBUG          epistemology   analysis        a symptom to an evidence-scored cause and one fix\nVERIFICATION   epistemology   verification    claims adjudicated against implementation evidence\nAUDIT          epistemology   verification    an agent measured against its contract, then corrected\nDISTILLATION   epistemology   reasoning       repeated behaviour to one proven base\nTRANSLATION    epistemology   representation  a rendering audited line by line against its source\nCOMPOSITION    pattern-cycle  formalisation   a structure rendered from anchors and modifiers\n\n# the genesis question each answers · one question, one family\n"how does a plan come to be?"      → CHECKLIST\n"how does a fix come to be?"       → DEBUG\n"how does a verdict come to be?"   → VERIFICATION, AUDIT\n"how does a base come to be?"      → DISTILLATION\n"how does a rendering come to be?" → TRANSLATION, COMPOSITION';

const WALK_DIAGRAM =
    'flowchart TB\n    type["The document type · declares the model and the axis"]\n    layers["Four layers · substrate, epistemic, conative, evaluative"]\n    nodes["Nodes · each typed to the shape it yields, each reading the prior output"]\n    gate["One evidence-bearing gate per node"]\n    spine["The spine · transitions declared once"]\n    artifact["The artifact the loop terminates on"]\n    type --> layers --> nodes --> gate --> artifact\n    spine --> nodes\n    gate -. repairs back, bounded .-> nodes';

const WALK_VS_READ_DIAGRAM =
    'flowchart LR\n    read["Read a template for ideas"]\n    shaped["Write something template-shaped"]\n    none["None of its guarantees"]\n    walk["Walk its nodes as the spine declares"]\n    artifact["The artifact the loop terminates on"]\n    read -. the tempting path .-> shaped --> none\n    walk --> artifact';

export const EXEMPLAR_SECTION: Section = {
    icon: EXEMPLAR_SECTION_ICON,
    id: EXEMPLAR_SECTION_ID,
    intro: "This section covers the template families, which <cite>the families</cite> lists with the genesis question each answers. A family document has no runtime, so it is walked by the reasoning model its type declares, on the axis its type names, and an adapter performs the effects, as shown in <cite>type to artifact</cite>. Every node states its layer, its axis, the shape its decision yields, the contract it transforms and one evidence-bearing gate, as shown in <cite>one node</cite> beneath <cite>family header</cite>. The transitions are declared once in <cite>loop spine</cite>, and every node cites it. A template is used by walking its nodes as the spine declares, as described in execute the template, and <cite>walk or read</cite> shows the difference that decides whether its guarantees hold.",
    subsections: [
        {
            blocks: [
                {
                    application:
                        "In practice, a family document opens by declaring its type, its trust anchor, its recursion limit and the slots every host fact resolves through. It states the four layers with the question each answers about this document, and the shape legend every decision is typed by. Each node has a purpose, an axis question, a cue and a contract, its decisions are typed, and it closes on a gate whose checks carry their evidence. The spine is declared once, and every handoff cites it.",
                    boundary:
                        "A template family fits only an artifact that will be walked, and an artifact that is read rather than walked is described in from intent to structure.",
                    cause: "A node that reads only the prior node's output cannot skip a decision, and a gate that owes a shape cannot be satisfied by a different one.",
                    decision:
                        "The family is selected by the genesis question the artifact answers, and the type declares who walks it and on which axis, rather than the reader picking.",
                    failureMode:
                        "A debugging document is walked as a plan, the ranking of candidate lines is skipped, and the first hypothesis is traced to the end.",
                    kind: "lesson",
                    principle:
                        "For this reason a template family is a document type whose nodes are typed contracts, walked by the reasoning model its type declares.",
                    problem:
                        "A family document that does not say who walks it and on which axis leaves the reader to pick.",
                    validation:
                        "To check this, name for each node the layer, the axis and the shape its header declares, and the gate that carries evidence. A node missing any of the four is prose written in the family's format.",
                },
                {
                    kind: "text",
                    text: "The trust anchor says which inputs are evidence and which are claims, so a hypothesis is untrusted until it is scored and prior knowledge is untrusted throughout.",
                },
                {
                    kind: "text",
                    text: "A node is design by contract at the scale of one decision. The repair edge is the one a fixed pipeline lacks, and what it does is described in validation gates.",
                },
                {
                    kind: "text",
                    text: `Families are selected by the genesis question, and each inlines its whole structure rather than importing a shared spine. Duplication is deliberate here and nowhere else, because independence is what makes each family walkable on its own. A family's loop, its typing and its gates are domain-neutral and transfer to any tree unchanged. Its catalogues, the taxonomies it cites and the thresholds it names, are slots the adapter resolves, as described in <a href="${tabLink(GRAMMAR_PAGE, GRAMMAR_VALIDATION_TAB, LIMITATION_SECTION_ID)}">limits</a>.`,
                },
                { code: HEADER_SAMPLE, kind: "code", language: PAG_LANGUAGE, title: "family header" },
                { code: NODE_SAMPLE, kind: "code", language: PAG_LANGUAGE, title: "one node" },
                { code: SPINE_SAMPLE, kind: "code", language: PAG_LANGUAGE, title: "loop spine" },
                { code: FAMILY_SAMPLE, kind: "code", language: PAG_LANGUAGE, title: "the families" },
                { caption: "type to artifact", kind: "mermaid", text: WALK_DIAGRAM },
                { caption: "walk or read", kind: "mermaid", text: WALK_VS_READ_DIAGRAM },
            ],
            title: "Typed nodes, one gate each",
        },
    ],
    title: "Template families",
};
```
