Repository navigation
test: capture Herdr fallback focus synchronously in Part C - #8378
Conversation
Capture the real explicit-close focus synchronously in Part C so the defective-release assertion does not depend on background sampling. Preserve final exact-focus and focus-preserving-release assertions. Fixes kunchenguid#8004
[Low impact] This test-only change appears safe to merge. Reviews (1) · Last reviewed commit: "test: observe Herdr fallback focus befor..." · Reviewed by Greptile |
|
Speaking as Kun's firstmate: thank you @tiago-peixoto for closing the loop on #8004. On I've queued the full suite. Nothing is waiting on you. |
|
Speaking as Kun's firstmate: this is merged. Thank you @tiago-peixoto — really appreciate you taking the time on this. |
* test: observe Herdr fallback focus before restoration (kunchenguid#8378) Capture the real explicit-close focus synchronously in Part C so the defective-release assertion does not depend on background sampling. Preserve final exact-focus and focus-preserving-release assertions. Fixes kunchenguid#8004 (cherry picked from commit cf7329b) * no-mistakes(document): Clarify synchronous fallback focus verification * no-mistakes(ci): Fixed extension-test queue contamination by draining prior recovery wakes before cleanup-headline assertions. Reproduced the exact CI failure using the real wake interface; the injected scenario and focused regression pass after the fix. Lint and diff checks pass. Aggregate extension suite twice hit its existing 34-second coordinator deadline locally, so aggregate verification remains incomplete. Full suite is a dependent failure, not a separate defect * Revert "no-mistakes(ci): Fixed extension-test queue contamination by draining prior recovery wakes before cleanup-headline assertions. Reproduced the exact CI failure using the real wake interface; the injected scenario and focused regression pass after the fix. Lint and diff checks pass. Aggregate extension suite twice hit its existing 34-second coordinator deadline locally, so aggregate verification remains incomplete. Full suite is a dependent failure, not a separate defect" This reverts commit 1c65050. * test: stabilize extension orphan recovery readiness (kunchenguid#8210) * test: wait for recovered orphan-readiness runners instead of a fixed marker poll The lifecycle-orphan-readiness section polled each recovered source's handled marker for a fixed 10s after reconcile. Reconcile only confirms each launch; each runner then polls, captures, takes a silent verdict and a terminal verdict, and the two runners take their verdicts in turn under the home's extension lifecycle lock. On a CPU-starved host that chain of short host and fixture processes can exceed 10s, so the section flaked. Wait for the recorded runner process groups to exit, bounded by the coordinator's section-lane deadline, then assert the handled markers, retirement and claim release. On timeout, kill the recorded runner groups and sweep the home before failing, and track the home so any exit sweeps it. * no-mistakes(review): Bound recovered-runner wait to coordinator deadline (cherry picked from commit 6125d41) --------- Co-authored-by: Tiago <tiagop@hey.com> Co-authored-by: ayrton-saunders <9414344+ayrton-saunders@users.noreply.github.com> Co-authored-by: Laszlo Horanszky <40281577+Dematom1@users.noreply.github.com>
Intent
The captain asked (2026-11-12) to start contributions where an open upstream issue has a better chance of merging.
Fix
https://github.com/kunchenguid/firstmate/issues/8004: tests/fm-backend-herdr-focus-flash-e2e.test.sh Part C fails when its focus sampler misses the short wrong-focus window, so the test fails on commits that do not touch the Herdr backend. The maintainer assistant confirmed it on main, labelled it ready-for-pr and classed it a contract-class restore. Fixes #8004.What Changed
tests/fm-backend-herdr-focus-flash-e2e.test.shnow wrapsfm_backend_herdr_cliso that it writes a focus snapshot to a file right after the realpane closecall returns, before the restore backstop runs. A failedherdrcall or a failed snapshot now fails the wrapper.Risk Assessment
✅ Low: The change touches one test file and replaces a timing-dependent sampler assertion with a synchronous focus snapshot taken inside the test's CLI override right after the real
pane close, which is the same instant the production restore in bin/backends/herdr.sh reads focus, while the final exact-anchor assertion and the focus-preserving-release assertions are kept.Testing
I drove the real test through bin/fm-test-run.sh against real Herdr 0.7.4 and 0.9.3 servers inside a disposable bwrap sandbox, with a sandbox-local default session and the bin/fm-herdr-lab.sh named lab session. The changed test passed on both releases and passed ten consecutive rounds on 0.7.4. With a ten-second sampler delay injected in sandbox scratch, the base-commit test failed with the issue 8004 message and the changed test passed on both releases. With the production restore call removed in sandbox scratch, the changed test failed at the exact-focus assertion. No baseline commands ran before this step, the worktree stayed clean, and the two pre-existing host Herdr servers were not touched. This is a test-only change, so there is no visual evidence.
Evidence: Changed test on Herdr 0.7.4
Source: Changed test on Herdr 0.7.4
Evidence: Changed test on Herdr 0.9.3
Source: Changed test on Herdr 0.9.3
Evidence: Issue 8004 reproduced: base test with delayed sampler on 0.7.4
Source: Issue 8004 reproduced: base test with delayed sampler on 0.7.4
not ok - Part C reached the fallback on a defective release but observed no wrong-focus sample at all, so the sampler proved nothing final exit status 1Evidence: Changed test with delayed sampler on 0.7.4
Source: Changed test with delayed sampler on 0.7.4
ok - fallback on a defective release: the explicit close changed focus and the backstop restored the exact anchor final exit status 0Evidence: Changed test with delayed sampler on 0.9.3
Source: Changed test with delayed sampler on 0.9.3
Evidence: Restore-removal negative control on 0.7.4
Source: Restore-removal negative control on 0.7.4
not ok - the fallback close left focus off the anchor (w8 w8:t1 -> wA wA:t1) final exit status 1Evidence: Ten consecutive rounds on 0.7.4
Source: Ten consecutive rounds on 0.7.4
Evidence: Sandbox launcher (bwrap)
Source: Sandbox launcher (bwrap)
Evidence: Sandbox entry script with scratch mutations
Source: Sandbox entry script with scratch mutations
Pipeline
Updates from git push no-mistakes
✅ **Intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
✅ **Review** - passed
✅ No issues found.
✅ **Test** - passed
✅ No issues found.
bash driver/sandbox.sh <herdr 0.7.4 binary> <worktree> plain- runsnice -n 10 bash bin/fm-test-run.sh tests/fm-backend-herdr-focus-flash-e2e.test.shin the bwrap sandbox: exit 0bash driver/sandbox.sh ~/.local/bin/herdr <worktree> plain(Herdr 0.9.3): exit 0REPEATS=10 bash driver/sandbox.sh <herdr 0.7.4 binary> <worktree> plain: 10 of 10 rounds passedbash driver/sandbox.sh <herdr 0.7.4 binary> <worktree> slow-base- base commit a02b0898 test withsleep 10injected into the Part C sampler: exit 1 with the issue 8004 messagebash driver/sandbox.sh <herdr 0.7.4 binary> <worktree> slow-target- changed test with the samesleep 10: exit 0bash driver/sandbox.sh ~/.local/bin/herdr <worktree> slow-target(Herdr 0.9.3): exit 0bash driver/sandbox.sh <herdr 0.7.4 binary> <worktree> no-restore- scratch copy of bin/backends/herdr.sh without thefm_backend_herdr_projection_focus_restore ... "pane close"call: exit 1 at the exact-focus assertiongit status --porcelainin the worktree after all runs: cleanpscheck after all runs: only the two host Herdr servers started in September and October remaindocs/verification/runtime-backends.md:1870- The dated Herdr 0.7.5 transcript (run on 2026-08-05) records the old Part C pass line: 'a bounded wrong-focus window of 4 samples was fully restored to the anchor'. Line 1892 repeats the four-sample count in prose. This change renames that pass line to 'the explicit close changed focus and the backstop restored the exact anchor', so a new 0.7.5 run no longer prints the recorded line. I did not edit the transcript, because it is a record of a real run and a rewritten line would be output nobody observed. The host has Herdr 0.9.3 only, and the workspace rules forbid installing 0.7.5, so I could not produce a new 0.7.5 transcript. The recorded guarantee stays true: on 0.7.5 the fallback close moves focus and the backstop restores the anchor. Follow-up option: rerun tests/fm-backend-herdr-focus-flash-e2e.test.sh against the pinned Herdr 0.7.5 binary and replace the 0.7.5 block and the line 1892 sentence with the new output.✅ **Lint** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.
Issues
Fixes #8004