runbook: carry offline moves with run under tmux on DOCS-T1 (Task 8)
Section 5 makes carlos move offline run the default (5.1): stage by hand, baseline, then run --resume --no-finish under tmux; what it decides alone; status then --resume after a dead terminal; when to fall back to move.sh (5.2). The SSM gate before open is dropped (plan s3).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 file changed,
+60
−1
docs/superpowers/plans/2026-10-21-offline-move-runbook.md+60 −1
Intent
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 c462692ef..d452f766c 100644 |
| --- a/docs/superpowers/plans/2026-10-21-offline-move-runbook.md |
| +++ b/docs/superpowers/plans/2026-10-21-offline-move-runbook.md |
| @@ -10,7 +10,7 @@ Sources: harness `RUNLOG.md` Runs 9 and 10 with corrections M2 to M15; the dev r |
| 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 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). |
| +3. Take the baseline, then run `carlos move offline run --resume <move-id> --no-finish` under tmux on DOCS-T1. It stages once more, then runs `start`, `seal`, `flip` and `open` and waits for the first 2xx. Before `open`, a failure or a step over its budget moves the instance back. Expect about 2.5 to 3 minutes offline for an instance with a 1.6 to 3.7 GB replica. `move.sh` is the fallback (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). |
| 5. Verify on the target with the row fingerprint (section 7), then run `finish` (section 8). |
| 6. About an hour after `open`, the target stops the instance briefly to nest it. Check it (section 9). |
| @@ -254,6 +254,65 @@ While a move is staged: |
| **Go (Paul): this instance is offline from `start` until it first answers on the target.** |
| +There are two ways through the doors. `carlos move offline run` (5.1) is the default from the release that carries it, on both the console and the `carlos` you run on DOCS-T1. `move.sh` (5.2) is the fallback. |
| + |
| +### 5.1 With `carlos move offline run` (the default) |
| + |
| +`run` is a loop over the same doors: it reads `status`, does at most one thing, and reads again every 2 seconds. It holds no state of its own. The console's record is the only truth, so a lost terminal costs nothing that `status` cannot tell you. |
| + |
| +**Run it under tmux on DOCS-T1** (Paul's decision 4 on #1005, 2026-11-15). Until the console can carry a move itself (the plan's slice 2), a machine that dies mid-move leaves the instance wherever it was, offline included, until someone reads `status`. tmux on DOCS-T1 keeps `run` alive when your own machine, terminal or SSH session goes away. |
| + |
| +```bash |
| +tmux new -s "move-$H" # later: tmux attach -t "move-$H" |
| +source "$W/env.sh" |
| +``` |
| + |
| +**Stage by hand first, then hand the move to `run`.** Stage until it has caught up (section 4), then take the baseline on the source just before, as `move.sh` does: |
| + |
| +```bash |
| +src "set -- $H; $(cat "$W/facts.box.sh")" | tee -a "$LOG" |
| +src "set -- $H $ROWS_ARGS; $(cat "$W/rows.box.sh")" | tee -a "$LOG" |
| +ID=$(MV status | awk '$1 == "move" { sub(",", "", $2); print $2 }'); echo "move $ID" |
| +note "run: resume $ID, stop at open for section 7" |
| +MV run "--resume $ID --no-finish --probe-path $PROBE_PATH --log $LOG"; echo "run exit $?" | tee -a "$LOG" |
| +``` |
| + |
| +`--resume` is how `run` takes over a move it did not stage: without it, `run` refuses a host that already has a move. It runs one more stage round first, because it did not watch the last one finish, and that round is the final stage right before `start` (section 4). Then it runs `start`, `seal`, `flip` and `open`, and requests `https://$H$PROBE_PATH` through DNS until the first 2xx. `--no-finish` stops it there with exit 0, so section 7 runs before `finish` (section 8), as it does with `move.sh`. Plain `run --to $TO` with no hand staging also works, but its baseline is then minutes older than `start`. |
| + |
| +`--log` appends each line to the move log as it is written, and each step's line is written before its door is posted, so rule 2 of section 1 holds without `ABOUT TO RUN` lines. The two times to read for section 6 are the `start` line and the `check ... answered 200` line. |
| + |
| +**The SSM gate is gone.** `run` does not compare target facts with the baseline before `open`. The landing now checks the env, files, config, timers and staged database against the seal, and `open` refuses until all of it passes (plan section 3). The baseline is still taken, for section 7's checks after `open`. |
| + |
| +**What it decides on its own.** |
| + |
| +- Before `open`, a failed box, a step over its budget or the first Ctrl-C posts `abort`, follows the move back, posts `finish` and exits 3. Check the source as in section 11. |
| +- The budgets are drafts until the dev rehearsal sets them: stop 3 min, seal 10 min, landing 5 min, from landed to open 2 min, and 15 min offline in all (`--max-offline`). They run on this process's clock from when it first saw the state, so a resumed `run` starts them again. Read the `offline` row of `status` for the time already spent. |
| +- A step the console reports ready is posted even when it is over budget, so a slow console never aborts a healthy move. |
| +- After `open` it never aborts. If no 2xx arrives within 2 minutes, it stops with exit 4 and says to run `finish`. The first wake can take most of a minute at 1.6 to 3.7 GB (end of 5.2), so a large instance can hit this: keep probing through the target as `move.sh` does, then section 7, then `finish`. |
| +- A second Ctrl-C stops watching and leaves the move running. After `open`, Ctrl-C only stops watching. |
| +- If someone runs `abort` from another terminal, `run` follows the move back and exits 3. |
| + |
| +Lines that read like trouble and are not: `no answer, checking where the move stands` (a door's reply was lost; `run` reads `status` and never posts the same door blind), and `no change for 30 s, woke the boxes` (it asked the console to wake the boxes; the `nudge` door bumps the serial and leaves the record alone). |
| + |
| +**Exit codes**, as for every `carlos move` verb: `0` open (with `--no-finish`) or finished, `3` moved back, `4` stopped for you to decide, `5` the console refused the first stage and nothing was written, `1` the console could not be reached or the log could not be opened. |
| + |
| +**After a dead terminal or a lost session:** |
| + |
| +1. `tmux attach -t "move-$H"`. If `run` is still going, leave it alone. |
| +2. If it is gone, run `MV status` before anything else (section 1, rule 3). |
| +3. Then one of: |
| + - `MV run "--resume <move-id> --no-finish --probe-path $PROBE_PATH --log $LOG"` to carry on from wherever the record is; |
| + - before `open`, `MV abort` then `MV finish` to go back (section 11); |
| + - the hand verbs one at a time (5.2's list says what each does). |
| + |
| +**Fall back to 5.2 when:** |
| + |
| +- the console or the `carlos` on DOCS-T1 predates `run` (it needs the doors that check the move id and the `nudge` door, from the same release); |
| +- you want the target facts compared with the baseline before `open`, for example on a new pair of regions or the first move of a new release; |
| +- `run` stopped with exit 4 and `status` shows a state you would rather step through one door at a time. |
| + |
| +### 5.2 By hand with `move.sh` |
| + |
| ```bash |
| L "move" "bash $W/move.sh 1200" |
| ``` |