You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Design: docs/supervision.md. Extends #154, which deferred cross-agent work until "a real second consumer beyond Coder" existed — configurable multi-layer supervision is that consumer.
The observation
Coder has a two-level hierarchy: Overseer coordinates across repos → each repo's Pilot → Engine. The structure is right. It lives in the wrong place — inside the agent rather than in the platform.
Three things hardcode it:
Hardcoded as
Where
Consequence
Target is a repo
drive_claude(repoId, instruction)
You cannot delegate to an agent. The type forbids it.
Coordinator is a route
POST /:instanceId/coding/overseer
Supervision is code, not configuration.
Depth fixed at 2
Overseer → Pilot → Engine, by construction
No third layer is expressible.
No table anywhere describes who supervises whom. So supervision cannot be configured, inspected, or reused — every future agent needing a coordinator would rebuild the Overseer.
Supervision is a different edge from choreography
agent_connections (0056) routes an emitted FACT to another instance — deliberately decoupled, a producer must not know its consumers. Correct for the lead chain. Supervision is not that edge:
Choreography (built)
Supervision (missing)
Verb
emit a fact
assign a goal
Addressing
producer doesn't know consumer
supervisor names the subordinate
Result
nothing returns
result returns; supervisor is accountable
Failure
dead-letter + replay
escalate to the supervisor
Shape
fan-out
tree
Modelling supervision as an event connection would lose the return path and the accountability — the entire point. But both need at-least-once handoff, idempotency and trace correlation, which migration 0058 already provides, so supervision reuses the delivery outbox rather than growing a second reliability mechanism (same argument that re-scoped #17).
Scope
Owner-scoped edge: supervisor_instance_id → subordinate_instance_id (both instances belong to one user, as connections already enforce).
DAG validation at wiring time — A supervises B supervises A is now reachable by configuration, not just a code bug, and it is an unbounded money-spending loop. Reject at create time, when the human is present.
Handoff rides the 0058 outbox; parent trace flows down every hop so a three-level delegation renders as ONE tree (the traceId → child run → chain.link mechanism already built for the pump).
Design:
docs/supervision.md. Extends #154, which deferred cross-agent work until "a real second consumer beyond Coder" existed — configurable multi-layer supervision is that consumer.The observation
Coder has a two-level hierarchy: Overseer coordinates across repos → each repo's Pilot → Engine. The structure is right. It lives in the wrong place — inside the agent rather than in the platform.
Three things hardcode it:
drive_claude(repoId, instruction)POST /:instanceId/coding/overseerNo table anywhere describes who supervises whom. So supervision cannot be configured, inspected, or reused — every future agent needing a coordinator would rebuild the Overseer.
Supervision is a different edge from choreography
agent_connections(0056) routes an emitted FACT to another instance — deliberately decoupled, a producer must not know its consumers. Correct for the lead chain. Supervision is not that edge:Modelling supervision as an event connection would lose the return path and the accountability — the entire point. But both need at-least-once handoff, idempotency and trace correlation, which migration 0058 already provides, so supervision reuses the delivery outbox rather than growing a second reliability mechanism (same argument that re-scoped #17).
Scope
supervisor_instance_id → subordinate_instance_id(both instances belong to one user, as connections already enforce).traceId→ child run →chain.linkmechanism already built for the pump).delegatetarget fromrepoIdto a supervisable entity) — that type change is the smallest useful first step.Acceptance
Companions: #184 (budget), #185 (authority containment). Both are cheap to build in now and expensive to retrofit.