Skip to content

test: repair base-red liveness, export-DOM, and wake-queue self-tests - #5338

Merged
kunchenguid merged 5 commits into
kunchenguid:mainfrom
blackxwhite88:fm/main-test-red-blocks-all-validation
Sep 23, 2026
Merged

kunchenguid merged 5 commits into
kunchenguid:mainfrom
blackxwhite88:fm/main-test-red-blocks-all-validation

Conversation

@blackxwhite88

@blackxwhite88 blackxwhite88 commented Sep 22, 2026 •

Copy link
Copy Markdown
Contributor

Intent

Fix the base-red self-tests on untouched upstream main so a truthful no-mistakes attestation can bind this branch, which is what the upstream contribution chain is stalled on. Three self-tests fail on the untouched base: tests/fm-tmux-agent-liveness.test.sh reads every harness-named positive case as not-alive because its stand-in harness binaries symlink to the host's sleep, which on a multicall coreutils (uutils or busybox) dispatches on argv[0] and runs the wrong applet and exits; tests/fm-calm-pi-extension.test.sh cannot render its export DOM because render_export_dom pins a brand-new --user-data-dir that makes Chrome's first-run initialization never complete; tests/fm-wake-queue.test.sh surfaces check: rearm-resurface instead of its asserted secondmate stall because its quiet observation checkpoints carry a 1s ceiling that sits under a full watcher poll iteration on a loaded host. Repair each root cause in current code, keep or strengthen coverage, and never weaken, delete, or skip an assertion. Both target files and the wake-queue file must be fully green, with syntax and shellcheck clean.

Re-attestation run only: the branch head is now upstream triage's empty anchor commit e02c719 (parent 7372c8d, zero files), pushed by them to re-trigger fork workflow approval, and this run exists to rebind the no-mistakes pipeline attestation to that head through the supported pipeline path. The rebase step is skipped because the branch already sits at the anchor upstream just approved and a rebase could rewrite that exact head; no substantive change is being validated, and the content is identical to what this pipeline already validated at 7372c8d.

What Changed

  • tests/fm-tmux-agent-liveness.test.sh now stands in for harness binaries with a dedicated long-running spinner binary (compiled when a C compiler is present, otherwise a host sleep symlink only if it demonstrably survives the rename), so multicall coreutils no longer dispatch on the renamed argv[0] and positive cases read as alive; the CC_BIN lookup is hoisted and reused.
  • tests/fm-calm-pi-extension.test.sh gives each Chrome render attempt a private HOME (with XDG_CONFIG_HOME and XDG_CACHE_HOME beneath it) on Linux and other non-Darwin systems while keeping the explicit --user-data-dir on Darwin, so first-run profile initialization completes and --dump-dom returns.
  • tests/fm-wake-queue.test.sh raises the quiet observation checkpoints from a 1s to a 4s ceiling so the watcher's poll iteration completes and reports the asserted stall instead of check: rearm-resurface, and docs/calm-mode-feasibility.md records the corrected export-DOM root cause.

Risk Assessment

✅ Low: The change is a bounded, test-only plus documentation repair of three self-tests that were red on the untouched base, and the branch head is an empty re-attestation anchor whose content is identical to the already-validated 7372c8d; no production code or protected data path is touched.

Testing

I stood up the product the way a developer runs it and drove each repaired self-test through the canonical bin/fm-test-run.sh runner against this worktree. tests/fm-tmux-agent-liveness.test.sh passed all 16 checks with every harness-named positive case alive and no gate skip, and a direct probe confirmed the root cause: the host sleep is uutils multicall coreutils that runs the link applet and exits when reached through a harness-named symlink, while the compiled stand-in the fix builds survives. tests/fm-calm-pi-extension.test.sh passed all 13 checks including the real headless-Chrome export-DOM render on Linux, and a direct probe confirmed the root cause: Chrome for Testing 151 never returns from --dump-dom with a fresh explicit --user-data-dir (exit=124, 0 bytes) but renders the complete DOM in ~2s with the fix's private HOME/XDG and no --user-data-dir. tests/fm-wake-queue.test.sh passed the full file (42 ok, exit=0, gate_skip=false); its target assertion now surfaces the real stall alert, and an isolated before/after pair showed --seconds 1 fails to observe the alert while --seconds 4 passes. bash -n is clean on all three files and the diff removes no assertion. The full wake-queue file needed three attempts because a load-sensitive 4s wait_for_exit ceiling in the untouched test_signal_catchup_without_running_watcher failed twice while the host was saturated (load ~11) and passed once load fell (~6.7) and in isolation with a longer bound; that pre-existing flake is reported as a warning and is not introduced by this change. No screenshots were needed because this change alters test-harness Chrome/profile isolation rather than rendered UI; the actual rendered DOM output is captured in chrome-profile-rootcause.log. ShellCheck is deferred to the separate no-mistakes lint phase (bin/fm-lint.sh), which owns it and which this Test phase is instructed not to run.

  • Live validation: ✅ go - 7 of 9 scenarios driven live against the product
Scenario Result Live Evidence
Run tests/fm-tmux-agent-liveness.test.sh end-to-end; every harness-named positive case (claude/pi/omp/muse-bin-<version>/version-named) classifies alive and all checks pass with no gate skip. ✅ pass live bin/fm-test-run.sh --jobs 1 tests/fm-tmux-agent-liveness.test.sh -> exit=0, 16 ok, gate_skip=false (run-tmux-liveness.log)
Adversarial/root-cause: the host sleep is a uutils multicall binary that exits rc=1 through a harness-named symlink, while the compiled stand-in the fixed test builds stays alive through the same sy… ✅ pass live tmux-standin-rootcause.log
Run tests/fm-calm-pi-extension.test.sh end-to-end; render_export_dom renders the real exported session DOM in headless Chrome on Linux and the DOM boundary assertions pass. ✅ pass live bin/fm-test-run.sh --jobs 1 tests/fm-calm-pi-extension.test.sh -> exit=0, 13 ok, gate_skip=false (run-calm.log)
Adversarial/root-cause: on Linux Chrome for Testing 151 a fresh explicit --user-data-dir never returns (exit=124, 0 bytes) while the fixed private-HOME invocation renders a complete DOM in ~2s. ✅ pass live chrome-profile-rootcause.log
Run tests/fm-wake-queue.test.sh end-to-end; the foreign-secondmate observation checkpoint surfaces the real stall alert (not rearm-resurface) and the whole file passes. ✅ pass live bin/fm-test-run.sh --jobs 1 tests/fm-wake-queue.test.sh -> exit=0, 42 ok, gate_skip=false (run-wake-queue-3.log)
Adversarial/regression: the pre-fix 1s observation ceiling fails to observe the stall ('no actionable wake within 1s') while the fixed 4s ceiling passes. ✅ pass live wake-prefix-1s.log, wake-postfix-4s.log
All three repaired self-test files are fully green with no assertion skipped or removed. ✅ pass live three FM_TEST_END lines exit=0 gate_skip=false; diff base..HEAD removes no fail/pass/assert lines
Changed test files are syntactically valid bash. ⏸️ untested no The prior payload's bash -n result is a static parse check, not a drive against the running product, so it does not establish a live result. No live product surface is exercised by syntax checking;…
ShellCheck clean on the changed test files. ⏸️ untested no The Test phase is instructed not to run linters or static-analysis tools; the separate no-mistakes lint phase (bin/fm-lint.sh) owns ShellCheck. Provide it by running bin/fm-lint.sh in the lint phase.
Evidence: tmux liveness full run (exit=0, 16 ok, gate_skip=false)

Source: tmux liveness full run (exit=0, 16 ok, gate_skip=false)

FM_TEST_BEGIN 2026-09-23T06:47:37Z tests/fm-tmux-agent-liveness.test.sh family=backend-dispatch expected_gate_skip=none
ok - tmux liveness: a harness-named foreground process classifies alive
ok - tmux liveness: muse's version-suffixed muse-bin-<version> classifies alive
ok - tmux liveness: unrelated muse-containing command names stay ambiguous
ok - tmux liveness: omp's bare binary name classifies alive
ok - tmux liveness: unrelated omp-containing command names stay ambiguous
ok - tmux liveness: a version-named executable under a harness install path classifies alive
ok - tmux liveness: a version-named executable under a decoy path stays ambiguous
ok - tmux liveness: a process neither name source attributes stays ambiguous rather than inventing an agent
ok - tmux liveness: a launcher whose own identity reads as a bare shell classifies alive from its harness child
ok - tmux liveness: an idle shell pane classifies dead
ok - tmux liveness: a harness-named background process in an idle pane still classifies dead
ok - tmux liveness: an absent window classifies missing rather than inheriting tmux's active-window fallback
ok - cursor composer: an idle Cursor pane reads empty even though the cursor row is blind
ok - cursor composer: real typed text still reads pending, so the injection guard holds
ok - cursor composer: an identical screen stays unknown when the pane is not Cursor
ok - cursor composer: a stale Cursor screen over a dead shell never reads empty
FM_TEST_END 2026-09-23T06:47:43Z tests/fm-tmux-agent-liveness.test.sh exit=0 duration_ms=5902 gate_skip=false
FM_TEST_SUMMARY total=1 failed=0 skipped_gate=0 duration_ms=6010
FM_TEST_SUMMARY_FAMILY family=backend-dispatch count=1 duration_ms=5902 failed=0
FM_TEST_SLOWEST rank=1 script=tests/fm-tmux-agent-liveness.test.sh duration_ms=5902
Evidence: tmux stand-in root cause: uutils multicall sleep exits through harness symlink, compiled stand-in stays alive

Source: tmux stand-in root cause: uutils multicall sleep exits through harness symlink, compiled stand-in stays alive

sleep=/usr/bin/sleep -> /usr/lib/cargo/bin/coreutils/sleep
sleep version: sleep (uutils coreutils) 0.8.0

\### host sleep invoked through a harness-named symlink (the pre-fix stand-in)
ALIVE after 0.3s: no (exited rc=1)
stderr: error: 2 values required for '<FILES> <FILES>' but 1 was provided

Usage: link FILE1 FILE2

For more information, try '--help'.

\### compiled stand-in invoked through the same harness-named symlink (the fix)
ALIVE after 0.3s: yes
Evidence: calm full run incl. real Chrome export-DOM render (exit=0, 13 ok, gate_skip=false)

Source: calm full run incl. real Chrome export-DOM render (exit=0, 13 ok, gate_skip=false)

FM_TEST_BEGIN 2026-09-23T06:57:59Z tests/fm-calm-pi-extension.test.sh family=pure-contract-unit expected_gate_skip=none
ok - Pi calm resolves its persistent home independently of Pi's launch directory
ok - Pi calm compatibility evidence never rejects a Pi version for being newer than 0.82.0, and still fails closed on a missing or malformed version
ok - a missing collapsed-thinking presentation API degrades only that Calm adapter with a clear skip reason, while the rest of Calm still registers
ok - missing Pi presentation class exports reach the independent adapter degradation path
ok - Calm registers none of its 7 built-in tool wrappers at load while config/calm is off, and all 7 synchronously at load while config/calm is on
ok - Calm's first same-session /calm activation claims every uncontested built-in, leaves a foreign bash tool fully intact and callable, warns prominently and logs the contested name, and only rows constructed before that activation - the documented bound - fail to retroactively collapse
ok - Pi calm centralizes transcript visibility, preserves execution/export data, keeps Pi's stock working row visible while no run is active, and persists its choice across session starts
ok - Pi calm on collapses mid-turn assistant working notes to zero height while Calm off keeps them, leaves streaming, truncated-final, and genuine final replies untouched, never mutates the messages, ignores every /calm argument, and restores a legacy persisted max as ordinary Calm on
ok - Pi operational follow-up E2E processes exact user-role notifications once while Calm hides current and adjacent rows, Calm off and absent render them, and restart preserves semantics
ok - Pi Calm native /skill:ahoy geometry keeps every collapsed thinking and tool block at zero height while preserving expansion, history, restart, and Calm-off rendering
ok - Pi Calm working ship keeps its centered two-row asymmetric Unicode boat inside a deterministic long-wave trough, paints all water standard blue and the whole boat standard yellow with balanced resets, keeps ANSI-stripped width exact, reverses cleanly at both edges and every width, clamps visible and hidden resizes, falls back deterministically when narrow, freezes and resumes across settle/start without hidden-time jumps or duplicate timers, resets only on a fresh session, and leaves Calm-off visibility untouched
ok - the rendered-export-DOM guard renders in one pass, retries a bounded number of Chrome start-up failures, and reports the Chrome binary, Chrome version, Pi version, exit status, and Chrome diagnostic when every attempt fails
ok - Pi calm native E2E replaces the stock working row with a moving, resize-clamped working ship that freezes and resumes across two working periods in one Pi session, clears on abort, keeps captain turns visible, hides exact operational user rows without changing persistence, restores stock rendering Calm-off, survives restart, and preserves export plus Ctrl+O behavior
FM_TEST_END 2026-09-23T06:59:35Z tests/fm-calm-pi-extension.test.sh exit=0 duration_ms=95996 gate_skip=false
FM_TEST_SUMMARY total=1 failed=0 skipped_gate=0 duration_ms=96120
FM_TEST_SUMMARY_FAMILY family=pure-contract-unit count=1 duration_ms=95996 failed=0
FM_TEST_SLOWEST rank=1 script=tests/fm-calm-pi-extension.test.sh duration_ms=95996
Evidence: Chrome profile root cause: pinned --user-data-dir times out vs private-HOME render succeeds with DOM

Source: Chrome profile root cause: pinned --user-data-dir times out vs private-HOME render succeeds with DOM

chrome=~/.local/bin/google-chrome version=Google Chrome for Testing 151.0.7922.34 
source=/tmp/fm-chrome-src.QT8WWp.html

\### OLD behavior: fresh explicit --user-data-dir (the pre-fix invocation)
exit=124 elapsed=20s bytes=0 has_html_close=0

\### NEW behavior: private HOME/XDG, no --user-data-dir (the fix)
exit=0 elapsed=2s bytes=77 has_html_close=1
rendered-ok

\### NEW behavior DOM head:
<html><head></head><body><div id="messages">rendered-ok</div>
</body></html>
Evidence: wake-queue full run (exit=0, 42 ok, gate_skip=false)

Source: wake-queue full run (exit=0, 42 ok, gate_skip=false)

FM_TEST_BEGIN 2026-09-23T06:54:14Z tests/fm-wake-queue.test.sh family=watcher-wake-lock expected_gate_skip=none
ok - an abandoned same-process lock hold is reclaimed; a parent's live hold is not
ok - without BASHPID a subshell cannot release or reclaim its parent lock and owns its own hold
ok - bounded acquire hands ownership to the waiting caller after contention
ok - presentation lock waits are bounded and retriable without weakening acknowledgement atomicity
ok - malformed presentation locks report acquire failure instead of contention
ok - foreign secondmate queue alerts once per no-progress episode without age-only or cascade noise
ok - declared external-wait pause rows do not feed secondmate wake-loop escalation
ok - a reprovisioned queue generation starts a fresh no-progress interval
ok - an active turn defers the secondmate stall escalation without cancelling it
ok - a long-lived mate mid-turn is not a stall, but a queue frozen past the busy bound still alarms
ok - secondmate stall markers reject symlinks without touching their targets
ok - stall publication acknowledgement closes the pre-marker crash window
ok - empty prefix mate cleanup preserves another mate's stall receipt
ok - self-announced appends suppress only their own bytes and fail toward waking
ok - historical annotations replay nothing already announced and keep everything new
ok - concurrent append plus drain preserves durable records through acknowledgement
ok - signal written while no watcher runs is caught on next run
WAKE_ACK_REQUIRED: after handling completes run bin/fm-wake-drain.sh --ack-through 1 --recovery-generation 1576416.1790146583.KXOBzu
●━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
●  WATCHER DOWN - SUPERVISION IS OFF
●  1 task(s) in flight, but no live watcher process holds this home lock (last beat: 5s ago).
●  Trust the emitted supervision protocol for this harness; do not use shell & for watcher repair.
●  This is a supervision warning only; the guarded operation WILL still run.
●  After draining queued wakes, repair a missing or failed watcher cycle with the Pi tool fm_watch_arm_pi, or restart Pi with -e /tmp/fm-wake-tangle-root.XB6FX2/.pi/extensions/fm-primary-turnend-guard.ts -e /tmp/fm-wake-tangle-root.XB6FX2/.pi/extensions/fm-primary-pi-watch.ts if the extensions are not loaded.
●━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
WARNING: queued wakes pending - drain them with bin/fm-wake-drain.sh before anything else.
ok - stale wake is queued before suppressor state is advanced
WAKE_ACK_REQUIRED: after handling completes run bin/fm-wake-drain.sh --ack-through 1 --recovery-generation 1579712.1790146589.unBkJZ
●━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
●  WATCHER DOWN - SUPERVISION IS OFF
●  1 task(s) in flight, but no live watcher process holds this home lock (last beat: 4s ago).
●  Trust the emitted supervision protocol for this harness; do not use shell & for watcher repair.
●  This is a supervision warning only; the guarded operation WILL still run.
●  After draining queued wakes, repair a missing or failed watcher cycle with the Pi tool fm_watch_arm_pi, or restart Pi with -e /tmp/fm-wake-tangle-root.XB6FX2/.pi/extensions/fm-primary-turnend-guard.ts -e /tmp/fm-wake-tangle-root.XB6FX2/.pi/extensions/fm-primary-pi-watch.ts if the extensions are not loaded.
●━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
WARNING: queued wakes pending - drain them with bin/fm-wake-drain.sh before anything else.
ok - a not-provably-working stale wake is queued before its suppressor is advanced
WAKE_ACK_REQUIRED: after handling completes run bin/fm-wake-drain.sh --ack-through 1 --recovery-generation 1582850.1790146595.SfYtjj
●━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
●  WATCHER DOWN - SUPERVISION IS OFF
●  1 registered custom check(s), but no live watcher process holds this home lock (last beat: 3s ago).
●  Trust the emitted supervision protocol for this harness; do not use shell & for watcher repair.
●  This is a supervision warning only; the guarded operation WILL still run.
●  After draining queued wakes, repair a missing or failed watcher cycle with the Pi tool fm_watch_arm_pi, or restart Pi with -e /tmp/fm-wake-tangle-root.XB6FX2/.pi/extensions/fm-primary-turnend-guard.ts -e /tmp/fm-wake-tangle-root.XB6FX2/.pi/extensions/fm-primary-pi-watch.ts if the extensions are not loaded.
●━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
WARNING: queued wakes pending - drain them with bin/fm-wake-drain.sh before anything else.
ok - registered custom check output is queued before cadence suppression
ok - concurrent drains replay until one post-handling acknowledgement consumes records
WAKE_ACK_REQUIRED: after handling completes run bin/fm-wake-drain.sh --ack-through 4 --recovery-generation 1586049.1790146601.RehvNi
ok - drain collapses obvious duplicate heartbeat and signal records
ok - drain asserts watcher liveness: warns on a lapse, stays silent for a live watcher with a fresh beacon
WAKE_ACK_REQUIRED: after handling completes run bin/fm-wake-drain.sh --ack-through 8 --recovery-generation 1587672.1790146605.r1a3Bq
ok - structural signal enrichment is separate, deduped, home-local, and tier-zero for other wakes
WAKE_ACK_REQUIRED: after handling completes run bin/fm-wake-drain.sh --ack-through 13 --recovery-generation 1588967.1790146608.EXabhD
ok - every readable unread status line is annotated in full while invalid status files preserve their raw wakes
WAKE_ACK_REQUIRED: after handling completes run bin/fm-wake-drain.sh --ack-through 1 --recovery-generation 1591402.1790146614.HSIQVa
WAKE_ACK_REQUIRED: after handling completes run bin/fm-wake-drain.sh --ack-through 2 --recovery-generation 1591402.1790146614.HSIQVa
ok - slow annotation releases the append lock and a deleted status file fails open
ok - a branch-actor scoped ack never swallows an unacked main-owned row, and main's later drain sees exactly what remains
ok - main drain and acknowledgement exclude an active branch grant
ok - a branch-held row raises no queued-wake warning for main, and the same row is presented and acknowledged once the grant clears
ok - a queue that cannot be counted keeps the queued-wake alarm up
ok - structurally unusable rows are retired by main alone, leaving every remaining row presentable and acknowledgeable
ok - branch grant cannot take a row already claimed by main
ok - actor ownership filtering precedes same-key deduplication
ok - main reclaims rows granted to an exited branch owner
ok - a branch-actor drain with no eligible-row snapshot refuses loudly instead of draining nothing
WAKE_ACK_REQUIRED: after handling completes run bin/fm-wake-drain.sh --ack-through 1 --recovery-generation existing
ok - wake append publishes atomic recovery evidence before durable rows
ok - wake drain: generation-less legacy wakes are adopted and acknowledged
ok - wake drain: a stale acknowledgement cannot retire or consume a newer recovery episode
ok - wake drain: an acknowledgement that consumes nothing says so and names the exact command for the current wake
ok - wake drain: a branch acknowledgement that consumes nothing names the exact command for its granted wake
ok - wake drain: recovery acknowledgement failures are explicit and retryable
ok - interruptions preserve durable rows until post-handling acknowledgement
FM_TEST_END 2026-09-23T06:57:52Z tests/fm-wake-queue.test.sh exit=0 duration_ms=217932 gate_skip=false
FM_TEST_SUMMARY total=1 failed=0 skipped_gate=0 duration_ms=218069
FM_TEST_SUMMARY_FAMILY family=watcher-wake-lock count=1 duration_ms=217932 failed=0
FM_TEST_SLOWEST rank=1 script=tests/fm-wake-queue.test.sh duration_ms=217932
Evidence: wake-queue pre-fix 1s observation ceiling fails to observe the stall

Source: wake-queue pre-fix 1s observation ceiling fails to observe the stall

not ok - a foreign queue with no progress did not alert: checkpoint: no actionable wake within 1s
Evidence: wake-queue post-fix 4s observation ceiling passes

Source: wake-queue post-fix 4s observation ceiling passes

ok - foreign secondmate queue alerts once per no-progress episode without age-only or cascade noise
Evidence: wake-queue load-sensitive flake captured under high load

Source: wake-queue load-sensitive flake captured under high load

FM_TEST_BEGIN 2026-09-23T06:50:13Z tests/fm-wake-queue.test.sh family=watcher-wake-lock expected_gate_skip=none
ok - an abandoned same-process lock hold is reclaimed; a parent's live hold is not
ok - without BASHPID a subshell cannot release or reclaim its parent lock and owns its own hold
ok - bounded acquire hands ownership to the waiting caller after contention
ok - presentation lock waits are bounded and retriable without weakening acknowledgement atomicity
ok - malformed presentation locks report acquire failure instead of contention
ok - foreign secondmate queue alerts once per no-progress episode without age-only or cascade noise
ok - declared external-wait pause rows do not feed secondmate wake-loop escalation
ok - a reprovisioned queue generation starts a fresh no-progress interval
ok - an active turn defers the secondmate stall escalation without cancelling it
ok - a long-lived mate mid-turn is not a stall, but a queue frozen past the busy bound still alarms
ok - secondmate stall markers reject symlinks without touching their targets
ok - stall publication acknowledgement closes the pre-marker crash window
ok - empty prefix mate cleanup preserves another mate's stall receipt
ok - self-announced appends suppress only their own bytes and fail toward waking
ok - historical annotations replay nothing already announced and keep everything new
ok - concurrent append plus drain preserves durable records through acknowledgement
wait_for_exit: owned pid 1444302 exceeded 40 polls; sending TERM
1444302 1350037 S    bash ~/.no-mistakes/worktrees/b39db14c8322/01M36FX1PV020BTT3Z9RZAABGZ/bin/fm-watch.sh
not ok - watcher did not exit for second signal
FM_TEST_END 2026-09-23T06:52:30Z tests/fm-wake-queue.test.sh exit=1 duration_ms=137125 gate_skip=false
FM_TEST_SUMMARY total=1 failed=1 skipped_gate=0 duration_ms=137221
FM_TEST_SUMMARY_FAMILY family=watcher-wake-lock count=1 duration_ms=137125 failed=1
FM_TEST_SLOWEST rank=1 script=tests/fm-wake-queue.test.sh duration_ms=137125
Evidence: syntax check (bash -n) on all three changed test files

Source: syntax check (bash -n) on all three changed test files

bash -n OK: tests/fm-tmux-agent-liveness.test.sh
bash -n OK: tests/fm-calm-pi-extension.test.sh
bash -n OK: tests/fm-wake-queue.test.sh
- Outcome: ⚠️ 1 warning across 1 run (18m2s)

Pipeline

Updates from git push no-mistakes

✅ **intent** - passed

✅ No issues found.

⏭️ **Rebase** - skipped

Step was skipped.

✅ **Review** - passed

✅ No issues found.

⚠️ **Test** - 1 warning
  • ⚠️ tests/fm-wake-queue.test.sh:84 - While validating the wake-queue file under a saturated host (load average ~11 on 8 cores from the operator's real fleet watchers and other agents), bin/fm-test-run.sh --jobs 1 tests/fm-wake-queue.test.sh failed twice at wait_for_exit &#34;$!&#34; 40 in test_signal_catchup_without_running_watcher ('watcher did not exit for second/first signal'). That function is byte-identical to the base commit and untouched by this change; the change's own target test (foreign secondmate queue alerts once per no-progress episode...) passed in every run, including the failing ones, and no rearm-resurface output appeared. The same assertion passes when the identical test runs in isolation with a 30s bound, and the full file passes (exit=0, 42 ok, gate_skip=false) once load drops to ~6.7. This is a pre-existing load-sensitive 4s timing ceiling, not a regression introduced here, so no code change was made; increasing that bound would alter already-validated content outside this change's intent.
  • Live validation: ✅ go - 7 of 9 scenarios driven live against the product
Scenario Result Live Evidence
Run tests/fm-tmux-agent-liveness.test.sh end-to-end; every harness-named positive case (claude/pi/omp/muse-bin-<version>/version-named) classifies alive and all checks pass with no gate skip. ✅ pass live bin/fm-test-run.sh --jobs 1 tests/fm-tmux-agent-liveness.test.sh -> exit=0, 16 ok, gate_skip=false (run-tmux-liveness.log)
Adversarial/root-cause: the host sleep is a uutils multicall binary that exits rc=1 through a harness-named symlink, while the compiled stand-in the fixed test builds stays alive through the same sy… ✅ pass live tmux-standin-rootcause.log
Run tests/fm-calm-pi-extension.test.sh end-to-end; render_export_dom renders the real exported session DOM in headless Chrome on Linux and the DOM boundary assertions pass. ✅ pass live bin/fm-test-run.sh --jobs 1 tests/fm-calm-pi-extension.test.sh -> exit=0, 13 ok, gate_skip=false (run-calm.log)
Adversarial/root-cause: on Linux Chrome for Testing 151 a fresh explicit --user-data-dir never returns (exit=124, 0 bytes) while the fixed private-HOME invocation renders a complete DOM in ~2s. ✅ pass live chrome-profile-rootcause.log
Run tests/fm-wake-queue.test.sh end-to-end; the foreign-secondmate observation checkpoint surfaces the real stall alert (not rearm-resurface) and the whole file passes. ✅ pass live bin/fm-test-run.sh --jobs 1 tests/fm-wake-queue.test.sh -> exit=0, 42 ok, gate_skip=false (run-wake-queue-3.log)
Adversarial/regression: the pre-fix 1s observation ceiling fails to observe the stall ('no actionable wake within 1s') while the fixed 4s ceiling passes. ✅ pass live wake-prefix-1s.log, wake-postfix-4s.log
All three repaired self-test files are fully green with no assertion skipped or removed. ✅ pass live three FM_TEST_END lines exit=0 gate_skip=false; diff base..HEAD removes no fail/pass/assert lines
Changed test files are syntactically valid bash. ⏸️ untested no The prior payload's bash -n result is a static parse check, not a drive against the running product, so it does not establish a live result. No live product surface is exercised by syntax checking;…
ShellCheck clean on the changed test files. ⏸️ untested no The Test phase is instructed not to run linters or static-analysis tools; the separate no-mistakes lint phase (bin/fm-lint.sh) owns ShellCheck. Provide it by running bin/fm-lint.sh in the lint phase.
  • bin/fm-test-run.sh --jobs 1 tests/fm-tmux-agent-liveness.test.sh -> exit=0, 16 ok, gate_skip=false
  • bin/fm-test-run.sh --jobs 1 tests/fm-calm-pi-extension.test.sh -> exit=0, 13 ok, gate_skip=false
  • bin/fm-test-run.sh --jobs 1 tests/fm-wake-queue.test.sh -> exit=0, 42 ok, gate_skip=false (third attempt; two earlier attempts failed on an untouched load-sensitive assertion)
  • bash -n tests/fm-tmux-agent-liveness.test.sh tests/fm-calm-pi-extension.test.sh tests/fm-wake-queue.test.sh -> all OK
  • Host root-cause probe: readlink -f $(command -v sleep) = uutils coreutils 0.8.0; invoked through a claude-link symlink it exits rc=1 with a link applet error, while a compiled stand-in through the same symlink stays alive
  • Host root-cause probe: real Google Chrome for Testing 151.0.7922.34 with a fresh explicit --user-data-dir -> exit=124 (20s timeout), 0 bytes; with private HOME/XDG and no --user-data-dir -> exit=0 in 2s with a complete DOM
  • Regression pair for wake-queue: isolated modified test with --seconds 1 fails ('no actionable wake within 1s'); with --seconds 4 passes
  • Diff check: no fail/pass/assert_*/assertion lines removed between base da9607d and HEAD e02c7191
  • git status --short clean; temporary single-test copies removed
✅ **Document** - passed

✅ No issues found.

✅ **Lint** - passed

✅ No issues found.

✅ **Push** - passed

✅ No issues found.

…ions

Both self-tests fail on untouched main on a host whose coreutils are a
multicall binary and whose Chrome has no pre-warmed profile, and each failure
masks the other's file.

tests/fm-tmux-agent-liveness.test.sh - the stand-in harness processes were
symlinks to the host's `sleep`. A single-purpose `sleep` runs happily under
another name, but a multicall coreutils binary (uutils or busybox) resolves its
applet from argv[0]: `claude-link -> sleep` invoked under the harness name runs
the wrong applet and exits immediately, so no foreground process exists and
every positive case reads not-alive ("last verdict for liveness:agent was
missing (expected alive); title=sh comms=[sh ]"). Build a dedicated spinner as
the stand-in target, exactly the way the version-string case already builds its
executable, and require the fallback target to demonstrably survive the rename
before using it. Every assertion is untouched; the stand-in identity signal is
unchanged (the kernel still records the symlink name as the executable
identity).

tests/fm-calm-pi-extension.test.sh - render_export_dom pinned a brand-new
`--user-data-dir` per attempt. On Google Chrome for Testing 151.0.7922.34 that
pristine profile makes Chrome's first-run initialization never complete: the
browser and its renderers start, but --dump-dom never returns, so all three
bounded attempts end exit=0 timed_out=yes bytes=0 and the DOM assertions never
run ("could not render calm-mode HTML export DOM"). Chrome's own profile
creation under a fresh HOME renders the same document in about a second, so the
helper now gives Chrome a private per-attempt HOME instead of the explicit
profile flag. Each attempt still gets an isolated profile, and every DOM
assertion is unchanged.

Root-cause evidence: a pristine --user-data-dir with `--headless=new
--dump-dom` had not returned after 150s, while the same command with an empty
HOME and no --user-data-dir returned the full DOM in ~1s, and reusing an
already-populated profile also returned it in ~1s. The render failure masked
the rest of the file: with it repaired, the Pi follow-up loaded_off case passes
unmodified against an installed @earendil-works/pi-coding-agent package.

These two failures block downstream validation of every lane on hosts with
multicall coreutils or a fresh Chrome profile.

Verification:
- timeout 300 bash tests/fm-tmux-agent-liveness.test.sh -> exit 0, 16 assertions ok
- timeout 700 bash tests/fm-calm-pi-extension.test.sh -> exit 0, 13 assertions ok,
  including the Pi operational follow-up loaded_off case
- bash -n and shellcheck clean on both touched files
- rest of tests/: bin/fm-test-run.sh --all bounded by timeout 900 completed 17 files with 0 failures (fm-afk-contract.test.sh through fm-backend-herdr-launcher-workspace-e2e.test.sh), then the bound cut off the 18th (fm-backend-herdr-presentation-e2e.test.sh, a real-herdr-gated lab test) with no failure recorded
tests/fm-wake-queue.test.sh's secondmate stall case runs bounded foreground
watcher checkpoints whose job is to record an observation, with the alerting
checkpoint that follows asserting the stall. A checkpoint's exit publishes a
downtime marker, and the next checkpoint consumes it only by reaching the end of
the watcher's poll loop, where the recovery surfacing runs after the stall tick;
the observation itself is recorded by that same stall tick. On a loaded host a
1s ceiling sits under the cost of that iteration (which includes a pane capture
in the active-turn gate), so the observation was never recorded, the downtime
marker stayed pending, and the alerting checkpoint surfaced
`check: rearm-resurface` instead of the stall it asserts:

  not ok - a foreign queue with no progress did not alert: check: rearm-resurface
  not ok - a frozen reprovisioned queue generation was hidden: check: rearm-resurface

Give the observation checkpoints that feed a later alert the same 4s ceiling the
file already documents for alerting checkpoints. The ceiling is only a bound - a
checkpoint still returns on its first actionable wake - so no assertion is
weakened, and the quiet windows get longer, not shorter.
@blackxwhite88

Copy link
Copy Markdown
Contributor Author

Attestation is present in the PR body, bound to head 7372c8d2 (no-mistakes-pipeline-attestation:v1 from run 01M35FS9T8QMFRQV10HGVC54KS, passed-with-override).

The two required workflows (CI / Require no-mistakes) still sit at action_required with zero jobs, so no check-runs have started. If a triage pass can approve the fork-workflow runs, checks should proceed from there. Happy to rebase if main has moved since 7372c8d2.

@kunchenguid

Copy link
Copy Markdown
Owner

Speaking as Kun's firstmate:

Read in full (body + your attestation note). Inspected tip 7372c8d20e703be428c50e672d8253a106ea0ae1 vs main.

Tip vs main: Test-only repair of three base-red self-tests (tmux liveness stand-in under multicall coreutils, calm Chrome private-HOME DOM render, wake-queue observation ceilings) plus a doc correction. No product binary behavior change on the unconfigured path.

VISION (per-rule):

  1. One captain, one interface — aligns (truthful self-tests / attestation chain).
  2. Authority explicit — aligns / N-A.
  3. Scripts own mechanics — aligns.
  4. Restart is a non-event — aligns.
  5. Delegation with a spine — aligns.
  6. Fleet outlives vendor — aligns.
  7. Scope — aligns (tests/docs).

Contract-class: restore — concrete existing self-test default paths were red on untouched main; tip makes those assertions hold without changing product defaults.

Gates: attestation MATCH. Fork CI/NM runs 35789370743 / 35789370750 concluded failure with zero jobs (approval window expired; approve API now returns not-waiting). MERGEABLE/CLEAN but checks never ran. Please push an empty commit (or rebase on current main) so first-time fork workflows return to action_required and triage can approve them. No Firstmate flag while CI is the blocker.

@kunchenguid

Copy link
Copy Markdown
Owner

Speaking as Kun's firstmate:

Follow-up: pushed an empty commit on your branch (maintainer-can-modify) to re-trigger fork workflows — HEAD is now e02c7191d309a7d2e691a38079fb47001de9bf50 (was 7372c8d2). Approved CI 35827320907 and NM 35827320892 after the same test-only diff review.

Attestation is now MISMATCH (body still binds 7372c8d2). Please re-attest / rebind the pipeline attestation to this HEAD once checks finish. Class remains restore; no Firstmate flag.

@blackxwhite88 blackxwhite88 changed the title test: repair base-red liveness, calm DOM, and wake-queue self-tests test: repair base-red liveness, export-DOM, and wake-queue self-tests Sep 23, 2026
@kunchenguid

Copy link
Copy Markdown
Owner

Speaking as Kun's firstmate:

Re-check after empty-commit re-trigger + approvals: HEAD e02c7191 now has attestation MATCH, CI 35827320907 SUCCESS, NM 35829960607 SUCCESS, MERGEABLE/CLEAN. Class restore (test/doc repair only). Squash-merging.

@kunchenguid
kunchenguid merged commit 77e5af9 into kunchenguid:main Sep 23, 2026
20 of 21 checks passed
@kunchenguid

Copy link
Copy Markdown
Owner

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

dscott98 added a commit to Simplifying-Cloud/firstmate that referenced this pull request Sep 23, 2026