feat(supervisor): implement plan completion verification#105
Conversation
donk8r
commented
Jul 12, 2026
- Add require_plan_complete configuration option
- Implement pre-gate to ensure all plan tasks are finished before completion
- Create open_plan_tasks utility to track incomplete items
- Integrate plan verification and checklists into verifier context
- Add session context rendering and plan advisory messages for the verifier
- Track plan-based blocks in supervisor stats and session info
- Add unit tests for context rendering and plan advisories
- Add require_plan_complete configuration option - Implement pre-gate to ensure all plan tasks are finished before completion - Create open_plan_tasks utility to track incomplete items - Integrate plan verification and checklists into verifier context - Add session context rendering and plan advisory messages for the verifier - Track plan-based blocks in supervisor stats and session info - Add unit tests for context rendering and plan advisories
Octomind — developer:brief (octohub:glm)📦 Brief: Plan completion verification pre-gate — blocks
|
| # | Change | Risk | Confidence |
|---|---|---|---|
| 1 | New deterministic pre-gate refuses done when plan has open items; verifier now receives session goal + plan checklist as context |
🟡 | ●●● |
Card 1/1: Plan completion pre-gate + verifier session context · 🟡 · ●●●
INTENT
Prevent "drift-by-omission": an agent self-reports done while its own decomposed plan still has open tasks, silently dropping parts of the work. The commit adds a free (no model call) deterministic pre-gate mirroring the existing mutation pre-gate, and enriches the LLM verify-gate with durable session context so terse follow-up turns ("continue") can be verified against the real goal.
WHAT CHANGED
- New config field
require_plan_complete = true(default ON) in[supervisor.gate]— a second deterministic pre-gate alongsiderequire_check_after_mutation. open_plan_tasks()reads the live plan storage and returns titles of non-completed tasks; empty when no active plan exists.- When the agent self-reports
doneand open plan items exist, a<pay-attention>advisory is injected (carryingPLAN_GATE_MARKER) and the turn re-runs, sharing the samegate_iterationsbudget as the mutation pre-gate. verify()signature gained acontext: &strparameter; the verifier prompt now includes aSESSION CONTEXTblock with the anchor intent and live plan checklist, plus prompt instructions to resolve terse requests against that context.plan_blockscounter added to supervisor stats and surfaced in/infodisplay as "plan-blocks".
IMPACT RADIUS
verify()is called from exactly one site —api_executor.rs#L485— which was updated to pass the newcontextargument. No other callers exist.- The pre-gate runs inside
execute_api_call_and_process_response, the main response-processing loop. It fires only on self-reporteddone(same trigger condition as the mutation pre-gate), so non-doneturns are unaffected. /infooutput gains a "plan-blocks" activity line — cosmetic, no downstream consumers beyond the CLI display.
RISK
🟡 MEDIUM. The plan pre-gate and mutation pre-gate share a single gate_iterations counter and the same max_iterations budget. They run sequentially in the same function: mutation gate first (line 336), plan gate second (line 367). If the mutation pre-gate consumes iterations on a turn where both conditions are true, the plan pre-gate may hit the exhausted budget and fall through to the LLM gate without nudging — the open-plan items go unenforced. In practice this requires both "code changed without a check" AND "open plan items" on the same done claim, which is plausible but not the common path. The fall-through is fail-open (LLM gate or acceptance), not a hard block, so the worst case is a missed nudge, not a stuck session.
QUESTIONS
- Should the plan pre-gate have its own iteration budget instead of sharing
gate_iterationswith the mutation pre-gate? The shared budget means one pre-gate can starve the other.
📎 Source
src/session/chat/session/api_executor.rs#L363-L408— plan pre-gate logic, shares gate_iterations with mutation pre-gate abovesrc/session/chat/session/api_executor.rs#L476-L494— session context rendered and passed to verify()src/supervisor/gate.rs#L234-L291— verify() signature change + context block in promptsrc/mcp/core/plan/core.rs#L905-L927— open_plan_tasks() and open_titles() filtersrc/supervisor/gate.rs#L185-L227— render_session_context() and format_plan_advisory()src/supervisor/stats.rs#L133-L170— plan_block counter and snapshot
📂 Files changed (7 files, ~120 lines)
config-templates/default.toml— newrequire_plan_completedefaultsrc/mcp/core/plan/core.rs—open_plan_tasks()+open_titles()filter + unit testsrc/mcp/core/plan/mod.rs— re-exportopen_plan_taskssrc/session/chat/session/api_executor.rs— pre-gate insertion + context passed to verify()src/session/chat/session/commands/display.rs—/infoshows plan-blockssrc/supervisor/gate.rs—render_session_context(),format_plan_advisory(),PLAN_GATE_MARKER, verify() signature + prompt update, testssrc/supervisor/mod.rs—require_plan_completefield on GateConfigsrc/supervisor/stats.rs—plan_blockscounter + snapshot
{tokens:197953,cost:0.2869232}
- Allow updating session intent and requests during compression - Record successful shell command outputs as session evidence - Implement deterministic verification for file:line references - Add ground truth verification using git diffs and command tails - Introduce EvidenceLedger to track mutated paths and command outputs - Refactor verify-gate to use GateInput for better context handling - Track last known gate gaps in ChatSession for continuity - Update supervisor prompts to prioritize ground truth over agent claims - Add unit tests for file reference validation and evidence rendering - Bump dependencies in Cargo.toml and refine config templates
Octomind — developer:brief (octohub:glm)Single caller confirmed. Now I have all the evidence needed. Let me compose the brief. 📦 Brief: Supervisor verification enhanced with ground-truth evidence, file:line citation checks, and intent pivot trackingOverall risk: 🟡 MEDIUM · Cards: 4
Card 1/4: Verify-gate receives runtime ground truth and prior gaps · 🟡 · ●●●INTENT WHAT CHANGED
IMPACT RADIUS
RISK DIVERGENCE 📎 Source
Card 2/4: Deterministic file:line reference validation · 🟡 · ●●●INTENT WHAT CHANGED
IMPACT RADIUS
RISK QUESTIONS 📎 Source
Card 3/4: Anchor intent now replaces on supply (was first-write-wins) · 🟢 · ●●●INTENT WHAT CHANGED
IMPACT RADIUS
RISK 📎 Source
Card 4/4: EvidenceLedger tracks mutated paths and last command output · 🟢 · ●●●INTENT WHAT CHANGED
IMPACT RADIUS
RISK 📎 Source
📂 Files changed (11 files, ~400 lines)
{tokens:206746,cost:0.3095234} |
- Upgrade agent-client-protocol, tokenizers, tungstenite, and rmcp - Bump minimad, reedline, termimad, sha1, and rand versions - Remove jsonrpcmsg dependency - Migrate agent-client-protocol schema imports to v1 - Box InitializeRequest in Command enum to reduce stack size - Replace Content with ContentBlock in rmcp calls and tool results - Align model usage across session and supervisor modules
Octomind — developer:brief (octohub:glm)📦 Brief: Dependency upgrades (rmcp 2.x, ACP 1.x, tokenizers 0.23) with API adaptationOverall risk: 🟡 MEDIUM · Cards: 1
Card 1/1: rmcp 2.x + ACP 1.x API migration with dependency bumps · 🟡 · ●●●INTENT WHAT CHANGED
IMPACT RADIUS
RISK QUESTIONS
DIVERGENCE
📎 Source
📂 Files changed (8 files, ~155 lines)
{tokens:180374,cost:0.2635066} |