Repository navigation
fix: suppress repeated unchanged supervision reports - #78
Merged
Merged
Conversation
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 asked how Sonnet does as the supervision helper. Answer given: accurate, but over ~16 hours 11 of its 46 captain-verdict outcomes were re-reports of an unchanged situation ("still paused, waiting on the captain, nothing new"), mostly while the Sydney restore waited on captain input; each one opens a MAIN turn for nothing. The 8 Nov comparison found the same regression: repeated captain re-reports of one unchanged situation (9 consecutive captain rows for one situation in 68 minutes, plus 4 for one parked test state), each opening a main turn. Recommendation: keep Sonnet and file a small fix so the helper does not re-report a situation that has not changed. Captain: "yes, please do that".
What Changed
Risk Assessment
✅ Low: This change only rewords the supervision prompt. Silence now depends on the newest durable row of any verdict, which
list --recentreturns because it includes silent rows. The captain-only read and the heartbeat rule are unchanged, docs only point to the prompt, and the tests check the prompt the script actually emits for both report surfaces.Testing
The focused test passed when run through Bash. Two live Sonnet turns in a disposable lab recorded the unchanged hold as silent routine and the red-to-green history case as visible and non-silent, with both scoped wakes acknowledged. An initial assertion required a specific verdict for the changed case; the final check followed the durable-history contract and verified visibility instead.
Evidence: Live Claude Sonnet repeat-outcome evaluation
Source: Live Claude Sonnet repeat-outcome evaluation
Pipeline
Updates from git push no-mistakes
✅ **Intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
bin/fm-branch-prompt.sh:149- The new silence rule checks against the wrong history row. It says to set silent true when the situation is unchanged "since the last task outcome" (line 149, and line 121 says "since the last outcome for that task"). But the only durable-history read the prompt allows is the captain-only query on line 147 (select(.task=="<id>" and .verdict=="captain") | tail -n 1), with "do not expand the window" and "an earlier routine outcome does not count". So when the branch has no conversation memory of its latest routine row (after a restart, or because the prompt tells it durable records outrank memory), it can only compare against the newest captain row. Before this change that gap did nothing, because a situation still waiting on MAIN or the captain was never silent.Example: (1) captain row: "PR ready for review, waiting on captain". (2) Visible routine row: "CI went red after rebase, worker fixing". (3) Next wake: CI is green and the task is waiting on the captain again, no action taken. Compared with the captain row nothing has changed, so the branch reports routine with silent true. The drain (bin/fm-wake-drain.sh:655) and the startup replay both drop silent rows, so the newest row MAIN can see still says CI is red. MAIN ends up with the wrong state and no error is raised.
Fix: have the silence decision read the newest row for the task regardless of verdict, for example
bin/fm-branch-outcome.sh list --recent 2000 | jq -c 'select(.task=="<id>")' | tail -n 1, alongside the captain-row read. Then "unchanged since the last task outcome" is checked against the durable record. Same rule, other site: bin/fm-branch-prompt.sh:121 (task-level silence rule), plus the matching assertions at tests/fm-branch-supervision.test.sh:62 and :125.bin/fm-branch-prompt.sh:93- Repeats are only partly removed for heartbeats. The change now silences per-task rows for an unchanged hold, but the heartbeat rule on line 93 is unchanged: "Only report a silent routine fleet outcome after those checks find nothing pending". While a captain decision stays pending (the Sydney restore case), every heartbeat still records a visible routine fleet row that repeats the same unchanged hold. In attended posture these rows are listed in MAIN's drain without opening a turn. In away posture they go into the return brief. The removed line used to forbid silence for both tasks and fleet reviews; now tasks may be silent while fleet reviews may not. If the intent ("the helper does not re-report a situation that has not changed") is meant to cover these heartbeat rows too, the heartbeat rule needs the same exception. If it is meant to cover only captain rows that open MAIN turns, the current split is fine. This is a product decision for the author.🔧 Fix applied.
1 info still open:
bin/fm-branch-prompt.sh:93- Repeats are only partly removed for heartbeats. The change now silences per-task rows for an unchanged hold, but the heartbeat rule on line 93 is unchanged: "Only report a silent routine fleet outcome after those checks find nothing pending". While a captain decision stays pending (the Sydney restore case), every heartbeat still records a visible routine fleet row that repeats the same unchanged hold. In attended posture these rows are listed in MAIN's drain without opening a turn. In away posture they go into the return brief. The removed line used to forbid silence for both tasks and fleet reviews; now tasks may be silent while fleet reviews may not. If the intent ("the helper does not re-report a situation that has not changed") is meant to cover these heartbeat rows too, the heartbeat rule needs the same exception. If it is meant to cover only captain rows that open MAIN turns, the current split is fine. This is a product decision for the author.✅ **Test** - passed
✅ No issues found.
tests/fm-branch-supervision.test.shdirect invocation (permission denied; rerun through Bash)bash tests/fm-branch-supervision.test.shFM_HOME=<marked lab> bin/fm-branch-prompt.sh --supervision-hostfm_supervision_engine_turn claude sonnet ...using the production engine function and synthetic lab historiesbin/fm-branch-outcome.sh list --recent 2000to inspect persisted verdictsbin/fm-wake-drain.shand its printed acknowledgement command; verified both lab wake rows and grants were consumed✅ **Document** - passed
✅ No issues found.
✅ **Lint** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.