Skip to content

fix(disk-hygiene): PowerShell guard covers .Delete() instance calls and robocopy purge flags#1128

Merged
kyle-sexton merged 2 commits into
mainfrom
fix/1111-dh-powershell-mutation-spellings
Jul 23, 2026
Merged

fix(disk-hygiene): PowerShell guard covers .Delete() instance calls and robocopy purge flags#1128
kyle-sexton merged 2 commits into
mainfrom
fix/1111-dh-powershell-mutation-spellings

Conversation

@kyle-sexton

Copy link
Copy Markdown
Contributor

Summary

Closes #1111 (handoff-inbox item 20260723-021058-disk-hygiene-0-6-4-consumer-audit, finding F4 remainder — Clear-RecycleBin and module-qualified cmdlets already landed via #1118's review rounds).

  • Instance-method .Delete() now raises the guard's final ask prompt (the .NET pattern required :: before delete, so $item.Delete() executed unflagged — live-observed in the producer audit); denied in audit-only mode.
  • robocopy with /MIR, /PURGE, /MOV, /MOVE (mass deletion via mirroring) gated the same way; plain robocopy /E copies stay untouched.
  • Truncation family (Set-Content, Out-File, New-Item -Force) declined with recorded reason (CHANGELOG): ordinary file-writing spellings — ask-tier friction on every write outweighs the raised bar; design stays raised-bar-not-fail-closed per the guard's documented philosophy.

disk-hygiene 0.7.0 → 0.7.1.

Test plan

  • Ask-grid + audit-only-deny-grid entries for .Delete() (two spellings), /MIR, /E /PURGE, /MOV
  • Negative cases: robocopy /E and Select-Object IsDeleted defer
  • Suite 128 OK

Related

🤖 Generated with Claude Code

…nd robocopy purge flags (#1111)

F4 remainder from the 0.6.4 consumer audit. The .NET-delete pattern required
:: before delete, so $item.Delete() executed with no guard flag
(live-observed); it now also matches .Delete(. robocopy with
/MIR|/PURGE|/MOV|/MOVE raises the final ask prompt and denies in audit-only
mode; plain /E copies defer. Truncation family declined with recorded reason
(ordinary file-writing work — ask-tier friction outweighs the raised bar the
engine's containment already backs). Grid coverage both directions.
disk-hygiene 0.7.0 -> 0.7.1.

Co-Authored-By: Claude Fable 5 (200k context) <noreply@anthropic.com>
@claude

claude Bot commented Jul 23, 2026

Copy link
Copy Markdown

Claude encountered an error after 1s —— View job


I'll analyze this and get back to you.

@claude

claude Bot commented Jul 23, 2026

Copy link
Copy Markdown

Claude encountered an error after 1s —— View job


I'll analyze this and get back to you.

@github-actions

github-actions Bot commented Jul 23, 2026

Copy link
Copy Markdown

Warning

Automated review did not complete — this is an infrastructure failure, not a review verdict.

Treat any Claude comment on this PR (including a placeholder like "I'll analyze this and get back to you") as incomplete, not "no findings."

Re-running the job, or pushing a new commit, will retry the review.

@github-actions

github-actions Bot commented Jul 23, 2026

Copy link
Copy Markdown

Warning

Automated security review did not complete — this is an infrastructure failure, not a review verdict.

Treat any Claude comment on this PR (including a placeholder like "I'll analyze this and get back to you") as incomplete, not "no findings."

Re-running the job, or pushing a new commit, will retry the review.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c62fa09b3a

ℹ️ 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".

Comment thread plugins/disk-hygiene/skills/clean/scripts/destructive_guard.py Outdated
…copy.exe

Review finding on PR #1128: the word-list lookbehind rejected a
backslash-preceded name, so C:\Windows\System32\robocopy.exe C:\src C:\dst
/MIR returned no guard decision. robocopy is an executable normally invoked
by full path, so its pattern now permits path separators before the name and
an optional .exe suffix. Positive grid: path-qualified /MIR and
call-operator /PURGE; negative: path-qualified /E copy defers. Suite 128 OK.

Co-Authored-By: Claude Fable 5 (200k context) <noreply@anthropic.com>
@claude

claude Bot commented Jul 23, 2026

Copy link
Copy Markdown

Claude encountered an error after 0s —— View job


I'll analyze this and get back to you.

@claude

claude Bot commented Jul 23, 2026

Copy link
Copy Markdown

Claude encountered an error after 0s —— View job


I'll analyze this and get back to you.

@kyle-sexton
kyle-sexton merged commit b038c4b into main Jul 23, 2026
25 checks passed
@kyle-sexton
kyle-sexton deleted the fix/1111-dh-powershell-mutation-spellings branch July 23, 2026 10:29
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.

fix(disk-hygiene): PowerShell mutation regex misses Clear-RecycleBin, .Delete(), robocopy purge (F4)

1 participant