Add commitlore uninstall command (T-1108) - #278
Conversation
The installer writes a binary and agent MCP config entries to the machine. Until now nothing reversed that. This adds `uninstall` as the lifecycle inverse: it removes the binary (only if it self-identifies as commitlore) and the commitlore entry from each agent config, preserving every other key byte-for-byte. A single source table in `src/core/agent-configs.ts` holds the config paths and formats. A bidirectional agreement test against `install.sh` catches silent divergence between the two sources. The command is idempotent, supports --dry-run and --json, refuses to delete a foreign binary, never leaks other entries' contents, and points at `hooks uninstall` / `inject uninstall-claude-hook` for per-repository state. Record-Id: r-t1108uninst Certainty: firm Blast: system Undo: easy Warn: Claude Code uses a plugin CLI and cannot be uninstalled programmatically — the command reports it and defers to `claude plugin uninstall commitlore` Ruled-out: Full TOML parser for codex config | would reformat the file and violate byte-for-byte preservation of other keys Ruled-out: Programmatic claude plugin uninstall via spawning the CLI | undocumented non-interactive behaviour and risk of credential prompts Ruled-out: Single regex-based removal for all formats | unsafe for JSON where a naive delete can produce invalid syntax Verified: Bidirectional install.sh agreement (unit), entry removal preserving other keys (unit), idempotent second run (unit), foreign binary refusal (unit), privacy no-leak (unit), live install-then-uninstall cycle in scratch HOME (manual) Unverified: Behaviour on configs written by future install.sh versions that add new agents
CommitLore — record lintTrailers: clean — 1 commit in Active constraints for the paths this PR touchesLimits (63)
Ruled out (118)
Warnings (46)
Trailer violations fail this check. Active constraints are informational — they are what the repository already decided, not a verdict on this PR. |
|
On hold — contract rewrite required. Do not merge as-is. An owner scope change removes compiled executables and platform binaries from the product, so Rewritten contract: remove exactly what the shell installer wrote — the pinned source checkout in the user's data directory, the thin The per-agent config table and the bidirectional test in this branch remain the right shape and are expected to survive the rewrite. Held as a draft until the revised installer contract is approved. |
|
Superseded by #328, merged at Not rebased, because the drift was not the blocking problem. This branch removes the entry whose key is That is the failure T-1123 names in its own text: an entry a user happened to name Two things the work surfaced that this branch could not have, since it was reading the ticket rather than the installers:
Thanks for the groundwork on the config formats — the three-format split in |
Closes #272.
Summary
Adds
commitlore uninstall— the lifecycle inverse ofinstall.sh. It removes:~/.local/bin/commitlore(only if it self-identifies via--version)commitloreMCP entry from each agent config the installer wrote toIt never touches per-repository state (hooks, index, notes) — those belong to
commitlore hooks uninstallandcommitlore inject uninstall-claude-hook.What was added
src/core/agent-configs.ts: single source table of agent config paths and formatssrc/commands/uninstall.ts: the command implementationsrc/cli.ts: one register linetest/uninstall.test.ts: entry removal, idempotency, foreign binary refusal, dry-run, privacytest/agent-configs.test.ts: bidirectional agreement withinstall.shdist/: rebuiltProperties
--dry-run: prints plan, changes nothing--json: structured output (never leaks other entries' contents)install.shTested
tsc --noEmit)