Skip to content

fix(bin): suppress redundant supervision wakes - #18

Merged
ryannmicua merged 8 commits into
mainfrom
fm/fm-wake-noise-suppression
Oct 10, 2026
Merged

ryannmicua merged 8 commits into
mainfrom
fm/fm-wake-noise-suppression

Conversation

@ryannmicua

@ryannmicua ryannmicua commented Oct 10, 2026 •

Copy link
Copy Markdown
Owner

Intent

I approve of the improvements 1-4 approach as recommended.

Context, item 1: keep no-op supervision wakes out of the main session. Evidence: data/env-retro-2026-10-10/report.md, and Fable's and Astra's reviews at data/fm-improve-xreview-fable/report.md (item 1, designs A, B and D) and data/fm-improve-xreview-astra/report.md (item 1). With the Claude supervision host running, main still gets about three wakes an hour, mostly (1) repeated captain outcomes that restate an unchanged state, such as "AP-1 PR still waiting on your merge decision" recorded twice, and (2) recovery announcements such as check: rearm-resurface with nothing queued. The approved approach is to build it in firstmate and propose it upstream later.

Substance of the referenced item 1 recommendations (approved as recommended):

  • Design A, repeat suppression at the outcome store: in bin/fm-branch-outcome.sh append (or the host before it wakes main), when a captain outcome names a task whose newest captain row has an identical fingerprint and whose status file and pr= state have not changed since that row, store it as routine and do not wake main. This kills the "still waiting on your merge decision" repeats.
  • Design B, empty-wake short circuit: before a supervision-host pass-through or the Stop-hook rewake wakes main, check the drain's presentation read-only; if there are no rows for main, no OPEN DECISIONS, no UNREAD STATUS and no BRANCH OUTCOMES, keep supervising instead of waking. check: rearm-resurface becomes a wake only when there is something to present.
  • Design D, fold the current-state read into the drain: when BRANCH OUTCOMES presents a task, print its bin/fm-crew-state.sh line beside it so main does not spend a call to check it.
  • Risks named by the reviews: A or B swallowing a real event. Suppress only on matching fingerprints with unchanged status, keep heartbeat backstops and escalation markers outside suppression, never suppress needs-decision rows or anything carrying an escalation count, log every suppression to state/.watch-triage.log as the watcher already does for absorbs, and never short-circuit the one-shot session-start digest or a lock-refused session. An empty queue does not imply no work: open decisions, unread status, record divergence and unprocessed branch outcomes stay actionable. Shadow-test the suppression (log what it would suppress) before enabling it. Keep it deterministic and inside Firstmate's existing owners (bin/fm-watch.sh, bin/fm-supervision-host.sh, bin/fm-wake-drain.sh, bin/fm-branch-outcome.sh); no new classifier or model in the loop.

What Changed

  • Add deterministic suppression of unchanged repeat captain outcomes and empty supervision wakes across the watcher, supervision host, and Claude Stop hook. Default to shadow logging, with enforcement enabled by a home-local flag.
  • Check main’s drain presentation read-only before suppressing empty wakes, preserving actionable status, decisions, divergence, and outcomes; exempt heartbeats, escalations, failures, and uncertain evidence.
  • Include current crew state beside captain branch outcomes, use stored verdicts in host and Pi delivery receipts, and add suppression documentation and regression coverage.

Risk Assessment

✅ Low: Suppression defaults to shadow mode, the current fixes preserve actionable evidence, and no additional material defects or intent contradictions were substantiated.

Testing

Focused checks and live CLI, Claude, and Pi scenarios passed after repairing two missing-backlog fixtures. Captured product transcripts and startup digests; isolated tmux sessions had no GUI surface for screenshots. Only the two test-fixture fixes remain in the worktree.

  • Live validation: ✅ go - 10 of 10 scenarios driven live against the product
Scenario Result Live Evidence
Repeat an unchanged captain report with only its idle age changed; store it as routine and report the stored verdict ✅ pass live live-cli-transcript.log; live-pi-report-transcript.log
Leave suppression disabled; repeat reports and empty recovery notifications remain visible while shadow decisions are logged ✅ pass live live-cli-transcript.log; live-shadow-watcher-transcript.log
Change report substance, status, or PR evidence, or carry an escalation, decision, heartbeat, or away posture; preserve captain outcomes ✅ pass live live-cli-transcript.log; tests/fm-wake-noise-suppression.test.sh
Recover monitoring with nothing to present; suppress the empty notification and keep monitoring through both Claude supervision paths ✅ pass live live-host-transcript.log; live-stop-transcript.log
Add a decision after an empty recovery was suppressed; deliver the new actionable notification ✅ pass live live-host-transcript.log; live-stop-transcript.log
Probe presentation repeatedly; retain unread status, open decisions, held-backlog divergence, and unprocessed captain outcomes without consuming records ✅ pass live live-cli-transcript.log
Probe missing indexes or recovered failed status captures; avoid migration writes and keep uncovered modern captures actionable ✅ pass live live-cli-transcript.log; test_probe_capture_coverage_matches_presenting_drain
Drain a captain outcome; print its current crew-state line beside the recorded summary ✅ pass live live-cli-transcript.log; test_branch_outcomes_show_the_current_crew_state
Start a session with suppression enabled and no queued notifications; receive the complete one-shot startup digest ✅ pass live live-startup-digest.log
Start a competing session while another real Claude session owns the home; receive the read-only diagnostic and preserve the existing owner ✅ pass live live-lock-refusal-digest.log
Evidence: Live outcome-store, presentation-probe, and divergence checks

Source: Live outcome-store, presentation-probe, and divergence checks


=== Repeat reports in enforce mode ===
$ FM_HOME=<enforce> bin/fm-branch-outcome.sh append --task labtask --verdict captain --wake stale: labtask (idle 200s) --summary PR remains under review
1
exit: 0
$ FM_HOME=<enforce> bin/fm-branch-outcome.sh lookup --seqs 1
{"seq":1,"epoch":1791599156,"task":"labtask","wake":"stale: labtask (idle 200s)","verdict":"captain","summary":"PR remains under review","silent":false,"statusEndpoint":40,"statusIdent":"strong:2049:7637945:2026-10-10 10:25:56.343199291 +0800"}
exit: 0
$ FM_HOME=<enforce> bin/fm-branch-outcome.sh append --task labtask --verdict captain --wake stale: labtask (idle 900s) --summary PR remains under review
2
stderr: note: outcome 2 repeats captain outcome 1 with the task's status and PR state unchanged, so it was stored as routine
exit: 0
$ FM_HOME=<enforce> bin/fm-branch-outcome.sh lookup --seqs 2
{"seq":2,"epoch":1791599156,"task":"labtask","wake":"stale: labtask (idle 900s)","verdict":"routine","summary":"Repeat of captain outcome 1 (status and PR state unchanged), not raised to main again: PR remains under review","silent":false,"statusEndpoint":40,"statusIdent":"strong:2049:7637945:2026-10-10 10:25:56.343199291 +0800"}
exit: 0
TRIAGE: [2026-10-10T10:25:56+0800] suppressed repeat captain outcome 2 for labtask: same as captain outcome 1 with status and PR state unchanged; stored as routine


=== Repeat reports in shadow mode ===
$ FM_HOME=<shadow> bin/fm-branch-outcome.sh append --task labtask --verdict captain --wake stale: labtask (idle 200s) --summary PR remains under review
1
exit: 0
$ FM_HOME=<shadow> bin/fm-branch-outcome.sh lookup --seqs 1
{"seq":1,"epoch":1791599157,"task":"labtask","wake":"stale: labtask (idle 200s)","verdict":"captain","summary":"PR remains under review","silent":false,"statusEndpoint":40,"statusIdent":"strong:2049:7637978:2026-10-10 10:25:56.935201752 +0800"}
exit: 0
$ FM_HOME=<shadow> bin/fm-branch-outcome.sh append --task labtask --verdict captain --wake stale: labtask (idle 900s) --summary PR remains under review
2
exit: 0
$ FM_HOME=<shadow> bin/fm-branch-outcome.sh lookup --seqs 2
{"seq":2,"epoch":1791599157,"task":"labtask","wake":"stale: labtask (idle 900s)","verdict":"captain","summary":"PR remains under review","silent":false,"statusEndpoint":40,"statusIdent":"strong:2049:7637978:2026-10-10 10:25:56.935201752 +0800"}
exit: 0
TRIAGE: [2026-10-10T10:25:57+0800] would suppress repeat captain outcome 2 for labtask (shadow mode): same as captain outcome 1 with status and PR state unchanged

$ FM_HOME=<adversarial> bin/fm-branch-outcome.sh append --task labtask --verdict captain --wake stale: labtask (idle 200s) --summary PR remains under review
1
exit: 0
$ FM_HOME=<adversarial> bin/fm-branch-outcome.sh lookup --seqs 1
{"seq":1,"epoch":1791599157,"task":"labtask","wake":"stale: labtask (idle 200s)","verdict":"captain","summary":"PR remains under review","silent":false,"statusEndpoint":40,"statusIdent":"strong:2049:7637996:2026-10-10 10:25:57.541204272 +0800"}
exit: 0

=== Preserve new summary ===
$ FM_HOME=<adversarial> bin/fm-branch-outcome.sh append --task labtask --verdict captain --wake stale: labtask (idle 900s) --summary CI is queued
2
exit: 0
$ FM_HOME=<adversarial> bin/fm-branch-outcome.sh lookup --seqs 2
{"seq":2,"epoch":1791599157,"task":"labtask","wake":"stale: labtask (idle 900s)","verdict":"captain","summary":"CI is queued","silent":false,"statusEndpoint":40,"statusIdent":"strong:2049:7637996:2026-10-10 10:25:57.541204272 +0800"}
exit: 0

=== Preserve escalation ===
$ FM_HOME=<adversarial> bin/fm-branch-outcome.sh append --task labtask --verdict captain --wake stale: labtask (idle 900s) --summary escalation 1: needs inspection
3
exit: 0
$ FM_HOME=<adversarial> bin/fm-branch-outcome.sh lookup --seqs 3
{"seq":3,"epoch":1791599158,"task":"labtask","wake":"stale: labtask (idle 900s)","verdict":"captain","summary":"escalation 1: needs inspection","silent":false,"statusEndpoint":40,"statusIdent":"strong:2049:7637996:2026-10-10 10:25:57.541204272 +0800"}
exit: 0

=== Preserve decision ===
$ FM_HOME=<adversarial> bin/fm-branch-outcome.sh append --task labtask --verdict captain --wake stale: labtask (idle 900s) --summary waiting on your decision
4
exit: 0
$ FM_HOME=<adversarial> bin/fm-branch-outcome.sh lookup --seqs 4
{"seq":4,"epoch":1791599158,"task":"labtask","wake":"stale: labtask (idle 900s)","verdict":"captain","summary":"waiting on your decision","silent":false,"statusEndpoint":40,"statusIdent":"strong:2049:7637996:2026-10-10 10:25:57.541204272 +0800"}
exit: 0

=== Preserve heartbeat ===
$ FM_HOME=<adversarial> bin/fm-branch-outcome.sh append --task labtask --verdict captain --wake heartbeat --summary PR remains under review
5
exit: 0
$ FM_HOME=<adversarial> bin/fm-branch-outcome.sh lookup --seqs 5
{"seq":5,"epoch":1791599158,"task":"labtask","wake":"heartbeat","verdict":"captain","summary":"PR remains under review","silent":false,"statusEndpoint":40,"statusIdent":"strong:2049:7637996:2026-10-10 10:25:57.541204272 +0800"}
exit: 0

=== Preserve changed PR ===
$ FM_HOME=<adversarial> bin/fm-branch-outcome.sh append --task labtask --verdict captain --wake stale: labtask (idle 900s) --summary PR remains under review
6
exit: 0
$ FM_HOME=<adversarial> bin/fm-branch-outcome.sh lookup --seqs 6
{"seq":6,"epoch":1791599159,"task":"labtask","wake":"stale: labtask (idle 900s)","verdict":"captain","summary":"PR remains under review","silent":false,"statusEndpoint":40,"statusIdent":"strong:2049:7637996:2026-10-10 10:25:57.541204272 +0800"}
exit: 0

=== Preserve new status ===
$ FM_HOME=<adversarial> bin/fm-branch-outcome.sh append --task labtask --verdict captain --wake stale: labtask (idle 900s) --summary PR remains under review
7
exit: 0
$ FM_HOME=<adversarial> bin/fm-branch-outcome.sh lookup --seqs 7
{"seq":7,"epoch":1791599159,"task":"labtask","wake":"stale: labtask (idle 900s)","verdict":"captain","summary":"PR remains under review","silent":false,"statusEndpoint":43,"statusIdent":"strong:2049:7637996:2026-10-10 10:25:57.541204272 +0800"}
exit: 0

=== Preserve away ===
$ FM_HOME=<adversarial> bin/fm-branch-outcome.sh append --task labtask --verdict captain --wake stale: labtask (idle 900s) --summary PR remains under review
8
exit: 0
$ FM_HOME=<adversarial> bin/fm-branch-outcome.sh lookup --seqs 8
{"seq":8,"epoch":1791599159,"task":"labtask","wake":"stale: labtask (idle 900s)","verdict":"captain","summary":"PR remains under review","silent":false,"statusEndpoint":43,"statusIdent":"strong:2049:7637996:2026-10-10 10:25:57.541204272 +0800"}
exit: 0

=== Preserve unreadable metadata ===
$ FM_HOME=<adversarial> bin/fm-branch-outcome.sh append --task labtask --verdict captain --wake stale: labtask (idle 900s) --summary PR remains under review
9
stderr: warning: outcome 9 was stored but its repeat-suppression record could not be written
exit: 0
$ FM_HOME=<adversarial> bin/fm-branch-outcome.sh lookup --seqs 9
{"seq":9,"epoch":1791599159,"task":"labtask","wake":"stale: labtask (idle 900s)","verdict":"captain","summary":"PR remains under review","silent":false,"statusEndpoint":43,"statusIdent":"strong:2049:7637996:2026-10-10 10:25:57.541204272 +0800"}
exit: 0

=== Empty read-only probe ===
$ FM_HOME=<probe> bin/fm-wake-drain.sh --would-present

exit: 1

=== Unread status remains actionable without consumption ===
$ FM_HOME=<probe> bin/fm-wake-drain.sh --would-present
would present: unread-status
exit: 0
$ FM_HOME=<probe> bin/fm-wake-drain.sh --would-present
would present: unread-status
exit: 0

=== Open decision remains actionable ===
$ FM_HOME=<probe> bin/fm-wake-drain.sh --would-present
would present: open-decisions
exit: 0

=== Unreadable status is indeterminate ===
$ FM_HOME=<probe> bin/fm-wake-drain.sh --would-present

exit: 2
$ FM_HOME=<coverage> bin/fm-branch-outcome.sh append --task labtask --verdict routine --summary Handled
1
exit: 0

=== Missing indexes are read without migration ===
$ FM_HOME=<coverage> bin/fm-wake-drain.sh --would-present

exit: 1
$ FM_HOME=<failed-capture> bin/fm-branch-outcome.sh append --task labtask --verdict routine --summary Handled
1
exit: 0

=== Recovery after failed modern capture stays actionable ===
$ FM_HOME=<failed-capture> bin/fm-wake-drain.sh --would-present
would present: status-outcome-backstop
exit: 0
$ FM_HOME=<failed-capture> bin/fm-wake-drain.sh
STATUS OUTCOME BACKSTOP (newest captain-facing task event has no covering branch outcome):
labtask done [at=1]: ready
BRANCH OUTCOMES, ROUTINE (handled by the supervision session since your last drain; for your awareness, nothing to acknowledge):
[seq 1] labtask: Handled
stderr: ●━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
●  WATCHER DOWN - SUPERVISION IS OFF
●  1 task(s) in flight, but no watcher has a fresh beacon (last beat: never, grace 300s).
●  Trust the emitted supervision protocol for this harness; do not use shell & for watcher repair.
●  This is a supervision warning only; the guarded operation WILL still run.
●  repair missing watcher supervision according to the session-start block for this harness; do not use shell &.
●━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
exit: 0

=== Current state printed beside captain outcome ===
$ FM_HOME=<current-state> bin/fm-branch-outcome.sh append --task labtask --verdict captain --wake stale: labtask (idle 200s) --summary Lab task needs review
1
exit: 0
$ FM_HOME=<current-state> bin/fm-branch-outcome.sh lookup --seqs 1
{"seq":1,"epoch":1791599166,"task":"labtask","wake":"stale: labtask (idle 200s)","verdict":"captain","summary":"Lab task needs review","silent":false,"statusEndpoint":0,"statusIdent":"-"}
exit: 0
$ FM_HOME=<current-state> bin/fm-wake-drain.sh
BRANCH OUTCOMES (captain outcomes the supervision session recorded for you, one line per task, oldest first; each says what was true when it was recorded and is followed by the task's current state from bin/fm-crew-state.sh, so check the task's current state first, including its still-open decisions listed above under OPEN DECISIONS, and sort them into still open and already settled, such as a decision since answered, a PR since merged, or a task since finished - process the still-open ones as firstmate: tell the captain, land or merge what is ready, answer or escalate a decision, or act on a blocker; your reply to the captain covers only those, as if the settled ones had never been listed, and a settled one needs only the acknowledgement):
[seq 1, recorded 0m ago] labtask: Lab task needs review
  current: state: unknown · source: none · no metadata for labtask
BRANCH OUTCOMES: after processing them run bin/fm-branch-outcome.sh mark-processed --through 1; until then every drain presents them again
exit: 0

=== Answered status with held backlog still presents divergence ===
$ FM_HOME=<divergence> bin/fm-captain-hold.sh hold question --title Choose export format --reason choose format
question
exit: 0
$ FM_HOME=<divergence> bin/fm-captain-hold.sh diverged
question	question	question	Choose export format
exit: 0
$ FM_HOME=<divergence> bin/fm-wake-drain.sh --would-present
would present: record-divergence
exit: 0

All live CLI assertions passed.
Evidence: Real Claude supervision-host delivery

Source: Real Claude supervision-host delivery

Real Claude CLI launched as session command on private fm-lab tmux socket, 120x36 terminal. Interactive attempt stopped at workspace trust; non-interactive normal login used without editing trust.

lock.out:
lock acquired: harness pid 3378282

live-host.out:
watcher: started pid=3384557 (beacon fresh)

state/.watch-triage.log:
[2026-10-10T10:25:22+0800] suppressed empty wake (watcher-resurface): check: rearm-resurface

state/.supervision-host.log:
1791599120	start	gen=host-3383898-1791599120	primary=claude

state/.watcher-down:
acked:downtime:live.1.abc

Watcher alive before decision: 3384557

Injected actual keyed needs-decision status, then observed real host main-only pass-through:

live-host.out:
watcher: started pid=3384557 (beacon fresh)
signal: ~/.no-mistakes/worktrees/ff5e17b6f5de/01M4HRBBMGBM2CJQ8BBDD22ZEN/.l/state/labtask.status

state/.supervision-host.log:
1791599120	start	gen=host-3383898-1791599120	primary=claude
1791599214	pass-through	attended	main-only	signal: ~/.no-mistakes/worktrees/ff5e17b6f5de/01M4HRBBMGBM2CJQ8BBDD22ZEN/.l/state/labtask.status

state/.wake-queue:
1791599212	1	signal	labtask.status	needs-decision: ~/.no-mistakes/worktrees/ff5e17b6f5de/01M4HRBBMGBM2CJQ8BBDD22ZEN/.l/state/labtask.status
1791599212	2	signal	labtask.status	needs-decision: ~/.no-mistakes/worktrees/ff5e17b6f5de/01M4HRBBMGBM2CJQ8BBDD22ZEN/.l/state/labtask.status

state/.watch-triage.log:
[2026-10-10T10:25:22+0800] suppressed empty wake (watcher-resurface): check: rearm-resurface

Real primary output:
Captain, I ran `bash .l/live-host.sh` once, with the 120-second timeout. It printed nothing and finished on its own instead of blocking until you stopped it. It didn't hit the timeout, but it may have exited early, so it's worth checking.

The tool didn't report an exit status, so I can't tell whether it succeeded or failed. I also can't confirm from here whether the supervision host actually ran. Your lab logs or state should show whether it took the lock and started the host.

I didn't run anything else or change any files.
Evidence: Real Claude Stop-hook monitoring and decision delivery

Source: Real Claude Stop-hook monitoring and decision delivery

Real Claude normal login in a private fm-lab tmux session; host-off and suppression flags in disposable lab. Temporary supported secondmate-home marker in gate code root made primary hooks applicable without relocating scripts or overriding fleet paths.

lock.out:
lock acquired: harness pid 3690773

state/.claude-autoarm-epoch:
epoch=1 owner_pid=3700474 outcome=arming updated_at=1791599475
linux-starttime=122212793 cmdline-hex=62617368002f686f6d652f72676d2f2e6e6f2d6d697374616b65732f776f726b74726565732f6666356531376236663564652f30314d34485242424d47424d32434a51384242444432325a454e2f62696e2f666d2d636c617564652d73746f702d6175746f61726d2e736800

state/.watcher-down:
acked:downtime:live.stop.1

state/.watch-triage.log:
[2026-10-10T10:31:16+0800] suppressed empty wake (watcher-resurface): check: rearm-resurface

Actual Stop-owned watcher alive after empty recovery: 3701131

Injected keyed needs-decision status; real Stop-owned watcher delivered it, then the next Stop firing rearmed:

state/.watch-deliveries.log:
3701131	linux-starttime=122212835 cmdline-hex=62617368002f686f6d652f72676d2f2e6e6f2d6d697374616b65732f776f726b74726565732f6666356531376236663564652f30314d34485242424d47424d32434a51384242444432325a454e2f62696e2f666d2d77617463682e736800	signal: ~/.no-mistakes/worktrees/ff5e17b6f5de/01M4HRBBMGBM2CJQ8BBDD22ZEN/.l/state/labtask.status

state/.watch-cycle-exits.log:
arm_pid=3701048	watcher_pid=3701131	origin=started	started_at=1791599475	ended_at=1791599499	exit_code=0	signal=none	reason=actionable-signal	beacon_age=2	lock_before=pid:3701131|identity:linux-starttime=122212835 cmdline-hex=62617368002f686f6d652f72676d2f2e6e6f2d6d697374616b65732f776f726b74726565732f6666356531376236663564652f30314d34485242424d47424d32434a51384242444432325a454e2f62696e2f666d2d77617463682e736800	lock_after=pid:none|identity:none	successor=started:3724969

state/.claude-autoarm-epoch:
epoch=2 owner_pid=3743388 outcome=arming updated_at=1791599520
linux-starttime=122217326 cmdline-hex=62617368002f686f6d652f72676d2f2e6e6f2d6d697374616b65732f776f726b74726565732f6666356531376236663564652f30314d34485242424d47424d32434a51384242444432325a454e2f62696e2f666d2d636c617564652d73746f702d6175746f61726d2e736800

state/.watcher-down:
acked:handling:3701131.1791599499.EiBOlN

state/.wake-queue:
Evidence: Real Pi report responses and persisted verdicts

Source: Real Pi report responses and persisted verdicts

Real Pi 0.87.1 on private fm-lab socket; session-only --approve; actual tracked branch extension, actual provider/model, actual outcome store. A disposable probe emitted the public dispatch event and awaited its settlement. No SDK or provider stubs.

LOCK 0 lock acquired: harness pid 3592958

ACCEPTED
SETTLED

TOOL CALL bash {"command": "bin/fm-wake-drain.sh", "timeout": 30}

TOOL RESULT bash
1	1	signal	labtask.status	signal: labtask.status
WAKE_ACK_REQUIRED: after handling completes run bin/fm-wake-drain.sh --ack-through 1 --recovery-generation 3384557.1791599212.AVnUfT
wake annotation: latest wake-EVENT observed at drain, not current state: labtask.status: paused [at=1]: awaiting external review


TOOL CALL bash {"command": "bin/fm-lease.sh claim labtask && bin/fm-crew-state.sh labtask", "timeout": 30}

TOOL RESULT bash
state: unknown · source: none · worktree gone (torn down?)


TOOL CALL fm_branch_report {"task": "labtask", "verdict": "captain", "summary": "PR https://example.com/pr/9 remains under review", "wake": "stale: labtask (idle 200s)"}

TOOL RESULT fm_branch_report
recorded seq 1 and delivered [captain] into main

TOOL CALL fm_branch_report {"task": "labtask", "verdict": "captain", "summary": "PR https://example.com/pr/9 remains under review", "wake": "stale: labtask (idle 300s)"}

TOOL RESULT fm_branch_report
recorded seq 2 and delivered [routine] into main

TOOL CALL bash {"command": "bin/fm-wake-drain.sh --ack-through 1 --recovery-generation 3384557.1791599212.AVnUfT && bin/fm-lease.sh release labtask", "timeout": 30}

TOOL RESULT bash
(no output)

BRANCH OUTPUT recorded seq 1 and delivered [captain] into main

recorded seq 2 and delivered [routine] into main

PERSISTED OUTCOME ROWS
{"seq":1,"epoch":1791599353,"task":"labtask","wake":"stale: labtask (idle 200s)","verdict":"captain","summary":"PR https://example.com/pr/9 remains under review","silent":false,"statusEndpoint":40,"statusIdent":"strong:2049:7639634:2026-10-10 10:26:21.429303535 +0800"}
{"seq":2,"epoch":1791599355,"task":"labtask","wake":"stale: labtask (idle 300s)","verdict":"routine","summary":"Repeat of captain outcome 1 (status and PR state unchanged), not raised to main again: PR https://example.com/pr/9 remains under review","silent":false,"statusEndpoint":40,"statusIdent":"strong:2049:7639634:2026-10-10 10:26:21.429303535 +0800"}

SUPPRESSION LOG
[2026-10-10T10:25:22+0800] suppressed empty wake (watcher-resurface): check: rearm-resurface
[2026-10-10T10:29:15+0800] suppressed repeat captain outcome 2 for labtask: same as captain outcome 1 with status and PR state unchanged; stored as routine
Evidence: Shadow-mode recovery remains visible

Source: Shadow-mode recovery remains visible

Real bin/fm-watch.sh as private fm-lab session command, actual tmux; config/wake-noise-suppression absent.

shadow-watcher.out:
check: rearm-resurface

state/.watch-triage.log:
[2026-10-10T10:34:08+0800] would suppress empty wake (watcher-resurface, shadow mode): check: rearm-resurface

state/.watcher-down:
announced:downtime:shadow.live.1
Evidence: Complete startup digest with suppression enabled

Source: Complete startup digest with suppression enabled


================================================================================
SESSION START - ~/.no-mistakes/worktrees/ff5e17b6f5de/01M4HRBBMGBM2CJQ8BBDD22ZEN/.z
================================================================================

LOCK
--------------------------------------------------------------------------------
lock acquired: harness pid 3744336

BOOTSTRAP
--------------------------------------------------------------------------------
BOOTSTRAP_INFO: lavish-axi >=0.1.80 enables confirmed board replies; this older compatible version retains the legacy reply path, but upgrade to prevent handing back a board before its reply is accepted

WAKE QUEUE
--------------------------------------------------------------------------------
(no queued wakes)
================================================================================
SUPERVISION OPERATING INSTRUCTIONS - primary harness: claude
================================================================================
Current state:
- Lock: held by this session; this session owns normal supervision unless away mode says otherwise.
- Away/quiet mode: inactive.
- X mode: inactive; use the default watcher cadence.
- Ordinary wake: the Stop-owned auto-arm (bin/fm-claude-stop-autoarm.sh) already owns watcher continuity; drain and handle the wake, and do not arm another cycle yourself.

Mode: Claude Stop-hook-owned supervision.

When this session owns supervision and away mode is not active:
1. Drain first with `bin/fm-wake-drain.sh`.
   After handling all emitted wakes and reconciling open decisions and unread status lines, run the exact `--ack-through` command printed as `WAKE_ACK_REQUIRED`; until then the work remains durable for idempotent re-handling after interruption.
2. Routine watcher arm and re-arm are owned by the Stop `asyncRewake` hook (`bin/fm-claude-stop-autoarm.sh`), never by you.
   Every turn end while supervision is needed launches or attaches one home-scoped watcher cycle with no model command and no model tokens.
   An actionable close wakes you through the hook's exit-2 rewake, delivered as a `Stop hook feedback` message.
3. On a `Stop hook feedback` wake (`signal:`, `stale:`, `check:`, or `heartbeat`), run `bin/fm-wake-drain.sh` first and handle the wake.
   Do not run `bin/fm-watch-arm.sh` after an ordinary wake; the next turn end re-arms automatically when supervision is still needed.
   Do not invent a wake from an attach-status line alone; drain and act only on real wake records, the drain's `OPEN DECISIONS` and `UNREAD STATUS` entries, or a real watcher reason line.
4. On the one `Stop hook feedback` automatic-mechanism failure notice (`firstmate watcher auto-arm FAILED ...`), drain, inspect the automatic mechanism failure, and do not turn the notice into a repeating manual-arm loop.
5. If the Stop hook does not claim the home or reports an exhausted failure, inspect its registration and watcher startup path before ending blind.
   Keep the Stop-owned automatic mechanism as the only Claude arm owner.
6. Treat `watcher: started ...` and `watcher: attached ...` inside automatic arm output as proof that one live cycle exists.
   On attach, the arm follows verified identity-matched successors instead of exiting when the first cycle ends.
7. The durable wake queue preserves actionable events between a rewake and the next Stop-launched arm, while the bounded turn-end guard prevents a blind Stop when recovery did not start.
   No PreToolUse hook denies fleet commands based on watcher status.
   [`watcher-continuity.md`](../watcher-continuity.md) owns the exact session-lock recovery boundary.
8. The turn-end guard (`bin/fm-turnend-guard.sh --claude`) remains the final backstop.
   It requires the PID-strict live-watcher and fresh-beacon predicate at the Stop boundary, except for the Claude-specific foreign-live-owner safe exit owned by [`turnend-guard.md`](../turnend-guard.md#guard-predicates); that document also owns the distinct model-aware mid-turn pull-guard rules.
   Otherwise, it allows the stop when a watcher is healthy or an open auto-arm generation claim owns recovery, while fresh failure epochs advance the bounded one-time attended fail-open progression described there.
9. Waiting on the hook-owned cycle is silent: do not send idle progress while the watcher is parked.

The watcher itself remains `bin/fm-watch.sh`, and `bin/fm-watch-arm.sh` remains the verified arm wrapper that the Stop hook foregrounds on a home that opted out of the [supervision host](../supervision-host.md) (`config/supervision-host-off`).
Re-arm attaches to an existing healthy cycle when one is already present and follows its verified successor chain.
See [`watcher-continuity.md`](../watcher-continuity.md) for the arm-layer successor and clean-close failure contract and the Claude ownership model.


================================================================================
READ-ONCE CONTRACT
================================================================================
Everything below is printed in full for this session start: every state/*.meta,
a compact data/backlog.md listing, a bounded tail of every state/*.status,
data/projects.md, data/secondmates.md, data/captain.md, data/captain-shared.md,
and data/learnings.md.
Do NOT re-read any of them after reading this digest, and do NOT bulk-read
data/backlog.md or state/*.status: re-reading everything defeats the entire
point of this command.

Go to a source directly only when:
  - this digest flagged it ABSENT (then rebuild or create it per AGENTS.md),
  - its contents looked unparseable or corrupt,
  - an individual full status log is needed for older wake-event history, or a
    status line was capped and its tail matters (each task's full log path is
    printed with its tail),
  - a full task body is needed (bin/fm-tasks-axi.sh show <id> --full, or data/backlog.md),
  - the backlog listing disclosed omitted queued items and this turn needs them,
  - the NETWORK CHECKS section reported its checks still IN PROGRESS and this
    turn needs their verdict (bin/fm-startup-network.sh report),
  - or a STARTUP TRUNCATED banner named the stage that would have printed it, in
    which case that stage's sources were never emitted and must be reconciled.

================================================================================
FLEET STATE
================================================================================

data/backlog.md
--------------------------------------------------------------------------------
compact backlog listing (tasks-axi; done rows omitted; every in-flight, held, and blocked row shown in full; ready queued bounded to 20; task bodies omitted)

in flight:
count: 0
tasks: 0 in_flight tasks in this backlog

held (captain- or time-gated; an in-flight item that is also held appears in both groups):
count: 0
tasks: 0 held tasks in this backlog

blocked queued:
count: 0
tasks: 0 blocked queued tasks in this backlog

ready queued (dispatchable now):
count: 0
ready: 0 unblocked queued tasks
ready_public_followups: 0 delivery-ready obligations
Full task bodies remain available on demand: bin/fm-tasks-axi.sh show <id> --full when compatible tasks-axi is available, or data/backlog.md.

Work under way (state/*.meta)
--------------------------------------------------------------------------------
(none)

Orphan status logs (state/*.status without matching .meta)
--------------------------------------------------------------------------------
(none)

AFK
--------------------------------------------------------------------------------
absent

================================================================================
NETWORK CHECKS
================================================================================
completed off the startup path in 2s: GitHub authentication, dead-secondmate relaunch, secondmate convergence, pending handoff delivery, project clone refresh with its drift reporting, and inactive terminal-outcome reconciliation.
(silent - no problems found)

================================================================================
CONTEXT
================================================================================

data/projects.md
--------------------------------------------------------------------------------
ABSENT

data/secondmates.md
--------------------------------------------------------------------------------
ABSENT

data/captain.md
--------------------------------------------------------------------------------
ABSENT

data/captain-shared.md (shared, main-authoritative, read-only in secondmate homes)
--------------------------------------------------------------------------------
ABSENT

data/learnings.md
--------------------------------------------------------------------------------
ABSENT

================================================================================
NEXT STEP
================================================================================
Follow the supervision operating instructions block above for harness 'claude'.
This script never starts supervision itself.

The digest above is complete for this session start. The READ-ONCE CONTRACT
section near the top of it governs what may still be read from disk.

Pipeline

Updates from git push no-mistakes

✅ **intent** - passed

✅ No issues found.

✅ **Rebase** - passed

✅ No issues found.

🔧 **Review** - 5 issues found → auto-fixed (3) ✅
  • 🚨 bin/fm-wake-suppress-lib.sh:232 - A new escalation can be downgraded to routine. With unchanged status/PR files and the same stale wake, a previous merge-wait summary and a new summary containing 'escalation 1' plus the same PR URL have identical fingerprints. Only the wake is checked for exemptions; summary prose is discarded. This contradicts 'never suppress needs-decision rows or anything carrying an escalation count.' Related sites: bin/fm-wake-suppress-lib.sh:186 ignores summary substance; bin/fm-branch-outcome.sh:556 changes the verdict; bin/fm-branch-report.sh:131 propagates it. Remove the summary-blind matching path and retain escalation/decision exemptions across the entire outcome. Normalizing every number at bin/fm-wake-suppress-lib.sh:184 also exceeds the idle-age matching needed for repeat suppression; narrow it to the changing age.
  • 🚨 bin/fm-wake-drain.sh:870 - The empty-wake probe treats failed evidence reads as absence. For a resolved status key whose backlog task remains captain-held, a timeout in the divergence lookup is swallowed by print_record_divergence_section, so this call succeeds with empty output and the recovery wake can be suppressed. Other affected reads: bin/fm-wake-drain.sh:860 uses a snapshot that skips unreadable status files; :868 uses a decision scan that skips failed folds. Repeat evidence has the same problem at bin/fm-wake-suppress-lib.sh:195 and :200, where failed reads of pr/pr_head, poll data, and merge-notified contents are masked by the checksum pipeline. Propagate indeterminate reads at the shared readers and prohibit suppression unless every required record was successfully inspected.
  • ⚠️ bin/fm-wake-drain.sh:864 - The required 'check the drain’s presentation read-only' is not implemented consistently. With a status file, an outcome store, and missing outcome indexes, --would-present calls print_status_outcome_backstop_section, which invokes processed-init and persistently writes per-task indexes and .branch-outcome-index-ready. The added comment at bin/fm-wake-drain.sh:854 explicitly allows this write. Use a genuinely read-only coverage lookup, leaving index migration to the presenting drain.
  • ⚠️ bin/fm-wake-suppress-lib.sh:230 - Repeat suppression never calls fm_wake_suppress_away. A matching captain outcome appended while .afk-contract exists is therefore stored as routine, despite the new documented guarantee that away/quiet outcomes are exempt. The empty-wake path correctly checks this at bin/fm-wake-suppress-lib.sh:149, but the shared repeat path does not. Add the posture check before matching; it must cover bin/fm-branch-outcome.sh:549 for both host and Pi callers.
  • ⚠️ bin/fm-wake-drain.sh:744 - Current-state enrichment adds an independent 20-second wait for every presented task before printing the section. Seven tasks whose state readers time out can consume 140 seconds, exceeding fm-session-start.sh’s default 120-second total budget and truncating the startup digest before later recovery/context sections. Related sites: bin/fm-wake-drain.sh:685 serializes the reads; :744 applies only a per-task timeout. Bound the aggregate enrichment time and print unavailable state for remaining tasks when that budget expires.

🔧 Fix applied.
5 issues (2 errors, 3 warnings) still open:

  • 🚨 bin/fm-wake-drain.sh:870 - The empty-wake probe treats failed evidence reads as absence. For a resolved status key whose backlog task remains captain-held, a timeout in the divergence lookup is swallowed by print_record_divergence_section, so this call succeeds with empty output and the recovery wake can be suppressed. Other affected reads: bin/fm-wake-drain.sh:860 uses a snapshot that skips unreadable status files; :868 uses a decision scan that skips failed folds. Repeat evidence has the same problem at bin/fm-wake-suppress-lib.sh:195 and :200, where failed reads of pr/pr_head, poll data, and merge-notified contents are masked by the checksum pipeline. Propagate indeterminate reads at the shared readers and prohibit suppression unless every required record was successfully inspected.
  • ⚠️ bin/fm-wake-drain.sh:864 - The required 'check the drain’s presentation read-only' is not implemented consistently. With a status file, an outcome store, and missing outcome indexes, --would-present calls print_status_outcome_backstop_section, which invokes processed-init and persistently writes per-task indexes and .branch-outcome-index-ready. The added comment at bin/fm-wake-drain.sh:854 explicitly allows this write. Use a genuinely read-only coverage lookup, leaving index migration to the presenting drain.
  • ⚠️ bin/fm-wake-drain.sh:744 - Current-state enrichment adds an independent 20-second wait for every presented task before printing the section. Seven tasks whose state readers time out can consume 140 seconds, exceeding fm-session-start.sh’s default 120-second total budget and truncating the startup digest before later recovery/context sections. Related sites: bin/fm-wake-drain.sh:685 serializes the reads; :744 applies only a per-task timeout. Bound the aggregate enrichment time and print unavailable state for remaining tasks when that budget expires.
  • 🚨 bin/fm-wake-drain.sh:399 - Round 1's R3 fix introduced an extra coverage path for modern outcomes whose status capture failed. If an existing done status is temporarily unreadable during append, the stored row has statusEndpoint=0 and statusIdent="-". Once readability returns, this condition treats the status as covered whenever its unchanged mtime precedes the outcome epoch. With no queued rows, decisions, or unprocessed captain outcomes, the probe can suppress recovery even though the presenting drain's index leaves that status uncovered. This contradicts "every case whose evidence cannot be read" remaining actionable. Remove the added acceptance of modern "-" captures and revert to the minimal read-only equivalent of existing coverage semantics; timestamp inference belongs only to legacy rows missing capture fields. Related sites: bin/fm-wake-drain.sh:396 defaults missing identity to the same sentinel; :411 skips covered events; bin/fm-branch-outcome.sh:296 initializes failed captures; :353 limits existing legacy inference to absent fields.
  • ⚠️ bin/fm-branch-outcome.sh:562 - On Pi, an identical captain report can now be stored and delivered as routine, but fm_branch_report still returns "delivered [captain]" using the requested verdict. The actual delivery correctly reads the stored row, so the tool reports a wrong result without erroring. Read the stored verdict for the tool response, as the shell report path already does. Related sites: .pi/extensions/fm-branch-supervision.ts:1233 retains the requested verdict, :1173 dispatches the stored verdict, :1270 emits the incorrect label; bin/fm-branch-report.sh:131 handles the corresponding shell path.

🔧 Fix applied.
1 warning still open:

  • ⚠️ bin/fm-branch-outcome.sh:562 - On Pi, an identical captain report can now be stored and delivered as routine, but fm_branch_report still returns "delivered [captain]" using the requested verdict. The actual delivery correctly reads the stored row, so the tool reports a wrong result without erroring. Read the stored verdict for the tool response, as the shell report path already does. Related sites: .pi/extensions/fm-branch-supervision.ts:1233 retains the requested verdict, :1173 dispatches the stored verdict, :1270 emits the incorrect label; bin/fm-branch-report.sh:131 handles the corresponding shell path.

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

✅ **Test** - passed

✅ No issues found.

  • Live validation: ✅ go - 10 of 10 scenarios driven live against the product
Scenario Result Live Evidence
Repeat an unchanged captain report with only its idle age changed; store it as routine and report the stored verdict ✅ pass live live-cli-transcript.log; live-pi-report-transcript.log
Leave suppression disabled; repeat reports and empty recovery notifications remain visible while shadow decisions are logged ✅ pass live live-cli-transcript.log; live-shadow-watcher-transcript.log
Change report substance, status, or PR evidence, or carry an escalation, decision, heartbeat, or away posture; preserve captain outcomes ✅ pass live live-cli-transcript.log; tests/fm-wake-noise-suppression.test.sh
Recover monitoring with nothing to present; suppress the empty notification and keep monitoring through both Claude supervision paths ✅ pass live live-host-transcript.log; live-stop-transcript.log
Add a decision after an empty recovery was suppressed; deliver the new actionable notification ✅ pass live live-host-transcript.log; live-stop-transcript.log
Probe presentation repeatedly; retain unread status, open decisions, held-backlog divergence, and unprocessed captain outcomes without consuming records ✅ pass live live-cli-transcript.log
Probe missing indexes or recovered failed status captures; avoid migration writes and keep uncovered modern captures actionable ✅ pass live live-cli-transcript.log; test_probe_capture_coverage_matches_presenting_drain
Drain a captain outcome; print its current crew-state line beside the recorded summary ✅ pass live live-cli-transcript.log; test_branch_outcomes_show_the_current_crew_state
Start a session with suppression enabled and no queued notifications; receive the complete one-shot startup digest ✅ pass live live-startup-digest.log
Start a competing session while another real Claude session owns the home; receive the read-only diagnostic and preserve the existing owner ✅ pass live live-lock-refusal-digest.log
  • TMPDIR="$PWD/.test-tmp" bash tests/fm-wake-noise-suppression.test.sh
  • Selected supervision-host tests: empty enforced recovery, shadow recovery, and refusal outside the lock owner
  • Selected Claude Stop-hook tests: empty enforced recovery and shadow recovery; reran successfully after adding missing disposable backlog fixtures
  • test_branch_report_response_uses_stored_verdict with the existing stubbed Pi SDK regression driver
  • python3 .test-tmp/live-cli.py: real public CLI calls against disposable marked homes, with persisted-output and read-only-state assertions
  • Real Claude interactive launch attempted on a private 120x36 tmux terminal; workspace trust prevented entry, so non-interactive normal-login launches were used
  • Real Claude supervision host and Stop hook: empty recovery followed by an injected keyed decision
  • Real Pi 0.87.1 with the tracked branch extension and a disposable public-dispatch probe: two actual model-driven report calls, asserting captain then routine receipts and stored verdicts
  • Real watcher CLI in shadow mode on a private tmux socket
  • Real Claude startup and competing-session startup; captured complete digests and verified the original lock owner remained unchanged
  • Stopped private lab sessions and lab-owned processes; removed temporary homes, runtime marker, selectors, and drivers
✅ **Document** - passed

✅ No issues found.

🔧 **Lint** - 1 issue found → auto-fixed ✅
  • ⚠️ linter found issues (exit code 1)

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

✅ **Push** - passed

✅ No issues found.

Related prior work

Open upstream PRs that overlap this change:

Deterministic, script-only wake-noise suppression owned by
bin/fm-wake-suppress-lib.sh, behind one switch (config/wake-noise-suppression)
that defaults to shadow mode, where every decision is only logged to
state/.watch-triage.log:

- Repeat captain outcomes: fm-branch-outcome.sh append stores a captain
  outcome as routine when the task's newest captain outcome has the same
  fingerprint (task, digit-normalized wake, summary URLs) and the task's
  status log and recorded PR state (meta pr/pr_head, PR poll registration,
  merge-notified receipt) are unchanged. fm-branch-report.sh receipts carry
  the stored verdict, so the supervision host wakes main only for real
  captain rows.
- Empty wakes: fm-wake-drain.sh --would-present answers read-only whether
  main's drain would present anything (queued rows, unread status, outcome
  backstop, open decisions, record divergence, captain branch outcomes). The
  watcher's rearm-resurface, the host's attended main-only pass-through, and
  the host-off Claude Stop-hook rewake retire an empty close's recovery
  episode with main's own acknowledgement and keep supervising instead.
- BRANCH OUTCOMES now prints each task's current fm-crew-state line beside
  its captain outcome.

Heartbeats, escalations, needs-decision and blocked events, failures,
supervision-host lines, away or quiet records, stale-lock reclaims, and any
unreadable evidence always reach main.
… preserving fail-open suppression and uncommitted status receipts. Fixed both ShellCheck warnings. Wake-queue, remote-reply, suppression, and unread-status suites passed, along with pinned lint and diff checks. Shard 4’s timeout did not reproduce; its cause remains unconfirmed
… reproduced shard 5’s timing failure, aligning all related waits with the existing suite bound. Remote lifecycle, open-decisions, unread-status, suppression, pinned lint, syntax, and diff checks passed locally
@ryannmicua
ryannmicua merged commit ce07df0 into main Oct 10, 2026
37 of 38 checks passed
@ryannmicua
ryannmicua deleted the fm/fm-wake-noise-suppression branch October 10, 2026 22:34
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