IUH-M01: mosaic uninstall — top-level teardown + shell wrapper #425
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Mission: install-ux-hardening-20260405
Milestone: IUH-M01
Branch: feat/mosaic-uninstall
Agent tier: sonnet
Problem
Post-cli-unification audit: only
mosaic gateway uninstallexists. A user who installs the Mosaic Stack viatools/install.shhas no clean reversal path for framework data, npm CLI, nested stack dependencies, runtime asset injections in ~/.claude/, npmrc scope mapping, or PATH edits.Scope
Implement top-level
mosaic uninstallwith flags:--framework— remove ~/.config/mosaic/ (honor--keep-datafor SOUL.md, USER.md, TOOLS.md, memory/, sources/)--cli— npm uninstall -g @mosaicstack/mosaic (takes nested stack deps with it)--gateway— delegate to existingmosaic gateway uninstall--all— all three + preserved user files + runtime asset reversal--keep-data— never touch memory/, SOUL.md, gateway DB/storage--yes— skip confirmation--dry-run— list what would be removed, change nothingMust also:
bash <(curl ... tools/install.sh) --uninstallpath for users without a working CLIDesign prerequisite
Install manifest:
~/.config/mosaic/.install-manifest.jsonwritten by tools/install.sh on first successful install. Records every file/dir/shell-profile mutation. Uninstall uses this as the authoritative reversal spec. Missing manifest → fall back to heuristic mode with explicit warning.Success Criteria
mosaic uninstall --dry-runlists every mutation without touching diskmosaic uninstall --all --yeson a freshly-installed machine leaves no Mosaic tracemosaic uninstall --framework --keep-datapreserves SOUL/USER/TOOLS/memoryFiles to touch
packages/mosaic/src/commands/uninstall.ts(new)packages/mosaic/src/commands/uninstall.spec.ts(new)packages/mosaic/src/cli.ts(register command)tools/install.sh(write manifest on success, add--uninstallpath)