import { MARKDOWN_LANGUAGE, PAG_LANGUAGE } from "#configuration/constants/code.constants"; import type { Section } from "#types/document.types"; import { TRACKING_SECTION_ICON } from "#configuration/icons/grammar.icons"; import { TRACKING_SECTION_ID } from "#core/ids/grammar.ids"; import { templateBodyOf } from "#core/converters/grammar.converter"; const GENERATOR_SAMPLE = templateBodyOf("CHECKLIST"); const CHECKLIST_TEMPLATE = "# \n\n## Worth\nObjective: \nNot in scope: \nBranches ranked: \n\n## Admissible\nHard limits: \nCost: \n\n## PHASE 1 — [genesis: · severity: ]\nReads: nothing.\nRipple: \nGate: \n- [ ] 1.1 · file: · evidence: · verifier: · not: \n\n## PHASE 2 — [genesis: · severity: ]\nReads: the output of PHASE 1.\nRipple: \nGate: \n- [ ] 2.1 · file: · evidence: · verifier: · not: \n\n## Termination\nThe run stops when the objective sentence reads true against the tree, not when the boxes are ticked."; const REPORT_TEMPLATE = "# a verification report · a verdict with its standing, its domain and its reach\nsubject: \nverdict: \nstanding: # withdrawn where a read surface moved beneath the run\ndomain: declared measured # what the run claimed to cover, and what it reached\nreached: []\nmoved: []\nrefusals: []\nunresolved: []\n\n## NODE 1 — \n### Gate: \n- status: \n- evidence: \n- over: \n- failure: \n- owner: "; const STAGE_DIAGRAM = 'flowchart TB\n orient["Orient · observe before plan"]\n intent["Intent · worth before work"]\n see["See · the lenses, the relational edges"]\n derive["Derive · principles and protocols by fit"]\n project["Project · phases in genesis order, the four axes"]\n act["Act · atomic tasks with evidence contracts and named ripple"]\n constrain["Constrain · admissible, on budget, on branch"]\n verify["Verify · the reasoning, against evidence, with its population"]\n commit["Commit · one terminal, every box unchecked"]\n terminate["Terminate · saturated, complete, verified"]\n orient --> intent --> see --> derive --> project --> act --> constrain --> verify --> commit --> terminate\n verify -. the repair edge · back to the earliest owning node, bounded .-> derive'; export const TRACKING_SECTION: Section = { icon: TRACKING_SECTION_ICON, id: TRACKING_SECTION_ID, intro: "A checklist is produced, never written: the ten nodes of the loop produce it, each owning one kind of decision and each closed by a gate, with the repair edge between them, as the ten nodes draws. The checklist generator is the grammar's own checklist template record, and rendered checklist is the surface it emits. That surface carries what is true now and what remains, as derived state teaches, so a closed task is deleted rather than ticked, and verification report is the verdict that travels with it.", subsections: [ { blocks: [ { application: "Walk the nodes in order and let no node make a decision another node owns; delete a task when it is done and verified, and stop when the objective sentence reads true against the tree.", boundary: "A one-task change still walks every node, because a one-line fix can be a fix nobody needed and orientation is what finds that out. What scales down is the size of each node's output, never the node set.", cause: "A decision made by the wrong node is made without the evidence the owning node would have gathered.", decision: "Delete a closed task rather than tick it, so the remaining set is the work and never a count.", failureMode: "A checklist says most of the units are done, two were undone by a later change, the bar still reads the same, and the next reader re-implements finished work while skipping the undone.", kind: "lesson", principle: "A checklist is produced by owned, gated nodes, and a state is derived rather than typed.", problem: "A checklist written in one sitting records the plan its author imagined.", validation: "For each unit of a rendered checklist, name the node that decided it and the evidence that node read. A unit nobody can trace to a node was authored, and a status marker on the surface was already lying the first time the tree changed.", }, { kind: "text", text: "The nodes are the derivation loop applied to a plan. Verification judges the reasoning, not the implementation, and its result line routes findings to the repair edge rather than forward, unknown to blocked. Commit numbers only once the order is stable, and every phase it renders carries the genesis stage its node derived rather than a role label written beside it.", }, { kind: "text", text: "A task's contract has five fields and none is inferred: the change, the file, the evidence that proves it landed, the verifier that reads the evidence, and the non-goal, which is what lets the next reader refuse the addition that would have widened it. A report carries the verdict with the standing verify the verifier derives, the domain it was measured over, and the reach a report, not a checkbox reads as coverage. A pass rate is a count nobody derived, and the template has no field for one.", }, { code: GENERATOR_SAMPLE, kind: "code", language: PAG_LANGUAGE, title: "checklist generator" }, { code: CHECKLIST_TEMPLATE, kind: "code", language: MARKDOWN_LANGUAGE, title: "rendered checklist" }, { code: REPORT_TEMPLATE, kind: "code", language: MARKDOWN_LANGUAGE, title: "verification report" }, { caption: "the ten nodes", kind: "mermaid", text: STAGE_DIAGRAM }, ], title: "Produced by nodes, derived by deletion", }, ], title: "Planning templates", };