# configuration/strings/agent.strings.ts

> 49 lines of code and 5 definitions.

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

## Definitions

- `AGENT_TEMPLATE` (lexical_declaration, line 7)
- `VERIFIER_TEMPLATE` (lexical_declaration, line 9)
- `CREATOR_TEMPLATE` (lexical_declaration, line 11)
- `EXPRESSION_DIAGRAM` (lexical_declaration, line 14)
- `AGENT_SECTION` (lexical_declaration, line 17, exported)

## Source

```typescript
import { AGENT_SECTION_ICON } from "#configuration/icons/grammar.icons";
import { AGENT_SECTION_ID } from "#core/ids/grammar.ids";
import { PAG_LANGUAGE } from "#configuration/constants/code.constants";
import type { Section } from "#types/document.types";
import { templateBodyOf } from "#core/converters/grammar.converter";

const AGENT_TEMPLATE = templateBodyOf("AGENT");

const VERIFIER_TEMPLATE = templateBodyOf("VERIFICATION");

const CREATOR_TEMPLATE =
    '---\nname: {creator_name}\ntype: TEMPLATE\nversion: 1.0.0\n---\n\nTHIS TEMPLATE GENERATES an agent from inspected evidence\n\n%% META %%:\n    objective: "an agent whose every claimed capability traces to evidence and has failed on purpose once"\n    jurisdiction: <the domain the agent will investigate> and {project.agent_registry} | external: every other agent\n    recursion_limit: 2\n\n# NODE 1 — EVIDENCE       [epistemic · ontology · set-theory · yields: set]\n@genesis: existence\nCONTRACT:\n  input:     <the domain the agent will investigate>\n  transform: DISCOVER_RESOURCES "<the domain>" INTO <sources>; FOR EACH <source> IN <sources>: READ_RESOURCE <source> INTO <content>; EXTRACT_FACTS <the shapes the agent must detect> FROM <content> INTO <evidence>\n  output:    <evidence>\nHANDOFF GATE:\n  [check] <sources> is non-empty because a search was run (evidence: the search log) over: <the domain> measured: <read> / <sources>\n  [check] every capability the agent will claim traces to an item in <evidence> (evidence: one item per capability)\n  [check] nothing in <evidence> came from prior knowledge (evidence: a source per item)\n  result: pass → NODE 2 | unsourced item → REPAIR (owner: NODE 1) | unknown → BLOCKED\n\n# NODE 2 — THE PORTABLE CONTRACT   [epistemic · formalisation · computation · yields: procedure]\n@genesis: structure\nCONTRACT:\n  input:     <evidence> from NODE 1\n  transform: COMPOSE_ARTIFACT <contract> FROM <evidence> · semantic operations only; slots for every host fact, {project.*} {convention.*} {limits.*} {toolchain.*}; no runtime, no tool name, no path, no model\n  preserves: every capability\'s trace to its evidence\n  output:    <contract>\nHANDOFF GATE:\n  [check] <contract> names no harness feature (evidence: a scan of its literals) over: its literals measured: <neutral> / <literals>\n  [check] every host fact in <contract> is a slot (evidence: no literal path or command)\n  [check] every operation in <contract> is one an adapter can map (evidence: the operation set)\n  result: pass → NODE 3 | harness name → REPAIR (owner: NODE 2) | unknown → BLOCKED\n\n# NODE 3 — RENDERING      [evaluative · representation · information-theory · yields: artifact]\n@genesis: transformation\nCONTRACT:\n  input:     <contract> from NODE 2\n  transform: COMPOSE_ARTIFACT <artifact> FROM <contract> USING <the adapter for one runtime>\n  output:    <artifact>\n  freshness: fingerprint(<contract>) + fingerprint(<the adapter>)\nHANDOFF GATE:\n  [check] every operation resolved to a tool (evidence: the adapter\'s map) over: operations measured: <mapped> / <operations>\n  [check] every slot resolved to a value or a declared absence (evidence: no unresolved slot)\n  [check] the identity the agent writes under is declared in the body the runtime delivers (evidence: the body)\n  result: pass → NODE 4 | unresolved slot → REPAIR (owner: NODE 2) | unknown → BLOCKED\n\n# NODE 4 — PROOF BEFORE PERSISTENCE   [evaluative · verification · logic · yields: boolean]\n@genesis: constraint\nCONTRACT:\n  input:     <artifact> from NODE 3\n  transform: EXECUTE_TOOL <artifact> ON <a case with a planted contradiction> INTO <fail-run>; EXECUTE_TOOL <artifact> ON <a clean case> INTO <pass-run>; VALIDATE_ARTIFACT <fail-run>, <pass-run> AGAINST <fails on purpose, passes for the right reason>; PERSIST_ARTIFACT <artifact> TO {project.agent_registry}\n  output:    the persisted agent\nHANDOFF GATE:\n  [check] the contradiction reported with its evidence (evidence: <fail-run>)\n  [check] the clean case passed for the right reason (evidence: <pass-run> names the check it passed) over: the two cases measured: <as expected> / <two>\n  [check] <artifact> persisted only after both cases ran (evidence: the two runs precede the write)\n  refuse: either run missing before PERSIST_ARTIFACT\n  result: pass → TERMINATE | silent contradiction → REPAIR (owner: NODE 2) | unknown → BLOCKED\n\n# CROSS-NODE INVARIANTS\nINVARIANT evidence-first: an agent is generated from inspected evidence, never from intent alone over: every generated agent binds: the creator objector: [check] nothing in evidence came from prior knowledge at NODE 1\nINVARIANT fail-on-purpose: no agent is persisted before it has failed on a planted contradiction over: every generated agent binds: the creator objector: [check] the contradiction reported at NODE 4';

const EXPRESSION_DIAGRAM =
    'flowchart TB\n    meta["META · the trust anchor as a trust line, the jurisdiction, the phase kind bound at ORIENT"]\n    self["A node that reads {self.definition} · the self-audit as a contract"]\n    decision["REQUEST_DECISION · resolves ABSENT for a bounded reader"]\n    proof["The creator\'s proof gate · fails on purpose, passes for the right reason, then persists"]\n    artifact["The terminal node · one typed artifact with its report, never a question"]\n    meta --> self --> decision --> proof --> artifact';

export const AGENT_SECTION: Section = {
    icon: AGENT_SECTION_ICON,
    id: AGENT_SECTION_ID,
    intro: "This section covers how a document expresses an agent, a verifier and a creator. An agent is a document of the agent type, a cognition walked on the reasoning axis, as shown in <cite>an agent</cite>, and a verifier is a document of the verification type, an epistemology walked on the verification axis, as shown in <cite>a verifier</cite>. A creator is a template that generates an agent, as shown in <cite>a creator</cite>, and the first two bodies are the grammar's own template records. What an agent is, why it is a walked loop and never a persona, and how a verifier earns trust are described in agents as executed contracts and verify the verifier, and <cite>where guarantees live</cite> maps where each guarantee is expressed.",
    subsections: [
        {
            blocks: [
                {
                    application:
                        "In practice, the trust anchor is the trust line of the meta block, the jurisdiction sits beneath it, and the phase kind is bound in the orient node. The self-audit is a node whose contract reads the agent's own definition and tests every capability it claims on a positive and a negative case. A decision request resolves absent for a bounded reader, so the terminal node yields the artifact and never a question. The creator's proof is a gate that runs the rendered agent on a planted contradiction and on a clean case before the persist line, and it refuses the persist while either run is missing.",
                    boundary:
                        "An agent written for a bounded invocation returns instead of asking, which is the inversion derived in composing a collaboration.",
                    cause: "A capability stated in prose has no node that exercises it, so nothing in the document can show the claim false.",
                    decision:
                        "Each guarantee of the agent is expressed as a node with a gate, rather than as a sentence about the agent in its description.",
                    failureMode:
                        "An agent's description says it calibrates its detectors, no node reads a fixture, and the description is the only place calibration ever happened.",
                    kind: "lesson",
                    principle:
                        "For this reason an agent document carries its guarantees as nodes and gates, so each one can be walked and can fail.",
                    problem: "An agent's guarantees stated in its description are read, never walked.",
                    validation:
                        "To check this, name for each capability the agent's description claims the node whose gate exercises it. A capability with no node was adopted from the description, and the document has not shown it.",
                },
                {
                    kind: "text",
                    text: "A claim's kind decides the evidence that can settle it, because a claim of existence needs a presence search and a claim of behaviour needs an execution, so the orient node assigns each claim its kind and the evidence shape that kind requires before anything is probed. The identity the agent writes under is declared in the body the runtime delivers, for the reason described in agents as executed contracts.",
                },
                { code: AGENT_TEMPLATE, kind: "code", language: PAG_LANGUAGE, title: "an agent" },
                { code: VERIFIER_TEMPLATE, kind: "code", language: PAG_LANGUAGE, title: "a verifier" },
                { code: CREATOR_TEMPLATE, kind: "code", language: PAG_LANGUAGE, title: "a creator" },
                { caption: "where guarantees live", kind: "mermaid", text: EXPRESSION_DIAGRAM },
            ],
            title: "Walked, not adopted",
        },
    ],
    title: "Agent templates",
};
```
