Repository navigation
test: repair base-red liveness, export-DOM, and wake-queue self-tests - #5338
kunchenguid merged 5 commits into
Conversation
…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.
|
Attestation is present in the PR body, bound to head The two required workflows (CI / Require no-mistakes) still sit at |
|
Speaking as Kun's firstmate: Read in full (body + your attestation note). Inspected tip 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):
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 |
|
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 Attestation is now MISMATCH (body still binds |
|
Speaking as Kun's firstmate: Re-check after empty-commit re-trigger + approvals: HEAD |
|
Speaking as Kun's firstmate: this is merged. Thank you @blackxwhite88 — really appreciate you taking the time on this. |
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.shnow stands in for harness binaries with a dedicated long-running spinner binary (compiled when a C compiler is present, otherwise a hostsleepsymlink only if it demonstrably survives the rename), so multicall coreutils no longer dispatch on the renamedargv[0]and positive cases read as alive; theCC_BINlookup is hoisted and reused.tests/fm-calm-pi-extension.test.shgives each Chrome render attempt a privateHOME(withXDG_CONFIG_HOMEandXDG_CACHE_HOMEbeneath it) on Linux and other non-Darwin systems while keeping the explicit--user-data-diron Darwin, so first-run profile initialization completes and--dump-domreturns.tests/fm-wake-queue.test.shraises the quiet observation checkpoints from a 1s to a 4s ceiling so the watcher's poll iteration completes and reports the asserted stall instead ofcheck: rearm-resurface, anddocs/calm-mode-feasibility.mdrecords 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.shrunner 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 hostsleepis uutils multicall coreutils that runs thelinkapplet 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-domwith 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 1fails to observe the alert while--seconds 4passes.bash -nis clean on all three files and the diff removes no assertion. The full wake-queue file needed three attempts because a load-sensitive 4swait_for_exitceiling in the untouchedtest_signal_catchup_without_running_watcherfailed 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.sleepis 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…bash -nresult 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;…Evidence: tmux liveness full run (exit=0, 16 ok, gate_skip=false)
Source: tmux liveness full run (exit=0, 16 ok, gate_skip=false)
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
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)
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
Evidence: wake-queue full run (exit=0, 42 ok, gate_skip=false)
Source: wake-queue full run (exit=0, 42 ok, gate_skip=false)
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
Evidence: wake-queue post-fix 4s observation ceiling passes
Source: wake-queue post-fix 4s observation ceiling passes
Evidence: wake-queue load-sensitive flake captured under high load
Source: wake-queue load-sensitive flake captured under high load
Evidence: syntax check (bash -n) on all three changed test files
Source: syntax check (bash -n) on all three changed test files
Pipeline
Updates from git push no-mistakes
✅ **intent** - passed
✅ No issues found.
⏭️ **Rebase** - skipped
Step was skipped.
✅ **Review** - passed
✅ No issues found.
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.shfailed twice atwait_for_exit "$!" 40intest_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 norearm-resurfaceoutput 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.sleepis 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…bash -nresult 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;…bin/fm-test-run.sh --jobs 1 tests/fm-tmux-agent-liveness.test.sh-> exit=0, 16 ok, gate_skip=falsebin/fm-test-run.sh --jobs 1 tests/fm-calm-pi-extension.test.sh-> exit=0, 13 ok, gate_skip=falsebin/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 OKHost root-cause probe:readlink -f $(command -v sleep)= uutils coreutils 0.8.0; invoked through aclaude-linksymlink it exits rc=1 with alinkapplet error, while a compiled stand-in through the same symlink stays aliveHost 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 DOMRegression pair for wake-queue: isolated modified test with--seconds 1fails ('no actionable wake within 1s'); with--seconds 4passesDiff check: nofail/pass/assert_*/assertion lines removed between base da9607d and HEAD e02c7191git status --shortclean; temporary single-test copies removed✅ **Document** - passed
✅ No issues found.
✅ **Lint** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.