Skip to content

feat(cli): X7 — uninstall machine-global teardown (spec 13) — X7 complete - #61

Merged
gustavobertoi merged 1 commit into
mainfrom
nightly/X7-uninstall
Jun 29, 2026
Merged

feat(cli): X7 — uninstall machine-global teardown (spec 13) — X7 complete#61
gustavobertoi merged 1 commit into
mainfrom
nightly/X7-uninstall

Conversation

@gustavobertoi

Copy link
Copy Markdown
Contributor

What

devstack uninstall — removes every machine-global devstack artifact, in spec-13 order, holding the flock. With workspace destroy (PR #56) this completes X7.

Sequence (runUninstall)

  1. compose down -v every managed stack (containers + named volumes, incl. shared DB data) — enumerated from the SDK by tool label, grouped by Compose project.
  2. docker network rm devstack_shared (compose refuses external networks; a not-found is the desired end state, not a warning).
  3. Remove the root CA from every trust store via trust.Uninstall (mkcert -uninstall: host + Firefox/NSS + Windows) — the load-bearing security step; warns loudly if it can't be cleared.
  4. Remove the marker-fenced /etc/hosts block.
  5. Remove alias symlinks (+ registry entries).
  6. Remove the ledger / template cache / config (XDG data/cache/config — devstack-namespaced).

Design

  • Best-effort: each step records a warning and the rest proceed (a half-broken install must still be removable); non-zero exit reports the warning count.
  • Gated by confirmation (type uninstall; --yes skips; --json requires --yes).
  • Network/volume removal shells the docker CLI via the existing Runner — the SDK Client stays read-only.

Tests

runUninstall unit-tested with mock client + fake runner + fake trust runner + temp XDG/hosts paths: every stack down -v, network removed, CA cleared, /etc/hosts block gone, dirs removed; plus a not-found network counts as removed (no warning); --json requires --yes. make ci green.

Spec acceptance (spec 13)

  • uninstall leaves no external network, shared volume, CA (host+Firefox+Windows), alias symlink, template cache, or ledger behind; reports each store cleared.
  • requires explicit confirmation; --yes skips; --json emits a machine-readable result.

Minor follow-up: workspace destroy --purge-data (per-workspace volume purge) — uninstall already covers the full-machine purge. Keyring entries are per-provider (secrets logout); a user's global ~/.cloudflared cred is intentionally left untouched.

🤖 Generated with Claude Code

…MPLETE

Removes every machine-global devstack artifact, in spec order, holding the flock:
1. `compose down -v` every managed stack (containers + their named volumes,
   including the shared Postgres/Redis/MinIO data) — enumerated from the SDK by
   tool label, grouped by Compose project;
2. `docker network rm devstack_shared` (compose refuses external networks — a
   not-found is the desired end state, not a warning);
3. remove the root CA from every trust store via `trust.Uninstall` (mkcert
   -uninstall: host + Firefox/NSS + Windows) — the load-bearing security step,
   warns loudly if it can't be cleared;
4. remove the marker-fenced /etc/hosts block;
5. remove alias symlinks (+ registry entries);
6. remove the ledger / template cache / config (XDG data/cache/config dirs).

Best-effort: each step records a warning and the rest proceed (a half-broken
install must still be removable); a non-zero exit reports the warning count. Gated
by confirmation (type `uninstall`; `--yes` skips; `--json` requires `--yes`).
Network/volume removal shells the docker CLI via the existing Runner — the SDK
Client stays read-only.

The sequencer is `runUninstall(ctx, uninstallEnv{...})`, unit-tested with a mock
client + fake runner + fake trust runner + temp XDG/hosts paths: every stack down
-v, network removed, CA cleared, hosts block gone, dirs removed; and a not-found
network counts as removed (no warning).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@gustavobertoi
gustavobertoi merged commit df262e7 into main Jun 29, 2026
2 checks passed
@gustavobertoi
gustavobertoi deleted the nightly/X7-uninstall branch June 29, 2026 18:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant