Skip to content

refactor(test): centralize declaration guard temp cleanup - #110311

Merged
steipete merged 1 commit into
mainfrom
codex/refactor-script-declaration-temp-dirs
Jul 18, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/refactor-script-declaration-temp-dirs

Conversation

@steipete

Copy link
Copy Markdown
Contributor

What Problem This Solves

Removes 21 repeated raw temporary-directory allocations and the file-local cleanup loop from the script declaration guard tests. The changed-file gate flagged every allocation for migration to the shared test helper.

Why This Change Was Made

Uses useAutoCleanupTempDirTracker(afterEach), the repository-standard test helper, for every fixture root. This deletes duplicate cleanup state and keeps teardown behavior centralized.

AI-assisted. The change passed the repository autoreview workflow with no actionable findings.

User Impact

No product behavior change. Test cleanup is simpler and the temp-directory migration guard is warning-free.

Evidence

@openclaw-barnacle openclaw-barnacle Bot added size: S maintainer Maintainer-authored PR labels Jul 18, 2026
@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. 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. P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. labels Jul 18, 2026
@clawsweeper

clawsweeper Bot commented Jul 18, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed July 17, 2026, 10:12 PM ET / July 18, 2026, 02:12 UTC.

Summary
The PR replaces file-local temporary-directory tracking and cleanup in test/scripts/check-script-declarations.test.ts with the shared useAutoCleanupTempDirTracker(afterEach) helper.

PR surface: Tests -27. Total -27 across 1 file.

Reproducibility: not applicable. This PR is a test-maintenance refactor, not a report of broken user-facing behavior. The supplied focused test command exercises the affected declaration-guard suite.

Review metrics: none identified.

Merge readiness
Overall: 🐚 platinum hermit
Proof: 🐚 platinum hermit
Patch quality: 🐚 platinum hermit
Result: ready for maintainer review.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Rank-up moves:

  • none.

Next step before merge

  • [P2] No repair is indicated; the protected maintainer label leaves the normal human review and merge decision outstanding.

Security
Cleared: The patch is limited to a test cleanup refactor and introduces no dependency, workflow, permissions, secret, or runtime execution change.

Review details

Best possible solution:

Merge the narrow refactor after the protected-label maintainer review confirms the shared helper contract remains the intended cleanup standard.

Do we have a high-confidence way to reproduce the issue?

Not applicable: this PR is a test-maintenance refactor, not a report of broken user-facing behavior. The supplied focused test command exercises the affected declaration-guard suite.

Is this the best way to solve the issue?

Yes: centralizing allocation and teardown through the existing shared test helper is the narrow maintainable solution, provided normal maintainer review confirms the helper contract.

AGENTS.md: unclear because the file could not be read completely.

Codex review notes: model internal, reasoning high; reviewed against d8f2645c2ced.

Label changes

Label justifications:

  • P3: This changes only test cleanup structure and reports no product or runtime behavior change.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (terminal): For this test-only refactor, the PR body supplies after-change terminal evidence for the focused suite and a successful changed-file gate on Blacksmith Testbox.
  • proof: sufficient: Contributor real behavior proof is sufficient. For this test-only refactor, the PR body supplies after-change terminal evidence for the focused suite and a successful changed-file gate on Blacksmith Testbox.
Evidence reviewed

PR surface:

Tests -27. Total -27 across 1 file.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 1 24 51 -27
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 1 24 51 -27

What I checked:

Likely related people:

  • steipete: Authored the current one-commit refactor of the declaration-guard test cleanup; no broader current-main ownership trail was available in the read-only review environment. (role: current test-cleanup contributor; confidence: low; commits: 519d0dc117d9; files: test/scripts/check-script-declarations.test.ts)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

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.

How this review workflow works
  • 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.
Review history (1 earlier review cycle)
  • reviewed 2026-07-18T02:03:53.131Z sha 35541bad0b0fd458e959aa36241e92fecad1e16d :: needs maintainer review before merge. :: none

@steipete
steipete force-pushed the codex/refactor-script-declaration-temp-dirs branch from 35541ba to 519d0dc Compare July 18, 2026 02:09
@steipete
steipete merged commit 1746cea into main Jul 18, 2026
87 checks passed
@steipete
steipete deleted the codex/refactor-script-declaration-temp-dirs branch July 18, 2026 02:15
@steipete

Copy link
Copy Markdown
Contributor 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. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: S 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