fix: prevent .muse/ internals from leaking into working-tree snapshots
Data-integrity bug: muse code add .muse/agent.md (or any explicit path inside .muse/) bypassed the _ALWAYS_PRUNE_DIRS exclusion that the walker honours. The explicit-path and directory-arg branches in _collect_paths had no guard, so VCS-internal files could be staged and committed.
Consequence: on checkout to a branch whose snapshot omits those files, muse would delete .muse/agent.md and .muse/config.toml from disk — corrupting live VCS state.
Fix: add _is_inside_muse_dir(root, path) helper and call it at the top of the explicit-path loop in _collect_paths. Paths inside .muse/ are silently skipped with a debug log, identical treatment to out-of-repo paths.
Tests I7/I8/I9 in TestSecurityI cover: I7 — dot-add never stages .muse/ files (was already safe via walker) I8 — explicit .muse/agent.md is silently rejected I9 — .muse/ as a directory arg stages nothing from inside it
0 comments
muse hub commit comment sha256:886b6675cbe9c199e84d3f5fcedd981ee1d2aa393effc6752944878bff04b90d --body "your comment"
No comments yet. Be the first to start the discussion.