Skip to content

chore: close the temp-dir fixture guard's remaining gaps (change 0462) - #343

Merged
danielhanold merged 7 commits into
mainfrom
chore/close-the-temp-dir-fixture-guard-s-remaining-gaps-internal-c
Sep 27, 2026
Merged

danielhanold merged 7 commits into
mainfrom
chore/close-the-temp-dir-fixture-guard-s-remaining-gaps-internal-c

Conversation

@danielhanold

@danielhanold danielhanold commented Sep 27, 2026 •

Copy link
Copy Markdown
Owner

↩ Change 0462 — Close the temp-dir fixture guard's remaining gaps (internal/cli gateTempDir, scan-root removal)

↩ Change 0462 — Close the temp-dir fixture guard's remaining gaps (internal/cli gateTempDir, scan-root removal)

Summary

  • Delete internal/cli/gate_test.go's private gateTempDir (built on os.MkdirTemp). All 22 call sites now use testsupport.TempDir(t).
  • TestRealProcessPackagesUseFixtureTempDir now also bans executable <ident>.MkdirTemp( calls in real-process test packages. A call is allowed only with a // tempdir-exempt: <reason> marker that has a non-empty reason. The marker can be on the same line, or alone on the line directly above. It is read from raw bytes, and the call is matched on the masked view.
  • Marked 8 justified sites:
    • TestMain binary builds.
    • sync.Once process-lifetime dirs.
    • Surviving release failure evidence.
    • The macOS /tmp alias test.
  • The spec's 9th site, the internal/app/gate_drive_test.go runroot, is converted to the fixture instead. It is a per-test dir.
  • Replace the hand-listed scanRoots with the shared repoguard.MaintainedFiles whole-repo walk. The realProcFloors population floors stay.

Verification

  • The full suite is green at the head, 54/54. See the evidence block below.
  • Guard mutation probes all failed the guard as intended, then were reverted:
    • Restored helper.
    • Stripped marker.
    • Blank reason.
    • Unmarked helper in another package.
    • Marker two lines above.
    • cmd excluded from the walk, and internal excluded.
  • A comment or string spelling stays green.

Review (docket-review-standard)

Finding Severity State
A trailing same-line marker also exempted a MkdirTemp on the next line minor fixed in 96c2e96 (a RED table case came first)

Post-review follow-up (8f7cbc1)

  • At the human's request, repoguard.MaintainedFiles now prunes every hidden directory at any depth except .github/, the one tracked hidden directory. When a guard runs from the primary checkout, it no longer walks .docket/ or the local harness installs (.claude/, .codex/, .cursor/, ...). The rule also covers the former .git/.worktrees exclusions. TestMaintainedFilesIncludesAndExcludes pins both directions and was mutation-tested. The full suite passed (54/54) at 8f7cbc1. The build-evidence block below still certifies the earlier head, so finalize re-gates this one.

command: go run ./cmd/docket development test
result: green
head_sha: 8f7cbc1
ran_at: 2026-09-27T20:53:51Z

Docket-Plan-Path: docs/superpowers/plans/2026-09-27-close-the-temp-dir-fixture-guard-s-remaining-gaps-internal-c.md
…e next line's MkdirTemp (change 0462, review finding: line-above exemption ignores trailing markers)

The line-above exemption in mkdirTempViolations now counts only a standalone
marker (first non-whitespace token on its line); a marker trailing code still
exempts its own line. Adds a TestMkdirTempViolations case for a trailing marker
followed by an unmarked call.
….github (change 0462, post-review follow-up)

A guard run from the main checkout walked .docket/ and the local harness
installs (.claude, .codex, .cursor, ...). Prune any dot-directory at any
depth; .github is the one tracked hidden directory and stays in.
@danielhanold
danielhanold merged commit 680cd87 into main Sep 27, 2026
1 check passed
@danielhanold
danielhanold deleted the chore/close-the-temp-dir-fixture-guard-s-remaining-gaps-internal-c branch September 27, 2026 20:54
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.

1 participant