Repository navigation
test(verify): keep fixture git out of the host's global config (#172) - #193
Conversation
The host's global git config routes trace2 events to the git-ai daemon, which writes .git/ai and refs/notes/ai into each fixture repository after the git command exits. In provenance.test.ts that write recreated the fixture root after the test renamed it, so the symlink at line 132 failed with EEXIST. Fixture git calls in the provenance, harness and publisher tests now run with GIT_CONFIG_GLOBAL=/dev/null and GIT_CONFIG_NOSYSTEM=1. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Merge Protections🟢 All 2 merge protections satisfied — ready to merge. Show 2 satisfied protections🟢 Queue ready pull requestsAutomatically queue non-draft pull requests targeting main after verify, Unfret, and live-gate pass on the head and every review thread is resolved.
🟢 🚦 Auto-queueWhen all merge protections are satisfied and these conditions match, this pull request will be queued automatically.
|
Live evidence: Open Pstack
|
|
[Low impact] The PR appears safe to merge based on the code changes reviewed. SummaryThe PR keeps fixture Git commands from reading the host's global and system configuration.
No actionable defects were found. This review checked source code; it did not run tests or reproduce the operator's daemon-write race. Reviews (1) · Last reviewed commit: "test(verify): keep fixture git out of th..." · Reviewed by Greptile |
✅ No blocking findingsWalkthroughThis PR fixes a flaky provenance test
Details
First review of this pull request. @unfret review · @unfret status · @unfret help |
Live evidence: Open Pstack
|
|
@Mergifyio refresh |
✅ Pull request refreshed |
Merge Queue Status
This pull request spent 10 seconds in the queue, including 1 second running CI. Required conditions to merge
|
Closes #172.
Summary
The host's global git config sends every git process's trace2 events to the git-ai daemon. After a fixture's
git addorgit commitexits, the daemon writes.git/ai/...into that repository by absolute path. It works through its queue in order, so in a full run ofprovenance.test.tsit reaches the redirect test's fixture after the test has renamed the fixture root.test('filesystem rechecks reject a candidate workspace redirected to an untouched pinned copy') fixture() - git init / config / add / commit # ambient config -> trace2 -> git-ai daemon + git init / config / add / commit # env: PATH, GIT_CONFIG_GLOBAL=/dev/null, GIT_CONFIG_NOSYSTEM=1 sourceHash(root, sha) # read-only git; the daemon writes nothing for these rename(root, untouched) - # daemon: mkdir -p root/.git/ai/working_logs/initial/... symlink(untouched, root) # was EEXISTThe same isolated environment goes on every git call these fixtures make themselves:
Production code is unchanged.
sourceHash()makes read-onlyrev-parse,diff --quietandls-treecalls. On pro14 those calls caused no git-ai writes.Evidence
The failure ran on pro14, where batch 153's gates ran on 2026-10-12. It does not reproduce on studio2. Each test run is a full-file
bun test scripts/provenance.test.tsfrom.claude/skills/verify-open-pstack, one at a time.mainf1c88d8, pro14): 12 of 200 runs failed, all withEEXIST ... symlink '<tmp>/pstack-provenance-XXXXXX-untouched' -> '<tmp>/pstack-provenance-XXXXXX'.After (this head, pro14): 200 of 200 runs passed.
rootif it exists. Onmainit caught the daemon's write 19 to 31 ms after the rename:maindid not reproduce there either: 0 of 200 runs, 4 at a time.The full investigation is in the batch record
projects/open-pstack/records/2026-10-15-batch-172/adjudication.mdin Eric's docs repository. It covers the daemon logs, the temp directories git-ai recreated after test cleanup, and why the 2026-10-12 failures were on pro14.Merge Danger
Door: two-way
Only test files change, and reverting the commit restores the old fixtures exactly.
Blast Radius: tests
The fixture git calls no longer read the global or system config. They now get their identity only from local config,
-corGIT_AUTHOR_*andGIT_COMMITTER_*, which they already set. The gate below passes with that change.Acceptance criteria
root. Evidence: the pro14 baseline loop and the diagnostic capture above, plus the batch record.bun test scripts/provenance.test.tsin a loop)." Passed: 200 of 200 on pro14, wheremainfailed 12 of 200, and 200 of 200 on studio2.Gate results
On this head's tree (
56d97ca), on studio2:bun run testbun run typecheckbun run staticclaude plugin validate plugins/pstackLive gate: this PR changes the verifier, so its live gate runs from the candidate checkout with
--self-testand the featureproject-skillin both harnesses. Run 1 onb151645failed before the doctor ran (evidence comment 6202992042). The Claude CLI on studio2 had hit its five-hour session limit, with overage rejected, and replied "You've hit your session limit · resets 9:30pm (America/New_York)". The Codex session did not start. Run 2 onb151645, after the reset, passed with publisher revision equal to the candidate SHA (evidence comment 6206010406). Claude and Codex each passeddoctor:exit-0,doctor:skill-loaded,doctor:doctor-rananddoctor:doctor-canonical-pass.Not verified
harness.test.tsorverify.test.tsalone. Their fixtures get the same environment, the full verifier suite passes, and pro14's temp folder and daemon log show git-ai acting on both fixtures before this change..git/ai-only temp directories that git-ai recreated before this change remain on studio2 and pro14. This PR does not remove them.🤖 Generated with Claude Code