Repository navigation
refactor(tests): deduplicate max-lines ratchet fixtures - #132372
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 29, 2026, 1:51 AM ET / 05:51 UTC. ClawSweeper reviewWhat this changesThe PR replaces repeated temporary Git-fixture setup and manual cleanup in max-lines ratchet tests with the shared temporary-directory tracker and a local commit helper. Merge readinessNo introduced correctness defect was found in this focused test-only refactor. The PR is member-authored and carries the protected Priority: P3 Review scores
Verification
How this fits togetherThe max-lines ratchet test creates isolated Git repositories to verify that the source-size suppression guard rejects baseline growth and broad lint disables. Each fixture feeds the guard with branch, staging, rename, and worktree states and asserts its result. flowchart LR
A[Test cases] --> B[Temporary Git fixture]
B --> C[Git history and staged files]
C --> D[Max-lines ratchet guard]
D --> E[Validation result]
F[Shared directory cleanup] --> B
Before merge
Agent review detailsSecurityNone. PR surfaceTests -71. Total -71 across 1 file. View PR surface stats
Review metrics
Technical reviewBest possible solution: Keep the shared fixture lifecycle and local Git setup helper, then integrate it through the normal exact-current-main maintainer check. Do we have a high-confidence way to reproduce the issue? Not applicable: this PR refactors test fixtures rather than reporting a user-facing failure. The relevant ratchet scenarios remain present in the reviewed test source. Is this the best way to solve the issue? Yes: it reuses the repository's existing temporary-directory lifecycle instead of retaining duplicated cleanup and Git setup sequences, while preserving the test-specific ordering differences. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 09be104e941c. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
|
Merged via squash.
|
What Problem This Solves
The max-lines ratchet tests repeat the same temporary-repository setup and directory bookkeeping across independent cases. That duplication makes fixture maintenance harder without adding behavioral coverage.
Why This Change Was Made
Reuse the existing temporary-directory tracker and consolidate nine identical, ordered Git initialization/configuration/commit sequences in a private fixture helper. All 12 original cases and assertions remain. The NUL-framed filename case remains init-only; divergent histories, staged versus unstaged content, commit messages, and the mock-restoration-before-cleanup order are preserved.
The tracker receives an explicit system temporary root to preserve its original spelling. Its existing cleanup policy includes bounded filesystem removal retries and retains tracked directories if cleanup throws; this is adoption of the canonical fixture lifecycle, not a claim of identical exceptional cleanup timing. No production code, shared helper, public API, test retry, test timeout, or assertion is changed.
User Impact
No user-visible behavior change. This is an AI-assisted, maintainer-requested test-fixture cleanup: production +0/-0; tests +36/-107, net -71 lines. The meaningful ratchet checks remain independent.
Evidence
Actual local proof on macOS used Node 24.19.0, the repository-pinned pnpm 12.0.0 through normal Corepack resolution, and the same canonical five-suite command before and after:
Baseline and candidate each passed all 60 cases across five files, with the complete named-case multiset preserved, including embedded-newline names and duplicate titles. There were no skips on this macOS host; the existing Windows-only filename-case skip remains unchanged.
Scoped formatting and
git diff --checkpassed. The full canonical changed gate passed all 14 selected commands, including root test typechecking, script lint, temporary-directory ownership reporting, and the relevant repository guards:One normal independent Codex precommit review completed with no actionable P0 findings. The ordinary commit hook ran and preserved the reviewed afterimage; signed commit
4cba0a3f472554205bc24ac4609f8160de37bb1dhas the exact one-file diff above.The first candidate preflight was refused before tests because its raw Git index bytes differed from the prior observation. The old raw bytes were not archived, so historical cause, actor, and exact field delta remain unknown. A complete index/flag/source audit established the intended state; a separately admitted candidate run then passed, without resetting the index or replaying installation/baseline tests. Original diagnostic failures remain retained, including a case-log parser correction for multiline names and a review-packet correction that relabeled unchanged lockfile/CI-guide context accurately. None required a product or assertion change.
Full tracked-source, semantic-index/flags, dependency, output, and current-runtime checks passed around review and commit; known processes and isolated review homes were verified absent. Normal Vitest cache creation/result updates were retained and disclosed.
Hosted exact-head CI, any published-head review, current-main integration, and native landing remain pending. No product build, live external API, Linux/Windows execution, performance improvement, or landed cleanup credit is claimed.
Subsequent Proof Update — 2026-08-29
This update supersedes only the pending proof statuses above; the original evidence and limitations are retained verbatim.
CI run 33234787464, attempt 1 for exact head
4cba0a3f472554205bc24ac4609f8160de37bb1d, completed successfully with 100 successful jobs and 18 skipped jobs. The canonical exact-head CI watcher exited 0. Its raw rollup reportedFAILURE, zero pending and 53 superseded checks beforeGREEN; this is not a claim that every raw check across earlier runs passed.Actual hosted logs contain the same 60 named passing cases as both local runs, including multiline names and duplicate titles: core-tooling-1 has 12 max-lines and 6 temporary-directory helper cases; core-tooling-3 has 20 environment-variable and 5 assertion-safety cases; core-tooling-6 has 17 shrink cases. Each owning group ended with exit 0. No skipped case is counted as a pass.
Those jobs checked out merge ref
8d3792e4b58488bdc1728945cafad26741aa540f, combining this head with base293c433a10bcd4727b11505caa1c8a995618a18f. A separate read-only comparison against main checkpoint015546cb8bd8866e5d76b7f264474e7e641f6a80found the owned test beforeimage unchanged and no relevant fixture/selector conflict in the inspected current-main deltas. The complete object-map composition predicts a one-file change on that checkpoint; it is not a performed merge or new local/hosted execution on015546....One normal independent Codex published-head review completed with no actionable P0 findings. Its actual process closure and source/index/dependency/output/runtime checks passed. The ClawSweeper review on this head had no findings; its outstanding CI verification is now backed by the exact-head run and named-case audit above. No redundant review request or comment was needed.
Native integration, final live mergeability and landing remain separate gates. No Windows execution, live external API, performance improvement, or landed cleanup credit is claimed by this update.