From 78a95d3f762baa3d14f63c89865faf8fef15a020 Mon Sep 17 00:00:00 2001 From: Kyle Sexton <153232337+kyle-sexton@users.noreply.github.com> Date: Sat, 25 Jul 2026 08:00:28 -0400 Subject: [PATCH 1/4] docs(disk-hygiene): disclose the PowerShell lane's uncovered mutation spellings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The safety model and the clean skill described the PowerShell belt as gating "known deletion spellings" without stating what it does not see. Move, rename, overwriting-writer, and volume-format spellings reach the tool with no guard verdict at all — audit-only mode included — so the documented protection read broader than the enumerated regex delivers. Name the uncovered families where the security model is stated, with the per-path human approval and the consumer permission policy identified as the only backstops there. Guard behavior is unchanged; closing the gap is #387. Closes #386 Co-authored-by: Claude Opus 5 (1M context) --- plugins/disk-hygiene/.claude-plugin/plugin.json | 2 +- plugins/disk-hygiene/CHANGELOG.md | 13 +++++++++++++ plugins/disk-hygiene/skills/clean/SKILL.md | 5 +++-- .../skills/clean/reference/safety-model.md | 9 +++++++++ 4 files changed, 26 insertions(+), 3 deletions(-) diff --git a/plugins/disk-hygiene/.claude-plugin/plugin.json b/plugins/disk-hygiene/.claude-plugin/plugin.json index bc3a76d895d..144a6d53f01 100644 --- a/plugins/disk-hygiene/.claude-plugin/plugin.json +++ b/plugins/disk-hygiene/.claude-plugin/plugin.json @@ -1,7 +1,7 @@ { "$schema": "https://json.schemastore.org/claude-code-plugin-manifest.json", "name": "disk-hygiene", - "version": "0.9.0", + "version": "0.9.1", "description": "Context-aware disk hygiene for arbitrary directory trees: inventories orphaned and temporary artifacts, classifies evidence into review tiers, and offers exact-path cleanup only after a fresh safety preview and explicit per-tier approval. The target is read-only by default; OS-managed paths, links and mount points, VCS-tracked content, changed entries, and live-handle uncertainty fail closed.", "author": { "name": "Melodic Software", diff --git a/plugins/disk-hygiene/CHANGELOG.md b/plugins/disk-hygiene/CHANGELOG.md index 5073346dfc8..48d06c5fd98 100644 --- a/plugins/disk-hygiene/CHANGELOG.md +++ b/plugins/disk-hygiene/CHANGELOG.md @@ -3,6 +3,19 @@ All notable changes to the `disk-hygiene` plugin are documented here. Format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/); this plugin uses semantic versioning. +## [0.9.1] + +### Changed + +- **The PowerShell lane's documented coverage now names what it does not flag (#386).** + `reference/safety-model.md` and the clean skill's PowerShell gotcha described the lane as gating + "known deletion spellings" without stating that destructive non-deletion spellings — `Move-Item`, + `Rename-Item`, overwriting writers (`Set-Content`/`Out-File`/`>`/`New-Item -Force`), and + `Format-Volume`/`Clear-Disk` — reach the tool with no guard verdict, audit-only mode included. The + gap is now disclosed where the security model is stated, with the per-path human approval and the + consumer's permission policy named as its only backstops. Docs only; the guard's behavior is + unchanged and closing the gap is tracked in #387. + ## [0.9.0] ### Fixed diff --git a/plugins/disk-hygiene/skills/clean/SKILL.md b/plugins/disk-hygiene/skills/clean/SKILL.md index 49e8433d863..3c2a6d6e599 100644 --- a/plugins/disk-hygiene/skills/clean/SKILL.md +++ b/plugins/disk-hygiene/skills/clean/SKILL.md @@ -336,8 +336,9 @@ sparse files, hard links, compression, and delayed allocation affect it. (`CLAUDE_TOOL_NAME` does not exist). - The PowerShell lane is the inverse tradeoff: it stays open for read-only support work (git, gh, metadata probes) and instead hard-denies engine invocations and turns known deletion spellings - into a final human permission prompt. It is a raised bar, not a fail-closed lane; the engine's - own containment and the Bash lane remain the deletion authority. + into a final human permission prompt. It is a raised bar, not a fail-closed lane — move, rename, + overwrite, and volume-format spellings are not flagged at all (`reference/safety-model.md`); the + engine's own containment and the Bash lane remain the deletion authority. - The guard rejects `~` anywhere in a Bash command as a shell-expansion character, which includes Windows 8.3 short names (`SOMEUS~1`). Always pass long-form paths; the guard's own disclosures are already long-form. diff --git a/plugins/disk-hygiene/skills/clean/reference/safety-model.md b/plugins/disk-hygiene/skills/clean/reference/safety-model.md index 665dfc2f26f..8c4a2674b73 100644 --- a/plugins/disk-hygiene/skills/clean/reference/safety-model.md +++ b/plugins/disk-hygiene/skills/clean/reference/safety-model.md @@ -144,6 +144,15 @@ switch. When the guard sees execution enabled they are downgraded to a final hum when it sees a configured `false` (audit-only mode) they are denied outright, so the kill switch would block deletions on the PowerShell lane too and not only the Bash engine apply. +Because this lane enumerates spellings instead of denying unknown commands, its coverage is +knowingly partial: the flagged set is deletion- and recycle-shaped (plus `robocopy` mirror/purge/move +and .NET `Delete`), so destructive **non-deletion** spellings — `Move-Item`/`mv`, `Rename-Item`, +overwriting writers (`Set-Content`, `Out-File`, `>`, `New-Item -Force`), and volume operations +(`Format-Volume`, `Clear-Disk`) — reach the tool with no guard verdict at all, in audit-only mode +included. Data loss through those spellings is held only by the per-path human approval the manual +handoff already requires and the consumer's own permission policy, never by this guard. +TODO(#387): extend the flagged set to those spellings. + **Kill-switch enforcement (since 0.9.0): both surfaces resolve it by reading user settings.** The guard registers on two surfaces — the **plugin-level engine gate** (`hooks/hooks.json`, exec form, `--mode engine-gate`) and the **skill-scoped belt** (the clean skill's frontmatter hook) — and both From dbfa4e2f2ca6e830920297ba98ff1eec5facc561 Mon Sep 17 00:00:00 2001 From: Kyle Sexton <153232337+kyle-sexton@users.noreply.github.com> Date: Sat, 25 Jul 2026 08:08:21 -0400 Subject: [PATCH 2/4] docs(disk-hygiene): qualify the fail-closed prompt guarantee to flagged spellings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Codex review on #1305: the fail-closed paragraph promised "a human prompt before every mutation", which the newly disclosed PowerShell coverage hole contradicts — an unflagged Move-Item or Set-Content defers with no verdict whether the toggle is readable or not. Bound the guarantee to what the guard actually sees, and separate the TODO annotation from the security-model prose so it does not read as a normative claim. Co-authored-by: Claude Opus 5 (1M context) --- plugins/disk-hygiene/skills/clean/reference/safety-model.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/plugins/disk-hygiene/skills/clean/reference/safety-model.md b/plugins/disk-hygiene/skills/clean/reference/safety-model.md index 8c4a2674b73..653e23ebf5f 100644 --- a/plugins/disk-hygiene/skills/clean/reference/safety-model.md +++ b/plugins/disk-hygiene/skills/clean/reference/safety-model.md @@ -151,6 +151,7 @@ overwriting writers (`Set-Content`, `Out-File`, `>`, `New-Item -Force`), and vol (`Format-Volume`, `Clear-Disk`) — reach the tool with no guard verdict at all, in audit-only mode included. Data loss through those spellings is held only by the per-path human approval the manual handoff already requires and the consumer's own permission policy, never by this guard. + TODO(#387): extend the flagged set to those spellings. **Kill-switch enforcement (since 0.9.0): both surfaces resolve it by reading user settings.** The guard @@ -177,8 +178,9 @@ engine invocation **whether or not the clean skill is active**; it defers (no ou does not reference the engine, so it does **not** see PowerShell deletion spellings. Those are enforced by the **skill-scoped belt** (`powershell_decision`) — denied outright in audit-only — only **while the clean skill is active**. An absent, unreadable, or ambiguous read fails **closed to enabled**: the guard stays -active and forces a human prompt before every mutation, so an unreadable toggle never silently disables -the guard. +active and forces a human prompt before every mutation **it sees** — every Bash engine `apply`, and on +PowerShell only the flagged spellings above — so an unreadable toggle never silently disables the +guard. This replaces the earlier delivery, where the gate carried a bare `${user_config.disk_hygiene_enabled}` argument. Because the declared userConfig `default` is not implemented upstream From 111545d1e53bf1a94542c0fb9765b7f6495d72ac Mon Sep 17 00:00:00 2001 From: Kyle Sexton <153232337+kyle-sexton@users.noreply.github.com> Date: Sat, 25 Jul 2026 08:14:35 -0400 Subject: [PATCH 3/4] docs(disk-hygiene): bound the audit-only denial claim to the gated lanes Same over-promise Codex caught in the fail-closed paragraph, in the audit-only direction: "denies every mutation lane" reads as total coverage, but the belt only ever sees the flagged deletion spellings. Name the two lanes as the scope rather than implying all of them. Co-authored-by: Claude Opus 5 (1M context) --- plugins/disk-hygiene/skills/clean/SKILL.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/disk-hygiene/skills/clean/SKILL.md b/plugins/disk-hygiene/skills/clean/SKILL.md index 3c2a6d6e599..050e4be1f4f 100644 --- a/plugins/disk-hygiene/skills/clean/SKILL.md +++ b/plugins/disk-hygiene/skills/clean/SKILL.md @@ -51,8 +51,8 @@ unless bounded with `--max-depth` or confirmed with `--confirmed-large-scan`. value could not be read. The guard now enforces this independently: it resolves the same `disk_hygiene_enabled` toggle by reading it straight from your user `settings.json` (the read is shared with this probe, and the settings file is located from the tamper-resistant - `${CLAUDE_PLUGIN_ROOT}` — not the environment), so in audit-only mode it denies every mutation lane - outright — the Bash engine `apply` and the PowerShell deletion belt alike. Running the probe still + `${CLAUDE_PLUGIN_ROOT}` — not the environment), so in audit-only mode it denies both mutation lanes + it gates outright — the Bash engine `apply` and the PowerShell deletion belt alike. Running the probe still matters so you can state the configured value accurately and stop before proposing work the guard would deny; the guard is the backstop, not the sole enforcer. The hook runs in shell-free exec form and reports its absolute Python interpreter and the authorized `--data-root` value in denial guidance. Use that exact interpreter From d78e6ac547b5cb664b2f79e6ab5b623bf485d736 Mon Sep 17 00:00:00 2001 From: Kyle Sexton <153232337+kyle-sexton@users.noreply.github.com> Date: Sat, 25 Jul 2026 08:20:13 -0400 Subject: [PATCH 4/4] docs(disk-hygiene): stop presenting per-path approval as a backstop for these spellings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Codex review on #1305: the manual handoff approves the paths selected for removal, so it cannot cover what an unflagged mutation collaterally destroys — a Move-Item -Force destination, a truncated Out-File target, a whole volume. Listing it as a backstop overstated the residual protection in the same way the paragraph set out to stop. The consumer's permission policy is the only one left. Co-authored-by: Claude Opus 5 (1M context) --- plugins/disk-hygiene/CHANGELOG.md | 5 +++-- plugins/disk-hygiene/skills/clean/reference/safety-model.md | 6 ++++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/plugins/disk-hygiene/CHANGELOG.md b/plugins/disk-hygiene/CHANGELOG.md index 48d06c5fd98..089929d594a 100644 --- a/plugins/disk-hygiene/CHANGELOG.md +++ b/plugins/disk-hygiene/CHANGELOG.md @@ -12,8 +12,9 @@ All notable changes to the `disk-hygiene` plugin are documented here. Format fol "known deletion spellings" without stating that destructive non-deletion spellings — `Move-Item`, `Rename-Item`, overwriting writers (`Set-Content`/`Out-File`/`>`/`New-Item -Force`), and `Format-Volume`/`Clear-Disk` — reach the tool with no guard verdict, audit-only mode included. The - gap is now disclosed where the security model is stated, with the per-path human approval and the - consumer's permission policy named as its only backstops. Docs only; the guard's behavior is + gap is now disclosed where the security model is stated, naming the consumer's permission policy as + its only backstop — the manual handoff's per-path approval covers the paths selected for removal, so + it does not reach what these spellings collaterally destroy. Docs only; the guard's behavior is unchanged and closing the gap is tracked in #387. ## [0.9.0] diff --git a/plugins/disk-hygiene/skills/clean/reference/safety-model.md b/plugins/disk-hygiene/skills/clean/reference/safety-model.md index 653e23ebf5f..e2c57d7cdd2 100644 --- a/plugins/disk-hygiene/skills/clean/reference/safety-model.md +++ b/plugins/disk-hygiene/skills/clean/reference/safety-model.md @@ -149,8 +149,10 @@ knowingly partial: the flagged set is deletion- and recycle-shaped (plus `roboco and .NET `Delete`), so destructive **non-deletion** spellings — `Move-Item`/`mv`, `Rename-Item`, overwriting writers (`Set-Content`, `Out-File`, `>`, `New-Item -Force`), and volume operations (`Format-Volume`, `Clear-Disk`) — reach the tool with no guard verdict at all, in audit-only mode -included. Data loss through those spellings is held only by the per-path human approval the manual -handoff already requires and the consumer's own permission policy, never by this guard. +included. The only thing standing between them and the filesystem is the consumer's own permission +policy, never this guard: the manual handoff's per-path approval covers the paths selected for +removal, so it does not reach what such a command collaterally destroys — a `Move-Item -Force` +destination, a truncated `Out-File` target, or an entire volume. TODO(#387): extend the flagged set to those spellings.