Skip to content

refactor(test): remove unused temp-directory counter - #144628

Merged
vincentkoc merged 1 commit into
mainfrom
refactor/test-audit-tracked-temp-dirs-20260911
Sep 11, 2026
Merged

vincentkoc merged 1 commit into
mainfrom
refactor/test-audit-tracked-temp-dirs-20260911

Conversation

@vincentkoc

@vincentkoc vincentkoc commented Sep 11, 2026 •

Copy link
Copy Markdown
Member

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 nextIndex fields, initialization, increment, and reset loop. Keep globalDirIndex, 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

  • Normal infra run of archive-helpers.test.ts and fs-safe-remove.test.ts: 27 passes across both suites, plus the existing Windows-only skip on Linux.
  • Exact-base changed checks: 15 passed before core-test typechecking failed because the local install lacks a declared UI dependency link. The 12 remaining checks passed in a reviewed continuation; the original failure is retained and no dependencies were changed locally.
  • Hosted CI run 34559010308, attempt1 passed. Its three typecheck jobs covered all 17 canonical core-test graphs after successful frozen-lockfile validation of restored dependency caches. The actual synthetic merge checkout was source-bound to this change; this is not a full-local-gate or whole-repository equality claim.
  • Required CI gate and Workflow Sanity passed; skipped jobs are not proof.
  • Targeted formatting and whitespace checks passed. Scoped independent and completed hosted reviews found no actionable findings.

This is scoped Linux proof, not Windows execution, a full consumer-suite run, or a performance claim.

@vincentkoc vincentkoc self-assigned this Sep 11, 2026
@clawsweeper

clawsweeper Bot commented Sep 11, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added size: XS maintainer Maintainer-authored PR labels Sep 11, 2026
@vincentkoc
vincentkoc marked this pull request as ready for review September 11, 2026 03:35
@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Sep 11, 2026
@clawsweeper

clawsweeper Bot commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 10, 2026, 11:41 PM ET / September 11, 2026, 03:41 UTC.

ClawSweeper review

What this changes

Removes 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
Reviewed head: 192f3cbe434fee917e8bf3eaaf7001b8e37b91cc

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, behavior-preserving cleanup with retained consumer coverage and no actionable defects.
Proof confidence 🌊 off-meta tidepool Not applicable: The MEMBER-authored PR changes only test-support bookkeeping and does not trigger an authority proof requirement; reported consumer-suite runs are supplemental validation.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The MEMBER-authored PR changes only test-support bookkeeping and does not trigger an authority proof requirement; reported consumer-suite runs are supplemental validation.
Evidence reviewed 6 items Introduced change preserves observable operations: The pinned introduction diff removes only private counter declarations, writes, and a reset loop. Directory naming still uses globalDirIndex; root caching, pending creation, filesystem calls, and error handling remain unchanged.
Cleanup remains necessary on main: The fetched main helper still initializes, increments, and resets nextIndex without using its value to name directories or determine cleanup.
Latest release retains the counter: The same unused counter remains in v2026.9.3; this cleanup is not already present in the supplied latest release.
Findings None None.
Security None None.

How this fits together

Test 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]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Tests -8. Total -8 across 1 file.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 1 3 11 -8
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 1 3 11 -8

Review metrics

None.

Technical review

Best 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.

Labels

Label changes:

  • add P3: This removes dead test-support state without changing production behavior or test coverage.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The MEMBER-authored PR changes only test-support bookkeeping and does not trigger an authority proof requirement; reported consumer-suite runs are supplemental validation.

Label justifications:

  • P3: This removes dead test-support state without changing production behavior or test coverage.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The MEMBER-authored PR changes only test-support bookkeeping and does not trigger an authority proof requirement; reported consumer-suite runs are supplemental validation.

Evidence

What I checked:

  • Introduced change preserves observable operations: The pinned introduction diff removes only private counter declarations, writes, and a reset loop. Directory naming still uses globalDirIndex; root caching, pending creation, filesystem calls, and error handling remain unchanged. (src/test-utils/tracked-temp-dirs.ts:9, 192f3cbe434f)
  • Cleanup remains necessary on main: The fetched main helper still initializes, increments, and resets nextIndex without using its value to name directories or determine cleanup. (src/test-utils/tracked-temp-dirs.ts:9, ae94766f288b)
  • Latest release retains the counter: The same unused counter remains in v2026.9.3; this cleanup is not already present in the supplied latest release. (src/test-utils/tracked-temp-dirs.ts:9, 1391f7cd2d40)
  • Retained consumer coverage: Both complete consumer suites allocate directories through make and invoke cleanup after tests; their scenario bodies and assertions are unchanged. The captured PR body reports 27 Linux passes and an existing Windows-only skip, while explicitly disclosing incomplete local type coverage. Tests were not executed during this read-only review. (src/infra/archive-helpers.test.ts:14, 192f3cbe434f)
  • Maintainer-requested campaign: The provided discussion links Test audit: reduce redundant test code and full-suite runtime #139428, an open campaign requesting coherent reductions in redundant test and support code while preserving behavioral coverage. This batch removes no scenarios and makes no full-suite performance claim.
  • Feature-history routing: Available file history identifies Peter Steinberger across root-reuse and subsequent helper maintenance, and Nachiket Torwekar on async-I/O work. Older patch and blame inspection encountered unavailable historical objects, so no source-line introduction attribution is asserted. (src/test-utils/tracked-temp-dirs.ts, ae94766f288b)

Likely related people:

  • Peter Steinberger: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Nachiket Torwekar: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

@vincentkoc
vincentkoc merged commit 66f17b0 into main Sep 11, 2026
222 checks passed
@vincentkoc
vincentkoc deleted the refactor/test-audit-tracked-temp-dirs-20260911 branch September 11, 2026 03:55
@vincentkoc

Copy link
Copy Markdown
Member Author

Merged via squash.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintainer Maintainer-authored PR P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: XS status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant