Skip to content

fix: avoid repeated supervision escalations while keeping pending actions visible - #48

Merged
peterOC26 merged 7 commits into
mainfrom
fm/fm-branch-prompt-repeat-captain-rows-p1
Nov 9, 2026
Merged

peterOC26 merged 7 commits into
mainfrom
fm/fm-branch-prompt-repeat-captain-rows-p1

Conversation

@peterOC26

@peterOC26 peterOC26 commented Nov 9, 2026 •

Copy link
Copy Markdown
Owner

Intent

Captain wants the supervision helper to stop writing repeated captain rows for one unchanged situation, because each row opens a main turn and wastes tokens, without hiding a situation that is really waiting on him. Evidence: data/fm-supervision-helper-sonnet-test/report.md showed that under Sonnet the helper wrote 9 captain rows in 68 minutes for one unchanged situation (pv-reset-queue-1105) and 4 for one parked test state (fm-afk-improve-r2); under Opus 38 of 308 silent rows (12%) hid a situation waiting on the captain.

What Changed

  • Instruct the supervision helper to compare pending situations against recent captain outcomes across both reporting surfaces and postures, reporting unchanged repeats as visible routine outcomes.
  • Require heartbeat reviews to check parked and captain-held backlog items, escalate previously unreported situations, and keep pending actions visible.
  • Consolidate policy documentation around the branch prompt and add assertions covering the emitted instructions on Pi and host surfaces.

Risk Assessment

✅ Low: The change only touches the wording of a static, byte-stable prompt plus the docs and tests that go with it. Both fix rounds checked out against the current code. The Verdict-section heartbeat silence bridge is restored, and step 4 now resolves through it. The captain-history lookup is now one bounded read (list --recent 2000) filtered to the task's captain rows with jq. It matches the real store schema (task/verdict fields), and the store is append-only in seq order, so tail -n 1 returns the newest matching row. A malformed or empty store fails toward reporting captain, so a pending situation stays visible. No source-backed defect, intent contradiction or unrequired component remains.

Testing

Both targeted suites and the real CLI history checks passed. Captured terminal evidence of the workspace-trust blocker; agent classification scenarios remain untested. Labs were removed and source stayed unchanged. No screenshot was produced because the change affects agent instructions; terminal evidence records the launch blocker.

  • Live validation: ⚠️ inconclusive - 1 of 6 scenarios driven live against the product
Scenario Result Live Evidence
Query outcome history and receive the newest captain row for the requested task, ignoring routine rows and other tasks; receive no match for an unknown task ✅ pass live bounded-history-cli.txt
Review a backlog-only pending decision on a heartbeat and report its first captain outcome ⏸️ untested no Claude's workspace-trust dialog blocked the isolated primary. Manually trust this exact worktree and rerun; modifying user-level trust configuration was outside the authorized boundary.
Recheck an unchanged pending situation after repeated wakes and MAIN acknowledgement, producing visible routine rows without another captain row ⏸️ untested no The isolated Claude primary could not pass workspace trust. Manually trust this exact worktree and rerun to exercise model classification.
Change a decision, blocker, or next action—or recur after resolution—and receive a new captain outcome ⏸️ untested no The isolated Claude primary could not pass workspace trust. Manually trust this exact worktree and rerun to exercise model classification.
Review a quiet fleet with no pending decisions, new results, or actions and produce a silent routine heartbeat outcome ⏸️ untested no The isolated Claude primary could not pass workspace trust. Manually trust this exact worktree and rerun to exercise heartbeat behavior.
Find no matching captain row within the bounded history window and report the pending situation as new ⏸️ untested no The CLI's empty lookup was verified, but the agent's resulting escalation was blocked by workspace trust. Manually trust this exact worktree and rerun.
Evidence: Isolated Claude launch: workspace-trust blocker

Source: Isolated Claude launch: workspace-trust blocker


────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
 Accessing workspace:

 ~/.no-mistakes/worktrees/7f0ec18181b6/01M707Y93MJA82XXBFD9KKGNGY

 Quick safety check: Is this a project you created or one you trust? (Like your own code, a well-known open source project, or work from
 your team). If not, take a moment to review what's in this folder first.

 Claude Code'll be able to read, edit, and execute files here.

 Security guide

 ❯ No, exit
   Yes, I trust this folder

 Enter to confirm · Esc to cancel
Evidence: Bounded history lookup through the real outcome CLI

Source: Bounded history lookup through the real outcome CLI

1
2
3
4
5

Newest captain row for pending-choice using the emitted bounded query:
{"seq":4,"epoch":1794231665,"task":"pending-choice","wake":"","verdict":"captain","summary":"New blocker: choose a replacement queue.","silent":false,"statusEndpoint":0,"statusIdent":"-"}

Bounded query for a task with no captain history:
(no matching row)
- Outcome: ⚠️ 2 warnings across 1 run (3m11s)

Pipeline

Updates from git push no-mistakes

✅ **intent** - passed

✅ No issues found.

✅ **Rebase** - passed

✅ No issues found.

🔧 **Review** - 1 issue found → auto-fixed (2) ✅
  • ⚠️ bin/fm-branch-prompt.sh:142 - The change deletes the Verdict-section bridge "Keep an unchanged fleet review silent as instructed above." Step 4 (line 85) still says to set silent true "only for a routine no-change outcome as defined under 'Verdict: routine or captain' below". After this change, the only positive silence rule in that section is the task-level one at line 129 ("only when it says the worker is still busy..."), and a quiet heartbeat never matches it. The fleet permission now exists only at line 96, in 'Handling a wake', and step 4 explicitly points away from that paragraph. Example: a heartbeat with nothing pending, no new result, and no action. Line 96 allows task=fleet silent, but step 4 plus line 129 forbid it, so a model following step 4 writes a visible routine fleet row on every quiet heartbeat. The docs have the same problem. docs/configuration.md:273, docs/pi-supervision-branch.md:465 and docs/supervision-host.md:242 now say the Verdict section owns "task and fleet silence eligibility", but the positive fleet rule is not in that section. Fix: restore a one-line bridge in the Verdict section, e.g. "A heartbeat fleet review is silent only as instructed under 'Handling a wake' above." Alternatively, point step 4 at both sections.

🔧 Fix applied.
2 warnings still open:

  • ⚠️ bin/fm-branch-prompt.sh:142 - The change deletes the Verdict-section bridge "Keep an unchanged fleet review silent as instructed above." Step 4 (line 85) still says to set silent true "only for a routine no-change outcome as defined under 'Verdict: routine or captain' below". After this change, the only positive silence rule in that section is the task-level one at line 129 ("only when it says the worker is still busy..."), and a quiet heartbeat never matches it. The fleet permission now exists only at line 96, in 'Handling a wake', and step 4 explicitly points away from that paragraph. Example: a heartbeat with nothing pending, no new result, and no action. Line 96 allows task=fleet silent, but step 4 plus line 129 forbid it, so a model following step 4 writes a visible routine fleet row on every quiet heartbeat. The docs have the same problem. docs/configuration.md:273, docs/pi-supervision-branch.md:465 and docs/supervision-host.md:242 now say the Verdict section owns "task and fleet silence eligibility", but the positive fleet rule is not in that section. Fix: restore a one-line bridge in the Verdict section, e.g. "A heartbeat fleet review is silent only as instructed under 'Handling a wake' above." Alternatively, point step 4 at both sections.
  • ⚠️ bin/fm-branch-prompt.sh:147 - The dedup rule depends on the branch finding an earlier matching captain row with bin/fm-branch-outcome.sh list --recent <n>, "expanding the window as needed". That command only returns the last n rows of the whole store, with no task or verdict filter (bin/fm-branch-outcome.sh:717-734), and the rule sets no stopping point. Here is the failure case. A held item such as pv-reset-queue-1105 got its captain row hours ago. Since then the fleet has written hundreds of rows, including the silent heartbeat and task rows the intent evidence counts (308 under Opus). On every heartbeat (line 94 requires each pending item to be re-checked) and on every task wake, the branch now has to page backwards through more and more JSON to reach that captain row. That costs branch tokens on each check, against the Discipline rule "Stay terse: your context is a cost". If the model stops paging early, line 148 ("If you cannot establish a matching captain outcome, report captain now") makes it write the same repeat captain row this change is meant to stop. Narrowest fix: have the prompt filter by task and verdict when reading, e.g. pipe list --recent <n> through jq -c 'select(.task=="<id>" and .verdict=="captain")', or set a bounded window. A sturdier fix is a per-task captain-history query on fm-branch-outcome.sh. That adds a new command beyond the change's stated scope, so the remedy, not the defect, needs authorization.

🔧 Fix applied.
✅ Re-checked - no issues remain.

⚠️ **Test** - 2 warnings
  • ⚠️ Live agent behavior remains unverified. Claude stopped at the worktree's workspace-trust dialog before processing a wake; accepting it would modify user-level configuration outside the authorized boundary. Manually trust this exact worktree in Claude, then rerun the test phase.
  • ⚠️ live validation verdict: inconclusive (1 of 6 scenarios were driven live against the product); untested: Review a backlog-only pending decision on a heartbeat and report its first captain outcome, Recheck an unchanged pending situation after repeated wakes and MAIN acknowledgement, producing visible routine rows without another captain row, Change a decision, blocker, or next action—or recur after resolution—and receive a new captain outcome, Review a quiet fleet with no pending decisions, new results, or actions and produce a silent routine heartbeat outcome, Find no matching captain row within the bounded history window and report the pending situation as new
  • Live validation: ⚠️ inconclusive - 1 of 6 scenarios driven live against the product
Scenario Result Live Evidence
Query outcome history and receive the newest captain row for the requested task, ignoring routine rows and other tasks; receive no match for an unknown task ✅ pass live bounded-history-cli.txt
Review a backlog-only pending decision on a heartbeat and report its first captain outcome ⏸️ untested no Claude's workspace-trust dialog blocked the isolated primary. Manually trust this exact worktree and rerun; modifying user-level trust configuration was outside the authorized boundary.
Recheck an unchanged pending situation after repeated wakes and MAIN acknowledgement, producing visible routine rows without another captain row ⏸️ untested no The isolated Claude primary could not pass workspace trust. Manually trust this exact worktree and rerun to exercise model classification.
Change a decision, blocker, or next action—or recur after resolution—and receive a new captain outcome ⏸️ untested no The isolated Claude primary could not pass workspace trust. Manually trust this exact worktree and rerun to exercise model classification.
Review a quiet fleet with no pending decisions, new results, or actions and produce a silent routine heartbeat outcome ⏸️ untested no The isolated Claude primary could not pass workspace trust. Manually trust this exact worktree and rerun to exercise heartbeat behavior.
Find no matching captain row within the bounded history window and report the pending situation as new ⏸️ untested no The CLI's empty lookup was verified, but the agent's resulting escalation was blocked by workspace trust. Manually trust this exact worktree and rerun.
  • bash tests/fm-branch-supervision.test.sh — passed, including both emitted-prompt contracts.
  • bash tests/fm-supervision-instructions.test.sh — passed.
  • Created a marked disposable lab with bin/fm-lab-home.sh create; launched real claude on its private tmux socket with a 140×42 terminal; captured the trust dialog and cleaned up the lab.
  • Used bin/fm-branch-outcome.sh append and the emitted list --recent 2000 | jq -c 'select(...)' | tail -n 1 query against an isolated outcome store; verified newest-match selection and an empty lookup.
  • git status --short — confirmed no worktree changes.
✅ **Document** - passed

✅ No issues found.

✅ **Lint** - passed

✅ No issues found.

✅ **Push** - passed

✅ No issues found.

@peterOC26 peterOC26 closed this Nov 9, 2026
@peterOC26 peterOC26 reopened this Nov 9, 2026
peterOC26 and others added 7 commits November 9, 2026 14:28
…o stale emitted-instruction assertions. Both targeted suites, ShellCheck, and diff checks pass. All 12 serial-test failures reproduce on the base commit; serial-9 failed on an HTTP 504 download. Full suite aggregates these lane failures. Only the affected test file changed
@peterOC26
peterOC26 force-pushed the fm/fm-branch-prompt-repeat-captain-rows-p1 branch from d1e4776 to d5c7d46 Compare November 9, 2026 13:46
@peterOC26 peterOC26 changed the title fix: prevent repeated supervision escalations for unchanged situations fix: avoid repeated supervision escalations while keeping pending actions visible Nov 9, 2026
@peterOC26
peterOC26 merged commit 4b7b500 into main Nov 9, 2026
45 of 48 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant