carlos / platform Public

docs: offline move runbook and CLI page for the #339 refusals

The runbook says stage and start refuse a stale live link and app
directories from the release carrying the fix, keeps its manual
checks for older releases, and gives the new status wording after an
abort from staging. The CLI page names the two refusals.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
claude agent, operated by paul@keymail.dev pushed by paul@keymail.dev b7aa5590792d1c05c12fa2af586b3badc91db327 parent 3a821c7
2 files changed, +8 −4
  • docs/site/cli.md +2 −0
  • docs/superpowers/plans/2026-10-21-offline-move-runbook.md +6 −4
diff --git a/docs/site/cli.md b/docs/site/cli.md
index e72a1fce5..de24fb86d 100644
--- a/docs/site/cli.md
+++ b/docs/site/cli.md
@@ -3385,6 +3385,8 @@ The instance is offline from `start` until `open`. Until `open`, `abort` puts it
`stage` is optional and comes before `start`. It copies the instance's data to the region it moves to while the instance keeps serving, and each time it runs it copies only what is new. The more it has copied, the less is left to copy while the instance is offline. Until `start`, `abort` removes the staged copy and the instance is never offline.
+`stage` and `start` refuse a move that would fail after the instance goes offline: when the box in the target region still holds a live link for the instance from an earlier time it ran there, or when the instance keeps directories beside its files directory, which the move cannot carry. Each refusal names the box and what it found.
+
## On the host
These are what systemd starts. You will rarely type them, but knowing what
diff --git a/docs/superpowers/plans/2026-10-21-offline-move-runbook.md b/docs/superpowers/plans/2026-10-21-offline-move-runbook.md
index 8a8c7705d..596d586d1 100644
--- a/docs/superpowers/plans/2026-10-21-offline-move-runbook.md
+++ b/docs/superpowers/plans/2026-10-21-offline-move-runbook.md
@@ -8,7 +8,7 @@ Sources: harness `RUNLOG.md` Runs 9 and 10 with corrections M2 to M15; the dev r
## The short version
-1. Check the fleet once (section 2) and the instance and the target box before each move (section 3). The target check is the one that matters most: a stale `/opt/carlos/live/<host>` link on the target makes `flip` fail only after the instance is already offline.
+1. Check the fleet once (section 2) and the instance and the target box before each move (section 3). The target check is the one that matters most: a stale `/opt/carlos/live/<host>` link on the target makes `flip` fail only after the instance is already offline. From the release carrying the #339 fix, `stage` and `start` refuse such a link, and app directories beside the files directory, while the instance still serves; on an older release section 3 is the only check.
2. Run `stage` while the instance serves, and run it again until a round copies almost nothing (section 4).
3. Run `move.sh`. It stages once more, records a baseline, then runs `start`, `seal`, `flip`, a check of the target and `open` back to back, judging each step by its exit code. Before `open`, any surprise aborts the move. Expect about 2.5 to 3 minutes offline for an instance with a 1.6 to 3.7 GB replica (section 5).
4. Measure the offline time yourself, from just before `start` to the first 2xx through the target. The console's figure read 40 to 75 seconds low on the flagship (section 6).
@@ -166,12 +166,14 @@ src "set -- $H; $(cat "$W/sizes.box.sh")"
aws --profile "$PROFILE" s3 ls --recursive --summarize "s3://$SRCDATA/instances/$H/" | tail -2
```
-Pass: the files tree is under 268435456 bytes (256 MiB; over that the seal refuses safely); no sidecar file. Record the database size and the replica's object count and total size: staging time and the size of the target's copy scale with the replica, not the database. A legacy flat `/data/<host>/` directory holding old key copies needs nothing: the seal passes and the retire parks it with the instance.
+Pass: the files tree is under 268435456 bytes (256 MiB; over that the seal refuses safely); no sidecar file; nothing beside the files directory in `/data/.instances/<host>/` but the platform's own entries (an app's `data/`, `documents/` or `blobs/` there makes the seal refuse with exit 4, and the move cannot carry it). From the release carrying the #339 fix, the source box reports such directories and `stage` and `start` refuse with "<host> keeps <dirs> beside its files directory on <box>, and this move can carry only the files directory. see the offline move runbook" (exit 5), each directory marked "(empty)" when it is empty, before the instance goes offline. Record the database size and the replica's object count and total size: staging time and the size of the target's copy scale with the replica, not the database. A legacy flat `/data/<host>/` directory holding old key copies needs nothing: the seal passes and the retire parks it with the instance.
### 3.3 The target box
This check exists because of the first staged move on the flagship. An earlier attempt had left a root-owned link `/opt/carlos/live/<host>` on the UK box, naming a build from weeks before. Nothing reports it before `flip`, and `flip` fails the landing's `release` item only after `start` has taken the instance offline: `flip` exited 4 with "uk could not take shop.example.com: the target box still holds an older build of this instance", the move was aborted, and the instance was offline for about two minutes for nothing (amadan #339).
+From the release carrying the #339 fix, the target box reports every live link it keeps for a host it has no row for, and `stage` and `start` refuse such a host with "<box> still holds a live link for <host> from when it last ran there. the move would fail at flip, after <host> is offline. see the offline move runbook" (exit 5), before anything goes offline. The doors refuse any such link, even one that names the build the instance runs. A box reports again within about six minutes, so after clearing a link wait for its next report before staging. The landing's own check stays behind the doors. Run the checks below anyway: they also cover older releases.
+
```bash
tgt "set -- $H; $(cat "$W/target.box.sh")"
src "readlink /opt/carlos/live/$H"
@@ -243,7 +245,7 @@ While a move is staged:
- the instance serves as normal;
- it refuses `carlos run` and deletion;
- no other instance in the deployment can stage or move offline;
-- `abort` removes the staged copy and ends the move with the instance never offline. `abort` and the `finish` after it both exit 3, the normal "aborted" code, with "The staged copy of shop.example.com is removed." and "shop.example.com is back in ie and serving. Nothing was lost." Afterwards `status` prints "Moving shop.example.com from ie to uk. Moving shop.example.com back to ie." and a list of items "waiting". Ignore that; the abort's own lines are the record (#339).
+- `abort` removes the staged copy and ends the move with the instance never offline. `abort` and the `finish` after it both exit 3, the normal "aborted" code, with "The staged copy of shop.example.com is removed." and "shop.example.com is back in ie and serving. Nothing was lost." Afterwards `status` prints "Nothing moved. The stage of shop.example.com was abandoned, and shop.example.com kept serving in ie." and lists no items. A CLI older than the #339 fix prints "Moving shop.example.com from ie to uk. Moving shop.example.com back to ie." and a list of items "waiting" instead; ignore that, the abort's own lines are the record.
---
@@ -456,7 +458,7 @@ A retry is a new move, staged from scratch, after section 3 passes again.
## 12. Known gaps
-- **amadan #339: nothing checks the target before the instance goes offline.** A stale root-owned `/opt/carlos/live/<host>` on the target fails `flip` (exit 4, the `release` item, MV-O177) only after `start`. Section 3.3 is the workaround. The same discussion covers two smaller things: after an abort from staging, `status` reads as if the instance moved and came back; and no output says how many objects the seal copied (section 6 has the count).
+- **amadan #339: stale live links and app directories.** Before the release carrying the fix, a stale root-owned `/opt/carlos/live/<host>` on the target fails `flip` (exit 4, the `release` item, MV-O177) only after `start`, and app directories beside the files directory fail `seal` (exit 4) only after `start`; sections 3.2 and 3.3 are the workaround. With the fix, `stage` and `start` refuse both before anything goes offline, but there is still no supported way to clear a stale link (root by hand, section 3.3) and no way to carry app directories, empty ones included. No output says how many objects the seal copied (section 6 has the count).
- **amadan #338: an alias row can keep the flat socket after nesting** and answer 502. Check an instance's aliases after the nesting stop (section 9).
- **The source keeps root-owned files.** `/data/programs/<host>.json` (root, 0644, in a root-owned directory) cannot be parked by the agent, which runs as `carlos`; `status` says "left /data/programs/<host>.json in place: cannot be renamed: ... permission denied". The root-owned `/opt/carlos/live/<host>` link stays too, by design. Both are listed for the claim census, and both are the kind of leftover that section 3.3 catches if that box is ever a move target.
- **The console's offline figure ends at `open`** and leaves out the first wake (section 6).