Skip to content

feat(bin): let the unchanged-pause rule absorb rechecks of exited workers - #56

Merged
alandomio merged 8 commits into
mainfrom
fm/pause-rule-exited
Oct 7, 2026
Merged

alandomio merged 8 commits into
mainfrom
fm/pause-rule-exited

Conversation

@alandomio

@alandomio alandomio commented Oct 5, 2026 •

Copy link
Copy Markdown
Owner

Intent

Widen firstmate's deterministic unchanged-pause absorption rule (config/absorb-unchanged-pause, rule_absorb_unchanged_pause in bin/fm-watch.sh) to also cover workers whose session has exited. Captain decision 2026-10-05: 'yes, widen it with the daily reminder'. Evidence: 526 unchanged exited-worker rechecks in 7 days were all only acknowledged; the rule without the exclusion absorbs 789 with 1 wrong, preserved by the reminder valve. Acceptance: an unchanged declared-pause recheck of an exited worker is absorbed exactly like a live worker's under plain 'on'; captain-held transfers and any changed recheck (pane text changed, or the worker exited since the last recheck) still surface; the reminder valve re-surfaces each parked wait once per FM_PAUSE_REMIND_SECS; docs/configuration.md, docs/architecture.md, AGENTS.md config line and script headers describe the new scope; tests cover exited-unchanged (absorbed), exited-changed (surfaced), exited-captain-held (surfaced) and the reminder valve. Exclusions: Jev absorb-try and the legacy unchanged-recheck absorb deliberately still skip exited workers; pane-text-changed and idle-worker rules stay out. Rebase context (captain instruction 2026-10-07: resolve the PR 56 conflicts keeping both main's changes and this rule's intent): main meanwhile landed PR 58, the opt-in 'daily' second line of config/absorb-unchanged-pause (rule_absorb_unchanged_wait) that absorbs an unchanged dead-agent recheck, captain-held included, until FM_PAUSE_REMIND_SECS since the last surface. Both are kept and layered deliberately: plain 'on' absorbs an exited paused wait via this rule's own FM_PAUSE_REMIND_SECS marker and never a captain-held one; with the 'daily' line set, the daily rule alone owns every exited-worker recheck (paused or captain-held) so its reminder window is not stretched by a second absorber. Main's test test_rule_daily_is_off_without_its_second_line was rewritten to assert a captain-held exited recheck still surfaces without the daily line, since an exited paused wait is now absorbed under plain 'on'. The branch was rebased onto main after the pipeline's earlier push; the captain approved recording the pre-rebase pipeline head f49fe1c as a merge parent with the ours strategy (tree identical to the rebased branch, no force push) so this push is a fast-forward - the merge commit is deliberate, not a mistake. Shared tracked firstmate material (bin/, docs/, tests/, AGENTS.md); firstmate-coding-guidelines applies.

What Changed

  • bin/fm-watch.sh: rule_absorb_unchanged_pause no longer skips workers whose session has exited. Under plain on, an unchanged declared-pause recheck of an exited worker is now absorbed the same way a live worker's is, and its FM_PAUSE_REMIND_SECS reminder re-surfaces the wait periodically. Captain-held transfers and changed rechecks (pane text changed, or the worker exited since the last recheck) still surface. When the daily second line of config/absorb-unchanged-pause is set, this rule gives up exited workers and the daily rule handles every exited-worker recheck on its own, so only one reminder window applies. The Jev absorb-try and the legacy unchanged-recheck absorb still skip exited workers.
  • tests/fm-watch-triage.test.sh adds four cases: exited and unchanged (absorbed), exited and changed (surfaced), exited and captain-held (surfaced), and the reminder re-surfacing. It also rewrites test_rule_daily_is_off_without_its_second_line to check that a captain-held exited recheck still surfaces without the daily line.
  • docs/configuration.md, docs/architecture.md, the config line in AGENTS.md and the script headers now describe the wider scope and how it combines with the daily rule.

🤖 Generated with Claude Code

Risk Assessment

✅ Low: This is a small, contained change to one condition: plain 'on' now lets rule_absorb_unchanged_pause take paused rechecks of exited workers. When the daily line is set, the daily rule owns those rechecks. Captain-held rechecks, changed rechecks and Jev's exclusions are unchanged, which matches the stated intent.

Testing

I ran the targeted tests/fm-watch-triage.test.sh suite against the real bin/fm-watch.sh triage rules and every test passed, with no not ok lines. These cases cover the acceptance criteria: an unchanged recheck of an exited worker is absorbed and recorded as source=rule; an exited recheck is surfaced if the pane or liveness changed; a captain-held exited recheck is always surfaced; the reminder valve re-surfaces a wait once per FM_PAUSE_REMIND_SECS. The 'daily' layering cases also passed, including the rewritten test that a captain-held recheck still surfaces when the daily line is not set. This change has no UI, so the evidence is the TAP log. The working tree is still clean.

Evidence: fm-watch-triage TAP log (exited-worker absorption, captain-held, reminder valve, daily layering)

Source: fm-watch-triage TAP log (exited-worker absorption, captain-held, reminder valve, daily layering)

ok - signal_reason_is_actionable: benign absorbed, captain verbs and coalesced batches surfaced
ok - stale_is_terminal: terminal status surfaces, non-terminal and no-status are benign
ok - scan_captain_relevant_statuses lists only captain-relevant statuses
ok - classifier primitives: keyed decisions and activity phases, captain relevance, window-to-task, and overrides
ok - status_is_nonterminal_progress_verb is the single shared predicate for all three call sites
ok - crew_is_provably_working: only working+run-step/pane is provable; idle/finished/parked/failed/unknown surface
ok - status_is_paused: only the leading paused verb matches, paused is not captain-relevant, and the two declared-wait verbs stay separable
ok - crew_absorb_class: working/paused/none from one read; crew_is_paused and crew_is_provably_working agree
ok - crew_worktree_written_since: real writes are evidence; no worktree, no anchor, quiet trees, .git churn and a mate's own home are not
ok - an empty FM_WORKTREE_WRITE_PRUNE widens the probe to the whole depth-bounded tree instead of disabling it
ok - an empty FM_WORKTREE_WRITE_PRUNE exported into the environment prunes nothing, widening the probe
ok - the worktree write probe is wall-clock bounded, and hitting the bound reads as no write evidence
ok - signal_crew_provably_working: benign only when every referenced crew is provably working
ok - a secondmate's status signal is never absorbed as provably working; crewmates are unaffected
ok - a no-verb signal whose crew is provably working is absorbed (no exit, no queue, suppressor advanced, beacon present)
ok - a bare turn-end whose crew is provably working (busy pane) is absorbed
ok - a bare turn-end whose crew is not provably working is surfaced (the swallowed-finish fix)
ok - a no-verb working: note whose crew is idle with no running pipeline is surfaced
ok - a secondmate's status note surfaces even while its own agent is busy
ok - a self-announced close never wakes its own home, and the next real note still does
ok - captain-relevant signal is surfaced (queue + exit) and marked surfaced
ok - a stale pane sitting on a terminal status is surfaced (queue + exit)
ok - a stale terminal-looking status is overridden and absorbed while a run is actively working, then wedge-escalated
ok - provably-working non-terminal stale is absorbed on first sight, then wedge-escalated past the threshold
ok - consecutive wedge escalations on the same pane accumulate and demand deep inspection at the threshold
ok - a pane becoming active again resets the consecutive wedge-escalation counter
ok - a busy worker below the turn-age bound remains working with no escalation
ok - a busy worker with a stable pane hash still escalates once its completed-turn age reaches the bound
ok - a busy worker whose pane hash changes every poll still escalates once its completed-turn age reaches the bound
ok - touching a busy worker's completed-turn marker resets the age and prevents an old-age escalation
ok - repeated busy turn-age escalations reuse the existing escalation counter and demand deep inspection at the threshold
ok - the production default busy-turn-age bound is 3600s (5min under does not wedge, 66min over does)
ok - a busy pane under a declared pause is rechecked on the long cadence, and lifting the pause restores the wedge escalation
ok - a not-provably-working non-terminal stale is surfaced immediately (never left to wait out the timer)
ok - a declared pause is absorbed on first sight, then re-surfaced as a recheck past the threshold, never wedge-escalated
ok - exited declared-pause and captain-held panes use bounded pause cadence while a live decision gate still surfaces once
ok - a live agent's declared pause with a churning pane hash uses the bounded recheck cadence, never a bare stale wake
ok - an unchanged declared pause is rechecked once, then absorbed until the reminder ceiling or a change in status, liveness, or pane text
ok - a live agent's pause line takes its one-time surface once, not again after every busy turn
ok - a declared paused secondmate re-surfaces on the bounded normal-mode cadence
ok - a captain-held secondmate re-surfaces on the bounded normal-mode cadence
ok - a non-paused secondmate retains normal stale suppression
ok - a resumed secondmate clears pause and stale tracking before stale exemption
ok - unchanged stale hashes reclassify when a crew enters or leaves pause
ok - a declared pause is periodically rechecked against authoritative active-run state
ok - a paused status overridden by authoritative working preserves its wedge timer and escalates
ok - matching non-terminal stale suppressors repair missing or corrupt stale-since timers
ok - a quiet pane writing its own worktree is deferred, while one writing nothing still wedge-escalates on the unchanged schedule
ok - a write deferral re-surfaces once on the bounded pause cadence, so a churning worktree cannot stay invisible
ok - a secondmate's own home supervision churn is not crew write evidence, so a pane recording that home keeps the unchanged escalation schedule
ok - an idle-window timer repair drops a finished write-deferral chain, so the next deferral gets a fresh re-surface window
ok - both first-sight paths through a captain-relevant status drop a finished write-deferral chain with the idle window
ok - triage log capping handles wc byte counts with leading spaces
ok - a captured process-event result wakes a healthy watcher proactively, with no manual drain
ok - an unacknowledged process-event result re-drains until handling is acknowledged
ok - complete process-event queue keys map to distinct seen markers
WAKE_ACK_REQUIRED: after handling completes run bin/fm-wake-drain.sh --ack-through 1 --recovery-generation 51426.1791368254.ZYpgA8
ok - queue revalidation, proactive output, and marker commit serialize with drain
~/.no-mistakes/worktrees/38493c8a7325/01M4AXGJZNMP9FPC4VQ0VW9859/bin/fm-push-transition-lib.sh: line 96: echo: write error: Broken pipe
tests/wake-helpers.sh: line 282: 56112 Killed: 9               PATH="$dir/fakebin:$PATH" FM_HOME="$dir" FM_PROCEVENT_CLAIM_ROOT="$dir/claims" FM_CREW_STATE_BIN="$dir/fakebin/fm-crew-state.sh" FM_POLL=0.2 FM_SIGNAL_GRACE=1 FM_CHECK_INTERVAL=999999 FM_HEARTBEAT=999999 "$WATCH" > "$out"
tests/wake-helpers.sh: line 282: 58276 Killed: 9               PATH="$dir/fakebin:$PATH" FM_HOME="$dir" FM_PROCEVENT_CLAIM_ROOT="$dir/claims" FM_CREW_STATE_BIN="$dir/fakebin/fm-crew-state.sh" FM_POLL=0.2 FM_SIGNAL_GRACE=1 FM_CHECK_INTERVAL=999999 FM_HEARTBEAT=999999 "$WATCH" > "$out"
ok - surfacing failures replay until post-handling acknowledgement
ok - marker failure exits through the shared wake owner, releases its lock, and replays later
ok - a heartbeat with no captain-relevant change is absorbed and backs off the cadence
ok - heartbeat backstop fail-safe surfaces a captain-relevant status the per-wake path missed
ok - the liveness beacon stays fresh while the watcher absorbs benign wakes (fm-guard never false-alarms)
ok - with .afk present the watcher reverts to one-shot so the daemon owns triage (no double-triage)
ok - AFK changed paused panes hand off plain stale identities for daemon-owned pause triage
ok - a routine working: signal the provably-working check would otherwise escalate is absorbed by Jev and recorded in the digest
ok - with config/jev-absorb absent, the same signal surfaces exactly as before
ok - a declared-pause recheck due to re-surface is absorbed by Jev, throttle advanced, recorded in the digest
ok - a dead-agent pause recheck always re-surfaces, never absorbed by Jev
ok - a captain-held recheck always re-surfaces, never absorbed, even with Jev enabled and overridden
ok - the deterministic rule absorbs a fresh unchanged declared-pause recheck and records it in the digest as source=rule
ok - the rule refuses a changed situation and a task with an open decision, surfacing both for real
ok - the rule absorbs an unchanged declared-pause recheck of an exited worker, recorded as source=rule
ok - the rule refuses an exited worker whose pane or liveness changed since the last recheck
ok - an exited wait is re-surfaced once per FM_PAUSE_REMIND_SECS, then absorbed again
ok - a captain-held recheck of an exited worker always re-surfaces, never absorbed by the rule, even when enabled
ok - daily: an unchanged dead-agent recheck is absorbed and counted as source=rule until the reminder, then surfaced
ok - daily: without the second line an unchanged dead-agent captain-held recheck keeps surfacing at every recheck
ok - daily: an alive to dead transition surfaces at once, and a changed pane or status line does too
ok - daily: a dead captain-held wait is absorbed and counted like a plain declared pause
ok - daily: a task with an open decision still surfaces at every recheck
ok - the rule surfaces a recheck for real when it cannot record the digest entry
ok - the rule surfaces a recheck for real when it cannot write the digest entry
ok - the rule's own safety valve forces one real surface after continuous absorption, then resets its marker
ok - absorb_vetoed vetoes terminal-status prefixes, open decisions, unread notes, check/heartbeat/merge reasons, and only presented mode relaxes status
ok - the unchanged-pause rule is behind the shared veto
ok - an already-presented terminal status with nothing appended is absorbed and recorded as source=rule
ok - a still-open needs-decision the captain was already shown is absorbed
ok - the presented-stale rule is off by default: the same stale surfaces
ok - the rule never absorbs without a matching, signed surfaced record
ok - any line appended since the presentation defeats the rule, even a repeat of the same text
ok - an unread note or an unbuildable digest entry keeps the presented stale surfacing
ok - the rule's own safety valve forces one real surface after the bound, then resets its marker

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.

  • bash tests/fm-watch-triage.test.sh
✅ **Document** - passed

✅ No issues found.

✅ **Lint** - passed

✅ No issues found.

✅ **Push** - passed

✅ No issues found.

Alan Domio and others added 2 commits October 5, 2026 17:03
…kers

The deterministic unchanged-pause rule skipped a worker whose agent had exited,
so every parked, exited worker re-surfaced on each recheck. The rule now treats
an exited worker like a live one; captain-held transfers, changed rechecks and
the FM_PAUSE_REMIND_SECS reminder valve are unchanged. Jev and the legacy
absorb still skip exited workers.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
alandomio and others added 6 commits October 7, 2026 10:58
…y reminder (#58)

* feat(bin): absorb an unchanged dead-agent wait recheck until the daily reminder

An unchanged recheck of a declared pause or captain-held transfer whose worker had already exited at the last surface woke the supervising session every FM_PAUSE_RESURFACE_SECS, and almost all of them ended in a plain acknowledgement.
config/absorb-unchanged-pause now accepts an optional second line "daily": the rule then also absorbs that recheck, behind absorb_vetoed and counted in the absorption digest as source=rule, until FM_PAUSE_REMIND_SECS since the last surface.
The first recheck, any change of status, open decisions, liveness (alive to dead included) or pane text, and the daily reminder still surface at once; homes without the second line behave as before.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>

* no-mistakes(document): docs: align absorb-unchanged-pause pointers with daily reminder

---------

Co-authored-by: Alan Domio <[email protected]>
Co-authored-by: Claude Sonnet 5.5 <[email protected]>
…ccess to /retrospective, and prune it (#59)

* feat(skills): add rule-classification, no-ops audit, review placement and information-access to /retrospective

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>

* docs(skills): credit /retro wording

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>

* docs(skills): prune retrospective skill; net shorter than before

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>

---------

Co-authored-by: Alan Domio <[email protected]>
Co-authored-by: Claude Sonnet 5.5 <[email protected]>
…kers

The deterministic unchanged-pause rule skipped a worker whose agent had exited,
so every parked, exited worker re-surfaced on each recheck. The rule now treats
an exited worker like a live one; captain-held transfers, changed rechecks and
the FM_PAUSE_REMIND_SECS reminder valve are unchanged. Jev and the legacy
absorb still skip exited workers.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…s on

After rebasing onto main's daily reminder, an exited paused wait could be absorbed
by the daily rule and then again by the unchanged-pause rule's own window, which
would stretch the reminder to twice its length. With the daily line set, the daily
rule now owns every exited-worker recheck; plain on keeps the unchanged-pause rule.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…d tree

The branch was rebased onto main after the pipeline had pushed f49fe1c. This
records that head as a parent so the next push is a fast-forward; the tree is
exactly the rebased one.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
@alandomio
alandomio merged commit 9db56d1 into main Oct 7, 2026
13 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