import { LOOP_SECTION_ICON } from "#configuration/icons/grammar.icons"; import { LOOP_SECTION_ID } from "#core/ids/grammar.ids"; import { PAG_LANGUAGE } from "#configuration/constants/code.constants"; import type { Section } from "#types/document.types"; const STAGE_SAMPLE = "# a genesis stage · where in the substrate cycle a node's artifact comes to be, derived from its verb\nexistence FIND, READ, DISCOVER_RESOURCES, READ_RESOURCE does the thing exist, is it scaffolded\ndifference ANALYZE, FILTER, SPLIT, REMOVE what boundary makes it distinct\nrelation EXTRACT, LINK, SEARCH_CONTENT, EXTRACT_FACTS what it depends on and connects to\nstructure CREATE, INSERT, COMPOSE_ARTIFACT how its parts are arranged under its laws\ntransformation EXECUTE, CONVERT, ITERATE, EXECUTE_TOOL what operation it performs\nconstraint VERIFY, VALIDATE, ENFORCE, VALIDATE_ARTIFACT what invariants and gates bound it\nemergence FINALIZE, REPORT, PERSIST_ARTIFACT, REPORT_RESULT does it integrate and stabilise\n\n# the stage is a tag on the node, beneath the header's four slots · one dialect, one header shape\n# NODE [ · · · yields: ]\n@genesis: "; const PROTOCOL_SAMPLE = '# a protocol · a verb chain with the transition it is for and the principles it serves\n:\n use_when: "a unit mixes concerns or exceeds a bounded complexity"\n chain: ANALYZE -> FIND -> EXTRACT -> CREATE -> VERIFY\n principles: []\n\n:\n use_when: "a new variant extends a stable system"\n chain: ANALYZE -> FIND -> CREATE -> LINK -> VERIFY\n principles: []\n\n:\n use_when: "an existing production path is replaced"\n chain: FIND -> ANALYZE -> CREATE -> EXECUTE -> VERIFY\n principles: []\n\n:\n use_when: "a new invariant needs automated protection"\n chain: ANALYZE -> CREATE -> LINK -> EXECUTE -> VERIFY\n principles: []\n\n: # always appended · every plan ends in it\n use_when: "every plan requires a final reasoning and checklist validation"\n chain: ANALYZE -> VERIFY -> REPORT\n principles: []'; const LABELED_SAMPLE = "# a chain expanded into nodes · each header carries its layer, axis, math type and yields, and each node its genesis stage\n# NODE 1 — ANALYZE THE UNIT [epistemic · analysis · logic · yields: set]\n@genesis: difference\n# NODE 2 — FIND THE SEAMS [epistemic · ontology · set-theory · yields: set]\n@genesis: existence\n# NODE 3 — EXTRACT THE CONCERN [epistemic · reasoning · graph · yields: edge-list]\n@genesis: relation\n# NODE 4 — CREATE THE NEW UNIT [epistemic · formalisation · computation · yields: procedure]\n@genesis: structure\n# NODE 5 — VERIFY THE SPLIT [evaluative · verification · logic · yields: boolean]\n@genesis: constraint\n\n# the stage is derived from the verb · a node whose stage disagrees with its verb is mislabelled\n# a node that depends on a later genesis than it produces is a genesis inversion"; const STAGE_DIAGRAM = 'flowchart TB\n verb["A node\'s verb"]\n ground["The reasoning record the verb grounds to"]\n genesis["Its genesis stage · the position in how the artifact comes to be"]\n order["The order of the nodes · no node depends on a later stage than it produces"]\n verb --> ground\n verb --> genesis --> order'; const PROTOCOL_DIAGRAM = 'flowchart LR\n request["A request"]\n transition["The transition it asks for · from one state of the tree to another"]\n fit["Semantic fit against each protocol\'s use-when"]\n chain["The chosen chain, with its reason"]\n nodes["Nodes · each with its stage, each closed by a gate"]\n gate["The verification gate protocol · always last"]\n request --> transition --> fit --> chain --> nodes --> gate'; export const LOOP_SECTION: Section = { icon: LOOP_SECTION_ICON, id: LOOP_SECTION_ID, intro: "Every node carries a genesis stage, and the stage is derived from the node's verb rather than chosen, as verb to stage draws: the verb names where in the substrate cycle the node's artifact comes to be, the table genesis stages lists, so one word decides the node's legal position. A protocol is a chain of such verbs, protocols shows four, selected the way from intent to structure selects and request to nodes draws, and a document instantiates the chain as tagged, gated nodes in genesis order, as chain expanded does.", subsections: [ { blocks: [ { application: "Tag every node with the stage its verb derives, and expand a chosen chain into nodes in genesis order, each with a contract that reads the prior output and a gate of its own. Append the verification gate protocol to every plan. Where a node's stage disagrees with its verb, the node is misnamed; where a node depends on a later genesis than it produces, the order is wrong.", boundary: "A one-step task has no chain to instantiate. A single read with a single gate is a directive, and tagging it adds a name to nothing.", cause: "A verb is a contract about what a node does, so a stage written beside it is a second declaration of the same fact, and a catalog of roles beside the verbs is a second vocabulary the ontology does not carry.", decision: "Derive the stage from the verb's grounding in the substrate cycle rather than write a role label beside the verb.", failureMode: "A node's tag says structure, its only directive reads a file, and the reviewer approves a build step that builds nothing.", kind: "lesson", principle: "A node's genesis stage derives from its verb, and the header carries one dialect.", problem: "A node labelled by hand carries a role its verb does not derive.", validation: "Read each node's verb and state the stage it implies. A stage that does not follow from the verb was written by hand, and a header whose bracket carries anything but the layer, the axis, the math type and the yields is a second dialect.", }, { kind: "text", text: "The stage is a tag beneath the header, derived from the verb, so a reader sees a document's construction order from its tags alone. The header's four slots are the loop's, the layer, the axis, the math type and the yields, and the same verb names the genesis stage node design orders by, so the chain's order is derived from one word and the header stays one shape. Every action verb grounds to a reasoning record, and the stage follows from that record: a verb grounded in observation realises existence, one grounded in construction realises structure, one grounded in a verification node realises constraint, which is what makes the derivation a lookup rather than a judgement.", }, { kind: "text", text: "A protocol is a chain with a use-when and the principles it serves. The use-when names the transition the chain is for, from one state of the tree to another, and the principles name what the chain must leave true, so a selected protocol carries its own acceptance criteria into the nodes it expands to. The verification gate protocol is appended to every plan, because every plan ends by checking its own reasoning against the tree.", }, { code: STAGE_SAMPLE, kind: "code", language: PAG_LANGUAGE, title: "genesis stages" }, { code: PROTOCOL_SAMPLE, kind: "code", language: PAG_LANGUAGE, title: "protocols" }, { code: LABELED_SAMPLE, kind: "code", language: PAG_LANGUAGE, title: "chain expanded" }, { caption: "verb to stage", kind: "mermaid", text: STAGE_DIAGRAM }, { caption: "request to nodes", kind: "mermaid", text: PROTOCOL_DIAGRAM }, ], title: "Derived from the verb", }, ], title: "Genesis stages", };