Case 5/0: the dispatch that only spoke to the terminal

The policy was implemented in the entry point, it worked, and that is why it reached exactly one surface

Jesús Pérez
Every capability in this project reaches the CLI, the daemon, MCP and GraphQL because its logic lives in a module a caller loads from a root. Domain command dispatch — alias resolution, the two activation paths, the extensions gate, the diagnostics — was written entirely inside a bash file only the terminal loads. It was not broken: it was at an address nobody else could call. The only symptom was a grep returning zero, and a zero reads as «not yet» rather than as «cannot».
Case 5/0: the dispatch that only spoke to the terminal

🩺 Show the full clinical history → 📋 Session protocol →

Clinical record · Software Pathology

The organ worked. It resolved the alias, told the two activation paths apart, applied the extensions gate and diagnosed better than the tree's average. It was implanted inside the terminal's entry point, the one place in the project no other surface passes through.

History No. 5/0Diagnosis: ANTI-PAP · POLICY IMPLEMENTED IN THE ENTRY POINT, AND THEREFORE WITH NO WAY OUT OF THE TERMINALStatus: RESOLVED · WITH DECLARED DEBT
The patient did not come in for this. They came in with a town-planning question — whether a domain needs its own subdomain and its own directory — and the examination discovered, in passing, that the capability whose housing was under discussion could not leave the terminal.
Show clinical picture
entry point
The shell wrapper that receives argv and decides who to call. The terminal loads it and nobody else: the daemon spawns nu -c with current_dir(root) and skips it entirely.
reflection module
A .nu file under reflection/modules/ that any caller loads with use from a root. It is this project's declared shape for a capability that must reach more than one surface.
biop cell
A typed check carrying its claim, its severity and its conduct toward what it cannot read. on_unknown = 'Refuse means that being unable to look does NOT count as having looked.
two activation paths
A domain opens either by the manifest's repo_kind (ADR-012) or by the presence of its bond carrier (ADR-073). Neither collapses the other, and the required_extensions gate binds the first alone.

The protocol to declare, version and verify this → ontoref.dev

The double ledger — what it cost, and what it left

After the intervention, dispatch answers through nu -c "use reflection/modules/domain.nu *; ...", which is the exact shape the daemon already uses to call validate and describe. Parity was measured over the tree’s six domains and over one unknown token, which must be returned untouched for the fall-through to keep working.

What the crime cost

  • Domain-dispatch routes reachable from the daemon 0
  • Points where the daemon DOES delegate to a nu module 5
  • Surfaces the capability reached, of those declared 1 of 4
  • Wrappers carrying the policy 1 of 2
  • Daemon files calling nickel on their own 9
  • Dead ends, every one of them the agent's 3

What the intervention left

  • Policy moved from the wrapper into the module +189 lines
  • Policy withdrawn from the wrapper −95 / +70
  • Parity measured against the shipped bash 6/6 + fall-through
  • The new cell, under deliberate mutation EXIT 0 → 1
  • Wrappers that dispatch, after the debt was paid 2 of 2
  • Surfaces the capability reaches TODAY 1 of 4
  • Declared debts paid in the same session 3 of 3

The case is filed RESOLVED WITH DECLARED DEBT, and the word DECLARED did work the same day: of the three debts written down, two were paid on being read aloud. rg was not declared as a capability — the hole jq had already had — so it was declared, and the cell went from not being able to look to answering through its harness. And the source wrapper gained detection, so code/ontoref pm scope answers where it used to die on nu::parser::extra_positional. Paying the second opened a new hole — two dispatchers, one cell watching one — and the cell now watches both; a check-mutation also revealed that its delegation half was satisfied by a COMMENT, and it is now anchored to the call. One of three remains, the one with no mechanism: the premise imported from the agent’s memory. The capability still reaches 1 of 4 surfaces, and that is sequence rather than debt — the module is the precondition for the other three, not the other three. This case is one of four mistakes made that afternoon; the wider reading of all four — and of why they are ordinary human habits before they are machine failures — is in The mirror that does not flatter.

The point of abandonment — what the table doesn't show

What stopped being watched was not the dispatch: it was the question «where can this be loaded from?». Every capability in this project answered it the same way at some point, by putting its logic in a module. No rule required answering it, so the one capability that did not never had to declare so either.

Differential diagnosis — what was ruled out

«The correct order is not CLI before daemon: it is the daemon as a service before any claim about domain routes»“Ruled out by the human WITH CODE, not with argument: five nu delegation points (api.rs:1825 and 1982, mcp/mod.rs:2343, 2487 and 2559), all five with current_dir of the root. I had generalised from domain.rs, which is precisely the piece that does NOT delegate.”Refuted with code
«This project's memory says the routes are baked at build»“Ruled out by opening the file: its body says SUPERSEDED IN PART and `domains` is inside the baked superset. The premise came from an index's hook line, not from the file that line points at.”Unopened premise
Calling a cell green when its oracle never ran“Ruled out by mutation: `nickel export` was failing without `--import-path` and zero bytes were executing. The green did not attest to the subject, it attested to an empty file.”Empty oracle

Etiology — the cause — The siting, verbatim

# install/ontoref-global — bash
_dispatch_domain() {
  # Two activation paths coexist (ADR-012 repo_kind ⊕ ADR-073 bond; ADR-076 G-1=A).
  local bond_carrier="${ONTOREF_PROJECT_ROOT}/.domains-ontoref/${first_arg}/bonds.ncl"
  ...
  if [[ -z "$activation_path" ]]; then
    echo "  ontoref: domain '${first_arg}' is not available for this project" >&2
    exit 1
  fi
}

The project also had TWO wrappers, and only one carried this policy: grep -c _dispatch_domain code/ontoref → 0. That is why code/ontoref pm scope died on nu::parser::extra_positional while the installed binary answered. Two symptoms, one cause, and neither was legible from the other.

Treatment — The therapy

# .ontoref/reflection/modules/domain.nu
export def "domain dispatch" [domain_id: string, ...args: string] {
  let id  = (domain resolve-alias $domain_id)
  let act = (domain activation $id)
  ...
}

# the same shape the daemon already uses for validate and describe:
$ nu -c 'use reflection/modules/domain.nu *; domain dispatch "pm" "scope"'
  role-scope  /Users/Akasha/Development/ontoref
  ADRs 100 · modes 35        EXIT=0

Detection stays in bash on purpose, with its reason written into the file itself: «is argv[1] a domain?» is asked on every ontoref invocation and must not cost a nu spawn. The policy had no such excuse.

Prognosis

The uncomfortable part is that there was nothing to repair in the moved code: it moved almost intact, and parity was measured domain by domain against the shipped bash. What failed was a siting decision taken once, months ago, that nothing ever asked again — and that nobody could notice by reading the code, because the code worked. The only symptom available was a grep returning zero, and a zero reads as «not yet» rather than as «cannot».

The policy lives in the entry pointThe capability-reachable-beyond-the-terminal cell ('Block): the module must declare domain dispatch and the wrapper may not invoke a commands.nu again. DETECTION stays in bash — it is asked on every invocation and must not cost a nu spawn; INVOCATION does not.
A premise imported from the agent's memoryADR-074 named the pattern — a carrier consulted instead of the governor — with its scope pointing at CLAUDE.md, MEMORY.md and the hooks, and with nothing walking them: the rule bound nobody in the one place it was written for. The memory-hook-carries-no-stale-fact cell walks them. A file that declares itself superseded must say so in its hook, and none may be missing from the index.
Green over an oracle that never ranMutation before declaring green: reinstate the direct invocation in the wrapper and check that EXIT moves from 0 to 1, naming install/ontoref-global:731. A green nobody has watched turn red attests to nothing.
Not being able to look, counted as having lookedThis one held, and held exactly long enough. on_unknown = 'Refuse made the cell report I DID NOT LOOK instead of passing, because no registry declared rg — the same hole jq once had. The ignorance was named, read, and closed by declaring the capability; the cell could then answer through its harness and not only by hand.
One capability with two doors and only one governedPaying the debt gave code/ontoref detection, and the cell would have been watching one dispatcher of two. It watches both, with the set DECLARED rather than globbed: a glob that stops matching watches nothing and passes in silence.

The regimen — the session, replayed with protocol

What was asked — reconstructed from .coder/sessions/2026-08-25-172344-fix-after-coder-session-2026-08-25-0.txt:6 — the opening prompt verbatim, with its line number. The same file holds, at :352, the human refutation that ruled out the first dead end, and at :421 the instruction to move dispatch into the module.

después de la sesión .coder/sessions/2026-08-25-012742-tengo-la-sensacin-de-que-mucho-de-lo-que-hay.txt
no me quedó claro si necesitamos un subdominio en outreach tipo pragma.ontoref.dev
y un directorio propio dentro de ontoref o fuera

What should have been asked

Before opining on where a domain lives, measure which surfaces reach its dispatch today, and
why. And any premise coming from your memory: open it, cite it by file and line, or do not
use it.
MicrotaskVerifiable
Measure how many daemon routes dispatch a domain command, before proposing anythinggrep -rn "commands.nu\|domain_command" code/crates/ontoref-daemon/src | wc -l → 0
Measure the delegation pattern that ALREADY exists, instead of inferring it from one filegrep -rn 'use reflection/modules/' code/crates/ontoref-daemon/src --include=*.rs → 5 lines: api.rs:1825, api.rs:1982, mcp/mod.rs:2343, 2487, 2559
Cite every memory premise by file and line before reasoning from itopen the cited memory file and look for its own expiry: grep -n 'SUPERSEDED' <file> → the body says SUPERSEDED IN PART and domains is in the baked superset
Write the cell and watch it FAIL before moving a single line of policyadd the direct invocation back to the wrapper → EXIT 0 → 1 naming install/ontoref-global:731; revert → EXIT 0
Check the module's parity against the shipped bash, domain by domaindomain resolve-alias + domain activation over pm·prov·rustelo·librosys·personal·framework and one unknown token → pm=layer1, prov=bond, rustelo=bond, unknown returned unchanged

The gate before delegating: The capability-reachable-beyond-the-terminal cell written and watched FAILING before a single line was moved. Without it the move is declared done and nothing distinguishes «the policy is in the module» from «the policy is in both places», which is how this defect comes back.

The ADR trigger: The moment it was decided that DETECTION stays in the wrapper and INVOCATION does not. That is not a style preference: it is a rule every future capability inherits, and it separates a per-invocation cost from a policy. It would have fired adr? there, not three steps later.

Prophylaxis — what enforces the lesson today

  • The rule, argued and with its severity split: the entry point detects, never invokesadr:101/entry-point-detects-never-invokes
  • The general claim, Soft and naming its absent verifier (no static oracle for «policy»)adr:101/capability-policy-is-not-entry-point-only
  • Domain dispatch lives in a module, not in the entry pointcontract:.ontoref/biop/capability-reachable-beyond-the-terminal.ncl#nucleus.cmd
  • The policy withdrawn from the wrapper, with its env contract declared.ontoref/reflection/modules/domain.nu — domain dispatch · domain activation · domain resolve-alias
  • The wrapper keeps DETECTION and writes down why that is the boundarycode/install/ontoref-global — header of _dispatch_domain
  • The source wrapper dispatches too: code/ontoref pm scope answerscode/ontoref — _dispatch_domain, delegating to the module, never invoking
  • The cell watches BOTH wrappers, and its oracle is the call, not the wordcontract:.ontoref/biop/capability-reachable-beyond-the-terminal.ncl#nucleus.cmd
  • rg declared as a capability: the cell can answer through its harness.ontoref/reflection/capabilities.ncl — capability rg
  • A memory index hook may not carry an expired fact, nor be missingcontract:.ontoref/biop/memory-hook-carries-no-stale-fact.ncl#nucleus.cmd
  • An absent memory store reports unknown, never an accusation.ontoref/reflection/modules/checks.nu — «no agent memory store» signature in harness-failure

Declared debt: All three debts were paid, and what remains is a declared LIMIT rather than an outstanding task: the general rule that was asked for — «a hook holds a pointer, never a fact» — has no static oracle, because telling a pointer from an assertion is a reading and not an rg. What IS checked is the failure mode that cost: an EXPIRED fact in a hook, and a memory with NO hook. The limit is declared inside the cell itself, where whoever reads it will meet it.

From the project vocabulary (8)
.domains-ontoref/
The consumer-side container a bonded project carries: one subfolder per bonded domain (`.domains-ontoref/<domain>/`).
Bond
A typed relation between projects (and their domains) within the ontoref framework — distinct from a `link`, which is a generic node reference (the `ln`/Link schema).
Cell
A unit with a constitutional nucleus and an expression interface, which participates in operational processes and whose validity is determined by its real participation, not by its form.
Domain (repo_kind CLI extension)
A repo_kind-activated CLI extension under code/domains/{id}/: a project's repo_kind turns on its domain, giving project-type-aware commands (e.g.
Gate
Typed prerequisites and policies controlling FSM state transitions in a project.
Nucleus
The `.ncl` of a cell: claim, evaluation and interface, plus the identity and lineage that make it the same cell across tissues.
adr?
Evaluation procedure invoked at the end of a session or feature.
ontoref
The protocol itself: a typed, queryable surface on which a project declares WHAT IT IS (ontology) and HOW IT ACTS (reflection), so a claim about the project can be contradicted by a machine and not only by a reader.

The project's full vocabulary →

Was this useful? Rate it
Got something to add? Tell me what you think, what you'd suggest, or whether we should keep exploring this topic.
· reads

We use cookies to help this site function, understand service usage, and support marketing efforts. Cookie Policy for more info.