Repository navigation
fix(bin): re-arm after an abandoned auto-arm claim and defer a wedge escalation while a worktree is written - #2524
Conversation
d164ac2 to
b3d8759
Compare
b3d8759 to
35d0dab
Compare
A Claude auto-arm cycle that armed, delivered one rewake, and exited left its single-flight lock behind. Both Stop-event participants then deferred to that lock forever, because its recorded pid was still live: the turn-end guard read it as recovery under way and allowed the stop, and the next Stop firing treated it as another owner and declined to arm. On 2026-08-14 a home with two tasks in flight lost supervision for about 40 minutes with no watcher process and no watcher lock, its beacon frozen at the one delivery, and both crewmates' finished reports sat in the durable queue until an operator drained it by hand. Abandonment is now proven from the epoch ledger instead of inferred from pid liveness. A lock whose holder pid matches the ledger's own owner_pid while the recorded outcome is anything other than arming has already finished its decision, so that claim is reclaimed under the lock's steal mutex, stops counting as recovery ownership in the guard, and is cleared by the guard's terminal check rather than deferred to. A failed clear re-blocks instead of allowing a blind stop, and an arming entry stays in flight however old it is, because its owner foregrounds the arm for the whole watcher cycle. Issue kunchenguid#2251's PR kunchenguid#2263 does not cover this failure. It is closed and unmerged, lives entirely in bin/fm-watch-arm.sh, and retires the stalled watcher and matching stale watcher lock of an arm that is currently running. Here no arm and no watcher were running and no watcher lock existed, so it has nothing to retire and the home stays blind. tests/fm-claude-stop-autoarm.test.sh covers the reclaim, the still-arming and unnamed-owner cases that must keep the gate closed, and the failed clear. tests/fm-turnend-guard.test.sh covers the guard side of the same boundary. Both fail without this change.
The wedge detector had two inputs, rendered pane quietness and the run step, and neither can see a crew that is writing source, then tests, then documentation behind a static pane. On 2026-08-14 one crewmate produced eight consecutive possible-wedge escalations in a single afternoon, three of them demanding deep inspection, while it was demonstrably working and then committed. Every one of them cost a supervision turn to disprove by hand. Add write activity inside the crew's own recorded worktree as a third liveness input. crew_worktree_written_since compares the worktree against the caller's existing idle-window timer file, so -newer needs no clock arithmetic, no temp file, and no portable mtime write. The probe runs only inside the branch that was about to escalate, which bounds it to one pruned, depth-bounded walk per window per FM_STALE_ESCALATE_SECS and leaves the per-poll stale sweep exactly as cheap as before. Positive evidence defers rather than cancels. The idle timer restarts so the next window probes again, the escalation counter is neither advanced nor reset so a later genuine wedge keeps the demand-deep-inspection history it earned, and a .writing-since marker ages the whole deferral chain so the pane still re-surfaces once per FM_PAUSE_RESURFACE_SECS, through the same throttle shape a declared pause already uses, labeled as a recheck rather than a wedge. This can only reduce false positives: every absence of evidence, including no recorded worktree, a torn-down worktree, a missing anchor, and a failed walk, falls through to the unchanged escalation schedule, so a crew that writes nothing still escalates on the existing timetable. What the signal cannot see, by design or by construction: - CPU burn with no writes, such as a long compaction, is invisible. That case keeps the old behavior exactly. - A commit-only phase writes only .git, which is pruned first so that firstmate's own read-only git commands against the worktree can never make the probe self-fulfilling. - Writes under the pruned generated trees, or deeper than FM_WORKTREE_WRITE_MAXDEPTH, do not count. - The probe cannot attribute a write to the crew, so a background build or another process touching the tree looks the same. The hourly re-surface is what bounds that, and a churny file cannot buy silence. - The away-mode daemon's own escalation path is deliberately untouched. tests/fm-watch-triage.test.sh covers the classifier including the .git prune, both halves of the live case on one fixture (quiet plus writing defers, quiet plus silent still escalates and counts), and the bounded re-surface. All three fail without this change.
…ned auto-arm claims
Two consistency gaps in the worktree write probe, both found while reviewing the wedge-deferral change on this branch. A write deferral is a bounded chain: its .writing-since marker ages the whole chain so a churning worktree still re-surfaces once per resurface window. That is only sound while the chain belongs to the current quiet stretch, so every path that restarts the idle-window timer has to drop it too. Two did not: the corrupt-timer repair in wedge_timer_check, and both first-sight branches for a captain-relevant status. A chain left over from an earlier quiet stretch made the first deferral of the new window re-surface immediately instead of after a full fresh window. FM_WORKTREE_WRITE_PRUNE is a skip list, so clearing it reads as "skip nothing" and is the obvious way to widen the probe to the whole depth-bounded tree. Instead an empty list reported no evidence at all, quietly costing the wedge detector its third liveness input on a home that meant to widen the walk. An empty list now widens the walk, and the header says so. Neither change alters when a stall that writes nothing escalates. Regressions in tests/fm-watch-triage.test.sh cover all three paths and each one fails on the pre-fix code.
35d0dab to
52f0753
Compare
|
Speaking as Kun's firstmate: Corrective — abandoned auto-arm claims now re-arm via pid-identity, and a writing worktree defers (does not cancel) a wedge with a bounded re-surface. I reviewed the full diff on current HEAD |
|
Ready for a maintainer when you have a moment. This one is complete on our side with all checks green. Nothing further is pending from this fork. |
|
Speaking as Kun's firstmate: Corrective — abandoned auto-arm claims re-arm via pid-identity, and a writing worktree defers (does not cancel) a wedge with a bounded re-surface. HEAD is still |
kunchenguid
left a comment
There was a problem hiding this comment.
Speaking as Kun's firstmate: reviewed the full thread and diff. Corrective re-arm after abandoned auto-arm and bounded write-probe deferral. Green CI including no-mistakes. #2744 has landed, this remains MERGEABLE. Approving to land.
|
Speaking as Kun's firstmate: this is merged. Thank you @Inthuson — really appreciate you taking the time on this. |
…nt (#167) * fix(bearings): restore decision options and add close controls (kunchenguid#2707) * fix(bearings): always show decision options and a close/drop control Freeform-only Captain's Call cards hid the option buttons the board was designed around, and there was no way to drop a stale hold without inventing an answer. Require selectable options, keep freeform as a supplement, and route the reserved __drop__ answer through decline so the hold leaves Captain's Call. * no-mistakes(review): Fix drop closure and decision-only option validation * no-mistakes(review): Preserve answerability for non-decision cards * no-mistakes(document): Clarify decision drop documentation * ci: require no-mistakes pipeline step attestation (kunchenguid#2710) Signature-only PRs can hide skipped review, test, or document steps. Fail unless no-mistakes >= 1.46.0 attests those three steps completed. * feat: collapse decisions into tasks held for the captain (kunchenguid#2728) * feat(captain-hold): collapse the decisions concept into tasks held for the captain A decision is no longer a separate type: it is an ordinary backlog task held for the captain, identified by its task id. bin/fm-captain-hold.sh owns the surviving behaviors - guarded hold creation, the recorded-answer close (answer/answers with a release mode for captain-gated work), the source bindings, and the investigation completion gate - and bin/fm-decision-hold.sh becomes a one-release compatibility shim over it. The fleet snapshot now parses hold-until and computes captain_actionable as queued + captain-held + unblocked + due, independent of row kind, plus a presentation-only deferred_marker for prose-deferred rows. Bearings renders every due captain-held task in Captain's Call, date-deferred holds as dated Charted Next gates, suppresses prose-deferred rows from default views with an omitted disclosure, and excludes from Recently Landed anything that closed while still held for the captain. Legacy compatibility: pre-collapse <origin>-decision-<key> rows are already plain task ids and keep working; short keys in recorded metadata, concrete origin bindings, chat --resolve-key fallbacks, and old resolution records all resolve in place. * no-mistakes(review): Fix captain answer replay and body preservation * no-mistakes(review): Fix captain hold idempotency and legacy replay * no-mistakes(review): Validate card close modes and compatibility routing * no-mistakes(review): Enforce release replay mode matching * no-mistakes(review): Prevent duplicate decision cards and released replay mismatches * no-mistakes(review): Preserve answer columns and legacy resolve replays * no-mistakes(document): Document strict replay and legacy compatibility * no-mistakes(lint): Quote done literals to satisfy ShellCheck * no-mistakes: apply CI fixes * fix(rebase): keep collapsed captain hold board semantics * fix: bound recovery announcements and preserve supervision (kunchenguid#2733) * fix(watch): announce recovery once per generation and keep successors supervising A lost Pi/OpenCode handling handshake re-announced the same recovery generation on every cycle and spent the successor's first ~55s blind, so a real crew event could be ignored and then dropped. Record the announcement in the durable marker, confirm the handshake before the follow-up without swallowing failure, and enter the poll loop immediately. * no-mistakes(review): Tighten recovery event timing regression * no-mistakes(document): Document recovery-loop supervision guarantees * fix(bin): surface captain-call record divergence (kunchenguid#2744) * fix(bin): signal a captain call resolved in the log but still held A captain call has two records and closing one has never closed the other: a `resolved [key=...]` line closes the status-log fold, while the backlog task held for the captain closes only through `fm-captain-hold.sh answer`. Answering on the status side alone left no trace of the disagreement - the fold went quiet, the durable record kept saying the captain owed an answer, and nothing warned. The defect was never the separation; it was the silence. Add `fm-captain-hold.sh diverged`, a read-only report of that contradiction, and print it from `fm-wake-drain.sh` as a bounded RECORD DIVERGENCE section beside OPEN DECISIONS on every drain. It flags one condition: a task still open and still carrying the captain-hold annotations whose key was closed on the status side by the resolve verb, under the collapsed identity or the legacy derived one. It closes nothing, ever. A captain call closed wrongly leaves review entirely, which is worse than the noise, so both reconciliation directions stay human-owned and the printed hint names both - a resolution is not proof the captain ruled, since a call can dissolve on a false premise or turn out to have been a question of fact. Three states are deliberately not divergence: a `captain-held` close is the verified transfer `complete` writes, a still-open keyed decision belongs to the OPEN DECISIONS fold, and a captain call with no routed work item is legitimate rather than incomplete, so routed work is no part of the test. `fm-classify-lib.sh` gains `status_key_closing_verb`, which reports how the status side currently reads one key by replaying the existing `_fm_decision_fold_line` rule rather than re-deriving it, so the two closing verbs stay distinguishable in one place. The per-wake cost is one `tasks-axi list`, one key scan per status log, and the precise per-key fold only for a key that already names a still-open task; the call is hard-bounded so a slow backlog tool can never delay wake presentation. * fix(document): Correct divergence lifecycle documentation * fix(document): Neutralize divergence lifecycle prose * fix(bin): re-arm after an abandoned auto-arm claim and defer a wedge escalation while a worktree is written (kunchenguid#2524) * fix(watch): re-arm supervision after an abandoned auto-arm claim A Claude auto-arm cycle that armed, delivered one rewake, and exited left its single-flight lock behind. Both Stop-event participants then deferred to that lock forever, because its recorded pid was still live: the turn-end guard read it as recovery under way and allowed the stop, and the next Stop firing treated it as another owner and declined to arm. On 2026-08-14 a home with two tasks in flight lost supervision for about 40 minutes with no watcher process and no watcher lock, its beacon frozen at the one delivery, and both crewmates' finished reports sat in the durable queue until an operator drained it by hand. Abandonment is now proven from the epoch ledger instead of inferred from pid liveness. A lock whose holder pid matches the ledger's own owner_pid while the recorded outcome is anything other than arming has already finished its decision, so that claim is reclaimed under the lock's steal mutex, stops counting as recovery ownership in the guard, and is cleared by the guard's terminal check rather than deferred to. A failed clear re-blocks instead of allowing a blind stop, and an arming entry stays in flight however old it is, because its owner foregrounds the arm for the whole watcher cycle. Issue kunchenguid#2251's PR kunchenguid#2263 does not cover this failure. It is closed and unmerged, lives entirely in bin/fm-watch-arm.sh, and retires the stalled watcher and matching stale watcher lock of an arm that is currently running. Here no arm and no watcher were running and no watcher lock existed, so it has nothing to retire and the home stays blind. tests/fm-claude-stop-autoarm.test.sh covers the reclaim, the still-arming and unnamed-owner cases that must keep the gate closed, and the failed clear. tests/fm-turnend-guard.test.sh covers the guard side of the same boundary. Both fail without this change. * fix(watch): defer a wedge escalation while the task worktree is written The wedge detector had two inputs, rendered pane quietness and the run step, and neither can see a crew that is writing source, then tests, then documentation behind a static pane. On 2026-08-14 one crewmate produced eight consecutive possible-wedge escalations in a single afternoon, three of them demanding deep inspection, while it was demonstrably working and then committed. Every one of them cost a supervision turn to disprove by hand. Add write activity inside the crew's own recorded worktree as a third liveness input. crew_worktree_written_since compares the worktree against the caller's existing idle-window timer file, so -newer needs no clock arithmetic, no temp file, and no portable mtime write. The probe runs only inside the branch that was about to escalate, which bounds it to one pruned, depth-bounded walk per window per FM_STALE_ESCALATE_SECS and leaves the per-poll stale sweep exactly as cheap as before. Positive evidence defers rather than cancels. The idle timer restarts so the next window probes again, the escalation counter is neither advanced nor reset so a later genuine wedge keeps the demand-deep-inspection history it earned, and a .writing-since marker ages the whole deferral chain so the pane still re-surfaces once per FM_PAUSE_RESURFACE_SECS, through the same throttle shape a declared pause already uses, labeled as a recheck rather than a wedge. This can only reduce false positives: every absence of evidence, including no recorded worktree, a torn-down worktree, a missing anchor, and a failed walk, falls through to the unchanged escalation schedule, so a crew that writes nothing still escalates on the existing timetable. What the signal cannot see, by design or by construction: - CPU burn with no writes, such as a long compaction, is invisible. That case keeps the old behavior exactly. - A commit-only phase writes only .git, which is pruned first so that firstmate's own read-only git commands against the worktree can never make the probe self-fulfilling. - Writes under the pruned generated trees, or deeper than FM_WORKTREE_WRITE_MAXDEPTH, do not count. - The probe cannot attribute a write to the crew, so a background build or another process touching the tree looks the same. The hourly re-surface is what bounds that, and a churny file cannot buy silence. - The away-mode daemon's own escalation path is deliberately untouched. tests/fm-watch-triage.test.sh covers the classifier including the .git prune, both halves of the live case on one fixture (quiet plus writing defers, quiet plus silent still escalates and counts), and the bounded re-surface. All three fail without this change. * no-mistakes(review): prove autoarm claims by identity; skip mate-home write probe * no-mistakes(document): document away-mode wedge boundary and probe filesystem limit * no-mistakes(document): qualify turn-end recovery condition for abandoned auto-arm claims * fix(watch): keep a write deferral scoped to its own idle window Two consistency gaps in the worktree write probe, both found while reviewing the wedge-deferral change on this branch. A write deferral is a bounded chain: its .writing-since marker ages the whole chain so a churning worktree still re-surfaces once per resurface window. That is only sound while the chain belongs to the current quiet stretch, so every path that restarts the idle-window timer has to drop it too. Two did not: the corrupt-timer repair in wedge_timer_check, and both first-sight branches for a captain-relevant status. A chain left over from an earlier quiet stretch made the first deferral of the new window re-surface immediately instead of after a full fresh window. FM_WORKTREE_WRITE_PRUNE is a skip list, so clearing it reads as "skip nothing" and is the obvious way to widen the probe to the whole depth-bounded tree. Instead an empty list reported no evidence at all, quietly costing the wedge detector its third liveness input on a home that meant to widen the walk. An empty list now widens the walk, and the header says so. Neither change alters when a stall that writes nothing escalates. Regressions in tests/fm-watch-triage.test.sh cover all three paths and each one fails on the pre-fix code. * no-mistakes(review): honor an empty write-prune, bound the probe, share window_key * no-mistakes(document): align probe knob count and guard regression-coverage ownership * no-mistakes(lint): silence deliberate single-quote SC2016 in write-prune env test * fix(bin): land local-only dirt that is already the target tip's content fm-merge-local.sh refused any dirty checkout, which deadlocked the case where the dirt IS what the merge would write: a generator that re-runs locally and reproduces bytes the task branch already contains. The refusal was unresolvable because landing the branch was the thing that would have cleaned it. Allow the fast-forward when every dirty path is provably the tip's own content. A throwaway index seeded from the tip, refreshed against the working tree, is what proves it, so content filters, symlinks, and file mode are judged by git rather than by a filename or timestamp heuristic. Staging must also lose nothing: a path's index entry has to be HEAD's or the tip's, never a third version. Only then are those paths staged, after the diverged-branch check, so the merge sees a consistent tree and writes no byte that is not already on disk. Every other dirty checkout refuses exactly as before: one differing byte, a different staged version, a different file mode, a local deletion, an untracked path the tip does not carry, and anything the tip holds as a directory or submodule pointer. tests/fm-merge-local.test.sh covers both directions, including the reproduction that fails on the previous code. --------- Co-authored-by: Kun Chen <[email protected]> Co-authored-by: Mickaël Rémond <[email protected]> Co-authored-by: Inthuson <[email protected]> Co-authored-by: QuinnBot <[email protected]>
Intent
Fix two live supervision defects in firstmate's own tooling that the captain hit during a real fleet incident.
Defect 1: a lapsed monitoring chain never re-armed. The auto-arm claim under state/.claude-autoarm.lock could be left behind by an owner that died, and the ledger reasoning on its own could not tell an abandoned claim from a live one, so the chain stayed down. The fix records a pid-identity file inside the claim directory, so an identity mismatch is abandonment proof by itself. The captain decided this explicitly at the review gate (finding autoarm-abandonment-ledger-only): FIX it now and add the pid-identity file, with the scope increase authorized. The existing ledger reasoning stays untouched rather than being replaced.
Defect 2: the wedge detector escalated a crewmate that was demonstrably writing code. The fix adds a bounded, pruned, depth-limited worktree write probe (crew_worktree_written_since) as a third liveness input, consulted only at the moment an escalation would otherwise fire. Overriding constraint stated by the captain: a stall that writes nothing must still escalate on the existing schedule, so this may only reduce false positives and must never delay a real escalation. A deferral is bounded rather than permanent: the .writing-since marker ages the whole chain so a churning worktree still re-surfaces once per resurface window. The probe prunes .git first so firstmate's own read-only git commands against a worktree can never make it self-fulfilling, and a secondmate home's supervision churn is excluded for the same reason.
Later captain decisions this branch carries, so they should not read as surprises in the diff:
Context so nothing is chased needlessly: eight test failures in this repo are pre-existing on origin/main and are out of scope for this task. The pipeline environment has no ShellCheck installed at all, so bin/fm-lint.sh (this repo's single owner of the lint definition, which refuses to run under any version other than pinned 0.11.0) cannot verify anything there; I verified the full canonical lint set clean at this head with pinned ShellCheck 0.11.0 outside the pipeline, and proved that run non-vacuous by injecting a deliberately bad function and watching it fail. The PR for this branch is a fork PR, so its workflow runs stay unstarted until a maintainer approves them; that is an external wait, not a failure of the change.
What Changed
bin/fm-claude-stop-autoarm.shrecords apid-identityfile insidestate/.claude-autoarm.lockbefore publishing itsautoarmrole, and newfm_autoarm_claim_abandoned/fm_autoarm_release_abandonedhelpers inbin/fm-wake-lib.shtreat an identity mismatch as abandonment on its own, alongside the existing ledger reasoning (terminaloutcomeowned by the lock's own pid), with the reclaim re-verified under the lock's steal mutex. The Stop hook reclaims such a lock once and retries instead of exiting at it, andbin/fm-turnend-guard.shno longer counts an abandoned claim as recovery inautoarm_owns_recovery, clearing it interminal_fail_openand re-blocking rather than allowing a blind stop when the clear fails.crew_worktree_written_sinceinbin/fm-classify-lib.shruns onefindover the task's recorded worktree, pruned (FM_WORKTREE_WRITE_PRUNE,.gitfirst), depth-limited (FM_WORKTREE_WRITE_MAXDEPTH),-xdev, and wall-clock bounded throughfm_run_timed(FM_WORKTREE_WRITE_TIMEOUT); an empty prune list widens the walk rather than disabling the probe, and secondmate homes are skipped so their own supervision churn is never read as crew progress.bin/fm-watch.shconsults it only in the at-threshold branch that was about to escalate, andwedge_defer_writingthen restarts the idle timer and ages a.writing-since-<key>chain so the pane still re-surfaces once perFM_PAUSE_RESURFACE_SECSthrough a new sharedresurface_absorbedhelper. Every negative outcome (no worktree record, missing anchor, timeout, failed walk) leaves the escalation schedule untouched.fm-watch.shcentralizes per-window marker naming in onewindow_keyhelper thatclear_pause_state/clear_pause_trackingand the poll loop now take pre-derived, and every path that restarts the idle-window timer (including the corrupt-timer repair and both first-sight branches) also drops the write-deferral chain;bin/fm-supervise-daemon.shclears the new.writing-*markers andbin/fm-test-run.shmapsfm-timeout-lib.shchanges onto the watcher family. New cases intests/fm-watch-triage.test.sh,tests/fm-claude-stop-autoarm.test.sh, andtests/fm-turnend-guard.test.shcover the deferral, its bounded re-surface, the mate-home exclusion, the stall-that-writes-nothing schedule, and the abandoned-claim reclaim and hold cases;AGENTS.md,docs/architecture.md,docs/configuration.md,docs/turnend-guard.md, anddocs/watcher-continuity.mddocument the new knobs, the away-mode boundary where no deferral applies, and the probe's filesystem limit.Risk Assessment
✅ Low: All three prior findings are genuinely fixed with discriminating behavioral regressions, every new code path fails safe toward escalation (a timeout, a missing worktree, or a failed walk all read as no evidence and leave the escalation schedule untouched), the intent's required behaviors are all present and its forbidden behaviors absent, and the only remaining items are three informational follow-ups with no current misbehavior.
Testing
I ran the three targeted suites that own this change (fm-watch-triage, fm-claude-stop-autoarm, fm-turnend-guard) plus the two fixture-updated suites and the test runner's own suite, all green, and then demonstrated both defects end-to-end by driving the real Stop hook, turn-end guard, and a real fm-watch.sh process in a hermetic firstmate home against the pre-fix tree and branch head: pre-fix an abandoned auto-arm claim left the hook silent and the home unsupervised while the guard allowed a blind stop, whereas at head the hook re-arms with its wake banner and the guard blocks with the two-tasks-in-flight banner; pre-fix a quiet pane whose worktree was being written escalated as a possible wedge, whereas at head it is deferred with a triage-log entry, a stall that writes nothing escalates identically in both trees on poll 1 at the same idle age (about 110ms extra inside a single 1s poll), a long-open deferral still re-surfaces on the bounded cadence, and a secondmate home's own churn still escalates. I also proved every new regression fails on the code as it stood before its fixing commit and passes at head, including the pid-identity proof and the secondmate-home exclusion the intent requires be preserved, and confirmed no em-dashes in the diff or commit messages. Only one informational note came out of it, the worktree is clean, and all throwaway comparison trees were removed.
Evidence: Evidence summary with pre-fix vs fixed side-by-side tables
Evidence: End-to-end CLI transcript, branch head (hook re-arms, guard blocks, write deferral absorbed)
Evidence: End-to-end CLI transcript, pre-fix base (silent hook, blind stop allowed, writing crew wedge-escalated)
Evidence: Captain-visible before/after for the two defects
Evidence: Escalation latency for a real stall, both trees (probe must not delay escalation)
PRE-FIX (base bdae21e, no probe) run 1: escalated in 692ms on poll 1 | stale: test:fm-stall1 (idle 501s, possible wedge, escalation 1) run 2: escalated in 688ms on poll 1 run 3: escalated in 689ms on poll 1 FIXED (branch head f2f4334, probe runs first) run 1: escalated in 802ms on poll 1 | stale: test:fm-stall1 (idle 500s, possible wedge, escalation 1) run 2: escalated in 802ms on poll 1 run 3: escalated in 801ms on poll 1Evidence: Fail-before/pass-after: every new regression run against its pre-fix parent commit
/tmp/no-mistakes-evidence/01M07VBM2K2KHCE1XCSZ9CX9VM/demo-supervision-e2e.sh)Evidence: Reproducer script for the escalation-latency comparison
Evidence: Targeted suite logs at head (watch-triage, autoarm, turnend-guard, fixture consumers, test runner)
Pipeline
Updates from git push no-mistakes
✅ **intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
bin/fm-classify-lib.sh:1147- The stated criterion for the newest commit is: "An empty FM_WORKTREE_WRITE_PRUNE now widens the probe to the whole depth-bounded tree instead of reporting no evidence at all, because the knob is a skip list and clearing it means skip nothing; the old behavior quietly cost the wedge detector its third liveness input on a home that meant to widen the walk." The function-level behavior is present (theelsebranch at line 1200 does widen), but the knob is defaulted with:-, which treats an explicitly-empty value as unset:FM_WORKTREE_WRITE_PRUNE=${FM_WORKTREE_WRITE_PRUNE:-'.git node_modules ...'}. Verified:FM_WORKTREE_WRITE_PRUNE='' bash -c 'echo "[${FM_WORKTREE_WRITE_PRUNE:-.git node_modules}]"'prints[.git node_modules]. So a home that clears the knob in its environment - the surface docs/configuration.md:590 documents - silently gets the default skip list back rather than a widened walk, which is the exact configuration path the criterion names.${FM_WORKTREE_WRITE_PRUNE-...}(no colon) would honor it. The accompanying regression tests/fm-watch-triage.test.sh:419 passes only because it assigns the shell variable after the library was sourced, so it does not cover the env path; and the configuration.md entry does not document the empty-widens semantics either. Since this concerns the semantics of a user-facing configuration knob and the author's own stated requirement, it needs the captain's call rather than a unilateral change.bin/fm-classify-lib.sh:1197- The worktree write probe'sfindhas no wall-clock bound, and it runs synchronously inside the watcher's poll loop at the exact moment an escalation would otherwise fire.-xdevprevents descent into a nested mount but does not protect against a worktree root that is itself on a hung network or container mount, and the no-hit case (precisely the case that was about to escalate) walks the entire depth-6 tree rather than short-circuiting on-quit. If that walk stalls, the process it stalls is the wedge detector itself: state/.last-watcher-beat stops being touched and the supervisor that exists to notice a wedge is the thing wedged. This is the only worktree-touching call reached from watcher triage that is not wall-clock bounded - its sibling is (bin/fm-crew-state.sh:75 boundsfm_nm_runwith FM_CREW_STATE_NM_TIMEOUT, default 10s, with numeric validation), and bin/fm-watch.sh:592-598 already carries a portable timeout/gtimeout/perl ladder for check scripts. Because the existing|| truealready maps a failed walk to "no evidence" and every negative outcome leaves the caller's escalation schedule untouched, wrapping the walk in a best-effort bound preserves the semantics exactly and needs no behavior decision.bin/fm-watch.sh:332- The change adds two more copies of the window-key derivation in two different idioms:clear_write_tracking(line 333-336) is a 4th copy of the${win//:/_}/${key//\//_}/${key//./_}chain already inclear_pause_state,clear_pause_tracking, andpause_state_class, whilewedge_defer_writing(line 319) adds another copy of thetr ':/.' '___'form used byhandle_paused_staleandsurface_nonterminal_stale.clear_pause_trackingnow computeskeylocally and then callsclear_write_tracking, which recomputes the same value. The two idioms are currently equivalent, but any future change to the key format has to be made in seven places or per-window markers leak silently. A singlewindow_key()helper used by all of them would be a mechanical, behavior-preserving cleanup.🔧 Fix: honor an empty write-prune, bound the probe, share window_key
3 infos still open:
bin/fm-watch.sh:264- The new window_key comment asserts "the format lives here alone: a second copy is how a future change to it silently orphans a window's markers instead of clearing them", but a second copy already exists: bin/fm-supervise-daemon.sh:434_stale_key() { printf '%s' "$1" | tr ':/.' '___'; }, applied to a WINDOW at lines 471, 483 and 500 to buildwatcher_key. The daemon uses that key to remove the watcher's own.paused-*,.paused-rechecked-*,.paused-resurfaced-*,.stale-*,.stale-since-*,.wedge-escalations-*and (added on this branch).writing-since-*/.writing-resurfaced-*markers, and to test[ -e "$state/.paused-$watcher_key" ]in reconcile_pause_tracking / migrate_watcher_pause_markers. Concrete consequence of a future format change (say window_key also maps spaces or-): the watcher writes.writing-since-<new-key>and.paused-<new-key>, while the daemon keeps removing and probing<old-key>, so a resumed-from-pause window keeps a stale.paused-*the daemon can no longer clear and a write-deferral chain that outlives its quiet stretch. That is exactly the orphaning the comment warns about, reached through the copy the comment says does not exist. Both scripts source bin/fm-classify-lib.sh, so one shared derivation is available; the minimal alternative is to qualify the comment to name the daemon as the second owner. No current misbehavior: the two derivations are byte-identical for any ASCII window name today.bin/fm-classify-lib.sh:1229- The bound's guard iscase "$bound" in ''|*[!0-9]*|0) bound=10 ;; esac, which rejects the literal0but accepts00,000, and so on. The adjacent comment (line 1173) and docs/configuration.md:594 both promise that "a value that is not a positive integer" falls back to the default, precisely becausetimeout 0and the perl fallback'salarm 0disable the deadline. Verified locally with GNU coreutils 8.32:timeout 00 sleep 3ran the full 3 seconds, so FM_WORKTREE_WRITE_TIMEOUT=00 handstimeout -k 1 00 find ...an unbounded walk and re-opens the exact failure this bound was added to close, a worktree on a hung mount stalling the watcher poll that started it and starving state/.last-watcher-beat. Same hole in the perl fallback (alarm 00); the bash fallback instead degrades tosleep 00and always reports the bound as hit, so the three mechanisms also disagree on this input. Replacing the pattern check with a value check (for example, keep the digit test and add[ "$bound" -gt 0 ] || bound=10) closes it and lets the two default literals at lines 1178 and 1229 stop drifting apart.bin/fm-test-run.sh:921- This round created a new dependency edge (bin/fm-classify-lib.sh now sources bin/fm-timeout-lib.sh) and updated the two test fixtures that build a partial bin/ around a classifier consumer: tests/fm-gotmp.test.sh (family session-bootstrap, already listed here) and tests/fm-afk-return.test.sh (family afk, not listed). So families_for_changed_path bin/fm-timeout-lib.sh emits session-bootstrap, snapshot-bearings, pure-contract-unit, secondmate and watcher-wake-lock, but not afk. Concretely: rename fm_run_timed or change fm-timeout-lib.sh's set -u handling and tests/fm-afk-return.test.sh breaks (fm-afk-return.sh sources fm-classify-lib.sh, which sources the renamed library from the fixture's own bin/) while the changed-path selection never runs it. One addedprintf '%s\n' afkline closes the edge the same round already had to acknowledge in the fixture.tests/fm-watch-triage.test.sh:448- Of the two empty-write-prune tests, onlytest_empty_write_prune_from_the_environment_widens_the_probefails on the pre-fix parent (655e2ea);test_empty_write_prune_widens_the_probepasses there. The in-process variant cannot detect that defect, because an assignment made after fm-classify-lib.sh is sourced leaves the variable empty under either defaulting form, so the environment variant is what carries the regression coverage for that behavior. No action needed; noted only because the intent states all three newest tests were verified fail-before.bin/fm-test-run.sh tests/fm-watch-triage.test.sh(probe classifier, prune widening, probe bound, wedge deferral, bounded resurface, chain drops)bin/fm-test-run.sh tests/fm-claude-stop-autoarm.test.sh(abandoned-claim reclaim, identity legs, negative controls)bin/fm-test-run.sh tests/fm-turnend-guard.test.sh(blind-stop block on abandoned claim, reused pid, terminal path)bin/fm-test-run.sh tests/fm-afk-return.test.sh tests/fm-gotmp.test.sh(the two suites whose fixtures now copy fm-timeout-lib.sh)bin/fm-test-run.sh tests/fm-test-run.test.sh(changed-file family map moved by this branch)Manual e2e:bash demo-supervision-e2e.sh <tree> <label>run against both the pre-fix base tree and branch head, driving the realbin/fm-claude-stop-autoarm.sh,bin/fm-turnend-guard.sh --claude,bin/fm-watch.shandbin/fm-wake-drain.shin a hermetic FM_HOMEManual e2e:bash demo-no-escalation-delay.sh <tree> <label> 3measuring escalation latency for a silent stall in a 400-file worktree on both treesFail-before proof: head test files copied unchanged onto trees archived ata8c4561,7528788and655e2ea, invoking only the relevant new test functionsgit diff bdae21e..f2f4334 | grep '^+' | grep -c '—'and the same over commit messages (no-em-dash constraint)docs/architecture.md:16- The write probe's -xdev filesystem limit (a write landing only under a mount nested inside the worktree is not seen) is documented only in the crew_worktree_written_since header comment, per the captain's approved option (a) at the earlier document gate. docs/architecture.md's enumeration of negative outcomes names the other four (missing worktree record, torn-down worktree, wall-clock bound, failed walk) but not this one. The sentence says "including", so it is not incorrect, and I left the approved placement alone rather than re-opening a settled decision. Worth one line in architecture.md only if the captain wants that enumeration exhaustive.docs/turnend-guard.md:78- docs/turnend-guard.md is classified operator-current, and the audience policy assigns dates and exact incident detail to maintainer-verification. Line 78 carries a one-sentence dated 2026-08-14 incident account as the rationale for the abandonment boundary. I left it because the doc already uses dated rationale in the same form (the 2026-07-21 blind window, grok 1.0.0, Cursor 2026.08.11-e8db854) and the sentence is the load-bearing why for the invariant rather than a narrative. Flagging it as a placement judgment call in case the captain would rather move the date and the 40-minute detail into docs/verification/supervision.md and keep only the mechanism here.🔧 Fix: silence deliberate single-quote SC2016 in write-prune env test
1 warning still open:
✅ **Push** - passed
✅ No issues found.