Skip to content

test(verify): keep fixture git out of the host's global config (#172) - #193

Merged
mergify[bot] merged 1 commit into
mainfrom
test/172-fixture-git-isolation
Oct 16, 2026
Merged

mergify[bot] merged 1 commit into
mainfrom
test/172-fixture-git-isolation

Conversation

@ericlitman

@ericlitman ericlitman commented Oct 15, 2026 •

Copy link
Copy Markdown
Owner

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 add or git commit exits, the daemon writes .git/ai/... into that repository by absolute path. It works through its queue in order, so in a full run of provenance.test.ts it 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 EEXIST

The same isolated environment goes on every git call these fixtures make themselves:

.claude/skills/verify-open-pstack/scripts/
├── provenance.test.ts   # fixture(), git config core.filemode, the second commit
├── harness.test.ts      # the clone-source repository fixture
└── verify.test.ts       # the publisher diff fixture (drops the process.env spread)

Production code is unchanged. sourceHash() makes read-only rev-parse, diff --quiet and ls-tree calls. 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.ts from .claude/skills/verify-open-pstack, one at a time.

  • Before (main f1c88d8, pro14): 12 of 200 runs failed, all with EEXIST ... symlink '<tmp>/pstack-provenance-XXXXXX-untouched' -> '<tmp>/pstack-provenance-XXXXXX'.
    After (this head, pro14): 200 of 200 runs passed.
  • Cause, before: a diagnostic copy of the test waits 400 ms after the rename, then lists root if it exists. On main it caught the daemon's write 19 to 31 ms after the rename:
    RECREATED <tmp>/pstack-provenance-i7n19a
    19ms .git/ai/working_logs/initial/blobs/e3b0c442…  (+2 more blobs)
    31ms .git/ai/working_logs/initial/checkpoints.jsonl
    
    Cause, after: with the fix, the diagnostic copy saw 0 recreations in 100 full-file runs. An unfixed control run of the same copy, right afterwards, saw 3 in 100. During the fixed runs the daemon logged 4 lines, none naming a provenance fixture. During the control it logged 1,176 lines naming them.
  • studio2, this head: 200 of 200 runs passed. main did 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.md in 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, -c or GIT_AUTHOR_* and GIT_COMMITTER_*, which they already set. The gate below passes with that change.

Acceptance criteria

  • "The cause is named with evidence, such as a reproduction loop." The git-ai daemon recreates root. Evidence: the pro14 baseline loop and the diagnostic capture above, plus the batch record.
  • "The fix removes it at the cause, with no retry and no sleep." The fixtures no longer send trace2 events to the daemon, so the daemon has no work to queue for them. The diff adds no retry and no sleep.
  • "The test passes 200 consecutive runs on the operator Mac (bun test scripts/provenance.test.ts in a loop)." Passed: 200 of 200 on pro14, where main failed 12 of 200, and 200 of 200 on studio2.

Gate results

On this head's tree (56d97ca), on studio2:

Check Exit
bun run test 0 (368 pass, 0 fail)
bun run typecheck 0
bun run static 0 (verifier suite 158 pass, 0 fail)
claude plugin validate plugins/pstack 0

Live gate: this PR changes the verifier, so its live gate runs from the candidate checkout with --self-test and the feature project-skill in both harnesses. Run 1 on b151645 failed 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 on b151645, after the reset, passed with publisher revision equal to the candidate SHA (evidence comment 6206010406). Claude and Codex each passed doctor:exit-0, doctor:skill-loaded, doctor:doctor-ran and doctor:doctor-canonical-pass.

Not verified

  • No loop targeted harness.test.ts or verify.test.ts alone. 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.
  • The leftover .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

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]>
@mergify

mergify Bot commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

Merge Protections

🟢 All 2 merge protections satisfied — ready to merge.

Show 2 satisfied protections

🟢 Queue ready pull requests

Automatically queue non-draft pull requests targeting main after verify, Unfret, and live-gate pass on the head and every review thread is resolved.

  • #review-threads-unresolved = 0
  • -draft
  • check-success=Unfret
  • check-success=live-gate
  • check-success=verify

🟢 🚦 Auto-queue

When all merge protections are satisfied and these conditions match, this pull request will be queued automatically.

  • -files~=^\.github/
  • base = main

@ericlitman

Copy link
Copy Markdown
Owner Author

Live evidence: Open Pstack

  • Candidate SHA: b151645965b832509085adc38a9c603f8898f9c5
  • Base SHA: f1c88d8f8a5ac6a1f2d963ff404c5db718d00fbe
  • Result: FAILED — verification did not complete; rerun required
  • Self-test: required in both harnesses
  • Publisher revision: b151645965b832509085adc38a9c603f8898f9c5
  • Evidence-set SHA-256: a492d74fd04d70f0b390ca9ceafc58feb58a46fb1d7ba41d2cbe337beaca4d82
  • Policy: every new head requires a fresh run; this verifier does not change PR state, queue, or merge.

@greptile-apps

greptile-apps Bot commented Oct 15, 2026 •

Copy link
Copy Markdown

RetriggerView in Greptile

[Low impact] The PR appears safe to merge based on the code changes reviewed.

Summary

The PR keeps fixture Git commands from reading the host's global and system configuration.

  • Verifier test fixtures use isolated Git settings.

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

@ericlitman
ericlitman marked this pull request as ready for review October 15, 2026 22:02
@unfret-eal

unfret-eal Bot commented Oct 15, 2026 •

Copy link
Copy Markdown

✅ No blocking findings

Walkthrough

This PR fixes a flaky provenance test (#172) by running the test fixtures' own git commands in an isolated environment. That environment passes only PATH, sets GIT_CONFIG_GLOBAL=/dev/null and sets GIT_CONFIG_NOSYSTEM=1, so the host's global config no longer sends trace2 events to the git-ai daemon. According to the author, the daemon used to write `.git/ai/...` back into a fixture root after the redirect test had renamed it, which caused intermittent EEXIST failures on symlink. The change touches only test files across provenance, harness and verify tests, with no production code and no retries or sleeps. The author reports 200/200 passing runs on pro14 (versus 12/200 failures on main) and on studio2. The live gate on this head was blocked by a Claude CLI session limit and has not been rerun yet.

Area What changes
Provenance test fixtures fixture() init/config/add/commit, the core.filemode config call, and the second commit now run git with the isolated gitEnv instead of the ambient environment.
Harness and verify test fixtures The clone-source repo fixture in harness.test.ts and the publisher diff fixture in verify.test.ts use the same isolated git environment. verify.test.ts drops its process.env spread and keeps the explicit GIT_AUTHOR_*/GIT_COMMITTER_* identity.
Details
Lane / stage Model Effort Outcome Duration
broad-gpt-5.6-sol-xhigh / review openai/gpt-5.6-sol → gpt-5.6-sol · primary xhigh succeeded 32 s
broad-opus-5.5-max / review anthropic/claude-opus-5-5 → claude-opus-5-5 · primary max succeeded 2 min 27 s
focal-gpt-5.6-sol-xhigh copy / review openai/gpt-6.1-sol → gpt-6.1-sol · primary xhigh succeeded 3 min 42 s
focal-gpt-5.6-sol-xhigh copy 2 / review openai/gpt-6.1-sol → gpt-6.1-sol · primary xhigh succeeded 3 min 46 s

First review of this pull request.
4 reviewers finished.
Commit b151645.
Check run.
Run: GET /unfret/run/panel:b151645965b832509085adc38a9c603f8898f9c5:64hV78K8cdD:-3EWV7PuK-w.

@unfret review · @unfret status · @unfret help

@unfret-eal unfret-eal Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No blocking findings
Check

@ericlitman

Copy link
Copy Markdown
Owner Author

Live evidence: Open Pstack

  • Candidate SHA: b151645965b832509085adc38a9c603f8898f9c5
  • Base SHA: f1c88d8f8a5ac6a1f2d963ff404c5db718d00fbe
  • Result: PASSED — named features verified
  • Self-test: completed in both harnesses
  • Publisher revision: b151645965b832509085adc38a9c603f8898f9c5
  • Evidence-set SHA-256: 970ded4ac124aa81899523d47e47ab1fe02d820258d3de6962256ee1bc22b87e
  • Installation (claude): CLI 2.1.301 (Claude Code), plugin 1.8.0, candidate b151645965b832509085adc38a9c603f8898f9c5, tree 527c15b012faf039f2a2ee1fdb5d88832a0d87de1345b3a1cc88fd4d1108ca37.
  • Installation (codex): CLI codex-cli 0.159.0, plugin 1.8.0, candidate b151645965b832509085adc38a9c603f8898f9c5, tree 527c15b012faf039f2a2ee1fdb5d88832a0d87de1345b3a1cc88fd4d1108ca37.
  • Observation (claude / project-skill): surface claude -p stream-json with the candidate plugin-dir; action recipe project-skill: doctor; result passed: doctor:exit-0 doctor:skill-loaded doctor:doctor-ran doctor:doctor-canonical-pass; 4 assertions machine-checked; transcript SHA-256 88ed70b8a749a94835f1c0f8fa65a6d970fb353601376b993dda62e6580041e7; artifact-set SHA-256 3eba5ffbb3c25fe452871e9f759461538b28c5356c07cba795200d41369da277.
  • Observation (codex / project-skill): surface codex exec --json with the run-owned candidate installation; action recipe project-skill: doctor; result passed: doctor:exit-0 doctor:skill-loaded doctor:doctor-ran doctor:doctor-canonical-pass; 4 assertions machine-checked; transcript SHA-256 4b487155f69c85d46f79f6a23b4ed86638809fcde59036f65481362d7e5580a7; artifact-set SHA-256 a5d9d32896eb49b7e6c3566a8574d9252ab5052931cc1e09238ddfa0e6f0c6f5.
  • Policy: every new head requires a fresh run; this verifier does not change PR state, queue, or merge.

@ericlitman

Copy link
Copy Markdown
Owner Author

@Mergifyio refresh

@mergify

mergify Bot commented Oct 16, 2026

Copy link
Copy Markdown
Contributor

refresh

✅ Pull request refreshed

@mergify

mergify Bot commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

Merge Queue Status

  • ✅ Entered queue — 2026-10-16 01:35 UTC · Rule: default · triggered by merge protections
  • ✅ Checks skipped · PR is already up-to-date
  • ✅ Merged — 2026-10-16 01:35 UTC · at 6c8eda412045cf436b82690dd306ce56faa1c998 · merge

This pull request spent 10 seconds in the queue, including 1 second running CI.

Required conditions to merge

@mergify
mergify Bot merged commit 6c8eda4 into main Oct 16, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

provenance.test.ts intermittently fails with EEXIST after renaming its fixture root

1 participant