Skip to content

fix(bin): bound repeat stale alarms for live unknown-busy panes with progress - #7220

Closed
zestysoft wants to merge 5 commits into
kunchenguid:mainfrom
zestysoft:fm/firstmate-monitor-alarm-bounds
Closed

zestysoft wants to merge 5 commits into
kunchenguid:mainfrom
zestysoft:fm/firstmate-monitor-alarm-bounds

Conversation

@zestysoft

@zestysoft zestysoft commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

Intent

Stop the repeated false "waiting too long" alarms on a live worker whose busy state the monitor cannot read, without weakening real wedge detection.

What is happening: a Pokemodz reverse-engineering worker running long single turns raised a possible-wedge alarm roughly every 1 to 8 minutes for hours. The monitor cannot classify that worker runtime's busy state - the state reader reports unknown codex-unverified for that pane - and an unreadable-but-alive pane escalates immediately by design, so the idle-patience setting never applies to it. Each escalation closes the monitoring cycle with exit code 0 and reason actionable-stale and starts a successor, which the monitor's own lifecycle ledger shows as a long run of consecutive identical rows, so the interruptions became self-reinforcing rather than occasional noise. The worker was verifiably alive and advancing the whole time: its own status log stayed fresh and its task worktree kept receiving recovered source files.

The second, related gap is that watcher patience settings cannot be persisted in a home with no Relay pairing token. The only file the watcher arm sources them from is config/x-mode.env, and the startup routine deletes that file on every run when no Relay token is configured, so an applied patience value silently disappears at the next session start.

Both gaps are in firstmate's own monitoring and startup code, and the ask is to fix them there rather than work around them.

What Changed

  • bin/fm-watch.sh: new unknown_alive_stale_bound check in surface_nonterminal_stale. It applies only when there is no declared wait, the busy reader returns unknown, and the recovery-grade endpoint probe says the agent is alive. It also needs progress inside one FM_STALE_ESCALATE_SECS window: either the task's own status log or its own task worktree was written in that window. If all of that holds, repeat new-hash alarms wait for the FM_PAUSE_RESURFACE_SECS cadence. The first sighting still alarms. A pane with no progress still alarms on every new hash.
  • bin/fm-watch-arm.sh: now sources a new home-local config/watch.env before config/x-mode.env. Watcher tuning like FM_PAUSE_RESURFACE_SECS now survives in homes without Relay, because bootstrap never deletes this file. Relay's 30s cadence still wins when Relay is on.
  • Docs updated (docs/architecture.md, docs/configuration.md, operational-home-layout skill). Tests added in tests/fm-watch-triage.test.sh (the bound, plus the no-progress path) and tests/fm-x-mode.test.sh (watch.env loading and order).

🤖 Generated with Claude Code

Risk Assessment

✅ Low: The quiet-period rule only applies to panes whose busy state is unknown, whose agent is proven alive, and that show fresh progress, and it re-checks progress on every sighting. CONFIG is now set safely in the arm, the arm is the single place watch.env is loaded, and the round-3 test fix now matches what the code really does, with both directions covered.

Testing

The 4 targeted tests passed (2 triage, 2 x-mode). Then I drove the real watcher, the real wake drain, bootstrap, and the watcher arm in disposable marked lab homes on a private tmux socket. A live unknown-state pane with fresh worktree writes alarmed once in 150s on the new code, versus 9 alarms on the base code. A live unknown-state pane with no progress evidence kept alarming about every 10-20s on both. watch.env survived bootstrap in a home with no Relay token, and the arm-launched watcher had FM_PAUSE_RESURFACE_SECS=777 with no unbound-variable crash. Everything was torn down and the worktree is clean. The worker panes were simple stand-in processes with argv0 codex, not a real Codex session. The busy reader returns unknown codex-unverified for every Codex pane (codex harness gate), so the watcher saw the same unknown-but-alive state as in the incident. This is a terminal and watcher change, so it has no visual UI to screenshot.

  • Live validation: ✅ go - 5 of 5 scenarios driven live against the product
Scenario Result Live Evidence
A live, unreadable-state worker that keeps writing recovered files to its worktree raises one stale alarm, then no repeats for the pause window ✅ pass live live-new-watcher.txt: lab:fm-prog shows stale once (03:36:37), then none through 03:38:33 even though its screen changed every 12s
Before/after: on the base code, the same worker repeats the false alarm every cycle ✅ pass live live-base-watcher.txt: lab:fm-prog gave 9 stale alarms in 150s with the base fm-watch.sh, matching the reported issue
Adversarial: a live, unreadable-state pane with no progress evidence (old status log, old worktree) keeps alarming on every new screen instead of going quiet ✅ pass live live-new-watcher.txt: lab:fm-noprog alarms in 11 of 13 cycles over 150s; both targeted triage tests pass
In a home with no Relay token, config/watch.env survives fm-bootstrap.sh ✅ pass live live-watch-env-arm.txt: watch.env is still present with FM_PAUSE_RESURFACE_SECS=777 after a real bootstrap
fm-watch-arm.sh with CONFIG unset loads watch.env without crashing, and the launched watcher gets the setting ✅ pass live live-watch-env-arm.txt: watcher: started pid=11708, and ps eww shows FM_PAUSE_RESURFACE_SECS=777 in that watcher; no unbound-variable error; --stop exits 0
Evidence: Live watcher run on the new code (progress pane alarms once, no-progress pane keeps alarming)

Source: Live watcher run on the new code (progress pane alarms once, no-progress pane keeps alarming)

== NEW: liveness/busy probes
lab:fm-prog alive=alive busy=unknown codex-unverified
lab:fm-noprog alive=alive busy=unknown codex-unverified
03:36:04 cycle=1 rc=0 out=[signal: /var/folders/vm/y9zpsxps43q2cvqmbq1xpqd00000gn/T//fm-lab.6r7OKp/state/noprog.status /var/folders/vm/y9zpsxps43q2cvqmbq1xpqd00000gn/T//fm-lab.6r7OKp/state/prog.status ]
03:36:13 cycle=2 rc=0 out=[stale: lab:fm-noprog ]
03:36:23 cycle=3 rc=0 out=[stale: lab:fm-noprog ]
03:36:32 cycle=4 rc=0 out=[stale: lab:fm-noprog ]
03:36:37 cycle=5 rc=0 out=[stale: lab:fm-prog ]
03:36:46 cycle=6 rc=0 out=[stale: lab:fm-noprog ]
03:36:56 cycle=7 rc=0 out=[stale: lab:fm-noprog ]
03:37:13 cycle=8 rc=0 out=[stale: lab:fm-noprog ]
03:37:35 cycle=9 rc=0 out=[stale: lab:fm-noprog ]
03:37:46 cycle=10 rc=0 out=[stale: lab:fm-noprog ]
03:37:59 cycle=11 rc=0 out=[stale: lab:fm-noprog ]
03:38:09 cycle=12 rc=0 out=[stale: lab:fm-noprog ]
03:38:23 cycle=13 rc=0 out=[stale: lab:fm-noprog ]
03:38:33 cycle=14 rc=124 out=[ ]
== NEW: triage log tail
Evidence: Live watcher run on the base code (progress pane alarms ~every 13s)

Source: Live watcher run on the base code (progress pane alarms ~every 13s)

== BASE: liveness/busy probes
lab:fm-prog alive=alive busy=unknown codex-unverified
lab:fm-noprog alive=alive busy=unknown codex-unverified
03:41:32 cycle=1 rc=0 out=[signal: /var/folders/vm/y9zpsxps43q2cvqmbq1xpqd00000gn/T//fm-lab.305eO2/state/noprog.status /var/folders/vm/y9zpsxps43q2cvqmbq1xpqd00000gn/T//fm-lab.305eO2/state/prog.status ]
03:41:47 cycle=2 rc=0 out=[stale: lab:fm-noprog ]
03:41:51 cycle=3 rc=0 out=[stale: lab:fm-prog ]
03:42:00 cycle=4 rc=0 out=[stale: lab:fm-noprog ]
03:42:04 cycle=5 rc=0 out=[stale: lab:fm-prog ]
03:42:13 cycle=6 rc=0 out=[stale: lab:fm-noprog ]
03:42:17 cycle=7 rc=0 out=[stale: lab:fm-prog ]
03:42:26 cycle=8 rc=0 out=[stale: lab:fm-noprog ]
03:42:35 cycle=9 rc=0 out=[stale: lab:fm-noprog ]
03:42:39 cycle=10 rc=0 out=[stale: lab:fm-prog ]
03:42:48 cycle=11 rc=0 out=[stale: lab:fm-noprog ]
03:42:52 cycle=12 rc=0 out=[stale: lab:fm-prog ]
03:43:01 cycle=13 rc=0 out=[stale: lab:fm-noprog ]
03:43:04 cycle=14 rc=0 out=[stale: lab:fm-prog ]
03:43:14 cycle=15 rc=0 out=[stale: lab:fm-noprog ]
03:43:17 cycle=16 rc=0 out=[stale: lab:fm-prog ]
03:43:27 cycle=17 rc=0 out=[stale: lab:fm-noprog ]
03:43:36 cycle=18 rc=0 out=[stale: lab:fm-noprog ]
03:43:40 cycle=19 rc=0 out=[stale: lab:fm-prog ]
03:43:49 cycle=20 rc=0 out=[stale: lab:fm-noprog ]
03:43:53 cycle=21 rc=0 out=[stale: lab:fm-prog ]
03:43:59 cycle=22 rc=124 out=[ ]
== BASE: triage log tail
Evidence: Bootstrap keeps watch.env; arm hands FM_PAUSE_RESURFACE_SECS=777 to the real watcher

Source: Bootstrap keeps watch.env; arm hands FM_PAUSE_RESURFACE_SECS=777 to the real watcher

$ ls config (before bootstrap): watch.env
$ fm-bootstrap.sh (no Relay token)
$ ls config (after bootstrap): startup-memory-budget
watch.env
export FM_PAUSE_RESURFACE_SECS=777
$ fm-watch-arm.sh
arm output so far:
watcher: started pid=11708 (beacon fresh)
watcher pid 11708 env:
FM_PAUSE_RESURFACE_SECS=777
FM_HOME=/var/folders/vm/y9zpsxps43q2cvqmbq1xpqd00000gn/T/fm-lab.uoLUzX
--- arm output after exit:
watcher: started pid=11708 (beacon fresh)
Terminated: 15             sleep "$POLL"
$ fm-watch-arm.sh --stop
watcher: none running
rc=0
Evidence: Lab driver script for the watcher scenarios

Source: Lab driver script for the watcher scenarios

#!/usr/bin/env bash
# usage: drive.sh <bin-dir> <label> <duration-secs>
set -u
BIN=$1; LABEL=$2; DUR=$3; WT=$PWD
LAB=$(mktemp -d "${TMPDIR:-/tmp}/fm-lab.XXXXXX")
"$WT/bin/fm-lab-home.sh" create "$LAB" >/dev/null; mkdir -p "$LAB/tmux"
export TMUX_TMPDIR="$LAB/tmux"
T="tmux -L fm-lab"
FAKE='exec -a codex bash -c "i=0; while :; do i=\$((i+1)); echo long codex turn step \$i; sleep 12; done"'
$T new-session -d -s lab -n fm-prog "bash -c '$FAKE'"
$T new-window -d -t lab -n fm-noprog "bash -c '$FAKE'"
SOCK=$($T display -p '#{socket_path}')
S=$LAB/state; old=$(( $(date +%s) - 1000 )); oldstamp=$(date -r $old +%Y%m%d%H%M.%S)
for t in prog noprog; do
  mkdir -p "$LAB/wt-$t/src"; : > "$LAB/wt-$t/src/old.c"; touch -t $oldstamp "$LAB/wt-$t/src/old.c"
  printf 'window=lab:fm-%s\nkind=ship\nharness=codex\nbackend=tmux\nworktree=%s\n' $t "$LAB/wt-$t" > "$S/$t.meta"
  printf 'working: recovering source files\n' > "$S/$t.status"; touch -t $oldstamp "$S/$t.status"
done
# prog worker keeps recovering source files into its own worktree
( n=0; while [ -d "$LAB/wt-prog" ]; do n=$((n+1)); printf 'x\n' > "$LAB/wt-prog/src/recovered$n.c" 2>/dev/null; sleep 10; done ) &
WRITER=$!
echo "== $LABEL: liveness/busy probes"
( export TMUX="$SOCK,0,0" FM_HOME="$LAB"; . "$BIN/fm-backend.sh"; . "$BIN/fm-busy-lib.sh"
  for w in lab:fm-prog lab:fm-noprog; do echo "$w alive=$(fm_backend_agent_alive tmux $w) busy=$(fm_busy_classify tmux $w codex x $S)"; done )
end=$(( $(date +%s) + DUR )); cycle=0
while [ "$(date +%s)" -lt "$end" ]; do
  cycle=$((cycle+1))
  out=$(env -u NO_MISTAKES_GATE -u FM_GATE_REFUSE_BYPASS -u FM_ROOT_OVERRIDE -u FM_STATE_OVERRIDE -u FM_DATA_OVERRIDE -u FM_CONFIG_OVERRIDE -u FM_PROJECTS_OVERRIDE \
     TMUX="$SOCK,0,0" FM_HOME="$LAB" FM_POLL=2 FM_SIGNAL_GRACE=1 FM_CHECK_INTERVAL=999999 FM_HEARTBEAT=999999 \
     FM_PAUSE_RESURFACE_SECS=3600 timeout $(( end - $(date +%s) + 1 )) "$BIN/fm-watch.sh" 2>/dev/null); rc=$?
  echo "$(date +%T) cycle=$cycle rc=$rc out=[$(echo "$out" | tr '\n' ' ')]"
  err=$(mktemp); FM_HOME="$LAB" "$BIN/fm-wake-drain.sh" >/dev/null 2>"$err"
  seq=$(sed -n 's/^WAKE_ACK_REQUIRED:.*--ack-through \([0-9]*\) --recovery-generation \([A-Za-z0-9._-]*\)$/\1 \2/p' "$err"); rm -f "$err"
  [ -n "$seq" ] && FM_HOME="$LAB" "$BIN/fm-wake-drain.sh" --ack-through ${seq% *} --recovery-generation ${seq#* } >/dev/null 2>&1
done
echo "== $LABEL: triage log tail"; grep -h "fm-prog\|fm-noprog" "$S"/*triage* 2>/dev/null | tail -8
kill $WRITER; $T kill-server; rm -rf "$LAB"
Evidence: Lab driver script for the watch.env scenario

Source: Lab driver script for the watch.env scenario

#!/usr/bin/env bash
# usage: live-watch-env-arm.sh <marked-lab-home>   (run from the worktree)
LAB=$1
U=(env -u NO_MISTAKES_GATE -u FM_GATE_REFUSE_BYPASS -u FM_ROOT_OVERRIDE -u FM_STATE_OVERRIDE -u FM_DATA_OVERRIDE -u FM_CONFIG_OVERRIDE -u FM_PROJECTS_OVERRIDE -u CONFIG -u FM_PAUSE_RESURFACE_SECS TMUX_TMPDIR=$LAB/tmux FM_HOME=$LAB)
echo "\$ ls config (before bootstrap): $(ls $LAB/config)"
echo '$ fm-bootstrap.sh (no Relay token)'; "${U[@]}" bin/fm-bootstrap.sh 2>&1 | tail -5
echo "\$ ls config (after bootstrap): $(ls $LAB/config)"; cat $LAB/config/watch.env
echo '$ fm-watch-arm.sh'; "${U[@]}" timeout 20 bin/fm-watch-arm.sh > $LAB/arm.out 2>&1 &
sleep 8; echo "arm output so far:"; cat $LAB/arm.out
for p in $(pgrep -f "$PWD/bin/fm-watch.sh"); do
  ps eww -p $p -o command= | grep -q "FM_HOME=$LAB" && { echo "watcher pid $p env:"; ps eww -p $p -o command= | tr ' ' '\n' | grep -E '^FM_PAUSE_RESURFACE_SECS=|^FM_HOME='; }
done
wait; echo "--- arm output after exit:"; cat $LAB/arm.out
echo '$ fm-watch-arm.sh --stop'; "${U[@]}" bin/fm-watch-arm.sh --stop 2>&1 | tail -3; echo "rc=${PIPESTATUS[0]}"
Evidence: Targeted triage tests

Source: Targeted triage tests

ok - an unknown-but-alive pane with progress evidence alarms once per bounded pause-resurface window
ok - an unknown-but-alive pane without progress evidence keeps surfacing every new hash
rc=0
Evidence: Targeted x-mode tests

Source: Targeted x-mode tests

ok - bootstrap preserves home-local watcher tuning and the arm hands it to the watcher
ok - bootstrap is inert without a non-empty .env token (non-X users unaffected)
rc=0

CI baseline evidence

The pipeline rebased this change from 6407052.
On pristine default-branch main at 1f3e7696 with a clean tree, PATH="/Users/Ian/.bun/install/global/node_modules/typescript/bin:$PATH" bash tests/fm-pi-primary-types.test.sh fails identically against Pi 1.2.0: TS2339 reports that BeforeAgentStartEvent has no prompt property in fm-primary-pi-watch.ts and fm-branch-supervision.ts.
The same two tracked extension lines fail locally on this task branch, and neither line is changed by this pull request.
The red Behavior check is therefore pre-existing Pi type drift on pristine main, not a watcher-alarm or persisted-state regression; all other reported checks are green.

Pipeline

Updates from git push no-mistakes

✅ **intent** - passed

✅ No issues found.

✅ **Rebase** - passed

✅ No issues found.

🔧 **Review** - 3 issues found → auto-fixed (3) ✅
  • 🚨 bin/fm-watch-arm.sh:129 - fm-watch-arm.sh runs under set -u but never defines CONFIG (only STATE is set via fm-wake-lib.sh; fm-path-lib/fm-gate-refuse-lib do not set CONFIG, and no caller exports it — fm-claude-stop-autoarm.sh:140, fm-turnend-guard-cursor.sh, the Pi/OMP extensions and agent-run arms all invoke it without CONFIG in env). The new [ -f &#34;$CONFIG/watch.env&#34; ] therefore aborts with CONFIG: unbound variable (reproduced with set -u; . bin/fm-wake-lib.sh; [ -f &#34;$CONFIG/watch.env&#34; ]), so every watcher arm/--restart/--stop/--take-over exits before doing anything: supervision breaks entirely. Same unbound use at bin/fm-watch-arm.sh:131. Fix: define CONFIG=&#34;${FM_CONFIG_OVERRIDE:-$FM_HOME/config}&#34; (matching the other bin scripts) before sourcing.
  • ⚠️ bin/fm-watch.sh:1978 - unknown_alive_stale_bound absorbs every new-hash stale sighting for PAUSE_RESURFACE_SECS (default 4h) on any pane whose busy verdict is unknown and whose endpoint is alive, without checking any progress evidence (fresh status log, task-worktree writes). A genuinely wedged Codex pane that still animates (spinner/timer churns hash) and has a live process now alarms once and then is silent for 4h, and the comment confirms such unknown panes never reach wedge_timer_check. Intent requires 'without weakening real wedge detection' and cites status-log freshness and worktree writes as the proof of liveness; consider gating the bound on that progress evidence instead of process liveness alone. Remedy changes detection policy, so needs author decision.
  • ℹ️ tests/fm-x-mode.test.sh:980 - test_bootstrap_preserves_nonrelay_watcher_tuning would pass before this change (bootstrap never touched config/watch.env) and its 'inherited' check only sources the file it just wrote, so it does not prove a watcher loader picks the value up. No test exercises fm-watch-arm.sh with a config/watch.env present, which is why the unbound-CONFIG crash is unguarded; a behavioral test arming with watch.env and asserting the watcher sees FM_PAUSE_RESURFACE_SECS would cover the intent's second gap.

🔧 Fix applied.
2 issues (1 error, 1 warning) still open:

  • 🚨 bin/fm-watch-arm.sh:129 - fm-watch-arm.sh runs under set -u but never defines CONFIG (only STATE is set via fm-wake-lib.sh; fm-path-lib/fm-gate-refuse-lib do not set CONFIG, and no caller exports it — fm-claude-stop-autoarm.sh:140, fm-turnend-guard-cursor.sh, the Pi/OMP extensions and agent-run arms all invoke it without CONFIG in env). The new [ -f &#34;$CONFIG/watch.env&#34; ] therefore aborts with CONFIG: unbound variable (reproduced with set -u; . bin/fm-wake-lib.sh; [ -f &#34;$CONFIG/watch.env&#34; ]), so every watcher arm/--restart/--stop/--take-over exits before doing anything: supervision breaks entirely. Same unbound use at bin/fm-watch-arm.sh:131. Fix: define CONFIG=&#34;${FM_CONFIG_OVERRIDE:-$FM_HOME/config}&#34; (matching the other bin scripts) before sourcing.
  • ⚠️ bin/fm-watch-arm.sh:128 - Fix round 1 made bin/fm-watch-arm.sh source config/watch.env and then config/x-mode.env itself. Every arm path goes through this script, so the caller-side copies added in the original commit no longer do anything: bin/fm-claude-stop-autoarm.sh:326-328, bin/fm-turnend-guard-cursor.sh:298-300, and the watch.env clause in .pi/extensions/fm-primary-pi-watch.ts:1075. They are parallel copies of one loading rule, and the intent only needs one loader. They also make docs/configuration.md:1593 ('every current watcher loader sources it') misleading: the OMP (.omp/extensions/fm-primary-omp-watch.ts:972) and OpenCode (.opencode/plugins/fm-primary-watch-arm.js:428) loaders were not changed and only get watch.env through the arm. Recommended fix: remove the three caller-side watch.env additions, keep the single load inside fm-watch-arm.sh, and reword the doc to say the watcher arm loads it.

🔧 Fix applied.
1 warning still open:

  • ⚠️ tests/fm-watch-triage.test.sh:1183 - Fix round 1 added the worktree case of unknown_alive_stale_case, and it seems to expect behavior the code does not have. Trace: at the first sight, the status log is aged 1000s and the worktree holds only src/old.c, also aged 1000s. So unknown_alive_progressing (bin/fm-watch.sh:2004) returns 1. unknown_alive_stale_bound then returns before it sets STALE_WAIT_DECLARATION (bin/fm-watch.sh:1998). The first wake fires, but stale_wait_record writes no .paused-resurfaced-&lt;key&gt; marker (bin/fm-watch.sh:1868). Before the second sight, the test writes wt/src/recovered.c. Progress now passes and the declaration gets set, but stale_wait_throttled finds no marker. It returns 1, the elif [ -n &#34;$STALE_WAIT_DECLARATION&#34; ] branch runs, throttled stays 1, and the successor alarms and exits. The test asserts the opposite ('a bounded unknown-but-alive successor exited' / 'printed a stale wake'), so it should fail. The status case passes only because its status log is fresh at the first sight. The code's behavior is defensible: the bound only starts at an alarm that already had progress evidence, so it costs at most one extra alarm when evidence first shows up. Smallest fix: in the worktree case, create the fresh worktree write before the first sight (so first sight → alarm + marker, second sight → absorbed), and assert that the evidence was present at the first alarm.

🔧 Fix applied.
✅ Re-checked - no issues remain.

✅ **Test** - passed

✅ No issues found.

  • Live validation: ✅ go - 5 of 5 scenarios driven live against the product
Scenario Result Live Evidence
A live, unreadable-state worker that keeps writing recovered files to its worktree raises one stale alarm, then no repeats for the pause window ✅ pass live live-new-watcher.txt: lab:fm-prog shows stale once (03:36:37), then none through 03:38:33 even though its screen changed every 12s
Before/after: on the base code, the same worker repeats the false alarm every cycle ✅ pass live live-base-watcher.txt: lab:fm-prog gave 9 stale alarms in 150s with the base fm-watch.sh, matching the reported issue
Adversarial: a live, unreadable-state pane with no progress evidence (old status log, old worktree) keeps alarming on every new screen instead of going quiet ✅ pass live live-new-watcher.txt: lab:fm-noprog alarms in 11 of 13 cycles over 150s; both targeted triage tests pass
In a home with no Relay token, config/watch.env survives fm-bootstrap.sh ✅ pass live live-watch-env-arm.txt: watch.env is still present with FM_PAUSE_RESURFACE_SECS=777 after a real bootstrap
fm-watch-arm.sh with CONFIG unset loads watch.env without crashing, and the launched watcher gets the setting ✅ pass live live-watch-env-arm.txt: watcher: started pid=11708, and ps eww shows FM_PAUSE_RESURFACE_SECS=777 in that watcher; no unbound-variable error; --stop exits 0
  • bash tests/fm-watch-triage.test.sh limited to test_unknown_alive_stale_is_bounded_after_its_first_alarm and test_unknown_alive_stale_without_progress_keeps_surfacing (temp filtered copy, removed after)
  • bash tests/fm-x-mode.test.sh limited to test_bootstrap_preserves_nonrelay_watcher_tuning and test_bootstrap_inert_without_token (temp filtered copy, removed after)
  • live-drive.sh $PWD/bin NEW 150: marked lab home from bin/fm-lab-home.sh create, private tmux -L fm-lab socket, two windows running a process with argv0 codex (alive, busy=unknown codex-unverified). fm-prog's worktree gets a new source file every 10s; fm-noprog only has 1000s-old files. Real bin/fm-watch.sh was re-armed for 150s, and each wake was acked with the real bin/fm-wake-drain.sh
  • live-drive.sh &lt;base-bin&gt; BASE 150: the same lab, using fm-watch.sh and fm-watch-arm.sh from base commit 6407052
  • live-watch-env-arm.sh &lt;lab&gt;: wrote config/watch.env (FM_PAUSE_RESURFACE_SECS=777) in a marked lab home with no Relay token, ran the real bin/fm-bootstrap.sh, then ran the real bin/fm-watch-arm.sh with CONFIG and FM_PAUSE_RESURFACE_SECS unset, read the launched watcher's environment with ps eww, then ran fm-watch-arm.sh --stop
  • Teardown: tmux kill-server, background writer killed, rm -rf of lab homes and the temp base bin; worktree git status is clean
✅ **Document** - passed

✅ No issues found.

✅ **Lint** - passed

✅ No issues found.

✅ **Push** - passed

✅ No issues found.

@kunchenguid

Copy link
Copy Markdown
Owner

Speaking as Kun's firstmate: thank you @zestysoft — bounding the unknown-but-alive false alarms (while keeping the first sight and the no-progress path loud) is exactly the kind of watcher calm the fleet needs.

VISION (each rule):

  • One captain, one interface: aligns (cuts spam without hiding a real wedge).
  • Authority is explicit: aligns (no new autonomy; first alarm still surfaces).
  • Scripts own the mechanics: aligns (bash bound on progress evidence).
  • A restart is a non-event: aligns (config/watch.env is durable, LOCAL, opt-in).
  • Delegation with a spine: neutral.
  • The fleet outlives any vendor: aligns (recovery-grade alive + progress, not harness-specific busy class).
  • Scope: aligns. Token: none on the hot path.

Contract-class: restore. The unconfigured watcher already promised progress-based deferral (declared waits, worktree-write probes, FM_PAUSE_RESURFACE_SECS). Unknown-alive panes with status/worktree progress inside FM_STALE_ESCALATE_SECS were incorrectly re-alarming on every new hash; this restores the existing bound after the first sight. Absent progress, every new hash still surfaces. config/watch.env is opt-in (absent = no change).

Where it stands: attestation MATCH eb4c2f3d, live go 5/5. CI on this tip: Behavior portable parallel 1 failed only on main's known Pi 1.2 type drift (BeforeAgentStartEvent.prompt / fm-pi-primary-types) — not your change. Serial 2 hit the known 30-min cancel. Everything else green. Main itself is red on those same shards, so nothing merges this wake. No action needed from you; once main is green this is in the auto-merge lane (corrective restore).

@zestysoft

Copy link
Copy Markdown
Contributor Author

Superseded by an issue-first pull request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants