|

docs: rename spec — match shipped behavior (end-running, probe-abort, slug warn)

Author: Chris Tusa <chris.tusa@leafscale.com>
Date: Jul 15, 2026 16:16
Changeset: ef2a5413116fde6b60d42e2dc60d282536822c02
Branch: default

Diff

diff -r ddc5aec03c4c -r ef2a5413116f docs/superpowers/specs/2026-07-15-repoman-rename-design.md
--- a/docs/superpowers/specs/2026-07-15-repoman-rename-design.md	Wed Jul 15 16:14:46 2026 -0500
+++ b/docs/superpowers/specs/2026-07-15-repoman-rename-design.md	Wed Jul 15 16:16:13 2026 -0500
@@ -127,6 +127,9 @@
    - registry: is there an entry for `<old>`? for `<new>`? (and the matched
      project's `repo` value)
    - container: does `<old>` exist? does `<new>` exist? current run-state?
+     (A `container_state` *probe failure* — incus unreachable — aborts here
+     with `Err` before any mutation; only a confirmed-empty `"MISSING"` is
+     treated as genuine absence.)
    - host dir: does `<repos_root>/<old>` exist? does `<repos_root>/<new>` exist?
    - (if flag) does the `<old>` slug dir exist? the `<new>` slug dir?
 2. **Guard rails** (refuse rather than guess):
@@ -141,7 +144,7 @@
    decoupled case the named repo dir that will be left untouched and why. Use
    `console.confirm_default_no`.
 4. Open the per-invocation log (after confirmation), verb `"rename"`.
-5. **Stop** the container if running; remember the prior run-state.
+5. **Stop** the container if running (required before `incus rename`).
 6. **Host dir** (directory tier only): if `<repos_root>/<old>` exists and
    `<repos_root>/<new>` does not → rename it. If `<new>` already exists and
    `<old>` is gone → skip (already done). If **both** exist → `Err` (never
@@ -157,8 +160,14 @@
 9. **Registry**: `config.rename_project(reg, old, new)` then atomic `config.save`.
    If the registry already holds `<new>` and not `<old>` → skip.
 10. **Claude slug** (only with `--migrate-claude-history`, directory tier): same
-    exists/skip/no-clobber rules as the host dir.
-11. **Start** the container iff it was running at step 5.
+    exists/skip rules as the host dir, but best-effort — a failed move or a
+    both-exist collision is a **warning**, not a hard error (history migration
+    is opt-in and never blocks the rename).
+11. **Ensure the container ends running**: re-read its current state and
+    `incus start` it if it exists and is not already running. (This supersedes
+    the original "restart iff it was running before" — a deterministic
+    end-running state is resume-safe: an interrupted-then-resumed run always
+    brings the container back up, and repoman containers are meant to be up.)
 
 ### Failure handling
 
@@ -166,8 +175,9 @@
   `cmd_new`/`cmd_remove`.
 - On failure mid-sequence, report which layers completed and which remain, and
   instruct the user to **re-run the identical command** — idempotency resumes it.
-- Never overwrite an existing target directory (steps 6 and 10 hard-error on a
-  both-exist collision).
+- Never overwrite an existing target directory: step 6 (host dir) hard-errors on
+  a both-exist collision; step 10 (opt-in Claude slug) warns and leaves both in
+  place rather than blocking.
 - The most fragile external step is `incus rename` (requires the container
   stopped); step 5 guarantees that precondition.