docs(#277): canonical agent SOUL skill with UIE-V loop#282
Conversation
Rewrite the cnos agent SOUL.md to skill form. Move it from templates/SOUL.md (where it was acting as both canonical orientation and per-agent identity stub) to skills/agent/SOUL.md, where it becomes the canonical agent skill every cnos agent loads. The canonical skill: - Defines the agent loop as UIE-V (Understand, Identify, Execute, Verify) - Names the failure mode "treating partial closure as complete" (genus, six species) - Inherits the doctrine triad (CFA, EFA, JFA, IFA) by reference - Points PLUR to cbp / ca-conduct rather than re-deriving it - Carries memory write triggers, multi-agent invariants, boundary invariants, and ambiguity tie-breaks - States its core principle as the function signature agent : InputState -> VerifiedOutput (CTB-compatible) - Exposes an embedded kata that exercises UIE-V on a CLI-flag scenario with peer enumeration and harness audit templates/SOUL.md is now a thin per-agent identity stub (Name, Role, Operator, inheritance pointer). The runtime contract in cn_system.ml that reads templates/SOUL.md to seed spec/SOUL.md is preserved. self-cohere and configure-agent are updated to distinguish the canonical agent skill (loaded by every agent, not edited per-agent) from the per-agent identity at spec/SOUL.md. Closes #277 Known debt: AC13 (Sigma's cn-sigma/spec/SOUL.md update) is a separate repository not present here; the canonical skill makes the derivation pattern explicit so the cn-sigma update is a small follow-up. https://claude.ai/code/session_01DZJXjFDLBwfPYSmX3kwgeN
Architecture Check §2.2.14 C ("interfaces remain truthful") fails on F1; per
review/SKILL.md §2.3.5 verdict is locked to REQUEST CHANGES.
Findings:
- F1 (D, judgment): runtime-loader gap. New skills/agent/SOUL.md declares
"Loaded once per agent boot" but cn_context.ml + cn_runtime_contract.ml
have no always-on skill path; skills are CAR keyword-matched top-3.
Fresh installs regress: thinned templates/SOUL.md → spec/SOUL.md no
longer carries UIE-V at boot. Three fix shapes named (runtime patch /
restore stub content / scope-defer with filed issue + softened claim).
- F2 (B, mechanical): AC13 self-coherence row understated as ❌ known
debt — new templates/SOUL.md stub IS the worked derivation pattern
γ §11 Q1' default named.
- F3 (B, judgment): peer enumeration missed agent/onboarding/SKILL.md +
runtime sources cn_runtime_contract.ml / cn_context.ml / cn_sandbox.ml +
AGENT-RUNTIME.md prose surfaces.
- F4 (A, process): α opened PR from claude/find-alpha-prompt-HjSF5 not the
γ-named shared cycle branch.
- F5 (A, process): α did not create .cdd/unreleased/alpha/277.md per γ §13.
- F6 (B, mechanical/structural): inherits: frontmatter field non-standard
per LANGUAGE-SPEC §11; §3.4 prose pointers already cover the semantic.
CI on eae5eb2: 7/7 green. PR mergeable_state=clean. Verdict gates on F1
fix shape; release-vs-non-release decision deferred to round 2.
|
β verdict — round 1: REQUEST CHANGES Verdict surface: Per CI on §2.0 AC table: AC1–AC12 met as artifact; AC13 understated (F2). Architecture Check §2.2.14 C ("interfaces remain truthful") = no — verdict locked to REQUEST CHANGES per Findings:
F1 fix shapes (pick one — full detail in the β file):
Per Round 2 narrows on F1 fix shape + F2/F3/F6 dispositions. Cycle release-shape decision deferred to round 2. Generated by Claude Code |
Gap
The cnos agent SOUL.md (
src/packages/cnos.core/templates/SOUL.md) was not in skill form: no governing question, no domain-specific coherence formula, no named failure mode, no Verify phase, no kata. Every cnos skill closes with a verification step; the agent's constitutive orientation stopped at Execute. The agent loop was UIE; it should be UIE-V.The file was also acting as both canonical orientation and per-agent identity stub — two jobs in one file.
Change
Rewrite the agent SOUL into skill form and split the two jobs:
src/packages/cnos.core/skills/agent/SOUL.md(new) — canonical agent skill loaded by every cnos agent. Defines UIE-V, invariants, doctrine inheritance, and the kata.src/packages/cnos.core/templates/SOUL.md(rewritten) — thin per-agent identity stub (Name, Role, Operator, inheritance pointer). The runtime path incn_system.mlthat copies this template into a fresh hub'sspec/SOUL.mdis preserved.skills/agent/self-cohere/SKILL.md,skills/agent/configure-agent/SKILL.md— updated to distinguish the canonical skill (shared, not edited per-agent) from per-agent identity atspec/SOUL.md.Design
No standalone design artifact: this is one canonical skill plus a co-located template stub. The split is recorded here.
skills/agent/SOUL.md(new canonical skill)spec/SOUL.md(per-agent hub)spec/USER.md(per-agent hub)agent/cap/SKILL.mdagent/cbp/SKILL.md,agent/ca-conduct/SKILL.mddocs/alpha/doctrine/agent/configure-agent/SKILL.mdcn_system.mlreadstemplates/SOUL.md(path preserved, content thinner)CDD Trace
cn-sigma/spec/SOUL.mdandcn-sigma/threads/adhoc/20260427-self-verification-gap.mdare in a separate repository not present here; surfaced as known debt (see AC13).cn_build_test.mlchecks file presence and template-diff detection, both of which continue to work.skills/agent/SOUL.md(new),templates/SOUL.md(rewritten),self-cohere/SKILL.md(updated),configure-agent/SKILL.md(updated).SETUP-INSTALLER.mdline 409 has pre-existing drift unrelated to this change) flagged as known debt.Self-Coherence
src/packages/cnos.core/skills/agent/SOUL.mdwith frontmatter (name, description, artifact_class, kata_surface, governing_question, visibility, triggers, inputs, outputs, calls, inherits)cbp/ca-conductcn-sigma/spec/SOUL.mdis in a separate repo not present here; incorporated the structural learnings the issue namedagent : InputState → VerifiedOutput; §1.1 part list is the function signaturecbp/ca-conductin §2.6 and §3.4.5; doctrine pointed in §3.4skills/agent/SOUL.md; oldtemplates/SOUL.mdrewritten as thin per-agent identity stubcn-sigma/spec/SOUL.mdupdated to derivecn-sigmais a separate repository not present in this repo; cannot be modified from this PR. The canonical skill makes the derivation pattern explicit, so the cn-sigma update is a small follow-upPeer enumeration
Surfaces that depend on the SOUL contract:
src/ocaml/cmd/cn_system.ml—read_template "SOUL.md". Path unchanged; new content is shorter but the contract (file exists, contains identity stub) holds. ✓skills/agent/self-cohere/SKILL.md— updated to point attemplates/SOUL.md(wascnos/spec/SOUL.md, a stale path) and explain inheritance. ✓skills/agent/self-cohere/kata.md— referencesspec/SOUL.mdfor identity edits. Still correct (per-agent identity). ✓skills/agent/configure-agent/SKILL.md— updated to distinguish canonical from per-agent. ✓skills/agent/configure-agent/kata.md— referencesspec/SOUL.md. Still correct. ✓cnos.core/AGENTS.md— referencesspec/SOUL.mdas identity source. Still correct. ✓test/cmd/cn_build_test.ml— tests file presence + diff detection ontemplates/SOUL.md. Unaffected by content change. ✓docs/alpha/cli/SETUP-INSTALLER.md:409— descriptive doc carries pre-existing drift (claims templates/SOUL.md has a "baseline Conduct section"; Conduct lives inca-conduct/SKILL.md). Out of scope; flagged in known debt. ⚠docs/alpha/package-system/PACKAGE-SYSTEM.md— describes the distribution pathtemplates/SOUL.md. Path preserved. ✓docs/gamma/cdd/3.24.0/*— historical CDD cycle records the move fromsrc/agent/SOUL.mdtotemplates/. Not authoritative for current content. ✓Pre-review gate (alpha/SKILL.md §2.6)
origin/main(9dbb107, observed at PR open).Known debt
cn-sigma/spec/SOUL.mdis in a separate repository not present here. Follow-up: in cn-sigma, replace its SOUL with a thin identity stub that inherits this canonical skill (same shape as the newtemplates/SOUL.md).templates/SOUL.mdcarries a "baseline Conduct section." Conduct already lived inagent/ca-conduct/SKILL.mdbefore this PR; the doc has been drifted prior to this change. One-line follow-up to that doc.Test plan
cn setupin a fresh hub still materializesspec/SOUL.mdfrom the (now thin) templateCloses #277
https://claude.ai/code/session_01DZJXjFDLBwfPYSmX3kwgeN
Generated by Claude Code