Repository navigation
fix(bin): correct declared-pause liveness triage - #2598
Closed
tiago-peixoto wants to merge 18 commits into
Closed
tiago-peixoto wants to merge 18 commits into
tiago-peixoto wants to merge 18 commits into
Conversation
tiago-peixoto
force-pushed
the
fm/firstmate-declared-pause-not-absorbed-r2
branch
from
August 19, 2026 19:10
0d9bbd8 to
0992d8f
Compare
tiago-peixoto
force-pushed
the
fm/firstmate-declared-pause-not-absorbed-r2
branch
from
August 19, 2026 19:16
0992d8f to
d5da853
Compare
A worker parked on a current, accurate `paused:` line was woken on first sight of every distinct stale hash instead of being absorbed on the long PAUSE_RESURFACE_SECS cadence. Six such wakes landed across four correctly parked tasks in roughly forty minutes on 2026-08-12, each costing a full supervision turn to confirm a wait that was already declared. pause_state_class read the declaration correctly - crew_absorb_class returns `paused` for it - and then discarded that verdict in two liveness short-circuits that returned `none` for any non-secondmate window whose agent was not `dead`. `none` routes to surface_nonterminal_stale, so handle_paused_stale, the absorber holding the long cadence, was reachable only once the agent was already dead: the healthy parked worker got surfaced and the dead one got the quiet cadence. Secondmates never showed it because both short-circuits skipped them. Liveness now decides whether the declaration still HOLDS instead of replacing the class, in one named predicate (pause_declaration_is_trustworthy): - a live agent is the normal case - it is there to end its own wait - so it is absorbed on the bounded cadence; - a confidently dead agent breaks the declaration, because nothing is left to end that wait, so it surfaces once for reconciliation and the per-hash stale suppressor plus the pause markers return it to the bounded cadence immediately; - a secondmate is unchanged: its idle endpoint is healthy by charter. `unknown` liveness keeps the declaration trusted. fm_backend_agent_alive folds an unreadable read, an ambiguous foreground process, and an unverified backend into `unknown`, so it is a gap in measurement rather than evidence the worker is gone - fm_backend_agent_state reserves confident verdicts for `alive` and `dead`/`missing` for that same reason. Reading it as death would permanently strip pause absorption from every worker on a backend that cannot answer, which is the same bug in a narrower form. Trusting it costs at most one bounded recheck per PAUSE_RESURFACE_SECS window, since that recheck remains the backstop for a trusted wait that has quietly rotted. This deliberately changes the dead-agent wake SHAPE that kunchenguid#743 introduced. A dead agent's declared pause now surfaces as a plain stale wake rather than one annotated "awaiting external ... confirm the wait still holds", which told firstmate a wait was still live for a worker that had already exited. The flood unchanged polls. Coverage drives all four liveness verdicts - alive, dead, unreadable, ambiguous - through the real tmux liveness classifier, and asserts the classification rather than wake wording: the pause is fresh under a high re-surface threshold, so the bounded cadence cannot wake, which makes a queued stale wake mean "declaration rejected" and no wake mean "absorbed". All four were proven RED against the prior code, failing in both directions. The classifier itself is unchanged, so its own portable regression (tests/fm-tmux-agent-liveness.test.sh) and live guard (tests/fm-harness-liveness-drift-live-e2e.test.sh) still own its per-harness evidence. The two multi-round loops in the exited-pause case wait 3s per absorbing round rather than the 1.5s used elsewhere in this suite. Each such round has to stay alive long enough to finish the poll that writes its markers; at 1.5s it reaps mid-poll and fails on either the wake count or the pause marker, measured 5/5 failures at 15 ticks against 5/5 passes at 30 with FM_POLL=1.
The dead-agent guarantee only held for a pane that sat perfectly still. When a
pane's content differs from the previous poll the hash counter resets, so the
two-consecutive-hash stale path is never reached and the changing-hash dispatcher
decides alone - and that dispatcher still collapsed two opposite verdicts into one
catch-all:
paused) handle_paused_stale ... ;;
*) clear_pause_tracking ... ;;
`none` there means the declaration is CONTRADICTED by a confidently dead agent,
which is the anomaly this classification exists to surface. Routing it to
clear_pause_tracking erased the pause and stale markers and queued nothing. A dead
agent's idle shell is exactly the pane most likely to churn - a clock, a
timestamped prompt, a spinner the exited agent left behind - so its hash never
repeats, this branch ran every poll, the state was cleared every poll, and
firstmate was never told the worker was gone.
That was a regression rather than a pre-existing gap. Before the liveness-trust
change this path returned `paused` for a dead agent, so a churning dead pane still
re-surfaced once per PAUSE_RESURFACE_SECS. It went from bounded-but-eventually
-surfaced to permanently silent.
The two stale dispatchers already route these three verdicts correctly, so this
brings the third into line rather than inventing a rule: clearing belongs to
`working` alone, where an authoritative run supersedes the declaration and the pane
returns to ordinary wedge tracking, while `none` surfaces. Using
surface_nonterminal_stale is what keeps the flood bound intact: it records the
`surfaced` marker, so the next poll returns `paused` and the churning dead pane
still costs exactly one wake rather than one per poll.
The regression covers both halves of the transition and was proven RED first,
failing with "dead churning declared pause was cleared instead of surfacing" while
its live half already passed, so the test discriminates rather than merely failing.
It drives a pane whose captured content differs on every read through the real tmux
liveness classifier: live and churning stays absorbed across repeated polls, then
the same window with a confirmed-dead agent surfaces once and stays quiet across
three further churning polls. The once-only bound, the dead-agent guarantee, the
unknown-is-trusted semantics, and the authoritative-working reclassification are
all still asserted by their existing tests and remain green.
The capture-failure skip and busy-state guard both exist verbatim in official upstream. Their ability to hide a declared pause is therefore a pre-existing watcher defect, not a regression introduced by this branch.\n\nComplete the triage reorder ahead of those short-circuits. A trusted live or unknown declaration now enters the bounded pause handler when capture fails, reusing the last recorded hash; capture failure itself never becomes evidence of death.\n\nReconcile an authoritative active run-step before the surfaced-marker early return. Active work can reclaim the pane and resume ordinary wedge tracking, while the surfaced marker still deduplicates a dead pane to one immediate wake.
This is architecturally the same defect as firstmate's disk-reclaim work ruled on earlier today: a pipeline step can silently drop an item while the guarantee is stated over all items. Two unrelated pieces of firstmate tooling had one flaw. The capture-failure skip and busy-state guard both exist verbatim in official upstream, so this closes a pre-existing watcher defect rather than a regression introduced by this branch. Every unique nonempty metadata-backed target now enters pane triage as an ordinary, secondmate, or AFK window. Missing metadata, empty targets, and duplicates are filtered before entry; the only in-loop exits are an explicitly logged secondmate charter absorption, a persisted pause absorption, a queued surface, or a capture-failure verdict recorded as authoritative working, trusted pause, or surfaced cannot-determine. Successful capture still records hash and count state before stale, busy, pause, or timer classification. The ordering now derives declared-pause liveness and current run-step authority before capture and busy checks can bypass them. A confirmed dead worker surfaces ahead of those guards, a current active run reclaims the pane on every poll, and failed capture is classified instead of skipped. The legacy .paused-rechecked marker no longer stores liveness trust, surface deduplication, bounded recheck decisions, or run-step authority. Pause mode persists in .paused, the once-only re-surface throttle persists in .paused-resurfaced, and all current decisions are derived during classification.
This is architecturally the same defect as firstmate's disk-reclaim work ruled on earlier today: a pipeline step can silently drop an item while the guarantee is stated over all items. Two unrelated pieces of firstmate tooling had one flaw. The capture-failure skip and busy-state guard both exist verbatim in official upstream, so this closes a pre-existing watcher defect rather than a regression introduced by this branch. The triage ordering still assigns every metadata-backed window one verdict before exit: declared-pause liveness and current run-step authority precede capture and busy guards, capture failure is classified instead of skipped, and cannot-determine surfaces. Unknown liveness remains a recorded trusted pause, while current run-step authority is derived on every classification rather than cached. The restored .paused-rechecked=surfaced token records one past act only: this death was already surfaced. That act cannot be reconstructed from current classification, unlike liveness trust, bounded cadence, or run-step authority; separating it from the shared .paused-resurfaced throttle preserves immediate death detection after scheduled wait rechecks without reintroducing the overloaded marker.
This is architecturally the same defect as firstmate's disk-reclaim work: a pipeline step could silently drop an item under a guarantee stated over all items. Two unrelated pieces of firstmate tooling had the same flaw. The capture-failure skip and busy-state guard both exist verbatim in official upstream, so the triage reorder closes a pre-existing watcher defect rather than a regression introduced by this branch. The reorder derives current run-step authority before capture and busy short-circuits, then records one verdict for every window instead of letting either guard drop it. The restored death-surface fact records a past act, not a derivable verdict. A confirmed alive read ends that death episode and clears only that fact; unknown leaves it untouched, so liveness trust, recheck caching, and run-step authority remain derived rather than stored on the marker.
This is architecturally the same defect as firstmate's disk-reclaim work: a pipeline step could silently drop an item under a guarantee stated over all items. Two unrelated pieces of firstmate tooling had the same flaw, and placing the episode reset inside a classifier that not every poll reaches repeated it one level down. The capture-failure skip and busy-state guard both exist verbatim in official upstream, so the triage reorder closes a pre-existing watcher defect rather than a regression introduced by this branch. The reorder derives current liveness and run-step authority before capture and busy short-circuits, then records one verdict for every window instead of letting either guard drop it. The death-surface token records a past act, not a derivable verdict. The shared preflight now uses its confident alive verdict to end that death episode immediately on every path; unknown leaves the token untouched, so liveness trust, recheck caching, and run-step authority remain derived rather than stored on the marker.
… budget The declared-pause tests added by this branch pushed the portable serial shard that carries them from 10m55s to 15m19s against a 15-minute limit, so CI cancelled it. This takes back the part of that cost which was buying nothing, and only that part. `wait_live` proves a negative: it burns its whole budget to show the watcher is still alive at the end of it. Every absorbing round therefore paid a fixed 3s even when the state it was really waiting for had landed in milliseconds. The live phase of the churning-pane test now waits for the pane's recorded hash to advance instead, which a churning pane rewrites on every poll. That returns as soon as one poll completes, and it asserts strictly more than the wait it replaces: that a poll actually happened, rather than only that the process had not exited. The dead-agent phase of the same test keeps its bounded liveness wait, and that is deliberate. A dead, already-surfaced pause absorbs cheaply and writes no new artifact - that cheapness is the once-only guarantee working - so there is nothing to observe completing. The same conversion was tried there, failed with "never completed a poll", and was reverted. The reason is recorded in the test so a later reader does not re-optimise it into asserting less than it does now. What is established: that one test drops from 32s to 18s in-suite, a 14s reduction, with a stronger assertion than before. What is NOT claimable, and is stated here so nobody infers it from the diff: a suite-level saving. Across the two measured runs, with only that one test changed, the suite moved 299s to 315s. Run-to-run spread of roughly 16s exceeds the 14s saving, so a single pair of measurements cannot establish a suite delta in either direction, and the nominal increase is noise rather than evidence of a slowdown. Resolving an effect that small against that noise floor would need several runs per side. The shard limit is deliberately not raised and the shard partition is deliberately not rebalanced here. Shard 3 was already at 13m02s before this branch existed, so the imbalance is not this change's defect, and correcting it belongs in its own work rather than bundled into this validation.
The capture-failure skip and busy-state guard both exist verbatim in official upstream, so this branch closes a pre-existing watcher defect rather than a regression it introduced. Declared-pause liveness reconciliation and authoritative run-step state now run before the capture and busy short-circuits, and no window leaves triage without exactly one recorded verdict. This is architecturally the same defect as Firstmate's disk-reclaim work: a pipeline step could silently drop an item while the guarantee was stated over all items. The tools are unrelated, but the flaw is shared, so future work can recognize the pattern instead of rediscovering it. The restored death-surface record stores a past ACT rather than caching a derivable verdict, so it does not reintroduce the overloaded marker removed by the restructure.
tiago-peixoto
force-pushed
the
fm/firstmate-declared-pause-not-absorbed-r2
branch
from
August 20, 2026 12:50
e1b8058 to
8d1aa9f
Compare
This was referenced Aug 21, 2026
Contributor
Author
|
Closing this pre-issue implementation so the confirmed behavior and any fresh implementation can proceed from #2713. That issue is now the authoritative discussion surface and is marked ready-for-pr. |
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
Fix an inverted safety check in bin/fm-watch.sh: healthy workers parked on a declared wait are woken every cycle, while dead ones get the quiet long cadence. It is exactly backwards, and it has been costing a full supervision turn per false alarm since at least 2026-08-12 (six spurious stale wakes across four correctly parked tasks in roughly forty minutes).
The diagnosis was handed over already done, to VERIFY rather than repeat. pause_state_class reads the status log correctly - crew_absorb_class returns
pausedfor a worker with a declaredpaused:line - and that verdict is then thrown away by two liveness short-circuits that both returnnone: one when.paused-<key>exists and the recheck marker is fresh, and one unconditionally, in each case for a non-secondmate window whose agent is notdead. The dispatcher routesnoneto surface_nonterminal_stale, which emits the bare unannotatedstale: <win>and then writes.paused-<key>,.paused-rechecked-<key>and.paused-resurfaced-<key>. Consequence: handle_paused_stale, the absorber holding the long PAUSE_RESURFACE_SECS cadence, was reachable for a non-secondmate worker ONLY when its agent was dead. Secondmates escaped entirely because both short-circuits were gated on window_kind != secondmate. This was verified against the code before changing it, and traced to its origin: PR #743 added the inversion in a review-fix commit titled "Gate pause suppression on confirmed agent death".Intended behaviour, as specified: liveness decides whether a declared pause is TRUSTWORTHY, not what the class is. A live agent on a declared pause is the normal healthy case and belongs in handle_paused_stale, absorbed on the long cadence. A dead agent on a declared pause is the anomaly - the pause can no longer be true, because nothing is left to end it - and deserves the immediate surface. The existing re-surface throttle is kept so a genuinely long wait still gets rechecked periodically; the goal is to stop the per-cycle churn, not to make firstmate blind to a wait that has gone stale.
An explicitly assigned open question was what
unknownshould mean, since fm_backend_agent_alive can return it and textually it took the same!= deadbranch as a live agent. DECISION MADE DELIBERATELY:unknownkeeps the declaration trusted, same asalive. fm_backend_agent_alive folds an unreadable read, an ambiguous foreground process, and an unverified backend intounknown, so it is a gap in measurement rather than evidence the worker is gone; fm_backend_agent_state reserves confident verdicts foraliveanddead/missingfor that same reason. Readingunknownas death would permanently strip pause absorption from every worker on a backend that cannot answer, which is the same bug in a narrower form, while trusting it costs at most one bounded recheck per PAUSE_RESURFACE_SECS window because that recheck remains the backstop. This decision is justified in the commit message, as required.This change DELIBERATELY overturns part of PR #743's tested guarantee, and that is intended, not an oversight. A dead agent's declared pause now surfaces as a plain stale wake instead of the annotated "awaiting external ... confirm the wait still holds" recheck, because that annotation told firstmate a wait was still live for a worker that had already exited. The flood #743 actually fixed is preserved and still asserted: exactly one wake across six unchanged polls, since the per-hash stale suppressor and the pause markers take over the moment the first surface lands. Two of #743's assertions (
bare -eq 0and the "awaiting external" grep for the dead-agent cases) were rewritten because they encoded the inversion, and the pre-existingalive-decision-gatesub-case, which asserted that a live parked worker must surface immediately, was replaced by the correct contract. This matches the fix shape recorded independently in the fleet backlog entry for this task, which asks for exactly this live/dead split including the immediate bare surface for a dead agent.Test approach was specified and followed: the regression was written FIRST and proven RED against the prior HEAD, and it can fail in both directions. All four liveness verdicts - alive, dead, unreadable, ambiguous - are driven through the real tmux liveness classifier via the existing fake-tmux fixture (pane commands grok, zsh, node and empty resolve to alive, dead, ambiguous and unreadable respectively), and both
unknownsources are exercised so neither one alone carries the verdict. Assertions are on the classification's observable effects rather than on wake wording, as required: the pause is fresh under a high re-surface threshold, so the bounded cadence cannot wake at all, which makes a queued stale wake mean "declaration rejected" and no wake mean "absorbed". Existing fixtures whose scenarios describe a LIVE parked worker but usedzshas the pane command (a dead-agent read, which only passed before because dead was the absorbing path) were switched to an agent command so they model what they claim; that is a fixture correction, not a weakened assertion. Aqueued_stale_wakestest helper was added because an absorbed cycle never creates the wake-queue file, so a raw awk over it errored instead of counting zero.Scope was constrained to bin/fm-watch.sh and its tests, with an explicit instruction not to redesign the watcher, add a config knob, introduce a new state file, or build a wrapper. The fix is the inversion of two conditions, extracted into one named predicate (pause_declaration_is_trustworthy) so the duplicated liveness read has a single owner; the now-dead
class = none && agent dead -> pausedpromotion collapsed into the trusted path. No config knob, no new state file, no wrapper, no redesign. Two owners outside bin/fm-watch.sh were updated because they stated the now-inverted policy in prose: docs/architecture.md's watcher paragraph, and a comment in bin/fm-classify-lib.sh which restated the watcher's liveness policy - that restatement was removed rather than corrected, so the policy keeps one owner (the firstmate repo's one-owner rule for contracts).The tmux liveness classifier itself is unchanged, so its existing portable regression (tests/fm-tmux-agent-liveness.test.sh) and its opt-in live guard (tests/fm-harness-liveness-drift-live-e2e.test.sh) still own its per-harness evidence; no verification record needed refreshing.
The fleet backlog entry for this task was deliberately NOT edited: the shipped behaviour matches the fix shape its body records, and that file is private fleet state outside this repository's tracked surface.
Constraints observed while editing: this is the firstmate repo's own shared tracked material, so the repo's coding guidelines were loaded first and applied - one sentence per physical line in tracked Markdown, plain dashes rather than em dashes, no agent co-author on the commit, shellcheck-clean bin scripts via bin/fm-lint.sh, and tests colocated in tests/ extending the existing suite rather than a new runner. bin/fm-lint.sh and bin/fm-doc-audience-check.sh both pass, and all fifteen suites selected by bin/fm-test-run.sh --changed are green.
RE-SCAFFOLD, 2026-08-18, captain ruling. An earlier validation of this same change parked at the rebase gate because the branch was based on the personal fork's main, which carries 35 commits absent from official upstream; rebasing would have bundled that unrelated fork divergence (65 files) into the upstream pull request. The base was a briefing error, not a defect in the change. The captain ruled: re-scaffold from upstream/main. That earlier run was aborted through the supported abort command and confirmed cancelled, and this branch was rebuilt at upstream/main (d843712) carrying exactly the original commit's content and nothing else; the original commit is preserved on a keep ref. bin/fm-watch.sh and bin/fm-classify-lib.sh are byte-identical to the already-validated original, because those two files were identical between upstream and fork main. The conflicting test hunk was resolved to this change's own content, and the fork-only test-harness edits it sat next to (a raised wait budget, an extra queue assertion, a bounded reap helper, a heartbeat polling loop) were deliberately NOT carried across, so this pull request contains only this fix.
Every piece of evidence was re-established on the new base rather than assumed to carry over: all four liveness verdicts were re-proven RED against upstream/main's watcher, failing in both directions, and the full triage suite passes on the new base.
One deliberate test-timing decision: the two multi-round loops in the exited-pause case wait 3s per absorbing round rather than the 1.5s used elsewhere in that suite. Each absorbing round must stay alive long enough to finish the poll that writes its markers; measured on this base, 15 ticks failed 5/5 in isolation while 30 passed 5/5, and the two new tests then passed 13/13 across repeated runs. That value was chosen from measurement on this base, not copied from the fork.
Known pre-existing failure that is NOT part of this change and must not be attributed to it: tests/fm-wake-queue.test.sh fails on stock macOS Bash 3.2 with "a subshell reclaimed its parent's live hold", both with and without this change, verified by running it on a clean upstream/main checkout. Stock macOS Bash has no BASHPID, so${BASHPID:-$ $} falls back to $$, which a subshell inherits unchanged, and fm_lock_try_acquire's holder check therefore misfires; the personal fork already carries a BASH_SUBSHELL guard for it. It is deliberately excluded here because importing that fix would bundle fork divergence into this upstream pull request, which is exactly what the re-scaffold was ordered to prevent. It does not affect this repository's CI: the Linux jobs run a Bash with BASHPID, and the required stock-macOS job runs only a parse sweep plus the fleet-snapshot and Bearings suites, which were verified locally under /bin/bash 3.2.57 at their exact expected counts of 15 and 41, with all three changed files parsing cleanly under that shell.
FOLLOW-UP FIX, 2026-08-19, captain ruling. Fork integration review found a real defect in this change and the captain ruled it must be fixed here, on this pull request, because this is the live review artifact. The dead-agent guarantee only held for a pane that sat perfectly still. When a pane's content differs from the previous poll the hash counter resets, so the two-consecutive-hash stale path is never reached and the changing-hash dispatcher decides alone, and that dispatcher still collapsed
workingandnoneinto a single clear_pause_tracking catch-all. A confidently dead agent therefore had its pause and stale markers erased every poll with no wake queued, and a dead agent's idle shell is exactly the pane most likely to churn - a clock, a timestamped prompt, a spinner the exited agent left behind - so its hash never repeats and firstmate was never told the worker was gone.This was a regression introduced by this change rather than a pre-existing gap: before it, that path returned
pausedfor a dead agent, so a churning dead pane still re-surfaced once per PAUSE_RESURFACE_SECS. It went from bounded-but-eventually-surfaced to permanently silent, which is strictly worse than the behaviour being replaced.The fix brings the third dispatcher into line with the two that review already corrected, rather than inventing a new rule: clearing is reserved for
working, where an authoritative run supersedes the declaration and the pane returns to ordinary wedge tracking, andnoneroutes to surface_nonterminal_stale. That target is what keeps the flood bound intact, because it records thesurfacedmarker, so the next poll returnspausedand a churning dead pane still costs exactly one wake rather than one per poll.The regression was proven RED first and fails for its stated reason rather than by timing: "dead churning declared pause was cleared instead of surfacing", while its live half already passed, so the test discriminates. It drives a pane whose captured content differs on every read through the real tmux liveness classifier, asserts that live and churning stays absorbed across repeated polls, then that the same window with a confirmed-dead agent surfaces exactly once and stays quiet across three further churning polls. The once-only flood bound, the dead-agent guarantee, the unknown-is-trusted semantics, and the authoritative-working reclassification all remain asserted by their existing tests and green, the full watcher triage suite passes with 53 tests, and bin/fm-lint.sh is now fully clean including pinned actionlint workflow lint.
TRIAGE REORDER STAGE, 2026-08-19, captain ruling. Review found that the dead-agent guarantee was still bypassable by two short-circuits that both exist verbatim in official upstream: the capture-failure skip, which can leave a dead worker holding a declared wait silent indefinitely because nothing revisits a window whose terminal window is gone, and the busy_now guard, which delays the same reconciliation behind wedge timing because the busy classifier does not probe process state. The captain ruled to take the finding's own remedy and accept the triage reordering, explicitly relaxing this task's standing no-redesign constraint for that one concrete reorder and nothing wider, and he required the absolute dead-agent wording to stay while the code is made true to it rather than the statement being weakened.
The current head carries the first half of that reorder. Three review findings against it remain open and must be closed: the preflight covers only a confidently dead agent, so a declared pause whose agent reads alive or unknown still falls through the capture-failure skip and can go silent indefinitely with its bounded cadence never running; the surfaced early return skips authoritative run-step reconciliation, so an active run starting later while the append-only status still reads paused is never reconciled; and the commit history must state that both bypasses are pre-existing upstream defects rather than regressions from this branch, and must explain what the reordering changes about triage order.
That last requirement must be satisfied by the message of a NEW commit. An earlier attempt at this stage failed because the required explanation was added by amending an already-recorded pipeline commit, which the gate correctly refused as an out-of-band rewrite that would have lost the reviewed change. Nothing may amend, reset, or replace an existing commit on this branch.
The reorder's own new regression does not yet pass, so completing it is part of this stage rather than a separate concern. Acceptance is unchanged and every existing guarantee must stay green and be re-run rather than assumed: the once-only flood bound, the dead-agent guarantee on every path including a missing terminal window and a stale busy record, the unknown-is-trusted classification with its bounded-recheck caching, the authoritative-working reclassification, and the changing-hash live-to-dead regression. A failed capture must never be read as death; only a confident dead or missing liveness verdict may invalidate a declaration, and a live or unknown agent must stay absorbed on every newly reachable path so healthy parked workers are not turned back into per-cycle wakes.
TEST COST TAKEBACK, 2026-08-19. CI on the previous head executed once a maintainer released the fork-approval gate, and it carried real information: one shard failed and a second was cancelled. Both were diagnosed separately rather than assumed related. The failure, "concurrent watcher never saw complete poll" in tests/fm-pr-check-security.test.sh, was caused by this change and legitimately so: that fixture never provided a tmux fake, so capture failed and the window was silently DROPPED under the old loop, and totality now records a verdict and surfaces it, so the watcher exits before completing its poll. The test encoded the old broken behaviour as its expectation. It was fixed by giving the fixture the tmux fake it never had so capture succeeds, leaving its merged assertion untouched; the totality guarantee was NOT weakened to make an old test pass. The cancelled shard was independent of that failure - the shard matrix sets fail-fast: false, proven directly because a sibling shard kept running after the failure and passed - and was a timeout at 15m19s against a 15-minute limit, caused by this branch's added tests growing that shard's runtime.
That growth was split into inherent cost and accidental waste before anything was changed. The waste was the fixed-budget liveness wait, which burns its whole budget to prove a negative; the live phase of the churning-pane test now waits for the pane's recorded hash to advance, returning as soon as a poll completes and asserting strictly more than before. The same conversion was attempted on that test's dead-agent phase and reverted, because a dead already-surfaced pause absorbs cheaply and writes no artifact by design, so there is nothing to observe completing and a bounded liveness wait is the honest instrument; the reason is recorded in the test. The established result is a per-test reduction from 32s to 18s in-suite. A suite-level saving is deliberately NOT claimed: across two runs with only that test changed the suite moved 299s to 315s, so run-to-run spread exceeded the saving and a single pair of measurements cannot establish a delta in either direction. The shard limit was deliberately not raised and the shard partition deliberately not rebalanced, because shard 3 was already at 13m02s before this branch existed, making that imbalance a separate concern rather than this change's defect.
What Changed
Risk Assessment
✅ Low: Captain, the source fixes remain intact and the new forward-only empty-tree commit satisfies every required history explanation without rewriting prior commits or changing behavior.
Testing
Baseline commit/diff inspection confirmed the tested tree matches the assigned target; four focused suites passed, and end-to-end watcher evidence demonstrated trusted live/unknown pauses, one immediate notification for confirmed death, and no repeated notification, with both logs saved and no transient worktree files remaining.
Evidence: Targeted automated tests
All four targeted suites passed with zero failures.Evidence: Declared-pause end-to-end evidence
Live, ambiguous, and unreadable agents queued no notification; confirmed death queued one bare stale notification, then none on the repeat poll.Pipeline
Updates from git push no-mistakes
✅ **intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
🔧 **Review** - 2 issues found → auto-fixed (2) ✅
bin/fm-watch.sh:1068- The intent requires authoritative run-step reconciliation before the busy guard and says an active run supersedes the older pause. This preflight calls pause_state_class only for dead liveness; alive/unknown skips it, while a dead+working verdict merely clears markers and falls through. A successfully captured, busy, over-age pane then reaches busy_turn_bound_check, which trusts the stale paused status and restores pause cadence instead of wedge tracking. Derive pause class for every declaration and carry a working verdict through the busy-bound decision.bin/fm-watch.sh:1096- The intent requires “every existing guarantee must stay green,” but the new working capture-failure arm absorbs even when .afk exists. This contradicts the established away-mode contract that every notification is queued for daemon-owned classification and that the watcher skips provably-working reads. Check AFK before capture-failure classification and hand off a plain stale notification rather than absorbing it; update the new afk-working fixture accordingly.🔧 Fix: Captain, fix active-run and AFK pause triage
1 error still open:
🔧 Fix: Add empty forward commit documenting triage rationale
✅ Re-checked - no issues remain.
✅ **Test** - passed
✅ No issues found.
bin/fm-test-run.sh tests/fm-watch-triage.test.sh tests/fm-watch-arm.test.sh tests/fm-pr-check-security.test.sh tests/fm-tmux-agent-liveness.test.shTemporary evidence harness:bash .manual-pause-evidence.shgit diff --quiet 3e350096dbcc428f9329227f67d81c7090e82b32..HEADDurable queue-row verification withawk -F '\t' ... pause-liveness-e2e.txtgit status --porcelain=v1 --untracked-files=all✅ **Document** - passed
✅ No issues found.
✅ **Lint** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.