Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion plugins/disk-hygiene/.claude-plugin/plugin.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"$schema": "https://json.schemastore.org/claude-code-plugin-manifest.json",
"name": "disk-hygiene",
"version": "0.4.4",
"version": "0.4.5",
"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",
Expand Down
14 changes: 14 additions & 0 deletions plugins/disk-hygiene/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,20 @@
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.4.5]

### Changed

- **Test isolation only — no runtime behavior change.** The `run_guard`, `run_guard_disabled`, and
`run_guard_powershell_disabled` helpers in `test_hygiene.py` mocked `os.environ` to exercise the
kill switch but left `sys.argv` unpatched. Since the guard reads `--disk-hygiene-enabled` from
`sys.argv[1:]` before the environment fallback, a test runner whose real invocation argv happened
to carry that flag could override the env-var mock and flip an expected `deny` to `ask`. Each
helper now patches `guard.sys.argv` to a clean, flag-free argv alongside its existing environment
mock — matching the pattern the `run_guard_enabled_argv` helper already established — so the
environment variable stays the sole channel under test. Standard `unittest`/`pytest` invocations
never produced such argv, so this seals latent fragility rather than a live failure.

## [0.4.4]

### Fixed
Expand Down
3 changes: 3 additions & 0 deletions plugins/disk-hygiene/skills/clean/scripts/test_hygiene.py
Original file line number Diff line number Diff line change
Expand Up @@ -1064,6 +1064,7 @@ def run_guard(self, command: str) -> dict[str, object]:
with (
mock.patch("sys.stdin", stdin),
redirect_stdout(stdout),
mock.patch.object(guard.sys, "argv", [str(SCRIPT_DIR / "destructive_guard.py")]),
mock.patch.dict(
"os.environ", {"CLAUDE_PLUGIN_OPTION_DISK_HYGIENE_ENABLED": "true"}, clear=False
),
Expand All @@ -1077,6 +1078,7 @@ def run_guard_disabled(self, command: str) -> dict[str, object]:
with (
mock.patch("sys.stdin", stdin),
redirect_stdout(stdout),
mock.patch.object(guard.sys, "argv", [str(SCRIPT_DIR / "destructive_guard.py")]),
mock.patch.dict(
"os.environ", {"CLAUDE_PLUGIN_OPTION_DISK_HYGIENE_ENABLED": "false"}, clear=False
),
Expand Down Expand Up @@ -1319,6 +1321,7 @@ def run_guard_powershell_disabled(
with (
mock.patch("sys.stdin", stdin),
redirect_stdout(stdout),
mock.patch.object(guard.sys, "argv", [str(SCRIPT_DIR / "destructive_guard.py")]),
Comment thread
kyle-sexton marked this conversation as resolved.
mock.patch.dict(
"os.environ",
{"CLAUDE_PLUGIN_OPTION_DISK_HYGIENE_ENABLED": "false"},
Expand Down
Loading