You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 2e0be76
Browse filesBrowse the repository at this point in the historyBrowse files
feat(disk-hygiene): handoff-apply, a Linux route for an acknowledged checkout (#5541)
Closes#5178
## Summary
On Linux an operator-acknowledged throwaway checkout had no deletion
route inside the engine: `handoff-verify` ran only on Windows and macOS,
and `apply` keeps VCS protection categorical. This adds `handoff-apply`,
a Linux-only engine route for one exact approved path. The
acknowledgement (`accept_unpublished` in `vcs-evidence.json`) is
evaluated only in the handoff verification path; preview and token
`apply` stay categorical, as the owner decided on the issue.
## Fix
- `hygiene.py`: new `handoff-apply` subcommand (`--execute --snapshot
--path --vcs-evidence --report --data-root`). It refuses off Linux, runs
`handoff_verify` in-process for the one path, deletes only on a `clear`
verdict, repeats the non-VCS checks per entry, and waives only
`vcs-tracked-content`. The verdict reports `accept_unpublished`.
- The snapshot records `.git` without its descendants, so
`handoff-apply` is the one lane that removes entries outside the
snapshot: it empties the repository metadata fd-relative, refusing on a
mount point, a consumer protection glob match (re-checked per child as
the purge reaches it), an unreadable directory or a device change, and
unlinking links rather than following them.
- `destructive_guard.py`: the exact `handoff-apply` shape asks when the
plugin is enabled (`exact-engine-handoff-apply`); the kill switch denies
it (`kill-switch-disabled-handoff-apply`).
- SKILL.md, `safety-model.md`, `unsupported-platform-handoff.md`, the
fan-out worker brief and the README name the Linux route and keep the
loss warning (unpushed commits and untracked or ignored files are lost).
- disk-hygiene 0.35.0 with a CHANGELOG entry.
## Verification
- `bash plugins/disk-hygiene/skills/clean/scripts/hygiene.test.sh` (from
`skills/clean/scripts`): 624 tests OK on the merged tree, covering the
Linux route, an unacknowledged repository staying contested, the
per-child protection recheck and the guard shapes.
- `check-changelog-parity.sh` with `--check`, `--check-order`,
`--check-bump origin/main` and `--check-preserved origin/main`, and
`validate-plugins.sh`: pass.
- Ruff check through the pinned wrapper and markdownlint: clean.
## Related
- #4227, #4936
- Owner decision (2026-09-29) on #5178: add a Linux `handoff-verify` to
engine `apply` route that re-checks gates 3+, acknowledgement only in
handoff-verify, preview and apply categorical.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
---------
Co-authored-by: Claude Sonnet 5.5 <[email protected]>
"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 without the complete checkout evidence bundle, changed entries, and live-handle uncertainty fail closed.",
Copy file name to clipboardExpand all lines: plugins/disk-hygiene/CHANGELOG.md
+30Lines changed: 30 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,6 +3,36 @@
3
3
All notable changes to the `disk-hygiene` plugin are documented here. Format follows
4
4
[Keep a Changelog](https://keepachangelog.com/en/1.1.0/); this plugin uses semantic versioning.
5
5
6
+
## [0.35.0] - 2026-09-30
7
+
8
+
### Added
9
+
10
+
-**`handoff-apply`, a Linux route for a standalone Git checkout**
11
+
([#5178](https://github.com/melodic-software/claude-code-plugins/issues/5178)). For one exact
12
+
approved path, `handoff-apply --execute` re-runs `handoff-verify` in the same process and deletes
13
+
on any `clear` verdict: one that passes every evidence gate, or one where `accept_unpublished` with
14
+
the operator's reason in `vcs-evidence.json` waives the first two, so a contested throwaway
15
+
checkout no longer has to be removed outside the engine. Preview and token apply keep VCS
16
+
protection categorical; the acknowledgement is evaluated only in the handoff verification path.
17
+
The Bash guard asks for the exact `handoff-apply` shape. Windows and macOS keep `handoff-verify`
18
+
and the manual handoff lane.
19
+
-**`handoff-apply` is the one lane that removes entries outside the snapshot.** The snapshot
20
+
records a repository's `.git` directory without its descendants, so the engine empties that
21
+
uninventoried metadata fd-relative before removing it. The purge refuses on a mount point at or
22
+
under the metadata directory, on any consumer protection glob match over a live `os.walk`, and on
23
+
a directory it cannot read (fail closed); it requires every directory to stay on the metadata
24
+
directory's device and unlinks links rather than following them. Each child is matched against
25
+
the consumer protection globs again as the purge reaches it. The hard-protection name check
26
+
is not applied to those contents.
27
+
28
+
### Changed
29
+
30
+
-**clean docs:**`safety-model.md` carries the `handoff-apply` command block and `SKILL.md` names the Linux
31
+
route in the throwaway-checkout bullet, still telling the operator plainly that unpushed commits
32
+
and untracked or ignored files will be lost. `safety-model.md`, `unsupported-platform-handoff.md`
33
+
and the README no longer imply the acknowledgement has no Linux route, that the guard asks only
34
+
for `apply`, or that the engine removes only snapshot entries.
0 commit comments