Repository navigation
fix: avoid repeated supervision escalations while keeping pending actions visible - #48
Merged
Merged
Conversation
…utcome reporting rules
…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
force-pushed
the
fm/fm-branch-prompt-repeat-captain-rows-p1
branch
from
November 9, 2026 13:46
d1e4776 to
d5c7d46
Compare
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.
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
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, sotail -n 1returns 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.
Evidence: Isolated Claude launch: workspace-trust blocker
Source: Isolated Claude launch: workspace-trust blocker
Evidence: Bounded history lookup through the real outcome CLI
Source: Bounded history lookup through the real outcome CLI
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 allowstask=fleetsilent, 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 allowstask=fleetsilent, 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 withbin/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. pipelist --recent <n>throughjq -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.
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 withbin/fm-lab-home.sh create; launched realclaudeon its private tmux socket with a 140×42 terminal; captured the trust dialog and cleaned up the lab.Usedbin/fm-branch-outcome.sh appendand the emittedlist --recent 2000 | jq -c 'select(...)' | tail -n 1query 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.