Repository navigation
Conversation
A worker that reports `blocked:` and then sits idle keeps waking firstmate. The status line wakes it once, which is right. But the parked pane still changes (a clock, a token counter), and every new pane hash re-enters the terminal-stale branch and alarms again with the same question. One blocker can wake firstmate many times while nothing has changed. Bound that repetition the way a declared pause is already bounded. When the latest status line is `blocked` and its status wake already exists (the `.seen` signature is current), the stale branch absorbs the new hash and re-alarms at most once per PAUSE_RESURFACE_SECS window, on the shared `.paused-resurfaced-<key>` marker. A new status line changes the signature and the declaration, so it wakes again. The bound steps aside in every case where an alarm is still wanted: - the blocker has not woken firstmate yet (`.seen` not current); - an open captain call already set a declaration (its first sight alarms); - `fm-captain-hold.sh open` could not establish whether a call is open (exit 2). `task_captain_call_open` now keeps that exit in CAPTAIN_CALL_OPEN_RC so the blocked bound can tell it from "no call". Away mode is unchanged: that branch hands each distinct stale hash to the away daemon before terminal triage, as before. Tests: the `unheld-blocker` row in test_stale_churn_without_a_captain_call_still_alarms pinned the old alarm-on-every-hash behaviour for an already-surfaced blocker, so it moves to new tests for the bound: a surfaced blocker absorbs churn while a `working:` line still alarms; a blocker under an open captain call still alarms on first sight; a blocker not yet surfaced still wakes; and a blocker whose backlog cannot be read still alarms.
|
Speaking as Kun's firstmate: thank you @jakinharp — a tightly scoped watcher fix with the regression reproduced on base and the adversarial "can't prove the call state" cases (open exit 2 / 124) kept loud is really nice work. I read tip Diff review: Contract-class: new-default. On main, a surfaced VISION.md: aligns on one-captain/peace-of-mind (fewer repeat alarms, first sight still loud), scripts-own-mechanics, restart-safety (state is the This pass: attestation matches the tip; live validation 11/11 go; no security concerns. Fork CI approved (runs 38838066183, 38838066229) and running. When it's green this goes to Kun for the merge-or-leave call — nothing needed from you right now. Overlap FYI: #7232 adds a sibling stale bound (unknown-but-alive panes with progress) in the same area of |
Intent
Send upstream one small watcher fix, and nothing else. The owner audited uncommitted local work left by an earlier agent and has zero confidence in half-baked solutions, so this PR carries only the part of that work that was proven correct: the watcher's repeat-stale-alarm bound for a worker that already declared a blocker.
Problem: when a worker appends a
blocked:status line, its first sight already raises its own wake (the status signal). Afterwards the stale-liveness check kept re-alarming on that same quiet worker every cycle, because only declaredpaused:waits bounded the stale alarm. The fix lets a blocked line that has already surfaced bound repeat stale wakes in the same way, while every case the watcher cannot prove is a wait still alarms.Decisions and tradeoffs that are deliberate:
fm-captain-hold.sh open --identityexits 2 (the backlog cannot say whether a captain call is open),task_captain_call_openkeeps that exit inCAPTAIN_CALL_OPEN_RCand the blocked bound refuses to absorb the alarm. This follows the existing rule "a wait this watcher cannot prove is not a wait". Other callers keep their old 0/1 return values..pi/and.claude/local files, and any compaction or durable-pi change. The audit recommended keeping the current pi CLI compaction plus the stow hook.Tests: four behavioural tests in tests/fm-watch-triage.test.sh drive the real watcher: a surfaced blocked line bounds stale wakes while a working line still alarms; a blocked line under an open captain call still alarms on first sight; a blocked line not yet surfaced still wakes on first sight; a blocked line still alarms when the backlog is unreadable (open exits 2; the test skips if the environment cannot produce rc 2). Fixture status text is generic (
blocked [key=push-rejected]: push rejected with 403), not site-specific. The full triage suite passed locally (153 ok, 0 not ok), and an independent codex review passed after the rc-2 fix.What Changed
bin/fm-watch.shaddssurfaced_blocked_stale_bound: when a crew's latest status line isblocked:and its status wake has already surfaced it (the.seensignature is current), later stale alarms from new pane hashes are absorbed on theFM_PAUSE_RESURFACE_SECScadence instead of re-alarming every cycle. First sight still alarms, a new status line is a new declaration that wakes again, and away mode is untouched.task_captain_call_opennow records thefm-captain-hold.sh openexit inCAPTAIN_CALL_OPEN_RC; the blocked bound only applies on a proven 0 or 1, so an open captain call or any unproven read (exit 2, a 124 identity-read bound, an unrunnable helper) still lets the stale alarm through.bin/fm-classify-lib.shgains thestatus_is_blockedverb check.docs/architecture.mdanddocs/configuration.mddescribe the new bound beside the existing paused/captain-held bounds, andtests/fm-watch-triage.test.shadds five watcher-driven tests: surfaced blocked line bounds stale wakes while a working line still alarms; blocked under an open call alarms on first sight; unsurfaced blocked line still wakes; blocked with an unreadable backlog (exit 2) still alarms; blocked with a wedged identity read (exit 124) still alarms.🤖 Generated with Claude Code
Risk Assessment
✅ Low: The change adds one well-bounded stale-alarm absorb branch gated on a proven no-call exit, a current seen marker, and a blocked last line; every traced path (first sight, open call, unproven open exit, new declaration, away mode, secondmate) matches the stated intent and the recorded round 1 decision, and the tests exercise the real watcher.
Testing
Ran the five new behavioural tests and their two neighbours one at a time through the suite's FM_TEST_ONLY hook; each starts the real bin/fm-watch.sh, the real bin/fm-captain-hold.sh and a real tasks-axi backlog in a throwaway home, with the suite's fake tmux pane and fake crew-state verdict standing in for the terminal. All seven passed, and neither rc-2 nor rc-124 case skipped. Added four extra scenarios in the evidence dir driven the same way: blocked -> working -> blocked gets its own signal wake and is then bounded again, the bound re-alarms once after the resurface window elapses, away mode still hands the stale hash to the away daemon with no bound, and fm-captain-hold.sh open keeps exit 0/1 for held/unheld. Ran the new bound test against an export of the base commit: it fails there (watcher exited on the churn), so the regression reproduces before the fix and passes after. No real-tmux lab was started because the change only alters classification after the pane capture, not the capture itself; the fake pane is noted as a stand-in for tmux only.Evidence: New watcher tests, one per process (all ok)
Evidence: Extra scenarios: cadence elapse, away mode, open exit codes
Evidence: Extra scenarios: blocked->working->blocked re-wake, away mode (with triage log)
--- triage log after first churn: 2 absorbed stale (blocked status already surfaced): test:fm-held-merge --- after re-declare: signal wakes=2 stale wakes=0 ok - blocked -> working -> blocked wakes again, then its repeats are bounded ok - away mode still hands a surfaced blocked line's new stale hash to the away daemonEvidence: Base commit before the fix: same test fails
== base commit 230db82 + new test: test_surfaced_blocked_line_bounds_stale_wakes not ok - the watcher exited on a surfaced blocked line's stale churn rc=1Evidence: Extra scenario driver script
Pipeline
Updates from git push no-mistakes
✅ **intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
✅ **Review** - passed
✅ No issues found.
✅ **Test** - passed
✅ No issues found.
FM_TEST_ONLY=test_surfaced_blocked_line_bounds_stale_wakes bash tests/fm-watch-triage.test.shFM_TEST_ONLY=test_blocked_line_under_open_call_first_sight_still_alarms bash tests/fm-watch-triage.test.shFM_TEST_ONLY=test_unsurfaced_blocked_line_still_wakes bash tests/fm-watch-triage.test.shFM_TEST_ONLY=test_blocked_line_with_unreadable_backlog_still_alarms bash tests/fm-watch-triage.test.sh(open exited 2, no skip)FM_TEST_ONLY=test_blocked_line_with_wedged_identity_read_still_alarms bash tests/fm-watch-triage.test.sh(open exited 124, no skip)FM_TEST_ONLY=test_open_captain_call_bounds_stale_churn bash tests/fm-watch-triage.test.shFM_TEST_ONLY=test_stale_churn_without_a_captain_call_still_alarms bash tests/fm-watch-triage.test.shExtra live scenarios from evidence/extra-scenarios.sh via the same FM_TEST_ONLY hook:extra_blocked_working_blocked_wakes_again,extra_blocked_bound_resurfaces_after_window,extra_away_mode_still_hands_blocked_stale_hash,extra_open_exit_codes_unchangedRegression repro: exported base commit 230db82 viagit archive, copied the new tests in, ranFM_TEST_ONLY=test_surfaced_blocked_line_bounds_stale_wakesthere: not ok (watcher exited on the surfaced blocked churn)✅ **Document** - passed
✅ No issues found.
✅ **Lint** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.