Repository navigation
fix: test fixtures stop tripping /ship's fetch sweep (GST-1695) - #4105
Conversation
…(GST-1695) Failing first: a marked fixture root and ship-bin's insteadOf-local clone are printed as ignored and never block the rerun, an unmarked network clone still does, and every test process keeps its temp paths under one marked root that is removed after a timeout. Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
… sweep ignores them (GST-1695) Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
|
😎 This pull request was merged. |
The macOS named regressions re-host a captured 120-column Claude screen at the run's temp path; under the per-process marked root that path is 11 characters longer, so the permission row overran 120 columns, the PTY split '(shift+tab)' mid-word and the guard never granted (CI run 42326005642). The fake now word-wraps an overlong row at its last space, as Claude Code's renderer does. test-setup.ts, the changelog fragment and docs/review-policy.md now say a Bun.spawn child given no env keeps the original temp dir, and the policy names the exemptions a reader could forge. Review-Finding: test/plan-count-file-permission.test.ts:101:functional-contract reader=qa Review-Finding: p1/red-team#1 reader=red-team Review-Finding: p1/specialist-batched#1 reader=security Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
E2E Evals: ❌ FAIL100 executed, 0 reused rule/judge records | 0 manual accepted (unscored; no score-cache credit) | $32.26 rule/judge cost | reconcile exit: 1 Profile: pr / mode Full gate restored by:
Rule and judge shards
Fail-closed reconciliationSliced lane: planner → duration-packed executors → fail-closed report. Behavior cases run a pre-registered 3-trial panel (PASS at 2/3 with no contract violation); a PASS 2/3 is shown with its failed trial, never as a clean pass. Reused results retain their original provenance and expiry. Failures and split verdictsDispatched narrow screen (gstack-ship-queue ready --screen) of merge commit |
…PDIR stays as handed (GST-1695) The narrow screen (evals run 42333856900) went red on qa-bootstrap: the preload nested gst-XXXXXX under the paid shard's private TMPDIR, so the case's mkdtemp(os.tmpdir()) landed below the bootstrap retention scope's temporary dir and registerBootstrapRetention refused it. createShardSandbox now writes the marker into the shard state dir beside tmp/, and the preload keeps any TMPDIR under a marked directory. Harness pin recorded as non-behavioral. Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
What changed
No UI change, so there is no screenshot. Before: a
bun testrun that was still going, or one that timed out before its own cleanup, left fixture git repositories such as/tmp/ship-bin-*(originhttps://github.com/fx/fx.git) under the temp dir, and /ship's per-stage fetch sweep counted them as a reader's fetch, quarantined the stage and then refused its rerun withFETCH_RERUN_BLOCKED. After: everybun testprocess keeps its temp paths under one per-process root marked.gstack-test-fixtureand removes it after the last file, and the sweep printsFETCH_IGNORED:for a marked root or a repository whose remote resolves locally throughurl.<base>.insteadOf.Why
Three /ship review passes were lost on 11-06 and 11-07 because leftover test fixtures looked like sealed-repo clones. The sweep has to keep catching a reader's real clone, so the fix marks what tests create instead of loosening what the sweep counts.
Summary
/ship stopped review passes when a test run's own fixture repositories sat in /tmp, because the fetch sweep could not tell them from a reader's clone. test-setup.ts, the
bun testpreload, now points TMPDIR at a marked per-process root and deletes it in a preload afterAll, and lib/review-sweep.ts skips a marked directory below a sweep root and a local-remote repository, printing why. An unmarked clone with a real network remote still quarantines the stage. The review round also fixed a macOS-only red. The named regressionreal fake CLI grants each current request once(cropped, path-cropped) re-hosts a captured 120-column Claude screen at the temp path, which the marked root made 11 characters longer, so the fake now word-wraps an overlong row the way Claude Code does.Blast radius
The preload change reaches every test process, and each one now writes under
$TMPDIR/gst-XXXXXX/and removes it at the end, and a nestedbun testinside an outer root keeps the outer TMPDIR. The free suite passed on Linux at c00402c (run 42326005642, free-suite shards green) and the one path-length casualty, the macOS named regression, was replayed on Linux at the macOS runner's TMPDIR length and passes after the fix (script ran);bun run typecheckandtypecheck:testare clean. Product code outside the sweep and the review-dispatch help text is untouched.Approvals
No approvals recorded for branch capy/gst-1695-fixture-sweep.
Test Coverage
8 of 12 changed code paths have tests (Step 7 audit, audit-only, no tests generated).
Tests: 1749 → 1749 (+0 new) in the audit's count; the branch's own failing-first tests landed in 208756b.
Coverage: 67% value-weighted (67% including 0 weakly covered paths)
Test value: 0 tests written, 1 rejected by the authoring gate, 0 existing tests extended, 0 paths weakly covered (weak = ★, gate-failing or unrated).
Leftover gaps, proposed: the longest-match
insteadOfrule among overlapping rules;sweepResultnot re-reporting an ignored path already present at start; a control-character remote inignoredLines.Tests ran: test carried from CI (see the receipt's pregate record).
Pre-Landing Review
Pass 1 (specialists testing, security and state-machines batched, Red Team, Step 7 coverage audit, parent checklist and QA): 3 findings, all fixed in 635d120.
test/plan-count-file-permission.test.ts:101: the macOS named regressionscroppedandpath-croppedfailed because the marked root lengthened the re-hosted screen row past 120 columns. Fixed: the fake word-wraps an overlong row at its last space.test-setup.ts:73: the comment and changelog said every spawned child follows TMPDIR; aBun.spawnchild given noenvkeeps the original. Fixed: the comment, the fragment and docs/review-policy.md say so.lib/review-sweep.ts:129: a reader could write the marker or an insteadOf line itself. Fixed as documentation: docs/review-policy.md names it beside the existing unseen cases.Pass 2 (range c00402c..635d120): specialists and Red Team NO FINDINGS. Step 11: native adversarial 4 findings, all below the floor (Review notes below); outside voice openai/gpt-6.1-sol completed, no findings.
REVIEW_LOOP: passes=2 blocking_found=1 deferred=0 noted=0 fixed=3 scope=frozen ledgers_read=4 dispatches=8
Gate edits: none detected (6 listed, 1 read; patterns: RH-1,RH-3,RH-4,RH-12,RH-13,RH-14,RH-15,RH-16; unlisted idioms: none)
Outside review: completed (openai/gpt-6.1-sol), Recommendation: approve.
Review notes
Below the blocking floor (advisory, informational, test-gap or wording items); recorded here and not fixed in this PR.
lib/review-sweep.ts:48Bun.spawn children given no env keep the original TMPDIR, so their fixtures land outside the marked root; documented, not closed. No current test creates a network-remote fixture that way.docs/review-policy.md:656A reader could write the fixture marker or an insteadOf line and hide a real clone; pre-existing trust model, now documented.test/plan-count-file-permission.test.ts:108The test's row reflow cuts an overlong row once; a row over ~240 columns would stay long (no current screen does).test-setup.ts:56A rewrapped comment line runs past the block's ~80-column wrap; cosmetic.Exploratory QA
Functional surface, report-only. Pre-fix probes: the sweep and fixture-root tests passed; the macOS-length TMPDIR replay of
test/plan-count-file-permission.test.ts -t croppedfailed exactly as CI did (product-defect), and passed at main's path length. Post-fix probes on current inputs (verdict pass): capture 001,bun test test/review-sweep.test.ts test/test-fixture-root.test.ts, pass; capture 002, the whole permission test file at the macOS-length TMPDIR, pass. Limit: macOS itself was not run locally; CI on the new head is the macOS proof. The pre-fix probe directory's own verdict is fail only because its first capture was superseded and not recaptured there.Design Review
No frontend files changed — design review skipped.
Eval Results
No prompt-related files changed — evals skipped.
Review bot comments
Bot comments present; not triaged in this run.
Scope Drift
Scope Check: CLEAN
Plan Completion
Plan completion audit: not run (no plan is bound to this branch and no docs/designs/ file matches). Fix: add "Plan: " to the PR body, or run /autoplan.
Issues
Refs p1/red-team#1
Refs p1/specialist-batched#1
Verification Results
No plan-specific verification items (bug fix, no plan): 0 PASS, 0 FAIL, 0 BLOCKED, 0 NOT RUN.
TODOS
No TODO items completed in this PR.
Documentation
Status: current. The docs already describe this change correctly, so no edits were needed.
Scope: 11 committed files from ca5dbfc..635d120 (fetch-sweep fixture marker, insteadOf local-remote handling, per-process test fixture root in test-setup.ts). There are no staged, unstaged or new files. I searched the 141 inventoried docs for related terms.
Documentation health:
Coverage debt: FETCH_IGNORED and the fixture marker each have reference coverage (review-policy, troubleshooting) and an explanation (the review-policy rationale), and FETCH_IGNORED has no separate troubleshooting anchor of its own. These are common gaps, not critical ones. The test-setup fixture root and GSTACK_TEST_TMP are documented only in code comments and review-policy, with nothing in TESTING_INTERNALS.
Diagram drift: none found.
Test plan
bun test --timeout=30000 test/plan-count-file-permission.test.ts test/test-fixture-root.test.ts test/review-sweep.test.ts: 133 pass, 0 failbun run typecheckandbun run typecheck:test: clean