test(tests): provide fake treehouse for secondmate harness spawns - #7
Merged
Merged
Conversation
…fake treehouse The crew-unaffected block spawns an ordinary ship task through fm-spawn.sh, which since the allocator-lease change (#5) takes the task worktree from 'treehouse get --lease' before confirming it against the pane probe. That block's fakebin carried no treehouse at all and the test's BASE_PATH is the bare system directories, so the spawn died on a missing allocator before writing its meta record and the crew-unaffected assertion failed deterministically, in CI and locally. The lease change migrated every other spawn-driving test to tests/lib.sh's shared fake treehouse but missed this file. Install the shared fake in make_launch_capturing_tmux, whose stub set exists exactly to serve the crew/scout spawn path. The fake leases FM_FAKE_PANE_PATH, so the recorded worktree and the pane witness agree and the confirmation step is exercised rather than bypassed. Secondmate spawns never consult the allocator and are unaffected.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Intent
Carve-out delivery, by explicit captain decision (decision key herdr-lane-red-round-2): land the CI-proven half of the fix-forward for red main now, while the unsolved Herdr half is redone by a separately equipped task. Context that must be plain in the PR body: PR #5 (fix(spawn): record task worktrees from allocator leases, squash-merged as 569dae6) was merged before its CI had ever completed, during the 2026-08-06 GitHub Actions outage, and when Actions recovered, main's run at the merge commit (run 31130627813, red on both attempts) showed two failing jobs: "Behavior portable serial 4" and "Behavior tests (Herdr)". This branch fixes the first of those two.
The single commit here (fix(tests): give the secondmate-harness crew spawn the lease-capable fake treehouse) fixes "Behavior portable serial 4": not ok - crew-unaffected: expected an ordinary ship task in tests/fm-secondmate-harness.test.sh. Causation was established by counterfactual, not from the diff: green at 84de72c (the commit before the merge), red at 569dae6 (the merge commit), reproduced locally in clean detached clones, deterministic on both CI attempts, and the fix was already proven green in CI by the "Behavior portable serial 4" check of PR #6 before that PR was split. Root cause: fm-spawn.sh now hard-requires treehouse get --lease; PR #5 migrated 17 test files to the new shared fake treehouse in tests/lib.sh but missed this file, whose crew-spawn block resolves commands against a bare system PATH, so the spawn died on the missing allocator before writing its task record. The fix is test-only: install the shared fake treehouse in that test's spawn stub set (make_launch_capturing_tmux); the fake leases FM_FAKE_PANE_PATH so the recorded worktree and the pane witness agree and the confirmation logic is exercised, not bypassed. PR #5's protections (allocator-lease worktree recording, independent pane confirmation) are untouched.
Known and expected on this PR's CI, to be stated plainly in the PR body: the "Behavior tests (Herdr)" lane will remain RED here, because that second regression lives in this branch's BASE (main at 569dae6) and this carve-out deliberately does not touch it. Evidence it is the base's own failure and not this commit's: main itself is red on that lane at 569dae6 on two consecutive run attempts with the identical assertion (projected teardown changed active workspace/tab from w4/w4:t1 to w9/w9:t2), and this commit changes only tests/fm-secondmate-harness.test.sh, which that lane does not run. The Herdr fix is deliberately NOT attempted here: two prior fixes were written blind against a herdr version the developer machine does not have (the outage-era "apply CI fixes" in PR #5 and the fix in PR #6) and both failed in CI, so by captain decision there will be no third blind attempt; a dedicated follow-up task with a guarded isolated herdr lab will reproduce the failure against the CI-pinned herdr 0.7.4 before committing anything. Do not attempt to fix, skip around, or auto-repair the red Herdr lane in this run; it is out of scope by explicit decision.
PR body requirements, all mandatory: (a) the outage fix-forward context above, so the record shows why a red main existed; (b) the per-commit causation method above (counterfactual around the merge commit, local reproduction in detached clones, deterministic CI failures, and prior CI proof on PR #6's serial-4 check), so a future reader knows the regression was introduced by PR #5 rather than pre-existing; (c) the split record: this PR carries only the secondmate-harness test fix, while the Herdr focus fix and the test-fixture pipe repair remain unmerged on branch fm/fm-ci-red-after-worktree-fix (PR #6, closed unmerged) pending the lab-equipped redo, with PR #6's closing note carrying the same cross-reference; (d) the expected-red statement for the "Behavior tests (Herdr)" lane with the base-failure evidence above; and (e) the false-green record, at the captain's direction: during PR #6's validation the no-mistakes CI monitor reported all checks passed while the behavior lanes had not yet registered on the head commit (real state at that moment: 4 of 14 checks completed), a success report issued before its evidence existed - the fifth control today to report success it had not established.
GitHub Actions may still be degraded from the outage, so CI may queue longer than usual; that is expected.
What Changed
Risk Assessment
✅ Low: a single test-only commit with no production code. The fix is CI-proven (PR #6's "Behavior portable serial 4" check before the split, and this PR's own run), and the mandatory delivery record the reviewer flagged as absent now exists: it is this description, written before this PR was created - the review and test notes below record that pre-PR state as run history. The "Behavior tests (Herdr)" lane remains red here from the base (main's own unfixed regression, per the expected-red statement above); that redness is inherited, not introduced or risked by this change.
Testing
The base counterfactual fails at the cited crew-spawn assertion; the target’s complete affected behavior suite passes, and direct end-to-end evidence shows the lease path is both recorded and independently confirmed. The Herdr lane was not run, as explicitly out of scope; this shell-only change has no rendered UI surface.
Evidence: Base regression transcript
Base commit reproduces the exact historicalcrew-unaffected: expected an ordinary ship taskfailure.Evidence: Target behavior transcript
Target commit completes the affected behavior suite successfully.Evidence: Leased crew-spawn evidence
End-to-end crew spawn callsget --lease, records the same leased worktree askind=ship, and matches the independent pane witness.Pipeline
Updates from git push no-mistakes
✅ **intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
fm/secondmate-harness-fake-treehouse, so the required outage, causation, carve-out, expected-Herdr-red, and false-green statements are absent from a reviewable PR. Create or point me to the intended PR before merge.git archive 569dae62b67dac7364916d9c361bcde9b2268d94followed bybin/fm-test-run.sh tests/fm-secondmate-harness.test.sh- reproduced the exact historical failure.bin/fm-test-run.sh tests/fm-secondmate-harness.test.sh --json /var/folders/_4/q0rlygb56rs6y6xp9sbql5240000gn/T/no-mistakes-evidence/01KZCZ63K31AKPQ8VQDR58SYM3/target-affected-timing.json- target affected suite passed.Isolated target-source snapshot plusverify-leased-crew-spawn.sh- verified allocator call, persistedkind=shipmetadata, matching pane witness, and no injected model/effort flags.bin/fm-test-run.sh --list --lane portable-serial-4of4- confirmed the affected script belongs to the named CI shard.gh-axi pr list --state all --head fm/secondmate-harness-fake-treehouse- found no matching pull request.✅ **Document** - passed
✅ No issues found.
✅ **Lint** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.