Repository navigation
refactor(test): remove unused temp-directory counter - #144628
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. Reviewed September 10, 2026, 11:41 PM ET / September 11, 2026, 03:41 UTC. ClawSweeper reviewWhat this changesRemoves an unused per-prefix counter from the temporary-directory test helper while preserving directory naming and cleanup behavior. Merge readiness✅ Ready for maintainer review This is a useful, behavior-preserving cleanup with no actionable findings. Current main still contains the unused counter, and the linked test-audit campaign supplies concrete maintainer context. Priority: P3 Review scores
Verification
How this fits togetherTest suites use this helper to allocate isolated directories beneath reusable temporary roots. It returns directory paths and removes their contents during test cleanup. flowchart LR
A[Test suite requests directory] --> B[Reuse or create prefix root]
B --> C[Global counter names directory]
C --> D[Return directory path]
D --> E[Test writes fixtures]
E --> F[Cleanup removes root contents]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceTests -8. Total -8 across 1 file. View PR surface stats
Review metricsNone. Technical reviewBest possible solution: Keep the global naming counter as the sole naming state and remove the unused per-prefix bookkeeping without changing fixture contracts. Do we have a high-confidence way to reproduce the issue? Not applicable: this is dead-state cleanup, and source inspection confirms the removed counter does not determine any observable result. Is this the best way to solve the issue? Yes: deleting the unused private bookkeeping is the narrowest solution and preserves the existing helper API and filesystem behavior. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against ae94766f288b. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Merged via squash.
|
Related: #139428
What Problem This Solves
The tracked temporary-directory test helper maintains a per-prefix counter that never affects directory names or cleanup. That unused state obscures the counter that actually owns naming.
Why This Change Was Made
Remove only the unused
nextIndexfields, initialization, increment, and reset loop. KeepglobalDirIndex, cached roots, pending creation, filesystem operations, and error handling unchanged.User Impact
No user-visible or production change. Eight net test-support lines are removed; all test cases and callers remain.
Evidence
archive-helpers.test.tsandfs-safe-remove.test.ts: 27 passes across both suites, plus the existing Windows-only skip on Linux.This is scoped Linux proof, not Windows execution, a full consumer-suite run, or a performance claim.