Skip to content

fix(bin): honour a declared wait before wedge-escalating a quiet pane - #4586

Merged
kunchenguid merged 2 commits into
kunchenguid:mainfrom
aminry:fm/fm-wedge-declared-wait-r4
Sep 16, 2026
Merged

kunchenguid merged 2 commits into
kunchenguid:mainfrom
aminry:fm/fm-wedge-declared-wait-r4

Conversation

@aminry

@aminry aminry commented Sep 16, 2026

Copy link
Copy Markdown
Contributor

Intent

The watcher escalates a lane as a possible wedge even when that lane has positively declared a bounded wait that has not elapsed. The escalation then repeats indefinitely, and each one costs a supervising turn.

#3909: a crewmate that declared a bounded external wait still escalates once the pane ages past FM_STALE_ESCALATE_SECS, reaching demand-deep-inspection on a lane that was verifiably working. crew_absorb_class returns paused for a declared wait, and aging appears to escalate without re-consulting that verdict.

#2614: the same defect reported from the other side - an idle pane whose latest status line is a declared paused: wait is still wedge-escalated at the idle threshold, repeatedly and with a monotonically growing escalation count, and once that count is high every escalation carries demand-deep-inspection, which by its own wording forces the supervisor to spend a full handling turn on each one. Investigated against current main rather than assumed: its declared-pause-on-an-idle-pane form and its busy-pane form no longer reproduce, and the one form that still reproduces is identical to #3909's, so it is closed by the same change rather than by separate work.

Both meet at wedge_timer_check, which escalates on elapsed idle time without ever consulting the worker's own account of its silence.

The goal is that a lane whose own declared wait has not elapsed is rechecked on a long cadence as the declared wait it is, rather than escalated as a suspected wedge. The generated crewmate brief already promises exactly this - that declaring paused: means the supervisor leaves the idle pane alone and rechecks it on a long cadence instead of treating it as a possible wedge - so this restores behaviour the supervision contract already states rather than adding a new capability, and it applies by default rather than behind a configuration flag. The existing workaround of raising FM_STALE_ESCALATE_SECS is not a fix: it delays real wedge detection by exactly the same amount for every lane.

A lane with no such declaration must keep its current escalation schedule, reasons and wake wording unchanged, so genuine wedge detection is not weakened and its worst-case detection time does not move. Both directions are required as executable tests: the declared-wait lane is rechecked on the long cadence with no escalation counted, and a lane with no declaration still escalates on exactly the unchanged schedule with unchanged wake wording.

The recheck must also name which human the wait is on. A paused: declaration is owed by an external dependency the worker named, while a captain-held: transfer is owed by the captain reading the recheck; wording a hold as an external wait points the captain away from the one action that clears it. A hold is not rechecked at all while the away-posture record exists, consistent with every other captain-held path, since nobody is there to answer it.

A known bound worth stating rather than hiding: the recheck throttle is scoped to the pane hash, so the long cadence holds for a lane whose pane is genuinely static, while a lane whose display churns (a ticking clock, a token counter) drops the throttle with each new hash and is rechecked once per idle window instead. That lane still loses the escalation ladder and the demand-deep-inspection wording, which is the defect being fixed, but it is not the full delivery of a long cadence. The alternative, letting the throttle outlive the hash, trades this for a stale throttle surviving into an unrelated later episode and suppressing that episode's first recheck, which is the worse failure.

A lane that is quiet because its own validation run is parked at a gate awaiting a human decision is deliberately out of scope here and keeps the unchanged ladder. Recognising that state correctly needs a signal that carries who the wait is on and what clears it, rather than one inferred from a parked verdict that also covers gates awaiting the crewmate itself; a crewmate that wedges before answering its own gate must remain detectable. That case is left for separate work.

One pre-existing contract case, test_paused_authoritative_working_preserves_wedge_timer, asserted that a paused status overridden by an authoritative working verdict preserves its wedge timer and escalates. That escalation is the defect #3909 reports, so the case could not survive the fix unchanged. Its wedge-timer-preservation half is retained, its past-threshold half now asserts the bounded recheck, and a lifted-declaration leg was added so the case still proves that escalation resumes once the wait is withdrawn.

Closes #3909
Closes #2614

What Changed

  • wedge_timer_check in bin/fm-watch.sh now consults the pane's own account of its quiet before escalating: a new wedge_wait_evidence reads the worker's last status line for an unelapsed paused: declaration or a verified captain-held: transfer, and wedge_defer_wait routes that lane to the FM_PAUSE_RESURFACE_SECS recheck cadence instead of the wedge ladder, leaving the escalation counter untouched. The recheck is aged from the status file mtime and worded by verb, so a paused: wait asks the reader to confirm the external dependency while a hold asks the captain to answer or release it; a hold is absorbed silently and arms no throttle while the away-posture record exists. A lane with no declaration, or one whose declared until time has passed, keeps the unchanged schedule, reason and demand-deep-inspection wording.
  • Added the new .waiting-resurfaced-* throttle marker to the cleanup paths that reset a window's stale bookkeeping (clear_stale_hash_tracking in bin/fm-watch.sh, clear_pause_tracking in bin/fm-supervise-daemon.sh) and to the state-file inventory in AGENTS.md.
  • Added two executable cases in tests/fm-watch-triage.test.sh covering both directions: a declared wait under a working verdict is rechecked with no escalation counted while an elapsed declaration and an undeclared lane both still reach escalation 3 with the demand-deep-inspection wording, and a captain-held lane is rechecked as a hold on the captain, never as an external wait, and not at all while the captain is away. The pre-existing test_paused_authoritative_working_preserves_wedge_timer keeps its wedge-timer-preservation half, now asserts the bounded recheck past threshold, and gained a lifted-declaration leg proving escalation resumes. docs/architecture.md and docs/configuration.md describe the consult, its wording split, and the known pane-hash throttle bound for lanes whose display churns.

Risk Assessment

✅ Low: The change is tightly scoped to the one at-threshold branch, leaves undeclared lanes bit-identical in schedule and wording, adds both-direction executable tests, and the only issue found is a comment that overstates an invariant on a deliberate away-mode exception.

Testing

I derived the scenarios from the intent's two required directions (a declared wait must be rechecked rather than escalated; an undeclared lane must keep its exact schedule, reasons and wake wording) plus adversarial probes at every boundary the intent names, then drove all of them against the real watcher process running over real state homes, with only tmux and the crew-state probe faked. Everything the intent promises held live: a declared paused: wait survives three consecutive thresholds with no wake, no possible wedge wording and no escalation counted, and once it outlives the cadence it surfaces as waiting 2003s - declared wait, awaiting external, rechecked on a long cadence not a wedge; confirm the wait still holds, aged from the declaration itself; a captain-held: lane instead reads awaiting the captain ... answer the held decision or release the hold, and under the away-posture record it prints nothing at all and arms no throttle, so the recheck is owed in full the moment the record is archived, which I confirmed by archiving it and seeing the recheck return immediately. The adversarial legs matter most and all passed: an undeclared lane still climbs escalation 1 to 3 and still carries the demand-deep-inspection sentence verbatim, a declaration whose until time has already passed still escalates as possible wedge, escalation 1, and withdrawing a declaration restores escalation on the very next idle window. The regression direction is proved rather than assumed: the identical driver run against the pre-fix base tree fails 19 checks and reproduces the reported defect exactly, wedge-escalating the declared wait up to escalation 4 with the demand-deep-inspection marker, while the two non-regression scenarios behave identically before and after. One honest caveat: the churning-pane probe passes on the base tree too, so it confirms the documented bound holds but is not itself a before/after discriminator. No screenshot or rendered artifact is included because this change has no UI surface - the end-user surface is the wake reason line the watcher prints to the supervising captain, and the CLI transcripts capture that text exactly as the captain receives it.

  • Live validation: ✅ go - 9 of 9 scenarios driven live against the product
Scenario Result Live Evidence
A crewmate that declared a bounded wait is not wedge-escalated across three consecutive idle windows past the threshold (#3909 repro) ✅ pass live Live driver S1 against the real bin/fm-watch.sh: watcher kept supervising through three thresholds, queued no stale wake, printed no possible wedge, and wrote no .wedge-escalations marker; triage lo…
The declared wait is rechecked once on the long cadence, naming the external dependency and the action that resolves it, aged from the declaration itself ✅ pass live Live driver S2: captain receives stale: fleet:fm-crew-validate (idle 2s, waiting 2003s - declared wait, awaiting external, rechecked on a long cadence not a wedge; confirm the wait still holds); pub…
ADVERSARIAL: a lane with no declaration still escalates on exactly the unchanged schedule with unchanged reasons and demand-deep-inspection wording ✅ pass live Live driver S3: escalation 1 -> 2 -> 3 on every threshold plus demand-deep-inspection: same pane has wedge-escalated 3 times in a row - do not re-absorb on the run-step/pane state alone, byte-identi…
ADVERSARIAL: a declared wait whose own until clearing time has already passed stops counting as evidence and keeps the unchanged wedge ladder ✅ pass live Live driver S4 with paused: waiting on the build queue until <2h in the past>: watcher surfaced possible wedge, escalation 1, identical to the base tree. Artifact s4-elapsed-until.wake.txt
A captain-held transfer is rechecked as a hold on the captain, never worded as an external wait ✅ pass live Live driver S5: waiting 2002s - captain-held, awaiting the captain - verified hold transfer ...; answer the held decision or release the hold, with no awaiting external, no `confirm the wait still…
ADVERSARIAL: while the away-posture record exists a hold is absorbed in silence with no throttle armed, and the recheck is owed in full the moment the record is archived ✅ pass live Live driver S6: across three thresholds nothing printed, no stale wake queued, no .waiting-resurfaced marker written, triage log records never rechecked while the away-posture record exists; after a…
ADVERSARIAL: a declared-wait lane whose pane display churns on every capture still never reaches the wedge ladder ✅ pass live Live driver S7 with a fake tmux rendering a changing token counter on every capture, six idle windows: no possible wedge, no demand-deep-inspection, no escalation counter. This is the bound the ch…
ADVERSARIAL: withdrawing the declaration restores the unchanged escalation on the very next idle window, so detection is deferred and not deleted ✅ pass live Live driver S8: the lane is deferred while paused: stands, then after the worker appends working: the release landed, resuming validation the next window emits possible wedge, escalation 1. Arti…
Away-mode daemon reconciliation clears the wait-recheck throttle when the crewmate withdraws its declaration, so the lane's next wait episode is not robbed of its first recheck ✅ pass live Live driver against the real reconcile_pause_tracking entry point of bin/fm-supervise-daemon.sh: .waiting-resurfaced-<key> is removed with the rest of the lane pause state on the target commit, while…
Evidence: Live end-to-end transcript at the target commit (8 scenarios, 0 failures)

Source: Live end-to-end transcript at the target commit (8 scenarios, 0 failures)

live driver for the declared-wait wedge deferral
watcher under test : ~/.no-mistakes/worktrees/041bc5e421de/01M2KP4KYEVBZRJZ44E33K1G73/bin/fm-watch.sh
watcher commit     : c850861
crewmate window    : fleet:fm-crew-validate
wedge threshold    : FM_STALE_ESCALATE_SECS=1 (the 240s default only changes how long each round takes)

========================================================================
S1  a crewmate that declared a bounded wait is not wedge-escalated (#3909)
========================================================================
crewmate's own last status line:
    paused: final validation at step 6/6 - clean whole-assembly baseline (~20 min)
driving three consecutive idle windows past the escalation threshold...
    PASS  watcher stayed supervising across three thresholds (never surfaced a wedge)
    PASS  no stale wake queued for the captain
    PASS  nothing reported as a possible wedge
    PASS  no wedge escalation counted
what the watcher recorded instead (triage log):
    [2026-09-15T16:51:03-0700] absorbed non-terminal stale (provably working after a declared pause) (the pane's own wait explains the quiet, idle 2s): fleet:fm-crew-validate
    [2026-09-15T16:51:04-0700] absorbed non-terminal stale (provably working after a declared pause) (the pane's own wait explains the quiet, idle 1s): fleet:fm-crew-validate
    [2026-09-15T16:51:06-0700] absorbed non-terminal stale (provably working after a declared pause) (the pane's own wait explains the quiet, idle 2s): fleet:fm-crew-validate

========================================================================
S2  the declared wait is rechecked on the long cadence, naming the external dependency
========================================================================
crewmate's own last status line (declared 2000s ago):
    paused: waiting on the upstream release cut
    PASS  watcher surfaced the recheck once the wait outlived the cadence
what the captain sees:
    stale: fleet:fm-crew-validate (idle 1s, waiting 2002s - declared wait, awaiting external, rechecked on a long cadence not a wedge; confirm the wait still holds)
    PASS  recheck names the wait as declared and owed by an external dependency
    PASS  recheck names the action that resolves it
    PASS  recheck is worded as a recheck, not a wedge
    PASS  no possible-wedge wording
    PASS  did not borrow the captain-held action
    PASS  published wait age (2002s) is the age of the declaration itself

========================================================================
S3  ADVERSARIAL: a lane with no declaration keeps the unchanged ladder and wording
========================================================================
crewmate's own last status line (no declared wait):
    working: validation under way
    PASS  escalated on every threshold, escalation 1 -> 2 -> 3, on the unchanged schedule
    PASS  demand-deep-inspection wording intact at the third escalation
what the captain sees:
    stale: fleet:fm-crew-validate (idle 1s, possible wedge, escalation 1)
    stale: fleet:fm-crew-validate (idle 1s, possible wedge, escalation 2)
    stale: fleet:fm-crew-validate (idle 1s, possible wedge, escalation 3, demand-deep-inspection: same pane has wedge-escalated 3 times in a row - do not re-absorb on the run-step/pane state alone)

========================================================================
S4  ADVERSARIAL: a declared wait whose own clearing time already passed escalates as before
========================================================================
crewmate's own last status line (clearing time two hours in the past):
    paused: waiting on the build queue until 2026-09-15T21:51:19Z
    PASS  watcher surfaced rather than deferring an expired declaration
what the captain sees:
    stale: fleet:fm-crew-validate (idle 2s, possible wedge, escalation 1)
    PASS  unchanged wedge wording and escalation count

========================================================================
S5  a captain-held transfer is rechecked as a hold ON THE CAPTAIN, not an external wait
========================================================================
crewmate's own last status line:
    captain-held: which retention window wins
    PASS  watcher surfaced the hold recheck
what the captain sees:
    stale: fleet:fm-crew-validate (idle 1s, waiting 2002s - captain-held, awaiting the captain - verified hold transfer, rechecked on a long cadence not a wedge; answer the held decision or release the hold)
    PASS  recheck names the captain as the human the wait is on
    PASS  recheck names the action that clears the hold
    PASS  not published as a wait on an external dependency
    PASS  not reported as a possible wedge

========================================================================
S6  ADVERSARIAL: while the captain is away a hold is silent, and the recheck returns intact
========================================================================
away-posture record written; driving three idle windows past the threshold...
    PASS  watcher stayed supervising, never woke the away captain
    PASS  no stale wake queued
    PASS  nothing printed to the captain
    PASS  no recheck throttle armed, so the recheck is owed in full on return
what the watcher recorded instead (triage log):
    [2026-09-15T16:51:44-0700] absorbed non-terminal stale (provably working after a declared pause) (captain-held, never rechecked while the away-posture record exists): fleet:fm-crew-validate
    [2026-09-15T16:51:45-0700] absorbed non-terminal stale (provably working after a declared pause) (captain-held, never rechecked while the away-posture record exists): fleet:fm-crew-validate
away-posture record archived (captain is back); driving one more idle window...
    PASS  the hold was rechecked immediately on return, not after another cadence
what the returning captain sees:
    stale: fleet:fm-crew-validate (idle 22s, waiting 2023s - captain-held, awaiting the captain - verified hold transfer, rechecked on a long cadence not a wedge; answer the held decision or release the hold)
    PASS  the recheck owed on return still names the captain

========================================================================
S7  ADVERSARIAL: the declaration still wins when the pane display churns every capture
========================================================================
crewmate's own last status line:
    paused: waiting on the nightly index rebuild
driving six idle windows against a pane whose text changes on every capture...
    PASS  a churning declared-wait lane is never reported as a possible wedge
    PASS  no demand-deep-inspection marker
    PASS  no wedge escalation counted
what the captain sees (the stated bound: rechecked once per idle window, never escalated):

========================================================================
S8  ADVERSARIAL: withdrawing the declaration restores the unchanged escalation
========================================================================
crewmate's own last status line:
    paused: waiting on the upstream release cut
    PASS  while the wait stands the lane is deferred, not escalated
    PASS  nothing reported as a possible wedge while the wait stands
the crewmate withdraws the wait and reports working again:
    working: the release landed, resuming validation
    PASS  the very next idle window escalates again
what the captain sees:
    stale: fleet:fm-crew-validate (idle 1s, possible wedge, escalation 1)
    PASS  unchanged wedge wording, escalation count starting from 1

========================================================================
RESULT: 0 check(s) failed
========================================================================
Evidence: Same driver against the pre-fix base tree bdcacb9 (19 failures - the reported defect reproducing)

Source: Same driver against the pre-fix base tree bdcacb9 (19 failures - the reported defect reproducing)

live driver for the declared-wait wedge deferral
watcher under test : /tmp/fm-base-repo/bin/fm-watch.sh
watcher commit     : (base tree bdcacb9, pre-fix)
crewmate window    : fleet:fm-crew-validate
wedge threshold    : FM_STALE_ESCALATE_SECS=1 (the 240s default only changes how long each round takes)

========================================================================
S1  a crewmate that declared a bounded wait is not wedge-escalated (#3909)
========================================================================
crewmate's own last status line:
    paused: final validation at step 6/6 - clean whole-assembly baseline (~20 min)
driving three consecutive idle windows past the escalation threshold...
    FAIL  watcher stayed supervising across three thresholds (never surfaced a wedge)
    FAIL  no stale wake queued for the captain
    FAIL  nothing reported as a possible wedge
    FAIL  no wedge escalation counted
what the watcher recorded instead (triage log):

========================================================================
S2  the declared wait is rechecked on the long cadence, naming the external dependency
========================================================================
crewmate's own last status line (declared 2000s ago):
    paused: waiting on the upstream release cut
    PASS  watcher surfaced the recheck once the wait outlived the cadence
what the captain sees:
    stale: fleet:fm-crew-validate (idle 1s, possible wedge, escalation 1)
    FAIL  recheck names the wait as declared and owed by an external dependency
    FAIL  recheck names the action that resolves it
    FAIL  recheck is worded as a recheck, not a wedge
    FAIL  no possible-wedge wording
    PASS  did not borrow the captain-held action
    FAIL  published wait age (s) is the age of the declaration itself

========================================================================
S3  ADVERSARIAL: a lane with no declaration keeps the unchanged ladder and wording
========================================================================
crewmate's own last status line (no declared wait):
    working: validation under way
    PASS  escalated on every threshold, escalation 1 -> 2 -> 3, on the unchanged schedule
    PASS  demand-deep-inspection wording intact at the third escalation
what the captain sees:
    stale: fleet:fm-crew-validate (idle 2s, possible wedge, escalation 1)
    stale: fleet:fm-crew-validate (idle 2s, possible wedge, escalation 2)
    stale: fleet:fm-crew-validate (idle 2s, possible wedge, escalation 3, demand-deep-inspection: same pane has wedge-escalated 3 times in a row - do not re-absorb on the run-step/pane state alone)

========================================================================
S4  ADVERSARIAL: a declared wait whose own clearing time already passed escalates as before
========================================================================
crewmate's own last status line (clearing time two hours in the past):
    paused: waiting on the build queue until 2026-09-15T21:56:51Z
    PASS  watcher surfaced rather than deferring an expired declaration
what the captain sees:
    stale: fleet:fm-crew-validate (idle 2s, possible wedge, escalation 1)
    PASS  unchanged wedge wording and escalation count

========================================================================
S5  a captain-held transfer is rechecked as a hold ON THE CAPTAIN, not an external wait
========================================================================
crewmate's own last status line:
    captain-held: which retention window wins
    PASS  watcher surfaced the hold recheck
what the captain sees:
    stale: fleet:fm-crew-validate (idle 2s, possible wedge, escalation 1)
    FAIL  recheck names the captain as the human the wait is on
    FAIL  recheck names the action that clears the hold
    PASS  not published as a wait on an external dependency
    FAIL  not reported as a possible wedge

========================================================================
S6  ADVERSARIAL: while the captain is away a hold is silent, and the recheck returns intact
========================================================================
away-posture record written; driving three idle windows past the threshold...
    FAIL  watcher stayed supervising, never woke the away captain
    FAIL  no stale wake queued
    FAIL  nothing printed to the captain
    PASS  no recheck throttle armed, so the recheck is owed in full on return
what the watcher recorded instead (triage log):
away-posture record archived (captain is back); driving one more idle window...
    PASS  the hold was rechecked immediately on return, not after another cadence
what the returning captain sees:
    stale: fleet:fm-crew-validate (idle 2s, possible wedge, escalation 4, demand-deep-inspection: same pane has wedge-escalated 4 times in a row - do not re-absorb on the run-step/pane state alone)
    FAIL  the recheck owed on return still names the captain

========================================================================
S7  ADVERSARIAL: the declaration still wins when the pane display churns every capture
========================================================================
crewmate's own last status line:
    paused: waiting on the nightly index rebuild
driving six idle windows against a pane whose text changes on every capture...
    PASS  a churning declared-wait lane is never reported as a possible wedge
    PASS  no demand-deep-inspection marker
    PASS  no wedge escalation counted
what the captain sees (the stated bound: rechecked once per idle window, never escalated):

========================================================================
S8  ADVERSARIAL: withdrawing the declaration restores the unchanged escalation
========================================================================
crewmate's own last status line:
    paused: waiting on the upstream release cut
    FAIL  while the wait stands the lane is deferred, not escalated
    FAIL  nothing reported as a possible wedge while the wait stands
the crewmate withdraws the wait and reports working again:
    working: the release landed, resuming validation
    PASS  the very next idle window escalates again
what the captain sees:
    stale: fleet:fm-crew-validate (idle 2s, possible wedge, escalation 2)
    FAIL  unchanged wedge wording, escalation count starting from 1

========================================================================
RESULT: 19 check(s) failed
========================================================================
Evidence: Before/after of the captain-facing wake line for the same declared wait
pre-fix (bdcacb9): stale: fleet:fm-crew-validate (idle 1s, possible wedge, escalation 1)
stale: fleet:fm-crew-validate (idle 2s, possible wedge, escalation 2)
stale: fleet:fm-crew-validate (idle 1s, possible wedge, escalation 4, demand-deep-inspection: same pane has wedge-escalated 4 times in a row - do not re-absorb on the run-step/pane state alone)

post-fix (c850861): stale: fleet:fm-crew-validate (idle 2s, waiting 2003s - declared wait, awaiting external, rechecked on a long cadence not a wedge; confirm the wait still holds)
stale: fleet:fm-crew-validate (idle 2s, waiting 2002s - captain-held, awaiting the captain - verified hold transfer, rechecked on a long cadence not a wedge; answer the held decision or release the hold)

unchanged for a lane with no declaration (identical before and after):
stale: fleet:fm-crew-validate (idle 1s, possible wedge, escalation 1)
stale: fleet:fm-crew-validate (idle 1s, possible wedge, escalation 2)
stale: fleet:fm-crew-validate (idle 1s, possible wedge, escalation 3, demand-deep-inspection: same pane has wedge-escalated 3 times in a row - do not re-absorb on the run-step/pane state alone)
Evidence: Live driver script (reproducible, takes repo root and output dir)

Source: Live driver script (reproducible, takes repo root and output dir)

#!/usr/bin/env bash
# Live end-to-end driver for the declared-wait wedge deferral (kunchenguid/firstmate#3909, #2614).
#
# Stands up a real firstmate state home, a real crewmate window record and status
# file, and runs the REAL bin/fm-watch.sh watcher process against it. The only
# things faked are the terminal backend (tmux) and the crew-state probe, exactly
# the two external systems the watcher shells out to. Everything else - the wake
# queue, the triage log, the per-window markers, the wake wording - is production
# code writing production state.
#
# Usage: live-wedge-drive.sh <repo-root> <output-dir>
set -u

ROOT=${1:?repo root}
OUT=${2:?output dir}
WATCH="$ROOT/bin/fm-watch.sh"
umask 022
mkdir -p "$OUT"
WORK=$(mktemp -d "${TMPDIR:-/tmp}/fm-live-wedge.XXXXXX")
export FM_ROOT_OVERRIDE="$WORK/not-a-git-repo"; mkdir -p "$FM_ROOT_OVERRIDE"
printf '#!/usr/bin/env bash\nexit 0\n' > "$WORK/alarm-sink"; chmod +x "$WORK/alarm-sink"
export FM_WEDGE_ALARM_EXEC="$WORK/alarm-sink"
WINDOW="fleet:fm-crew-validate"
KEY=$(printf '%s' "$WINDOW" | tr ':/.' '___')
PANE_TEXT='validating: whole-assembly baseline'

FAILURES=0
note() { printf '%s\n' "$*"; }
check() {  # <description> <0|1 result>
  if [ "$2" -eq 0 ]; then printf '    PASS  %s\n' "$1"
  else printf '    FAIL  %s\n' "$1"; FAILURES=$((FAILURES + 1)); fi
}

hash_text() {
  if command -v md5 >/dev/null 2>&1; then printf '%s' "$1" | md5 -q
  else printf '%s' "$1" | md5sum | cut -d' ' -f1; fi
}
set_mtime() {  # <epoch> <file>
  local stamp
  if stamp=$(date -r "$1" +%Y%m%d%H%M.%S 2>/dev/null); then touch -t "$stamp" "$2"
  else touch -t "$(date -d "@$1" +%Y%m%d%H%M.%S)" "$2"; fi
}
iso_utc_at() { date -u -r "$1" +%Y-%m-%dT%H:%M:%SZ 2>/dev/null || date -u -d "@$1" +%Y-%m-%dT%H:%M:%SZ; }

# A firstmate home whose crewmate pane is already stably stale at its recorded
# hash - the exact population wedge_timer_check owns - with <status-line> as the
# worker's own last word, written <age> seconds ago.
make_home() {  # <name> <status-line> <status-age-secs>
  local name=$1 line=$2 age=$3 home state fakebin
  home="$WORK/$name"; state="$home/state"; fakebin="$home/fakebin"
  mkdir -p "$state" "$fakebin"
  cat > "$fakebin/tmux" <<'SH'
#!/usr/bin/env bash
set -u
case "${1:-}" in
  list-windows) printf '%s\n' "${FM_FAKE_TMUX_WINDOW#*:}"; exit 0 ;;
  capture-pane) cat "$FM_FAKE_TMUX_CAPTURE"; exit 0 ;;
  display-message) case "$*" in *pane_current_command*) printf 'grok\n'; exit 0 ;; esac ;;
esac
exit 1
SH
  cat > "$fakebin/fm-crew-state.sh" <<'SH'
#!/usr/bin/env bash
printf '%s\n' "${FM_FAKE_CREW_STATE:-state: unknown}"
SH
  chmod +x "$fakebin/tmux" "$fakebin/fm-crew-state.sh"
  printf '%s' "$PANE_TEXT" > "$home/pane.txt"
  printf 'window=%s\nkind=ship\nharness=grok\nbackend=tmux\n' "$WINDOW" > "$state/validate.meta"
  printf '%s\n' "$line" > "$state/validate.status"
  set_mtime "$(( $(date +%s) - age ))" "$state/validate.status"
  # Prime the already-seen suppressor through the production signature owner, so
  # the pre-existing status line does not fire a first-sight signal wake.
  FM_STATE_OVERRIDE="$state" bash -c '. "$1"; fm_wake_status_mark_current "$2" "$3"' \
    _ "$ROOT/bin/fm-wake-lib.sh" "$state" "$state/validate.status" >/dev/null
  printf '%s' "$(hash_text "$PANE_TEXT")" > "$state/.hash-$KEY"
  printf '1\n' > "$state/.count-$KEY"
  printf '%s' "$(hash_text "$PANE_TEXT")" > "$state/.stale-$KEY"
  printf '%s\n' "$home"
}

# Run the real watcher against <home> for one idle window past the escalation
# threshold. mode=exit expects it to surface and exit (an actionable wake);
# mode=absorb expects it to survive three whole poll cycles at the threshold.
run_watcher() {  # <home> <mode> [resurface-secs]
  local home=$1 mode=$2 resurface=${3:-999}
  local state pid i=0 beat first now cycles
  state="$home/state"
  PATH="$home/fakebin:$PATH" \
    FM_FAKE_TMUX_WINDOW="$WINDOW" FM_FAKE_TMUX_CAPTURE="$home/pane.txt" \
    FM_FAKE_CREW_STATE='state: working · source: run-step · ci running' \
    FM_WATCH_HANDLING_SUCCESSOR=1 FM_STATE_OVERRIDE="$state" \
    FM_CREW_STATE_BIN="$home/fakebin/fm-crew-state.sh" \
    FM_PAUSE_RESURFACE_SECS="$resurface" FM_STALE_ESCALATE_SECS=1 \
    FM_POLL=1 FM_SIGNAL_GRACE=1 FM_CHECK_INTERVAL=999999 FM_HEARTBEAT=999999 \
    "$WATCH" >> "$home/watch.out" 2>> "$home/watch.err" &
  pid=$!
  beat="$state/.last-watcher-beat"
  if [ "$mode" = exit ]; then
    while [ "$i" -lt 150 ]; do kill -0 "$pid" 2>/dev/null || { wait "$pid" 2>/dev/null; return 0; }; sleep 0.1; i=$((i+1)); done
    kill "$pid" 2>/dev/null; wait "$pid" 2>/dev/null; return 1
  fi
  cycles=0
  while [ "$cycles" -lt 3 ]; do
    rm -f "$beat"; first=""; i=0
    while [ "$i" -lt 300 ]; do
      kill -0 "$pid" 2>/dev/null || { wait "$pid" 2>/dev/null; return 1; }
      first=$(stat -f %m "$beat" 2>/dev/null || stat -c %Y "$beat" 2>/dev/null || true)
      [ -n "$first" ] && break; sleep 0.1; i=$((i+1))
    done
    while [ "$i" -lt 300 ]; do
      kill -0 "$pid" 2>/dev/null || { wait "$pid" 2>/dev/null; return 1; }
      now=$(stat -f %m "$beat" 2>/dev/null || stat -c %Y "$beat" 2>/dev/null || true)
      [ -n "$now" ] && [ "$now" != "$first" ] && break
      sleep 0.1; i=$((i+1))
    done
    [ "$i" -lt 300 ] || { kill "$pid" 2>/dev/null; wait "$pid" 2>/dev/null; return 1; }
    cycles=$((cycles + 1))
  done
  kill "$pid" 2>/dev/null; wait "$pid" 2>/dev/null; return 0
}

# Acknowledge the durable wake queue so the next watcher round starts clean.
ack() {  # <state>
  local state=$1 err seq gen
  err="$state/.ack.err"
  FM_STATE_OVERRIDE="$state" "$ROOT/bin/fm-wake-drain.sh" >/dev/null 2>"$err" || return 1
  seq=$(sed -n 's/^WAKE_ACK_REQUIRED:.*--ack-through \([0-9][0-9]*\) --recovery-generation [A-Za-z0-9._-]*$/\1/p' "$err")
  gen=$(sed -n 's/^WAKE_ACK_REQUIRED:.*--ack-through [0-9][0-9]* --recovery-generation \([A-Za-z0-9._-]*\)$/\1/p' "$err")
  [ -n "$seq" ] && [ -n "$gen" ] || return 1
  FM_STATE_OVERRIDE="$state" "$ROOT/bin/fm-wake-drain.sh" --ack-through "$seq" --recovery-generation "$gen" >/dev/null 2>&1
}

stale_wakes() { awk -F '\t' -v w="$WINDOW" '$3=="stale" && $4==w {n++} END {print n+0}' "$1/.wake-queue" 2>/dev/null || echo 0; }

banner() { printf '\n========================================================================\n%s\n========================================================================\n' "$*"; }

printf 'live driver for the declared-wait wedge deferral\n'
printf 'watcher under test : %s\n' "$WATCH"
printf 'watcher commit     : %s\n' "$(cd "$ROOT" && git rev-parse --short HEAD)"
printf 'crewmate window    : %s\n' "$WINDOW"
printf 'wedge threshold    : FM_STALE_ESCALATE_SECS=1 (the 240s default only changes how long each round takes)\n'

# ---------------------------------------------------------------- scenario 1
banner 'S1  a crewmate that declared a bounded wait is not wedge-escalated (#3909)'
H=$(make_home s1-declared-wait 'paused: final validation at step 6/6 - clean whole-assembly baseline (~20 min)' 0)
note "crewmate's own last status line:"
note "    $(cat "$H/state/validate.status")"
note 'driving three consecutive idle windows past the escalation threshold...'
r=0; n=1
while [ "$n" -le 3 ]; do
  run_watcher "$H" absorb || r=1
  n=$((n + 1))
done
check 'watcher stayed supervising across three thresholds (never surfaced a wedge)' "$r"
[ "$(stale_wakes "$H/state")" -eq 0 ]; check 'no stale wake queued for the captain' $?
! grep -qF 'possible wedge' "$H/watch.out"; check 'nothing reported as a possible wedge' $?
[ ! -e "$H/state/.wedge-escalations-$KEY" ]; check 'no wedge escalation counted' $?
note 'what the watcher recorded instead (triage log):'
sed -n 's/^/    /p' "$H/state/.watch-triage.log" | grep -F 'wait explains the quiet' | tail -3
cp "$H/state/.watch-triage.log" "$OUT/s1-declared-wait.triage.log" 2>/dev/null || true

# ---------------------------------------------------------------- scenario 2
banner 'S2  the declared wait is rechecked on the long cadence, naming the external dependency'
H=$(make_home s2-declared-recheck 'paused: waiting on the upstream release cut' 2000)
note "crewmate's own last status line (declared 2000s ago):"
note "    $(cat "$H/state/validate.st

... [458 bytes truncated] ...

ence not a wedge' "$H/watch.out"; check 'recheck is worded as a recheck, not a wedge' $?
! grep -qF 'possible wedge' "$H/watch.out"; check 'no possible-wedge wording' $?
! grep -qF 'release the hold' "$H/watch.out"; check 'did not borrow the captain-held action' $?
w=$(sed -n 's/.*waiting \([0-9][0-9]*\)s.*/\1/p' "$H/watch.out" | head -1)
[ -n "$w" ] && [ "$w" -ge 1900 ]; check "published wait age (${w}s) is the age of the declaration itself" $?
cp "$H/watch.out" "$OUT/s2-declared-recheck.wake.txt"

# ---------------------------------------------------------------- scenario 3
banner 'S3  ADVERSARIAL: a lane with no declaration keeps the unchanged ladder and wording'
H=$(make_home s3-no-declaration 'working: validation under way' 0)
note "crewmate's own last status line (no declared wait):"
note "    $(cat "$H/state/validate.status")"
n=1; r=0
while [ "$n" -le 3 ]; do
  run_watcher "$H" exit || r=1
  ack "$H/state" || r=1
  grep -qF "possible wedge, escalation $n" "$H/watch.out" || r=1
  n=$((n + 1))
done
check 'escalated on every threshold, escalation 1 -> 2 -> 3, on the unchanged schedule' "$r"
grep -qF 'demand-deep-inspection: same pane has wedge-escalated 3 times in a row' "$H/watch.out"
check 'demand-deep-inspection wording intact at the third escalation' $?
note 'what the captain sees:'
sed -n 's/^/    /p' "$H/watch.out"
cp "$H/watch.out" "$OUT/s3-no-declaration.wake.txt"

# ---------------------------------------------------------------- scenario 4
banner 'S4  ADVERSARIAL: a declared wait whose own clearing time already passed escalates as before'
PAST=$(iso_utc_at "$(( $(date +%s) - 7200 ))")
H=$(make_home s4-elapsed-until "paused: waiting on the build queue until $PAST" 0)
note "crewmate's own last status line (clearing time two hours in the past):"
note "    $(cat "$H/state/validate.status")"
run_watcher "$H" exit; check 'watcher surfaced rather than deferring an expired declaration' $?
note 'what the captain sees:'
sed -n 's/^/    /p' "$H/watch.out"
grep -qF 'possible wedge, escalation 1' "$H/watch.out"; check 'unchanged wedge wording and escalation count' $?
cp "$H/watch.out" "$OUT/s4-elapsed-until.wake.txt"

# ---------------------------------------------------------------- scenario 5
banner 'S5  a captain-held transfer is rechecked as a hold ON THE CAPTAIN, not an external wait'
H=$(make_home s5-captain-held 'captain-held: which retention window wins' 2000)
note "crewmate's own last status line:"
note "    $(cat "$H/state/validate.status")"
run_watcher "$H" exit 240; check 'watcher surfaced the hold recheck' $?
note 'what the captain sees:'
sed -n 's/^/    /p' "$H/watch.out"
grep -qF 'awaiting the captain' "$H/watch.out"; check 'recheck names the captain as the human the wait is on' $?
grep -qF 'answer the held decision or release the hold' "$H/watch.out"; check 'recheck names the action that clears the hold' $?
! grep -qF 'awaiting external' "$H/watch.out"; check 'not published as a wait on an external dependency' $?
! grep -qF 'possible wedge' "$H/watch.out"; check 'not reported as a possible wedge' $?
cp "$H/watch.out" "$OUT/s5-captain-held.wake.txt"

# ---------------------------------------------------------------- scenario 6
banner 'S6  ADVERSARIAL: while the captain is away a hold is silent, and the recheck returns intact'
H=$(make_home s6-held-away 'captain-held: which retention window wins' 2000)
FM_HOME="$H" FM_STATE_OVERRIDE="$H/state" "$ROOT/bin/fm-afk-contract.sh" propose >/dev/null 2>&1
FM_HOME="$H" FM_STATE_OVERRIDE="$H/state" "$ROOT/bin/fm-afk-contract.sh" confirm >/dev/null 2>&1
note 'away-posture record written; driving three idle windows past the threshold...'
r=0; n=1
while [ "$n" -le 3 ]; do run_watcher "$H" absorb 240 || r=1; n=$((n + 1)); done
check 'watcher stayed supervising, never woke the away captain' "$r"
[ "$(stale_wakes "$H/state")" -eq 0 ]; check 'no stale wake queued' $?
[ ! -s "$H/watch.out" ]; check 'nothing printed to the captain' $?
[ ! -e "$H/state/.waiting-resurfaced-$KEY" ]; check 'no recheck throttle armed, so the recheck is owed in full on return' $?
note 'what the watcher recorded instead (triage log):'
grep -F 'never rechecked while the away-posture record exists' "$H/state/.watch-triage.log" | sed -n 's/^/    /p' | tail -2
FM_HOME="$H" FM_STATE_OVERRIDE="$H/state" "$ROOT/bin/fm-afk-contract.sh" archive >/dev/null 2>&1
note 'away-posture record archived (captain is back); driving one more idle window...'
: > "$H/watch.out"
run_watcher "$H" exit 240; check 'the hold was rechecked immediately on return, not after another cadence' $?
note 'what the returning captain sees:'
sed -n 's/^/    /p' "$H/watch.out"
grep -qF 'awaiting the captain' "$H/watch.out"; check 'the recheck owed on return still names the captain' $?
cp "$H/watch.out" "$OUT/s6-held-away-return.wake.txt"
cp "$H/state/.watch-triage.log" "$OUT/s6-held-away.triage.log" 2>/dev/null || true


# ---------------------------------------------------------------- scenario 7
banner 'S7  ADVERSARIAL: the declaration still wins when the pane display churns every capture'
H=$(make_home s7-churning-pane 'paused: waiting on the nightly index rebuild' 0)
# A ticking clock / token counter: every capture renders different text, so the
# pane hash changes on every poll. This is the bound the change states openly -
# the recheck throttle is hash-scoped, so such a lane is rechecked once per idle
# window rather than on the long cadence. What must NOT survive is the wedge
# ladder: no escalation, no demand-deep-inspection.
cat > "$H/fakebin/tmux" <<'SH'
#!/usr/bin/env bash
set -u
case "${1:-}" in
  list-windows) printf '%s\n' "${FM_FAKE_TMUX_WINDOW#*:}"; exit 0 ;;
  capture-pane)
    c=$(cat "$FM_FAKE_TMUX_CAPTURE.tick" 2>/dev/null || echo 0)
    printf '%s\n' "$((c + 1))" > "$FM_FAKE_TMUX_CAPTURE.tick"
    printf 'validating: whole-assembly baseline  [%s tokens]\n' "$((c * 137))"
    exit 0 ;;
  display-message) case "$*" in *pane_current_command*) printf 'grok\n'; exit 0 ;; esac ;;
esac
exit 1
SH
chmod +x "$H/fakebin/tmux"
note "crewmate's own last status line:"
note "    $(cat "$H/state/validate.status")"
note 'driving six idle windows against a pane whose text changes on every capture...'
n=1
while [ "$n" -le 6 ]; do
  run_watcher "$H" exit 240 >/dev/null 2>&1 || true
  ack "$H/state" >/dev/null 2>&1 || true
  n=$((n + 1))
done
! grep -qF 'possible wedge' "$H/watch.out"; check 'a churning declared-wait lane is never reported as a possible wedge' $?
! grep -qF 'demand-deep-inspection' "$H/watch.out"; check 'no demand-deep-inspection marker' $?
[ ! -e "$H/state/.wedge-escalations-$KEY" ]; check 'no wedge escalation counted' $?
note 'what the captain sees (the stated bound: rechecked once per idle window, never escalated):'
sort -u "$H/watch.out" | sed -n 's/^/    /p' | head -6
cp "$H/watch.out" "$OUT/s7-churning-pane.wake.txt"

# ---------------------------------------------------------------- scenario 8
banner 'S8  ADVERSARIAL: withdrawing the declaration restores the unchanged escalation'
H=$(make_home s8-lifted-declaration 'paused: waiting on the upstream release cut' 0)
note "crewmate's own last status line:"
note "    $(cat "$H/state/validate.status")"
run_watcher "$H" absorb; check 'while the wait stands the lane is deferred, not escalated' $?
! grep -qF 'possible wedge' "$H/watch.out"; check 'nothing reported as a possible wedge while the wait stands' $?
note 'the crewmate withdraws the wait and reports working again:'
printf 'working: the release landed, resuming validation\n' >> "$H/state/validate.status"
note "    $(tail -1 "$H/state/validate.status")"
FM_STATE_OVERRIDE="$H/state" bash -c '. "$1"; fm_wake_status_mark_current "$2" "$3"' \
  _ "$ROOT/bin/fm-wake-lib.sh" "$H/state" "$H/state/validate.status" >/dev/null
: > "$H/watch.out"
run_watcher "$H" exit; check 'the very next idle window escalates again' $?
note 'what the captain sees:'
sed -n 's/^/    /p' "$H/watch.out"
grep -qF 'possible wedge, escalation 1' "$H/watch.out"; check 'unchanged wedge wording, escalation count starting from 1' $?
cp "$H/watch.out" "$OUT/s8-lifted-declaration.wake.txt"

banner "RESULT: $FAILURES check(s) failed"
rm -rf "$WORK"
[ "$FAILURES" -eq 0 ]
Evidence: Daemon reconciliation clearing the wait-recheck throttle (target commit)

Source: Daemon reconciliation clearing the wait-recheck throttle (target commit)

daemon under test : ~/.no-mistakes/worktrees/041bc5e421de/01M2KP4KYEVBZRJZ44E33K1G73/bin/fm-supervise-daemon.sh
crewmate window   : fleet:fm-crew-validate

state before the crewmate withdraws its wait:
    .paused-fleet_fm-crew-validate
    .paused-rechecked-fleet_fm-crew-validate
    .waiting-resurfaced-fleet_fm-crew-validate

the crewmate withdraws the wait: "working: the release landed, resuming validation"
away-mode daemon reconciles the lane against that new status line...

state after reconciliation:
    (no pause or wait bookkeeping left for this lane)

    PASS  the wait-recheck throttle was cleared with the rest of the lane pause state,
          so the next wait episode on this lane is rechecked from its first window
Evidence: Same daemon check against the pre-fix base tree (throttle survives)

Source: Same daemon check against the pre-fix base tree (throttle survives)

daemon under test : /tmp/fm-base-repo/bin/fm-supervise-daemon.sh
crewmate window   : fleet:fm-crew-validate

state before the crewmate withdraws its wait:
    .paused-fleet_fm-crew-validate
    .paused-rechecked-fleet_fm-crew-validate
    .waiting-resurfaced-fleet_fm-crew-validate

the crewmate withdraws the wait: "working: the release landed, resuming validation"
away-mode daemon reconciles the lane against that new status line...

state after reconciliation:
    .waiting-resurfaced-fleet_fm-crew-validate

    FAIL  the wait-recheck throttle survived the withdrawn declaration;
          the next unrelated wait episode on this lane would lose its first recheck

Pipeline

Updates from git push no-mistakes

✅ **intent** - passed

✅ No issues found.

✅ **Rebase** - passed

✅ No issues found.

⚠️ **Review** - 1 info
  • ℹ️ bin/fm-watch.sh:1037 - The new header claims the wait consult and worktree probe run "at most one each per window per STALE_ESCALATE_SECS, never per poll" (and docs/architecture.md:27 repeats it as "never on an ordinary poll"), but the away-silenced captain-held branch of wedge_defer_wait (bin/fm-watch.sh:984-988) returns before date +%s &gt; &#34;$since_file&#34; at line 1012, so the wedge timer is never restarted. Concrete sequence: a lane whose last status line is captain-held: ... with the away-posture record present crosses STALE_ESCALATE_SECS; on every subsequent poll age &gt;= STALE_ESCALATE_SECS still holds, so the threshold branch re-runs wedge_wait_evidence (a status-file grep) and appends a triage_log line once per FM_POLL (15s default) for the entire away window, instead of once per 240s. Not resetting the timer is deliberate and correct - it is what makes the recheck owed immediately when the record is archived, which the new test pins - so the remedy is to correct the two comments to state the exception, not to change the code. No wake, escalation count or user-visible behavior is affected; the triage log is size-capped and AGENTS.md marks it as never relied on.
✅ **Test** - passed

✅ No issues found.

  • Live validation: ✅ go - 9 of 9 scenarios driven live against the product
Scenario Result Live Evidence
A crewmate that declared a bounded wait is not wedge-escalated across three consecutive idle windows past the threshold (#3909 repro) ✅ pass live Live driver S1 against the real bin/fm-watch.sh: watcher kept supervising through three thresholds, queued no stale wake, printed no possible wedge, and wrote no .wedge-escalations marker; triage lo…
The declared wait is rechecked once on the long cadence, naming the external dependency and the action that resolves it, aged from the declaration itself ✅ pass live Live driver S2: captain receives stale: fleet:fm-crew-validate (idle 2s, waiting 2003s - declared wait, awaiting external, rechecked on a long cadence not a wedge; confirm the wait still holds); pub…
ADVERSARIAL: a lane with no declaration still escalates on exactly the unchanged schedule with unchanged reasons and demand-deep-inspection wording ✅ pass live Live driver S3: escalation 1 -> 2 -> 3 on every threshold plus demand-deep-inspection: same pane has wedge-escalated 3 times in a row - do not re-absorb on the run-step/pane state alone, byte-identi…
ADVERSARIAL: a declared wait whose own until clearing time has already passed stops counting as evidence and keeps the unchanged wedge ladder ✅ pass live Live driver S4 with paused: waiting on the build queue until &lt;2h in the past&gt;: watcher surfaced possible wedge, escalation 1, identical to the base tree. Artifact s4-elapsed-until.wake.txt
A captain-held transfer is rechecked as a hold on the captain, never worded as an external wait ✅ pass live Live driver S5: waiting 2002s - captain-held, awaiting the captain - verified hold transfer ...; answer the held decision or release the hold, with no awaiting external, no `confirm the wait still…
ADVERSARIAL: while the away-posture record exists a hold is absorbed in silence with no throttle armed, and the recheck is owed in full the moment the record is archived ✅ pass live Live driver S6: across three thresholds nothing printed, no stale wake queued, no .waiting-resurfaced marker written, triage log records never rechecked while the away-posture record exists; after a…
ADVERSARIAL: a declared-wait lane whose pane display churns on every capture still never reaches the wedge ladder ✅ pass live Live driver S7 with a fake tmux rendering a changing token counter on every capture, six idle windows: no possible wedge, no demand-deep-inspection, no escalation counter. This is the bound the ch…
ADVERSARIAL: withdrawing the declaration restores the unchanged escalation on the very next idle window, so detection is deferred and not deleted ✅ pass live Live driver S8: the lane is deferred while paused: stands, then after the worker appends working: the release landed, resuming validation the next window emits possible wedge, escalation 1. Arti…
Away-mode daemon reconciliation clears the wait-recheck throttle when the crewmate withdraws its declaration, so the lane's next wait episode is not robbed of its first recheck ✅ pass live Live driver against the real reconcile_pause_tracking entry point of bin/fm-supervise-daemon.sh: .waiting-resurfaced-<key> is removed with the rest of the lane pause state on the target commit, while…
  • bin/fm-test-run.sh tests/fm-watch-triage.test.sh - 115/115 pass, exit 0 (owning suite for bin/fm-watch.sh; includes the two new cases test_wedge_threshold_defers_to_a_declared_wait_under_a_working_verdict and test_wedge_threshold_recheck_names_the_captain_for_a_held_lane, and the rewritten test_paused_authoritative_working_preserves_wedge_timer)
  • bin/fm-test-run.sh tests/fm-daemon.test.sh - 126/126 pass, exit 0 (owning suite for the touched bin/fm-supervise-daemon.sh)
  • Manual live driver live-wedge-drive.sh - stands up real firstmate state homes and runs the real bin/fm-watch.sh process through 8 end-to-end scenarios (declared wait, long-cadence recheck, undeclared control ladder, elapsed until, captain-held recheck, captain-held under the away-posture record and on return, churning pane, withdrawn declaration); 0 of 33 checks failed
  • Same driver re-run against a pre-fix tree extracted from base commit bdcacb9 - 19 checks fail, reproducing the reported escalation ladder and demand-deep-inspection wording on a declared wait
  • Manual live driver live-daemon-throttle-drive.sh - drives the real reconcile_pause_tracking entry point of bin/fm-supervise-daemon.sh against real state; passes on the target and fails on the base tree
  • git status --porcelain - worktree clean, no transient test artifacts left behind
⚠️ **Document** - 1 info
  • ℹ️ docs/architecture.md:62 - Out-of-scope consolidation worth a follow-up: the "Event-driven supervision" section now states the declared-wait-is-not-a-wedge rule twice, ~40 lines apart, for two distinct mechanisms. Lines 20-30 (added by this change) describe the wedge-timer deferral for a live, provably-working pane, while line 62 describes the older pause_state_class absorb for a pane whose agent is confidently dead, using near-identical wording ("re-surfaced only on the longer pause cadence, rather than being treated as a possible wedge"). Read on its own, line 62 reads as though it already covers the case this change fixed. Neither statement is wrong, so nothing here is stale; resolving it means restructuring the section into one declared-wait subsection that distinguishes the live and dead-agent paths, which is beyond this change's scope.
✅ **Lint** - passed

✅ No issues found.

✅ **Push** - passed

✅ No issues found.

wedge_timer_check escalated on elapsed idle time alone. Nothing asked
whether the worker had already said why its pane was quiet, so a lane
that declared a bounded external wait climbed the escalation ladder for
as long as the wait lasted, and past FM_WEDGE_DEMAND_INSPECT_COUNT every
repeat carried demand-deep-inspection - which by its own wording forbids
re-absorbing on the run-step or pane state, so the supervisor could not
use the evidence that was there either.

The generated brief promises that declaring `paused:` buys the long
recheck cadence instead of a wedge, but the timer was still reachable
while that declaration stood: a crew that declares a wait and then has an
active run or busy pane attributed to it is handed to the timer as
provably-working. The declaration is what the worker said about its own
silence, so it now outranks a liveness verdict that only says something
is running.

The consult runs in the at-threshold branch that was about to escalate,
beside the worktree walk already there, and costs one status-line read.
Either status-line record defers to the same FM_PAUSE_RESURFACE_SECS
recheck the declared-wait absorber already uses, so the wait is still
rechecked and cannot rot invisibly. Which verb declared it decides the
wording, because the two block on different people: a `paused:` wait is
owed by an external dependency and asks the reader to confirm it still
holds, while a `captain-held:` transfer is owed by the captain reading
the recheck and asks them to answer or release the hold. A hold is not
rechecked at all while the away-posture record exists, as on every other
captain-held path, and that absorb arms no throttle so the recheck is
owed in full on return.

A declared clearing time that has already passed stops counting, and a
lane that never declared one keeps the identical escalation schedule,
reason, count and demand-deep-inspection wording, so detection and its
worst-case time are unchanged. The deferral restarts the idle timer
rather than cancelling it, so a lane that stops waiting escalates again
within one threshold.

A lane quiet because its own validation run is parked at a gate awaiting
a human decision is deliberately out of scope: reading that state needs a
signal carrying who the wait is on and what clears it, rather than one
inferred from a parked verdict that also covers gates awaiting the
crewmate itself.

Tests pin both directions for each case and were each confirmed to fail
with the consult removed.
@kunchenguid
kunchenguid merged commit b430bf5 into kunchenguid:main Sep 16, 2026
14 checks passed
@kunchenguid

Copy link
Copy Markdown
Owner

Speaking as Kun's firstmate: this is merged. Thank you @aminry — really appreciate you taking the time on this.

contract-class: restore — generated brief already promises that a declared paused: leaves the idle pane alone on the long recheck cadence instead of wedge-escalating; wedge_wait_evidence / wedge_defer_wait make wedge_timer_check honour that existing contract (Closes #3909, Closes #2614 — verified in author body).

VISION (per-rule): One captain/one interface — aligns (fewer false demand-deep-inspection wakes). Authority explicit — aligns (no new autonomy; declaration already captain-facing). Scripts own mechanics — aligns (deterministic status-line consult in fm-watch.sh). Restart non-event — aligns (durable .waiting-* markers). Delegation with a spine — aligns (refusal/recheck path strengthened). Fleet outlives vendor — aligns (status-line contract, not UI pixels). Scope — aligns (supervision honesty, not workshop).