feat: loadout rm — artifact removal with clean uninstall - #21
Merged
Conversation
Adds the missing delete verb (spec 009): one confirmation-gated pass uninstalls an artifact from every agent home and deletes it from the store. Fills the MergeJSON removal hole with jsonRemove — the surgical inverse of jsonMerge — so removing an MCP or hook artifact now cleans the merged settings.json/.claude.json/.mcp.json entry instead of leaking it (closes the ROADMAP MCP-uninstall open question). - Drift safety: targets edited since install are skipped with a warning (--force removes, snapshot first); their install records are retained so a later --force still works. loadouts switch inherits this. - rm snapshots (trigger "rm") also capture the store manifest + content under the shared 'store' pseudo-agent (same layout as spec 008), so 'loadout restore' resurrects a regretted rm even without git. - Store.RemoveArtifact: manifest first, then content, path-safe. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
machado144
force-pushed
the
feat/008-artifact-removal
branch
from
August 10, 2026 16:15
2fea599 to
db8e789
Compare
✅ PR title follows the required formatCurrent title: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Spec 009 (spec · plan, 10/10 steps done): the store's missing delete verb.
`loadout rm ...` uninstalls from every agent home and deletes from the store in one confirmation-gated pass — files deleted, managed blocks stripped, and (new) merged JSON entries removed surgically. Flags: `--dry-run`, `--yes`, `--force`, `--keep-store`.
Why
Example
User-authored keys keep their exact bytes; `mcpServers`/`hooks` objects are pruned only when the removal empties them.
Safety
Behavior change
`loadouts switch` now skips drifted targets instead of deleting them (strictly safer; `--force` restores the old behavior). One integration test updated to the new semantics.
Testing
TDD: failing engine tests reproducing the JSON leak came first. 10 `jsonRemove` behavior tests, drift/retain/ApplyRemoval engine tests, 3 `Store.RemoveArtifact` tests, 7 integration scenarios driving the built binary (full removal, declined confirm, keep-store, force/drift, unknown ID, source-origin warning, restore round-trip). Rebased on #20 (spec renumbered 008→009, store snapshots harmonized onto `SnapshotAgent`); `make ci` + `make test-integration` green on the rebased tree.
🤖 Generated with Claude Code