fix: the shadow snapshot was measuring git's background work - #867
Merged
Conversation
CommitLore — record lintTrailers: clean — 1 commit in Active constraints for the paths this PR touchesLimits (4)
Ruled out (7)
Warnings (2)
Trailer violations fail this check. Active constraints are informational — they are what the repository already decided, not a verdict on this PR. |
…and's `check (24)` failed on #866 with `expected [ …(39) ] to deeply equal [ …(40) ]` in `capture --shadow > runs prepare and verify against history without changing the worktree or .git`. The diff named one entry: - file .git/objects/maintenance.lock e3b0c442...b7852b855 `e3b0c442...b7852b855` is the SHA-256 of the empty string, so the missing entry is an empty lock file that git's auto-maintenance created before the `before` snapshot and removed before the `after` one. Nothing the command did produced or consumed it. The obvious repair -- filter `*.lock` out of `byteSnapshot` -- is the wrong one. That snapshot is exhaustive precisely because it is the evidence that `capture --shadow` is read-only, and a filter is a place a real stray file can hide. So the fixture denies git the background work instead: `gc.auto 0` and `maintenance.auto false` on the temporary repository leave nothing transient for the snapshot to disagree about, and the snapshot stays total. Record-Id: r-shadowsnapshotlock Provenance: authored Certainty: firm Blast: local Undo: easy Ruled-out: filtering lock files out of byteSnapshot | it makes the snapshot non-exhaustive, and the snapshot's exhaustiveness is the whole assertion -- a stray file written by the command would then be able to hide behind the same filter Ruled-out: retrying the flake and moving on | the trigger is git's auto-maintenance heuristic, which fires on repository state rather than on chance, so it returns on the next branch that reaches the same threshold Limit: this fixture only; other suites build repositories through createTestRepo, which does not disable maintenance either, and would show the same shape if any of them ever compared .git byte for byte Verified: test/capture-shadow.test.ts passes 3/3 locally after the change; the failing CI diff named exactly one entry and it was the maintenance lock Unverified: the failure was observed once, on one runner; this removes the mechanism rather than demonstrating the mechanism's absence over repeated runs
MongLong0214
force-pushed
the
fix/capture-shadow-maintenance-flake
branch
from
September 7, 2026 02:52
a2a5fde to
c950499
Compare
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.
check (24)failed on #866 within
capture --shadow > runs prepare and verify against history without changing the worktree or .git. The array diff named exactly one entry:e3b0c442…b7852b855is the SHA-256 of the empty string, so the missing entry is an empty lock file created by git's auto-maintenance between the two snapshots. Nothingcapture --shadowdid produced or consumed it — the test was measuring git's background work.Why not filter the snapshot
byteSnapshotis exhaustive on purpose: its exhaustiveness is the assertion that the command is read-only. A*.lockfilter would make it non-exhaustive and give a real stray file somewhere to hide. So the fixture denies git the background work instead —gc.auto 0andmaintenance.auto falseon the temporary repository — and the snapshot stays total.Verified
test/capture-shadow.test.ts3/3 locallytest/dogfood.test.ts10/10 on this committest/is not inSOURCE_INPUTS, so no canonical rebuild or manifest change is neededNote
createTestRepointest/git-fixtures.tsdoes not disable maintenance either. No other suite compares.gitbyte for byte today, so nothing else is exposed — but that is why this is fixed in the fixture rather than in the walker.