Repository navigation
Description
Refs #4224. Slice 1 of 2: build option A, the batched fail-closed Windows verify-and-recycle (owner decision 2026-09-29; requirements from the PR #5128 review, listed in the 2026-09-29 comment). Option C (inline repeatable --path, the self-describing ask reason, the allow-rule gotcha) already shipped in #5528.
Problem
On Windows the manual handoff lane still costs about one permission prompt and two to three tool calls per deleted path: handoff-verify, then a model-composed PowerShell Recycle Bin call that the guard answers with a hook ask. The engine's handoff-apply already verifies and deletes in one process, but it takes one --path and runs on Linux only (plugins/disk-hygiene/lib/engine_grammar.py, the handoff-apply subcommand; execution_blockers() in the clean skill's engine script blocks other platforms).
Fix
Extend handoff-apply (plugin disk-hygiene):
- Accept a repeatable
--pathand a required--tier. Refuse the whole call, deleting nothing, when any path's tier in the snapshot is not--tier(the tier must not be a label only). - For each path, inside the approved process and immediately before its removal, re-run the
handoff-verifychecks (existence, type, protections). A path whose verdict is notclearis skipped and reported. A declined or interrupted call deletes nothing. - On Windows, recycle through
IFileOperation(or the shell API with undo enabled). Fail closed when the path's volume has no Recycle Bin, or when the API would delete permanently: refuse, never fall back to a permanent delete. The report'spermanent_delete_usedreflects what happened, not a hardcodedFalse. - Keep the guard's classification:
handoff-applyis already a hookask(destructive_guard.py,_HANDOFF_APPLY_ASK_REASON). Do not change_decideor any ask/allow outcome. Do extend the ask reason so the prompt lists the tier, the count, and every path. - Update
skills/clean/SKILL.mdandskills/clean/reference/unsupported-platform-handoff.mdso the Windows lane runs onehandoff-applyper tier, and drop the separate AskUserQuestion approval for a tier whose hookaskalready lists the paths.
Put the Windows recycle call behind a small backend function so the Linux suite can test every refusal with a stub.
Done when
- A test proves a batch whose volume has no Recycle Bin refuses and deletes nothing:
python3 -m pytest plugins/disk-hygiene/skills/clean/scripts/test_hygiene.py -k recycleexits 0 - A test proves a path whose snapshot tier differs from
--tierrefuses the whole batch:python3 -m pytest plugins/disk-hygiene/skills/clean/scripts/test_hygiene.py -k tierexits 0 - A test proves a path that changed after approval is skipped and reported, not deleted
-
git diff origin/main...HEAD -- plugins/disk-hygiene/skills/clean/scripts/destructive_guard.pychanges no line inside_decide - A guard test asserts the tier, the count and each path appear in
permissionDecisionReasonfor a batchedhandoff-apply -
pr-test-windowsandci-statusare green on the PR head
Activity
github-actions commentedon Oct 24, 2026
Proposed work class: work-class: scoped
Basis: automated intake triage; the lanes App applied this class.
Size: Medium
Complexity: Medium
Uncertainty: Known
Flags: none
Blocked by: none
Understood: extend
disk-hygienehandoff-applyto take repeatable--pathand a required--tier. It re-verifies each path just before removal and recycles through a fail-closed Windows backend. The ask reason lists the tier, count and paths, and_decidestays unchanged.#9764 (comment)
This decision settles the open question about where
--tieris checked from. Nothing else is open.Automated triage, applied by the lanes App.
1 remaining item
melodic-automation-lanes commentedon Oct 26, 2026
Not admitted to the issue lane yet: blocker #9779 is not closed by a listed human or a merge.
melodic-automation-lanes commentedon Oct 29, 2026
The work-resolve-issue lane did not start this issue: it needs a person to make it clearer first.
Why, in the run's own words:
What the run says it did not do:
The newest comment from a listed maintainer, #9764 (comment), does not start with
**Decision recorded.**, so the lane did not count it as an answer. If it answers the question, post the answer again in a new comment whose first line is:Run: https://github.com/melodic-software/claude-code-plugins/actions/runs/40905518452
To retry, answer the question in a comment whose first line is
**Decision recorded.**, then removeneeds-humanand addagent-readyagain.kyle-sexton commentedon Oct 29, 2026
Decision recorded. Check each
--pathagainst theconfidence_ceilingof its hints in the snapshot, used as a cap. Refuse the whole batch, deleting nothing, when--tierranks above the lowestconfidence_ceilingamong that path's hints. Refuse the whole batch when any path has no hint, whatever the tier, so the check fails closed.Basis:
The owner's decision on disk-hygiene: batch verify-and-recycle into one gated call per tier and fold the approval into the hook ask #4224 (2026-09-29): "Build option A (the batched, fail-closed verify-and-recycle)". The requirement it accepted, from the decision packet, is "Validate paths against
--tier(it is only a label)".That decision held the build "only after the chore(disk-hygiene): affirm recorded decline of Windows engine-execution lane (F12) #1116 security review exists". Owner rule C12 (2026-10-24) replaced that gate: between agent-ready and post-merge the only stops are an intent or vision mismatch found during the build and "a security issue found at PR review". The 2026-10-24 split comment applied C12 to this issue, so security review happens at this PR's review.
A snapshot entry records no tier, only hints with a
confidence_ceiling(lane pushback). The body's "differs from--tier" therefore reads as "ranks above the path's lowest ceiling". Taking the lowest ceiling when a path has several hints is the most conservative reading. A path with no hint has nothing to validate against, so it is refused.The check adds a refusal where today there is none. The hook
askand_decidestay unchanged, as the body requires.A test proves a batch whose volume has no Recycle Bin refuses and deletes nothing:
python3 -m pytest plugins/disk-hygiene/skills/clean/scripts/test_hygiene.py -k recycleexits 0 (body, unchanged)A test proves that a batch refuses as a whole when any path's lowest hint
confidence_ceilingranks below--tier, or when any path has no hint:python3 -m pytest plugins/disk-hygiene/skills/clean/scripts/test_hygiene.py -k tierexits 0 (body, amended: the snapshot records no tier, so "snapshot tier differs from--tier" becomes the ceiling cap above, plus the no-hint refusal)A test proves a path that changed after approval is skipped and reported, not deleted (body, unchanged)
git diff origin/main...HEAD -- plugins/disk-hygiene/skills/clean/scripts/destructive_guard.pychanges no line inside_decide(body, unchanged)A guard test asserts the tier, the count and each path appear in
permissionDecisionReasonfor a batchedhandoff-apply(body, unchanged)pr-test-windowsandci-statusare green on the PR head (body, unchanged)