feat(machine-health): add drive-root-litter check surfacing stray volume-root entries - #3498
feat(machine-health): add drive-root-litter check surfacing stray volume-root entries#3498kyle-sexton wants to merge 2 commits into
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6bffa36e7d
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
6bffa36 to
e4757f8
Compare
|
Claude finished @kyle-sexton's task in 2m 24s —— View job CI code review — complete
I read all 9 changed files in full: Correctness: traced the residue-diffing logic ( Tests: One finding — no changed line to anchor it to, so it's here instead of inline:
No other high-signal correctness or maintainability issues found. I did not run the PowerShell/Pester suites myself (no PowerShell available in this environment) — the PR body's test results are author-claimed and unverified by me; my review is based on static reading of the diff and surrounding code. |
|
Claude finished @kyle-sexton's task in 53s —— View job Security review (
|
|
Last security-reviewed head: |
|
Claude has reviewed this PR 3 times. The lane skips further automatic reviews after 5; deleting this comment resets the count. |
|
Claude finished @kyle-sexton's task in 52s —— View job CI code review — complete
Skip gate: trivial change, no new review surface. This lane already reviewed the substantive diff (commit The only commit added since that review is plugins/machine-health/README.md#L9 — confirmed now reads "19 checks", matches No findings on this pass. |
…ume-root entries A disk audit found an empty C:\tmp path-translation artifact and a 0-byte C:\log.txt at the volume root; no existing check would ever have reported either. The new catalog entry #19 lists each fixed-volume root non-recursively and diffs it against an expected-entry baseline that is data (references/windows/drive-root-baseline.jsonc), not script logic: the system drive gets the full baseline diff, non-system volumes report only known litter-name shapes, and admitting a legitimate entry is a data edit. Severity caps at WARN (>=10 residue entries), INFO below, no CRIT, and the check is excluded from the trend engine's generic upward upgrade; output is deterministic so an unchanged dropping feeds identical_streak demotion instead of reading as news. Read-only, unelevated, Windows-only; removal routes to disk-hygiene:clean. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Egdf11hXdBch1HTFmjB8FV
The drive-root-litter addition brings the shipped catalog to 19 enabled Windows checks; README.md still advertised 18. Plugin-wide grep found no other stale count (CHANGELOG and check-catalog '18' hits are section references, sdk-eol-table's is Node 18). Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Egdf11hXdBch1HTFmjB8FV
c136d66 to
033af5e
Compare
|
Claude finished @kyle-sexton's task in 1m 24s —— View job CI code review — complete
Skip gate: this head already has a successful review from this lane that still applies. I compared
No new review surface. No findings. |
|
Claude finished @kyle-sexton's task in 1m 11s —— View job Security review (
|
Summary
Adds machine-health catalog check #19,
drive-root-litter, so stray files and directories at fixed-volume roots surface on a routine health run instead of only during a manual disk audit. The audit that prompted this found an emptyC:\tmppath-translation artifact and a 0-byteC:\log.txtowned by BUILTIN\Administrators — neither visible to any existing check.Closes #3499
Fix
scripts/windows/checks/Test-DriveRootLitter.ps1: lists each fixed-volume root non-recursively and diffs it against an expected-entry baseline. Read-only; unelevated; Windows-only.references/windows/drive-root-baseline.jsoncholds the expected sets (any-volume housekeeping / system-drive-only / known litter-name shapes) as type-aware, case-insensitive-likepatterns. Admitting a newly legitimate entry is a data edit, never a script change.tmp,temp,tmp.*,log.txt,*.tmp) are reported there. Removable/network drives never scanned.Invoke-TrendAnalysis.ps1maps it toresidue_countfor history only).identical_streakdemotion instead of reading as news weekly.checks.jsonc, rubric §19 inreferences/windows/check-catalog.md, plugin bumped to 0.12.0 with changelog entry. Owner and directory-emptiness probes are best-effort (try/catch→null) so a denied ACL read degrades instead of erroring.Verification
C:\acceptance run (unelevated): the manual audit's ground truth was exactly three unexpected entries, and the check reported exactly those three —C:\symbols(directory, SymSrv store),C:\tmp(directory, path-translation artifact),C:\log.txt(0-byte file, owner BUILTIN\Administrators read without elevation) — plus one entry that postdates the audit:C:\worktrees, an empty user-owned directory created 2026-08-30 14:24:32 and registered to no worktree in either repo'sgit worktree list— a second instance of the same leak CLASS from a different producer, not a recurrence of the same artifact. TheC:\tmpleak itself fired once, at 2026-08-30 14:15:56, from themktemp -dpath inplugins/source-control/skills/worktree/context/create.md(addressed separately in PR fix(source-control): convert the mktemp path to Windows mixed form before it feeds the Write tool #3497); it was never deleted or re-created. Zero false positives: 16 of 20C:\root entries matched baseline, all stock names (Windows, Program Files, ProgramData, Users, PerfLogs, Recovery, $Recycle.Bin, System Volume Information, pagefile.sys, swapfile.sys, DumpStack.log.tmp, Documents and Settings, OneDriveTemp, Config.Msi, …) suppressed.D:\tmpreported on the data volume via the litter-name posture.Test-DriveRootLitter.Tests.ps1: 16/16 — clean baseline-only root, stray file, stray directory, type-aware matching, severity ladder (never CRIT), non-system posture, UNKNOWN degradations, mutation-free assertion, deterministic ordering.Invoke-TrendAnalysissuite extended for the new mapping: 12/12.Test-EnvironmentHealth%VAR% expansion) is machine-environment-dependent and fails identically on an untouched main checkout.scripts/affected-tests.sh: every changed file maps (--explainexit 0);--runexit 3 as documented (all selected suites are Pester, covered above).Related
Closes #3499. The repo-tooling
scripts/check-drive-root-litter.shis intentionally untouched — it is CI tooling being widened separately, not a machine-health check.🤖 Generated with Claude Code
https://claude.ai/code/session_01Egdf11hXdBch1HTFmjB8FV