gabriel / muse public
feat patch task/prune #1 / 1
gabriel · 62 days ago · Apr 14, 2026 · Diff

feat: implement muse prune — surgical removal of unreachable objects

- _collect_all_reachable_ids: delegates to gc._collect_reachable_objects (conservative walk: all snapshot manifests on disk + stash.json entries) - _find_prune_candidates: scandir-based walk of .muse/objects/; excludes reachable IDs; filters by mtime when --expire SECONDS is given - run: refuses mid-merge; computes reachable set; finds candidates; --dry-run reports without deleting; live run uses os.unlink with missing_ok semantics for concurrent-prune safety - JSON schema: pruned, bytes_freed, dry_run; candidates list in dry-run - Safety: only deletes under .muse/objects/; never touches working tree, commits, snapshots, or stash; merge-in-progress guard - 18 tests: unit (reachable collection, candidate finding, expire filter for recent and old objects), integration (dry-run idempotent, JSON schema, pruned count, keeps reachable, empty repo, no orphans), security (commits and snapshots untouched), stress (200 objects with 50% orphaned)

sha256:21acafd51794b3181aa9489e0b5c015ba9c9294309f09b65ed5054ed2b339504 sha
sha256:9816791cd09c73ae886aa1a2bfe5f90f153b51b34e3bb03b3e714034804aed7d snapshot
← Older Oldest on task/prune
All commits
Newer → Latest on task/prune

0 comments

No comments yet. Be the first to start the discussion.

To add a comment, use the Muse CLI: muse hub commit comment sha256:21acafd51794b3181aa9489e0b5c015ba9c9294309f09b65ed5054ed2b339504 --body "your comment"