Skip to content

Prevent automatic maintenance from escaping generated Git fixtures - #965

Merged
taras merged 1 commit into
mainfrom
agent/git-files-pagination-948-20261019
Oct 20, 2026
Merged

taras merged 1 commit into
mainfrom
agent/git-files-pagination-948-20261019

Conversation

@taras

@taras taras commented Oct 20, 2026

Copy link
Copy Markdown
Owner

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: useGeneratedFixture sets repository-local maintenance.auto=false immediately after initialization and before object writes. The setting also applies to later fixture.run commands. 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.ts and packages/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

  • Existing focused evidence: deno task test packages/git/tests/git-observations.test.ts passed 12 tests and35 steps after the recorded regex correction. The regression exercises actual maintenance controls; configuration text alone is insufficient evidence.
  • Both original independent reviewers returned PASS on the identical signed feedback commit 4af02536c57f9b53ad9959981e6f26f8eb268468.
  • Normal signature verification reports G. Required CI, including the actual green aggregate 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:clean run is not a local prerequisite for this patch. Any maintainer-authorized repair-label gate remains a separate requirement.

Scope confirmation

  • Every changed file supports fixture-owned maintenance prevention and its regression.
  • Unrelated cleanup and formatting changes are excluded.
  • No generated or mechanical changes are included.
  • The description identifies the exact reviewed head, retained focused result and remaining delivery gates.

)

`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>
@github-actions

Copy link
Copy Markdown

PR #965: Prevent automatic maintenance from escaping generated Git fixtures

2 files, +49 / -1

Scope

✅ PR scope looks good.

Structural

Oxlint structural signals:

  • no-unused-vars ×1: packages/git/tests/support/observations.ts

Slop

✅ Slop indicators look low.

Static Analysis

Oxlint: 4 diagnostics across 1 file (3 rules)
Density: 0.082 violations/added-line

no-array-sort (2): packages/git/tests/support/observations.ts
no-unused-vars (1): packages/git/tests/support/observations.ts
no-array-reverse (1): packages/git/tests/support/observations.ts

Correctness

FILE: packages/git/tests/git-observations.test.ts
PATTERN: dead code
CONCERN: Commented-out git config command unrelated to useGeneratedFixture logic
QUESTION: Is this line intended to be removed or is it a leftover from prior implementation?

FILE: packages/git/tests/support/observations.ts
PATTERN: signal cluster
CONCERN: Multiple Oxlint violations (no-array-sort, no-unused-vars, no-array-reverse) in same file
QUESTION: Are these violations due to unreviewed generated code or structural issues?

@taras
taras marked this pull request as ready for review October 20, 2026 02:44
@taras
taras merged commit 1acb05a into main Oct 20, 2026
44 checks passed
@taras
taras deleted the agent/git-files-pagination-948-20261019 branch October 20, 2026 02:55
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.

Make Git.Files pagination tests reliable under Deno

1 participant