The gate script tests give the same verdict on the same tree every run: fixtures edit a private shadow, never the checkout - #1480
Open
DmitriyG228 wants to merge 1 commit into
Conversation
…ckout withEdited() rewrote tracked deploy files in place and restored them after the gate ran. node --test runs test files concurrently, and sbom.test.mjs reads deploy/lite/Dockerfile.lite and asserts the very marker the runtime-parity fixture replaces, so its read could land inside a ~50 ms write window: the required gates check redded at random on unrelated PRs (#1106). The fixture now edits a per-file shadow of the working tree (git ls-files copy, built once, removed in after()) and runs the working tree's gates.mjs with cwd set to the shadow — gates.mjs resolves every input from process.cwd(), so the one redirection covers all five edited surfaces. The checkout has no writer. Adds a harness test that reads the tracked file from inside the fixture and asserts the committed bytes (red on the old withEdited).
🃏 Merge card — #1480
Not mergeable yet — every row above must be accepted before merge (choke point 1). Fill in what's ❌ above, then this clears automatically. How a PR reaches merge: the merge bar. |
This was referenced Sep 3, 2026
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.
Delivers issue: #1478 (diagnoses the report #1106)
Contribution rights
under Apache-2.0, and it is not owned or controlled by an employer, client, or other entity.
may control this contribution. I am requesting Vexa's private corporate-authorization process.
Observation bundle
grep -n writeFileSync scripts/*.test.mjs release/*.test.mjsat basef94c8fa74· saw:scripts/gates.test.mjs:136writesjoin(ROOT, relPath)for five tracked deploy surfaces;scripts/sbom.test.mjs:51readsdeploy/lite/Dockerfile.liteand asserts the literal three of those fixtures replace; every other writer targets amkdtempdir · concluded: two test files on one tracked file, one writing, one reading, run concurrently bynode --test.node --test scripts/gates.test.mjsat base · saw:MUTATED +1330ms / restored +1392ms,+1509/+1553,+1659/+1741—windows=3· concluded: 45–80 ms per run in which any sibling read sees a fixture as the tree. The pass/fail rate on this 128-core host was 0/23 at base (3 default, 10 pinned to 4 cores, 10 to 2), so the poller, not the rate, is the instrument here.gate:image-licensesandgate:runtime-parityinscripts/gates.mjs· saw: every input resolved fromROOT = process.cwd()(:465,480-482,530,557,594-596,602), no.gitdependency · concluded: pointing the subprocesscwdat a shadow copy covers all five surfaces without a per-file override.withEditededits a per-file shadow (git ls-files -z --cached --others --exclude-standardcopy, built once, removed inafter());runGateruns the working tree'sscripts/gates.mjswithcwd= shadow. Call sites untouched. Rejected on the way: env overrides (five surfaces + a templates dir),--test-concurrency=1(hides the race, keeps the class), a throwawaygit worktree(HEAD, not the working tree — an uncommitted deploy edit would be invisible to its own fixture).windows=0,leftover shadows: 0· ran:node --test scripts/gates.test.mjs· saw: 20/20 (every RED fixture still reds through the shadow; file time 1.46 s → 1.82 s) · ran: the new harness test appended to the basewithEditedin a throwaway worktree · saw:not ok … the tracked Dockerfile.lite changed under a running fixture(19 pass / 1 fail) · ran:taskset -c 0-3 node --test scripts/*.test.mjs release/*.test.mjs×10 at head · saw: 10/10pass=134 fail=0.Acceptance floor
f94c8fa74→windows=3(45–80 ms each); head →windows=0withEdited (#1106): the checkout is untouched while a fixture runs — the edit lives in the shadow only: RED against basewithEdited(not ok 20 … changed under a running fixture), GREEN at headnode --test scripts/*.test.mjs release/*.test.mjs, 4-core pin, 10 consecutive runs at head: 10/10 green, 134 tests eachscripts/gates.test.mjs20/20 at head; full script-test lane green ×10;gatesCI on this PRDocs diff (D6c)
None. The lane is described only by the comment at
.github/workflows/gates.yml:47-51and the one line inscripts/README.md; neither states fixture mechanics, anddocs/does not reference the test files. The gates' documented behaviour is unchanged — only their tests' inputs move. The mechanism is explained in the file header where the next reader ofwithEditedwill look.Security checks
scripts/gates.test.mjs; no dependency, lockfile or runtime change — dependency/licence scan not applicable,pnpm gate:licensesruns in CI regardless.git diff -U0 | grep -Ei '(api[_-]?key|secret|token|password|BEGIN (RSA|OPENSSH)|AKIA…)'→ no matches.gitleaksis not installed on the measuring host.node --checkclean.mkdtempdir of tracked + untracked-unignored files only; nothing git-ignored (secrets files are ignored) is copied, and it is removed when the file's tests finish.Validation request
Any non-author maintainer; the reporter of #1106, on the laptop where the flake reproduced ~1 in 3, is the preferred signer. Watch: A1 (the poller from the bundle, or any 5 ms read loop on
deploy/lite/Dockerfile.liteduringnode --test scripts/gates.test.mjs) and A3 (10 consecutive full-lane runs).D12b: no deployment applies — CI tooling only. Provenance of the measurements: fresh
git worktreeofVexa-ai/vexaat basef94c8fa74on a 128-core Linux host, Node v22.14.0, no env deltas; a second throwaway worktree at the same base for the A2 negative control.Authorship
Submitted by the maintainer. Tooling disclosure: diagnosed, measured and drafted with an agent; no co-author trailers.