Repository navigation
Prevent automatic maintenance from escaping generated Git fixtures - #965
Conversation
) `useGeneratedFixture` writes 1002 blobs and commits them, and a commit returns before the maintenance it starts does. Nothing in the fixture asked Git not to start it, so the generated checkout could leave a detached writer running past the command that launched it — repacking objects while a read enumerates them, and recreating `objects/info` after a removal had already passed `objects`. That is the ENOTEMPTY the saved trace caught. The fixture now sets `maintenance.auto` to false in its own checkout, immediately after `git init` and before the first object is written, so no command it runs — its own commit, or any later ordinary `fixture.run` — has an automatic launch to make. The policy is local to that temporary checkout and the helper's already neutralized environment, so nothing outside it is configured. The new GO5 case is a discriminator rather than a reading of the configuration. On a real 1002-file fixture holding no pack and at least 1002 loose objects, an empty commit that selects Git's own loose-object task and keeps it in the foreground leaves the pack set empty; the identical command with `maintenance.auto=true` added for that one command writes a new `loose-*.pack`. Configuration text alone cannot satisfy both halves, and an absence of maintenance work cannot pass on its own. Production code, the shared Git and temporary-directory helpers and every existing observation are unchanged. No read or removal error is tolerated, retried or caught here, and the temporary directory keeps its existing owner. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
PR #965: Prevent automatic maintenance from escaping generated Git fixtures2 files, +49 / -1 Scope✅ PR scope looks good. StructuralOxlint structural signals:
Slop✅ Slop indicators look low. Static AnalysisOxlint: 4 diagnostics across 1 file (3 rules) no-array-sort (2): packages/git/tests/support/observations.ts CorrectnessFILE: packages/git/tests/git-observations.test.ts FILE: packages/git/tests/support/observations.ts |
Why
Generated Git fixtures can start detached automatic maintenance while creating their objects. That work can outlive the fixture command and race observations or teardown. This repair prevents fixture-owned automatic maintenance from escaping that lifetime.
Fixes #948.
What changes
Before: generated fixtures use Git's automatic-maintenance defaults while writing their objects and during later fixture commands.
After:
useGeneratedFixturesets repository-localmaintenance.auto=falseimmediately after initialization and before object writes. The setting also applies to laterfixture.runcommands. A focused regression uses real foreground negative and new-loose-object/pack positive controls to distinguish the former automatic-launch behavior from the fixture policy.The change is limited to
packages/git/tests/support/observations.tsandpackages/git/tests/git-observations.test.ts.What must stay true
The 1002-path fixture, default100 and full pagination, larger limits, changes and patch windows, and GO8 read-only/containment/lifetime assertions remain intact. The repair adds no production Git behavior or read/remove-error tolerance.
How to verify it
deno task test packages/git/tests/git-observations.test.tspassed 12 tests and35 steps after the recorded regex correction. The regression exercises actual maintenance controls; configuration text alone is insufficient evidence.4af02536c57f9b53ad9959981e6f26f8eb268468.greenaggregate and existing main-health gate, remains authoritative for delivery. It is pending at publication.Risks and limitations
The fresh trace supports the fixture-local maintenance/lifetime repair. The historical Node actor, original Deno failure path and relationship between those historical failures remain unknown; this PR does not claim main health is restored.
Preserved implementation evidence includes the initial guessed-path failure and authored-regex failure, followed by the focused passing result. There are24 actual command logs; malformed start timestamps leave precise starts/durations unknown. The subsequent pair accepted the existing signed implementation; those process deviations are not rewritten as clean instruction compliance.
This draft awaits actual required CI and the original Planner's final title/body APPLY followed by independent VERIFY. No merge is requested. No dependency declarations, locks, release configuration or generated assets change, so a dependency-state
verify:cleanrun is not a local prerequisite for this patch. Any maintainer-authorized repair-label gate remains a separate requirement.Scope confirmation