docs(architecture): Agent-Boundary Doctrine + audit every hand-off (#230)#241
Merged
Conversation
…off (#230) Document the explicit criterion in docs/ARCHITECTURE.md: keep a separate sub-agent ONLY when it adds an independent/adversarial perspective; collapse any pure-relay hop (a context that only paraphrases a prior agent's output, emitting no new verdict) into its caller. It is a substance rule, not a wiring rule. Audit (ground truth = subagent_type="…" dispatch sites in the skill jinja sources, not docs): all 8 pipeline-dispatched agents emit independent verdicts and none is a relay. The only relay hops the doctrine condemns — the Self-MoA synthesizer/debate-arbiter — were already collapsed in #240. Resolve the orphaned documentation-reviewer (zero skill dispatch sites) as a deliberate keep: unlike the removed relays it emits a unique, non-relay docs-vs-source verdict, so it is retained as an optional, user-dispatchable agent and now self-declares a "Dispatch status:" annotation. Add tests/test_agent_dispatch_audit.py to enforce the invariant going forward: any agent shipped with no dispatch site and not marked optional fails the gate, preventing a silent orphan from recurring. Closes #230
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Resolves #230 — writes down the Agent-Boundary Doctrine and audits every live agent hand-off
independent | relay.Doctrine (in
docs/ARCHITECTURE.md→ "Agent-Boundary Doctrine")It is a substance rule, not a wiring rule — what matters is whether the agent emits an independent verdict, not how many skills call it.
Audit (ground truth =
subagent_type="…"dispatch sites in skill*.jinjasources, not docs)All 9 shipped agents classified with
file:linedispatch citations. The 8 pipeline-dispatched agents (task-decomposer, research-agent, actor, monitor, predictor, evaluator, final-verifier, reflector) each emit an independent verdict — none is a relay.No relay hops remain. The only relay hops the doctrine condemns — the Self-MoA
synthesizer(paraphrased 3× Actor/Monitor into one, no new verdict) anddebate-arbiter— were already collapsed/removed in PR #240 (17c69bc). That is the keep/collapse decision acceptance criterion 3 names for the Synthesizer hop: the decision was collapse, already executed (the agent no longer exists, so a fresh cost/approval delta is moot).Orphan resolved:
documentation-reviewer→ deliberate keepVerified repo-wide: it has zero skill dispatch sites. But unlike the removed relays it is not a relay — it emits a unique docs-vs-source-architecture verdict (URL validation, completeness scoring, consistency). Under the substance rule it passes the doctrine; its missing caller is a discoverability gap, not redundancy. Retained as an optional, user-dispatchable agent (
Task(subagent_type="documentation-reviewer", …)), now self-declaring aDispatch status:annotation. Wiring it into a pipeline is deferred feature work, out of scope here.Enforcement
tests/test_agent_dispatch_audit.pymakes the invariant a gate: any agent shipped with no dispatch site and not inDOCUMENTED_OPTIONAL_AGENTS(with aDispatch status:annotation) fails — a silent orphan can't recur. Includes a non-empty discovery guard.Why
#240 removed two orphaned relay agents but never wrote down the criterion that justified it. This codifies that criterion so future agent-boundary decisions are principled, and pins the one remaining ambiguity (
documentation-reviewer) as a deliberate, documented choice.Testing
make check→ 2572 passed, 3 skipped, lint clean,check-renderconfirms generated trees matchtemplates_src(agent annotation rendered to.claude/agents/+templates/agents/).Silent orphan agent(s): ['zzz-orphan-probe']); removing it restores green.Scope notes
docs/model-tier-trigger-experiment.md) left intact as dated records; only source-of-truthARCHITECTURE.mdupdated.🤖 Generated with Claude Code