Runbook: v0.28.5 dev and flagship roll (re-arm, E1 console recovery) and the first offline moves, from harness Run 9
Docs only. One operator runbook with a Paul's-go line before every write: status and gates, the dev roll (signing session, leo and sophie by the ruled re-arm, dennis by system update, E1 for the guarded console, the dev check with R9-1), the dev offline-move rehearsal with M1 to M10 applied, the flagship roll, and the first flagship moves with budget, notice, cleanup and rollback paths.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
1 file changed,
+1,412
−0
docs/superpowers/plans/2026-10-20-v0.28.5-roll-and-first-moves.md+1,412 −0
CI passed — run details
diff --git a/docs/superpowers/plans/2026-10-20-v0.28.5-roll-and-first-moves.md b/docs/superpowers/plans/2026-10-20-v0.28.5-roll-and-first-moves.md| new file mode 100644 |
| index 000000000..5cd3cd9ca |
| --- /dev/null |
| +++ b/docs/superpowers/plans/2026-10-20-v0.28.5-roll-and-first-moves.md |
| @@ -0,0 +1,1412 @@ |
| +# Rolling v0.28.5 to dev and flagship, and the first offline moves: operator runbook |
| + |
| +Written 2026-10-20 for Paul, attended. Docs only: this file runs nothing and authorizes nothing. Every step that writes to a real box, bucket or account sits behind a line that starts **Paul's go**. Steps without one are read-only. |
| + |
| +Sources: the harness rehearsal (`platform-harness-build`, `harness/RUNLOG.md`, "Run 9: v0.28.5 roll" to the end, with "Run 9 corrections" R9-1 to R9-4 and M1 to M10); the dev claim runbook (`claim-dev-cohort1-runbook` @ 5860108f in `platform-cohort1`, called "the claim runbook" below); the README "Releasing the platform" and "Checking dev"; the offline move plan's "Morning runbook outline" (`2026-10-20-offline-operator-move.md`, unedited; M1 to M10 are applied here, not there); the roll recipe and roll order notes; the read-only flagship reports of 2026-10-20 (`own/after236/`); the release artefacts in `~/.cache/release-v0.28.5/`. |
| + |
| +Conventions: |
| +- Harness names map to dev's: kathleen-juggling is leo-climbing (leo), ada-letterpress is sophie-knitting (sophie, the console box), noor-marquetry is dennis-stenciling (dennis). Harness "v0.28.6" is the real v0.28.5; harness "v0.28.5" played dev's v0.28.4. |
| +- `STOP` means: do nothing else, keep the evidence, tell Paul. Nothing is retried in place unless the step says so. |
| +- A block marked "DOCS-T1" runs on the operator's shell. A block marked "on sophie" (and so on) runs as root on that box, either through `ssm.sh` (Appendix A) or in an attended root shell, as each step says. |
| +- Scratch lives in `$TMPDIR/v0285` and is removed by exact path at the end (section 5). Nothing here starts a server or a background process. |
| +- Never print a secret. Key checks print a presence flag and the first 16 hex digits of a SHA-256, never the value. |
| + |
| +--- |
| + |
| +## 0. Status and gates |
| + |
| +### 0.1 The release |
| + |
| +| Fact | Value | |
| +|---|---| |
| +| Tag | `v0.28.5` (tag object `7619729d29513e9d2220aa95ec93f0767ea1d61e`) | |
| +| Commit | main `54ae7fb93820f37f123bbdcbcb57f4f2efb25dc9` (short `54ae7fb9`); `~/.cache/release-v0.28.5/src` is a clean detached checkout of it | |
| +| State | published and latest (GitHub release, signature verified publicly, Homebrew tap, apt `v0.28.5-1`). Rolled nowhere | |
| +| Signed sums | `SHA256SUMS.txt` sha256 `42f267f076699253da94d5279fa9d06a2fb4ee6e51540c360bd5a63845b30b25` (the public download is byte-equal to `~/.cache/release-v0.28.5/dist/`, checked 2026-10-20); `.sig` sha256 `7983502bb45cc58ace79bbb33c3896fa6cfa02157f9159a1dc56dae57fd85899` | |
| +| Router (linux-arm64) | `carlos-linux-arm64` `858342a3202aa5a5bbac2b8404b0a6c47a8414fe4af514d78809c2e6412a968b` | |
| +| Operator CLI (linux-amd64) | `carlos-linux-amd64` `505dfc4ffc5eb5fd6ff437d37468a3238a43e4bf2b3d4bfc4a838326a92dec0b` (equals `~/.local/bin/carlos`, which prints `carlos v0.28.5`) | |
| +| Prebuilt console | `~/.cache/release-v0.28.5/console-linux-arm64`, sha256 `3ad7ab50b0adb736c5cace95e82fd9687869185499a5ad3cd87b2028a4ac3c9c`, 47317154 bytes, `version.Build=v0.28.5`. Use this exact file; never rebuild it and never run it | |
| +| Console ship version `CV` | `54ae7fb9` | |
| +| Release notes | `~/.cache/release-v0.28.5/NOTES.md` (approved). Flagship is on v0.28.0, so the operator notes of v0.28.1 to v0.28.4 apply too (section 3.1) | |
| + |
| +### 0.2 The harness rehearsal (Run 9, 2026-10-20) |
| + |
| +Harness host `i-06a1ec144aa5226fb`; the build is 54ae7fb9 plus the harness patch (`b2f1ad8f...`), stamped v0.28.6. Snapshots `pre-0285`, `e-refused-0285`, `post-0285`, `pre-move-r9`. Evidence: `harness/evidence/run9/`. |
| + |
| +| Part | Result | Run ID and time (UTC) | |
| +|---|---|---| |
| +| (a) signing session, C2 first | PASS | session `cohort1-20261020T161315Z`, 16:13:09 to 16:13:46 | |
| +| (b) leo by the ruled re-arm | PASS | 16:19:47 to 16:23:32 (apply 19 s, edge restarted 16:20:21) | |
| +| (c) dennis by normal `system update` | PASS | 16:23:40 to 16:23:58 | |
| +| (d) sophie's router by the re-arm on canary | PASS | 16:30:36 to 16:33:24 | |
| +| (e) sophie's guarded console by `install-console` | FAIL (defect 5) at 16:33:34; passes by E1 | E1 at 16:35:14 | |
| +| (f) the dev check | PASS on the console box; leo's pinned check differs from the README (R9-1) | 16:35:36 | |
| +| Normal road to the next release | PASS, no hand step | 16:38:08 to 16:48:26 | |
| +| Offline move of a flagship-shaped app, sophie to dennis | PASS: 366 s offline, about 23 s of steps | 17:20:31 to 17:31:01 | |
| +| Abort after flip | PASS: back serving in 23 s, nothing lost | 17:32:49 to 17:33:13 | |
| +| Post-open nesting | PASS at the 1-hour grace, a 24 s second stop | 18:26:40 | |
| + |
| +Roster revision in Run 9: 9 to 10 to 11 for leo's roll, 11 to 12 to 13 for sophie's, 13 to 15 for the normal road (C4 holds). |
| + |
| +### 0.3 Known blockers and pending fixes |
| + |
| +| Item | What it is | What this runbook does about it | |
| +|---|---|---| |
| +| Defect 5 (blocks 1.e) | `system claims install-console` refuses to replace an installed protected console (`activation_artifacts_linux.go:359-360`, `consoleSlotHolds`), dry run included | E1, the attended recovery ruled by platform-1c, for v0.28.5 only. `install-console --upgrade` (platform-1c, in progress) retires it | |
| +| Defect 6 (section 2, 4) | Config sync never retries a `config.env` write that failed because the nested instance directory did not exist yet (`agent.go:1349-1356`). A new nested instance can run without its settings for up to about 70 minutes | M5: check `config.env` before the first wake, and force a new bundle generation on the rehearsal apps only | |
| +| Defect 7 (sections 2, 4) | `flip` and `open` refuse for most of each moves-pass cycle: the doors trust a box report for 2 minutes, boxes rewrite theirs only on a door-triggered pass or every 5 to 6 minutes (`apiinstancemove_offline.go:57`, `agent.go:3262`). `flip` then says "still runs a process", which is the wrong sentence for a stale report | M2: run `flip` and `open` straight after the previous door, or retry every 15 s. Budget: about 6 minutes offline today, under 1 minute once fixed | |
| +| Defect 8 (sections 2, 4) | After `open`, the source box's scheduler re-creates the parked instance's `<host>.env` in `/data/.instances/<host>/` (`schedule_wiring.go:154-180`) | M6: check after `finish`; move the file into the park directory, never delete it | |
| +| Fixes | 6, 7 and 8 are being fixed for a later release. Paul has been asked about them | The moves below are run on v0.28.5 as it is | |
| + |
| +### 0.4 What the harness could not show |
| + |
| +- Real IAM. MinIO users are read-write, so the staging-lane checks (P0.4) prove reachability, not the IAM statements. |
| +- The real store backend (AWS IAM users under a boundary). Run 9 bound the store as app settings (H18); the dev rehearsal here uses `carlos store create`. |
| +- Real SSM, real DNS and EIPs, the real signing host, and real scale (the flagship ie box has 118 instance slices). |
| +- Instances as large as the customer's. Run 9 moved 4 MB. The customer's nested directories are 20M, 538M and 308M (section 4.0). |
| + |
| +### 0.5 The go register |
| + |
| +| Go | Step | What it writes | |
| +|---|---|---| |
| +| G1 | 1.a.3 open the signing session | an IAM role, profile, security group and instance in the dev account; reads the release key | |
| +| G2 | 1.a.2 console ship and promote (C2) | dev bucket `apps/bab/console/`, `canary/console` pointer; sophie stages the build | |
| +| G3 | 1.a.4 `publish-identity` | one create-only object, `control/system/router/releases/v0.28.5.json` (cannot be replaced) | |
| +| G4 | 1.b leo re-arm | promotes `router/stable`; leo applied by hand; dennis rolls from the same promote | |
| +| G5 | 1.d sophie re-arm | promotes `router/canary`; sophie applied by hand | |
| +| G6 | 1.e E1 | stops the dev console for about a minute and replaces its protected binary | |
| +| G7 | 2.2 rehearsal apps | two apps, a store and records in the dev account | |
| +| G8 | 2.3 the rehearsal move | `start` to `finish` on `moverehearsal` | |
| +| G9 | 2.6 the abort rehearsal | `start` to `abort` on `rollbackrehearsal` | |
| +| G10 | 2.8 remove E1's aside directory | one exact directory on sophie | |
| +| G11 | 3.2 flagship boxes | `carlos system update` on the stable channel | |
| +| G12 | 3.4 `bootstrap/carlos` copy | only if status asks for it | |
| +| G13 | 3.5 flagship console | `roll-console.sh <checkout> flagship` | |
| +| G14 | 4.1 moves unfrozen (D8) | a decision, no write | |
| +| G15 | 4.2 the return lane | UK's staging grant on the IE data bucket (infra) | |
| +| G16 | 4.5 canada | one move | |
| +| G17 | 4.5 ips | one move | |
| +| G18 | 4.5 kpmg | one move | |
| + |
| +### 0.6 The order, and why |
| + |
| +Dev boxes, then the dev console, then check dev, then the dev rehearsal, then flagship boxes, then the flagship console, then the moves (the roll order ruling of 2026-10-13: dev first, boxes before their console). Within dev, the console shipped to `canary/console` (C2) comes first because `publish-identity` reads it, and `publish-identity` comes first because, once a floor is published (dev's is, since 2026-10-19), every console-driven update reserves itself in the signed roster and resolves the release's identity by tag (`reserveHostUpdate`). |
| + |
| +The third-party deployment is never rolled from here. |
| + |
| +### 0.7 Common values |
| + |
| +On DOCS-T1: |
| + |
| +```bash |
| +export TAG=v0.28.5 CV=54ae7fb9 |
| +export REL=$HOME/.cache/release-v0.28.5 |
| +export CONSOLE_ART=$REL/console-linux-arm64 |
| +export PINFRA=$HOME/amadan.net/carlos/platform-infrastructure |
| +export DEVC=https://platform.dev.carlosframework.com DEVB=carlos-dev-640012953448 |
| +export LEO=i-046c7fe43620944bc SOPHIE=i-05498eada6f0afd23 DENNIS=i-009d593f451cfd562 |
| +export FLAGC=https://console.carloku.com FLAGB=carlos-flagship-271376211898 |
| +export FIE=i-092c0c1eea75723cb FUS=i-0ed0641d8e476f1b8 FUK=i-03c310ceaf50a9bab FAU=i-022288023f5e7496d |
| +export W=$TMPDIR/v0285; mkdir -p "$W" |
| +export EVID=$REL/evidence-roll-20261020; mkdir -p "$EVID" |
| +``` |
| + |
| +| Deployment | Profile | Bucket | Console | Boxes | |
| +|---|---|---|---|---| |
| +| dev | `kass` | `carlos-dev-640012953448` | `https://platform.dev.carlosframework.com` | leo `i-046c7fe43620944bc` (eu-west-1, stable, armed); sophie `i-05498eada6f0afd23` (eu-west-1, canary, armed, console box); dennis `i-009d593f451cfd562` (eu-west-2, region `uk`, stable, unarmed) | |
| +| flagship | `keymail` | `carlos-flagship-271376211898` | `https://console.carloku.com` (the same console as `platform.carlosframework.com`) | ie `i-092c0c1eea75723cb` (eu-west-1, the console box, `annie-welding`); us `i-0ed0641d8e476f1b8` (us-east-1); uk `i-03c310ceaf50a9bab` (eu-west-2); au `i-022288023f5e7496d` (ap-southeast-2) | |
| + |
| +Helpers (`ssm.sh`, `leo`, `sophie`, `dennis`, `fie`, `fuk`, `rosterview`, `box_inspect`) are in Appendix A. Set them up now. |
| + |
| +### 0.8 Pre-flight, read-only (DOCS-T1) |
| + |
| +Verify the release from the public side, as the README does: |
| + |
| +```bash |
| +D=$(mktemp -d "$TMPDIR/v0285-pub.XXXXXX"); cd "$D" |
| +rel=https://github.com/carlosframework/releases/releases/download/$TAG |
| +curl -sSLO $rel/SHA256SUMS.txt |
| +curl -sSLO $rel/SHA256SUMS.txt.sig |
| +curl -sSLO $rel/carlos-linux-arm64 |
| +printf '\x30\x2a\x30\x05\x06\x03\x2b\x65\x70\x03\x21\x00' > pub.der |
| +echo 'R+EO3qQ47VsuKl9Qq/pkDXBucPYvzp5lU2ut4zpnJPc=' | base64 -d >> pub.der |
| +base64 -d SHA256SUMS.txt.sig > sig.bin |
| +openssl pkeyutl -verify -pubin -inkey pub.der -keyform DER -rawin -in SHA256SUMS.txt -sigfile sig.bin |
| +sha256sum -c --ignore-missing SHA256SUMS.txt |
| +sha256sum SHA256SUMS.txt SHA256SUMS.txt.sig |
| +cmp SHA256SUMS.txt "$REL/dist/SHA256SUMS.txt" && echo sums-equal |
| +grep ' carlos-linux-arm64$' SHA256SUMS.txt |
| +sha256sum "$CONSOLE_ART" |
| +grep -c 3ad7ab50 SHA256SUMS.txt |
| +go version -m "$CONSOLE_ART" | grep -o 'internal/version.Build=[^ "]*' |
| +sha256sum "$(command -v carlos)" |
| +carlos version |
| +curl -sS https://apt.carlosframework.com/latest.txt |
| +cd "$W" |
| +``` |
| + |
| +Pass: `Signature Verified Successfully`; `carlos-linux-arm64: OK`; the two sha256 lines equal 0.1's; `sums-equal`; the router line is `858342a3...968b`; the console sha256 is `3ad7ab50...3c9c` and `grep -c` prints `0` (the console is not in the sums, as for v0.28.4); `Build=v0.28.5` once; the CLI sha256 is `505dfc4ffc5eb5fd6ff437d37468a3238a43e4bf2b3d4bfc4a838326a92dec0b`; `carlos v0.28.5`; `v0.28.5`. Keep `$D` until the signing session has its copies (1.a.3), then remove it by exact path. |
| + |
| +Sign in to the two consoles (Paul at the keyboard; the roll commands need saved logins): |
| + |
| +```bash |
| +carlos system status --console "$DEVC" |
| +carlos system status --console "$FLAGC" |
| +``` |
| + |
| +Pass: a table of boxes, not a login prompt or a 401. If either asks for a login, Paul runs `carlos auth login --console <console>` himself. |
| + |
| +--- |
| + |
| +## 1. Dev roll |
| + |
| +### 1.0 Before anything (read-only) |
| + |
| +```bash |
| +carlos system status --console "$DEVC" |
| +leo '/opt/carlos/carlos version 2>&1 | tail -1; /opt/carlos/carlos.prev version 2>&1 | tail -1; systemctl is-active carlos-system-update.path; ls /opt/carlos/system/guard/identities' |
| +sophie '/opt/carlos/carlos version 2>&1 | tail -1; /opt/carlos/carlos.prev version 2>&1 | tail -1; systemctl is-active carlos-system-update.path; ls /opt/carlos/system/guard/identities' |
| +dennis '/opt/carlos/carlos version 2>&1 | tail -1; /opt/carlos/carlos.prev version 2>&1 | tail -1; systemctl is-active carlos-system-update.path; ls /opt/carlos/system/guard 2>&1 | head -2' |
| +rosterview |
| +``` |
| + |
| +Pass: |
| +- all three boxes `current` at v0.28.4; |
| +- leo and sophie: `carlos v0.28.4` twice, path unit `active`, identities `v0.28.4.json` (and older ones); |
| +- dennis: `carlos v0.28.4`, `.prev` `carlos v0.28.3`, `active`, no guard directory; |
| +- `rosterview` prints `{"rev":<N>,"activations":[]}`. Write N down as `REV0` (9 at the end of the claim runbook's step 7). A held activation (`activations` not empty) is a STOP: promote and rollback of stable are refused until it is released. |
| + |
| +Sophie's console mail check, the claim runbook's "P9. Sophie's console has console mail off", run as written (Appendix A saves its box command as `$W/p9.box.sh`): `sophie "$(cat "$W/p9.box.sh")"`. Pass: the last line is `console mail: OFF (none of the 7 names is set)`. Any `SET` line is a STOP. |
| + |
| +The dev console's state, for the rollback record: |
| + |
| +```bash |
| +curl -sI "$DEVC/healthz" | grep -i -E '^(HTTP|x-carlos-version)' |
| +sophie 'p=$(systemctl show -p MainPID --value console.service); echo "pid $p"; readlink /proc/$p/exe; sha256sum < /proc/$p/exe | cut -c1-16; tr "\0" "\n" < /proc/$p/environ | grep "^CARLOS_HOST_CLAIM="' |
| +``` |
| + |
| +Record the `x-carlos-version` (the claim runbook saw `f3bf1214` at the pause on 2026-10-19), the pid and the sha. `CARLOS_HOST_CLAIM=` must be empty. |
| + |
| +The wakecheck baseline: `curl -sS -w '\n[%{http_code}]\n' https://wakecheck.dev.carlosframework.com/` and record `hits=`. |
| + |
| +The claim runbook's "pre-roll emptiness check for the roster-binding fix" is not part of this roll: it applies to the release that carries the binding fix (v0.28.6 or later), not to v0.28.5. |
| + |
| +### 1.a Signing session: publish-identity (C2 first) |
| + |
| +#### 1.a.1 Read-only checks before the console ship (the claim runbook's 5.0a item 1) |
| + |
| +```bash |
| +dev() { AWS_PROFILE=kass AWS_REGION=eu-west-1 CARLOS_DEPLOYMENT_BUCKET=$DEVB "$@"; } |
| +aws --profile kass s3 ls "s3://$DEVB/apps/bab/console/channels/" |
| +dev carlos channels --app console --account-id bab |
| +aws --profile kass s3 ls "s3://$DEVB/apps/bab/console/releases/$CV/" |
| +dev carlos channels digests --account-id bab |
| +``` |
| + |
| +Pass: exactly one key, `canary/console.json`; `canary/console f3bf1214 ... yes` (the rollback version); the `releases/54ae7fb9/` listing is empty (exit 1); `pointer digests: on for bab since 2026-10-18T10:11:25Z` and no `written after digests were turned on` row. If `releases/54ae7fb9/` already holds objects, STOP and ask. |
| + |
| +#### 1.a.2 Ship and promote the prebuilt console (C2) |
| + |
| +> **Paul's go: G2.** Writes `apps/bab/console/releases/54ae7fb9/` and moves `canary/console` in the dev bucket. Sophie stages the build at `/opt/carlos/versions/54ae7fb9/console`. Sophie's console is guarded, so the running console stays the protected v0.28.4 build (Run 9: pid 308 before and after C2). Rollback: `carlos promote -app console f3bf1214 canary/console` with the release key, as 5.0a's "Rollback" block. |
| + |
| +```bash |
| +CARLOS_BIN=$(command -v carlos) "$PINFRA/scripts/ship-app.sh" kass "$DEVB" console "$CV" canary/console binary "$CONSOLE_ART" |
| +dev carlos channels --app console --account-id bab |
| +dev carlos channels digests --account-id bab |
| +sophie 'S=/opt/carlos/versions/54ae7fb9/console; stat -c "%n %U:%G %a links=%h size=%s" $S; sha256sum $S; systemctl is-active console.service; echo pid $(systemctl show -p MainPID --value console.service)' |
| +curl -sI "$DEVC/healthz" | grep -i -E '^(HTTP|x-carlos-version)' |
| +``` |
| + |
| +Expected: `shipped console 54ae7fb9 (1 artifacts)` then `promoted console 54ae7fb9 -> canary/console`; `canary/console 54ae7fb9 ... yes`; no `console canary/console` row in the digests listing; the staged file is `root:root 755 links=1 size=47317154` with sha256 `3ad7ab50...3c9c` (allow up to a minute for the stage); `console.service` active. The pid should be the one recorded in 1.0; if the console restarted, it is still running the old protected binary (confirm with the exe sha from 1.0) and healthz is 200. Any other sha256 on the staged file is a STOP. |
| + |
| +Do this before the session opens: the release key reads of the session are counted from its start time. |
| + |
| +#### 1.a.3 Open the signing session |
| + |
| +> **Paul's go: G1.** Creates the signer host (`signing-host.md`, "Create") and reads `/carlos/release-key` onto its tmpfs. |
| + |
| +Follow the claim runbook's "The signing session" order of work and `signing-host.md` ("Create", "Getting jq and the carlos CLI there", "Getting the key there"), with these v0.28.5 values: |
| +- The role's inline policy: `WriteIdentity` names exactly `arn:aws:s3:::carlos-dev-640012953448/control/system/router/releases/v0.28.5.json`. Run the policy check line from "Create" with `v0.28.5` in place of `v0.28.4`. The other statements are as widened on 2026-10-19 (`ReadControl` includes `status/consoles/dev-console.json`). |
| +- Tools, verified on DOCS-T1 before upload: the router `carlos-linux-arm64` `858342a3...968b` from the public download in `$D` (0.8), jq 1.7.1 `4dd2d8a0661df0b22f1bb9a1f9830f06b6f3b8f7d91211a1ef5d7c4f06a8b4a5`. Upload to `s3://carlos-dev-640012953448/claim-signer/<run-id>/` with `aws s3 cp`: the CLI, jq, `SHA256SUMS.txt` and `SHA256SUMS.txt.sig` exactly as downloaded, `release.pub` (from leo's `CARLOS_RELEASE_PUBKEY`; its sha256 prefix is `960d03ff`), and `helpers.sh`. |
| +- `<run-id>` is `v0285-` and the UTC date and time. Record the session start time (`date -u +%FT%TZ`) before the key fetch. |
| +- `helpers.sh` is the claim runbook's 5.1 first helper block (`CARLOS=/usr/local/bin/carlos`, `KEY=/run/claim-signer/release.key`, no `AWS_PROFILE`) followed by 6.1's `phase_out`, both extracted verbatim. |
| + |
| +Session checks on the signer: both `sha256sum -c` lines `OK`; `carlos v0.28.5`; `jq-1.7.1`; no swap; `/run` is tmpfs; `/usr/local/bin/carlos system claims help` matches the text quoted in the claim runbook (the v0.28.5 build prints it unchanged: `inspect`, `run [--out FILE]`, `install-console`, and the last line about `--out`); the key file is `root 600 1 45`. A mismatch on any is a STOP. |
| + |
| +Then `refresh` on the signer and expect `REV` equal to `REV0` with `activations` empty. No phase has run. |
| + |
| +#### 1.a.4 publish-identity |
| + |
| +> **Paul's go: G3.** One create-only write of `control/system/router/releases/v0.28.5.json`. A wrong identity can never be replaced; it would need a new release tag. Check every value below before the apply. |
| + |
| +On the signer, in `/root/claim-trial`: |
| + |
| +```bash |
| +CV=54ae7fb9 |
| +jq -n --rawfile sums SHA256SUMS.txt --rawfile sig SHA256SUMS.txt.sig --arg cv "$CV" \ |
| + '{identity:{release_tag:"v0.28.5",moves_protocol:1,sha256sums:$sums,sha256sums_sig:$sig, |
| + console:{account:"bab",app:"console",channel:"canary/console",version:$cv}}}' > identity-phase.json |
| +phase_out publish-identity identity-phase.json /root/claim-trial/identity.v0.28.5.json publish-identity-result.json |
| +jq '{identity_key, release}' publish-identity-result.json |
| +jq -er .output_sha256 publish-identity-result.json |
| +``` |
| + |
| +Run the dry run on its own first (the claim runbook's 6.1 does) and check it field by field. Expected: |
| +- the dry run, then the apply, succeed; `writes` lists one create-only put (`before_etag` empty) of `control/system/router/releases/v0.28.5.json`; |
| +- `release.version` and `release_tag` `v0.28.5`, `moves_protocol` `1`; |
| +- `artifacts.linux-arm64.sha256` is `858342a3202aa5a5bbac2b8404b0a6c47a8414fe4af514d78809c2e6412a968b` (the sums' router line); |
| +- `console_artifacts.linux-arm64.sha256` is `3ad7ab50b0adb736c5cace95e82fd9687869185499a5ad3cd87b2028a4ac3c9c` (the prebuilt console, read through the pointer's signed digest, manifest and artefact, whose `version.Build` is `v0.28.5`); |
| +- `channel stable`, `spread 0s`, `source release:v0.28.5` (as for v0.28.4). |
| + |
| +Any other value is a STOP. Run 9 passed this as one create-only write of `control/system/router/releases/v0.28.6.json` at 16:13Z, REV 9. |
| + |
| +Then, on DOCS-T1, fetch the published object and compare it with the signer's file: |
| + |
| +```bash |
| +aws --profile kass s3 cp --quiet "s3://$DEVB/control/system/router/releases/$TAG.json" "$W/identity.$TAG.json" |
| +sha256sum "$W/identity.$TAG.json" |
| +``` |
| + |
| +The sha256 must equal the signer's `output_sha256`. The roll commands below need nothing else from the signer, so close the session now (1.a.5). If Paul prefers to keep it open through the roll, `refresh` on the signer replaces `rosterview`; the key then stays on the host longer. |
| + |
| +#### 1.a.5 Close the signing session |
| + |
| +No go needed. The claim runbook's "Closing the signing session": on the signer `shred -u /run/claim-signer/release.key && rmdir /run/claim-signer`; from DOCS-T1 terminate the instance, remove the exchange objects by exact key, delete the role, instance profile and security group; then the CloudTrail check with the session start time. Pass: every `GetParameter` on `/carlos/release-key` since the start comes from `assumed-role/carlos-claim-signer/<the signer's instance id>`, there are as many as key fetches, no signer instance is listed, `get-role` says `NoSuchEntity`. Anything else is reported on #250 before any further step. Then `rm -r "$D"` (the public-download directory, by exact path). |
| + |
| +### 1.b Leo by the ruled re-arm |
| + |
| +Why not `system update`: leo's installed v0.28.4 updater reads a candidate's stderr as part of the answer and refuses every candidate on an armed box. The release carries the stdout-only fix (8a313548), which helps once installed. This road is for the v0.28.4 to v0.28.5 step only; a box on v0.28.5 takes the next release through its own updater (R9-2; Run 9's normal road, 16:38 to 16:48Z). |
| + |
| +Set up the box script on DOCS-T1. It is the claim runbook's G4 recovery as a box script, from Run 9's `rearm-strict.leo.sh` with one change: the real box has no file pushed to it, so step 4 copies the agent's fetched cache to `/root/carlos-v0.28.5`, and the checks against both signed values make the source irrelevant. |
| + |
| +```bash |
| +SUMS_SHA=$(grep ' carlos-linux-arm64$' "$REL/dist/SHA256SUMS.txt" | cut -d' ' -f1) |
| +IDENT_SHA=$(aws --profile kass s3 cp --quiet "s3://$DEVB/control/system/router/releases/$TAG.json" - | python3 -I -c ' |
| +import json,sys,base64 |
| +d=json.load(sys.stdin) |
| +if "payload" in d and isinstance(d["payload"],str): d=json.loads(base64.b64decode(d["payload"])) |
| +c=d.get("current") or d.get("release") or d |
| +print(c["artifacts"]["linux-arm64"]["sha256"])') |
| +echo "SUMS_SHA=$SUMS_SHA IDENT_SHA=$IDENT_SHA" |
| +test "$SUMS_SHA" = "$IDENT_SHA" && test "$SUMS_SHA" = 858342a3202aa5a5bbac2b8404b0a6c47a8414fe4af514d78809c2e6412a968b && echo values-agree |
| +cat > "$W/rearm.box.sh" <<'EOF' |
| +set -euo pipefail |
| +TAG=__TAG__; SUMS_SHA=__SUMS_SHA__; IDENT_SHA=__IDENT_SHA__ |
| +case "${1:-}" in |
| +stop) |
| + systemctl stop carlos-system-update.path |
| + systemctl show carlos-system-update.path -p ActiveState |
| + ;; |
| +apply) |
| + for i in $(seq 1 120); do [ -f "/data/system/router/$TAG/carlos" ] && break; sleep 5; done |
| + if [ -f "/data/system/router/$TAG/carlos" ]; then echo "cache: fetched by the agent"; else echo "cache: MISSING, staging by hand is needed"; exit 3; fi |
| + test "$(sha256sum < "/data/system/router/$TAG/carlos" | cut -d' ' -f1)" = "$IDENT_SHA" |
| + install -m 0700 -o root -g root "/data/system/router/$TAG/carlos" "/root/carlos-$TAG" |
| + test "$(stat -c '%U:%G %a %h' "/root/carlos-$TAG")" = 'root:root 700 1' |
| + H=$(sha256sum < "/root/carlos-$TAG" | cut -d' ' -f1) |
| + test "$H" = "$SUMS_SHA" |
| + test "$H" = "$IDENT_SHA" |
| + echo "staged /root/carlos-$TAG $H = signed sums = identity" |
| + systemd-run --wait --pipe -p EnvironmentFile=-/etc/carlos/host.env -p UMask=0022 "/root/carlos-$TAG" system apply |
| + cat /opt/carlos/system/router/applied.json; echo |
| + cat /opt/carlos/system/router/result.json; echo |
| + grep -q '"outcome": "applied"' /opt/carlos/system/router/result.json |
| + test "$(grep -o '"version": "[^"]*"' /opt/carlos/system/router/applied.json)" = "\"version\": \"$TAG\"" |
| + ls -la /opt/carlos/system/guard/identities; test -f "/opt/carlos/system/guard/identities/$TAG.json" |
| + echo "completed.json: $(cat /opt/carlos/system/guard/completed.json)" |
| + sleep 3 |
| + P=$(systemctl show -p MainPID --value carlos-edge.service) |
| + test "$(sha256sum < /proc/$P/exe | cut -d' ' -f1)" = "$IDENT_SHA" && echo "edge pid $P exe = the release" |
| + systemctl show carlos-edge.service -p NRestarts -p ActiveState -p ExecMainStartTimestamp |
| + test "$(systemctl show -p NRestarts --value carlos-edge.service)" = 0 |
| + /opt/carlos/carlos version 2>&1 | tail -1; /opt/carlos/carlos.prev version 2>&1 | tail -1 |
| + systemctl start carlos-system-update.path |
| + systemctl show carlos-system-update.path -p ActiveState |
| + shred -u "/root/carlos-$TAG"; test ! -e "/root/carlos-$TAG" && echo "shredded /root/carlos-$TAG" |
| + ;; |
| +esac |
| +EOF |
| +sed -e "s/__TAG__/$TAG/" -e "s/__SUMS_SHA__/$SUMS_SHA/" -e "s/__IDENT_SHA__/$IDENT_SHA/" "$W/rearm.box.sh" > "$W/rearm.ready.sh" |
| +``` |
| + |
| +Pass: `values-agree`. If the cache copy fails the `root:root 700 1` or sha checks, the block stops before the apply and `/root/carlos-v0.28.5` is the only thing left on the box (remove it with `shred -u /root/carlos-v0.28.5`). |
| + |
| +> **Paul's go: G4.** Promotes `router/stable` to v0.28.5. Leo is applied by hand. Dennis, on the same channel, rolls from the same promote within the 5 minute spread. If the apply fails, STOP: the `router/stable` activation stays held, promote and rollback of stable are refused until a recovery ruling, so do not attempt a rollback. Leo and dennis keep serving v0.28.4. Report the activation ID and leo's refusal line. (A refused roll on an armed box records no completion; Run 1.) |
| + |
| +The seven steps, in this order (the claim runbook's G4): |
| + |
| +```bash |
| +# 1. on leo, BEFORE the promote |
| +leo "set -- stop; $(cat "$W/rearm.ready.sh")" |
| +# 2. operator: promote, then refresh the roster revision |
| +carlos system update --console "$DEVC" --channel stable --version "$TAG" --yes |
| +rosterview |
| +# 3 to 7. on leo: wait for the agent's cache, stage, apply, evidence, restore the path unit |
| +leo "set -- apply; $(cat "$W/rearm.ready.sh")" |
| +``` |
| + |
| +Expected on the promote (Run 9): "2 boxes over 5m" (leo and dennis), a "has not been on canary" warning, `router/stable` pointed, roster `rev` REV0+1 with one activation. The box block prints, in order: `cache: fetched by the agent` (49 s in Run 9), `staged /root/carlos-v0.28.5 858342a3... = signed sums = identity`, the `system apply` result `Finished with result: success` (about 19 s), `applied.json` and `result.json` reading `applied` for `v0.28.5`, identities `v0.28.4.json` and `v0.28.5.json`, `edge pid ... exe = the release`, `NRestarts=0`, `carlos v0.28.5` then `carlos v0.28.4` (the `.prev`), the path unit `active`, and `shredded /root/carlos-v0.28.5`. |
| + |
| +Then the operator side (C4: `rosterview` after each console-driven update): |
| + |
| +```bash |
| +aws --profile kass s3 cp --quiet "s3://$DEVB/status/boxes/leo-climbing.json" - | jq -c '{generated_at, release: .metrics.release, binary: (.metrics.binary_sha256[0:16]), activation_id: .metrics.activation_id, activation_complete: .metrics.activation_complete}' |
| +rosterview |
| +carlos system status --console "$DEVC" |
| +``` |
| + |
| +Pass: a report written after the apply with `release v0.28.5`, binary `858342a3...` and `activation_complete true` (Run 9: 16:21:22Z); `rosterview` back to `"activations":[]` with `rev` REV0+2 (3 min 44 s after the promote in Run 9); leo `current` at v0.28.5. Save each output to `$EVID`. |
| + |
| +### 1.c Dennis by its normal `system update` |
| + |
| +Nothing to run: dennis is unarmed and on stable, so the promote in 1.b is its roll. It takes the release inside the 5 minute spread, through its own `carlos-system-update.service`. Run 9: 16:23:40 to 16:23:58Z, edge restarted, `NRestarts` 0. |
| + |
| +```bash |
| +dennis 'systemctl show carlos-system-update.service -p Result -p ExecMainStartTimestamp; cat /opt/carlos/system/router/result.json; echo; /opt/carlos/carlos version 2>&1 | tail -1; /opt/carlos/carlos.prev version 2>&1 | tail -1; systemctl show carlos-edge.service -p NRestarts -p ExecMainStartTimestamp' |
| +carlos system status --console "$DEVC" |
| +``` |
| + |
| +Pass: `result.json` outcome `applied` for v0.28.5, `carlos v0.28.5` with `.prev` `carlos v0.28.4` (it was v0.28.3 before this roll), `NRestarts=0`, dennis `current` at v0.28.5. If dennis has not rolled after 10 minutes, read `journalctl -u carlos-system-update.service -n 40` on it and STOP; do not hand-apply. |
| + |
| +### 1.d Sophie's router by the re-arm on canary (R9-2) |
| + |
| +Sophie follows canary and is armed, so it takes the same seven steps with `--channel canary`. Its console keeps running the protected v0.28.4 console throughout: a router apply does not touch it. |
| + |
| +> **Paul's go: G5.** Promotes `router/canary` to v0.28.5; sophie is the only canary box ("1 box, already mirrored" in Run 9). Same failure rule as G4: STOP, no rollback. |
| + |
| +```bash |
| +# 1. on sophie, BEFORE the promote |
| +sophie "set -- stop; $(cat "$W/rearm.ready.sh")" |
| +# 2. operator |
| +carlos system update --console "$DEVC" --channel canary --version "$TAG" --yes |
| +rosterview |
| +# 3 to 7. on sophie |
| +sophie "set -- apply; $(cat "$W/rearm.ready.sh")" |
| +aws --profile kass s3 cp --quiet "s3://$DEVB/status/boxes/sophie-knitting.json" - | jq -c '{generated_at, release: .metrics.release, binary: (.metrics.binary_sha256[0:16]), activation_id: .metrics.activation_id, activation_complete: .metrics.activation_complete}' |
| +rosterview |
| +carlos system status --console "$DEVC" |
| +sophie 'p=$(systemctl show -p MainPID --value console.service); echo "console pid $p"; sha256sum < /proc/$p/exe | cut -c1-16' |
| +``` |
| + |
| +Pass: as 1.b for sophie (Run 9: 16:30:36 to 16:33:24Z, apply 19 s); `rosterview` ends with `activations` empty and `rev` REV0+4; all three boxes `current` at v0.28.5; the console pid and exe sha are the ones recorded in 1.0 (the protected v0.28.4 console, unchanged). |
| + |
| +### 1.e Sophie's guarded console: E1, the attended recovery (ruled by platform-1c) |
| + |
| +Defect 5: `install-console` refuses a slot that already holds other bytes, so sophie's protected console cannot be replaced by the supported road in v0.28.5. E1 is the ruled recovery for v0.28.5 only: `install-console --upgrade` (platform-1c, in progress) retires it. The offline-move doors exist only in the new console, so the dev rehearsal (section 2) cannot start until E1 is done. |
| + |
| +Run it attended, in a root shell on sophie, one numbered step at a time, reading the output between steps. |
| + |
| +Staging first (DOCS-T1, no change to the console): |
| + |
| +```bash |
| +sha256sum "$W/identity.$TAG.json" |
| +sophie 'test ! -e /root/claim-trial/identity.v0.28.5.json && echo absent' |
| +box_put "$SOPHIE" "$W/identity.$TAG.json" /root/claim-trial/identity.v0.28.5.json |
| +sophie 'cd /root/claim-trial; stat -c "%n %U:%G %a links=%h size=%s" identity.v0.28.5.json; sha256sum identity.v0.28.5.json' |
| +sophie 'S=/opt/carlos/versions/54ae7fb9/console; stat -c "%n %U:%G %a links=%h size=%s" $S; sha256sum $S' |
| +``` |
| + |
| +Pass: `absent`; `staged`; the identity on sophie is `root:root 600`, one link, with the same sha256 as the published object; the console source is `root:root 755`, one link, 47317154 bytes, sha256 `3ad7ab50...3c9c`. Any difference is a STOP. |
| + |
| +> **Paul's go: G6.** Stops `console.service` on sophie (the dev console is down, 502, until step 5) and replaces its protected binary. Rollback is step 6. |
| + |
| +Start the attended session: `aws --profile kass --region eu-west-1 ssm start-session --target "$SOPHIE"`, then a root shell. |
| + |
| +**E1.1. Record.** The sha256 of `console` and `console.prev`, and `stat` for each (owner, mode, links), written to a record file that step 6 reads. |
| + |
| +```bash |
| +bash -euo pipefail <<'EOF' |
| +umask 077 |
| +D=/opt/carlos/system/console |
| +UTC=$(date -u +%Y%m%dT%H%M%SZ) |
| +ASIDE=/opt/carlos/system/console-aside-$UTC |
| +REC=/root/claim-trial/e1-record-$UTC.txt |
| +{ |
| + echo "ASIDE=$ASIDE" |
| + echo "SHA_CUR=$(sha256sum < $D/console | cut -d' ' -f1)" |
| + echo "OWN_CUR=$(stat -c '%U:%G' $D/console)" |
| + echo "MODE_CUR=$(stat -c '%a' $D/console)" |
| + echo "LINKS_CUR=$(stat -c '%h' $D/console)" |
| + echo "SHA_PREV=$(sha256sum < $D/console.prev | cut -d' ' -f1)" |
| + echo "OWN_PREV=$(stat -c '%U:%G' $D/console.prev)" |
| + echo "MODE_PREV=$(stat -c '%a' $D/console.prev)" |
| + echo "LINKS_PREV=$(stat -c '%h' $D/console.prev)" |
| +} > $REC |
| +cp -p $REC /root/claim-trial/e1.env |
| +cat $REC |
| +stat -c '%n %U:%G %a links=%h size=%s inode=%i' $D/console $D/console.prev |
| +stat -c '%n %U:%G %a' $D |
| +ls -la $D |
| +EOF |
| +``` |
| + |
| +Expected: both slots `root:root`, `755`, one link, 47186082 bytes, sha256 `8d49199f433662ab183a98ce7a5ebeb18f36bc02af5689752580a596bc565e9b` (the v0.28.4 console, with `console.prev` the same bytes at arming). A different sha256 is a STOP: record it and tell Paul before step 2. Keep the printed `ASIDE=` value; it is the exact directory step 7 removes. |
| + |
| +**E1.2. Stop.** |
| + |
| +```bash |
| +systemctl stop console.service |
| +systemctl is-active console.service || true |
| +``` |
| + |
| +Expected: `inactive`. Write down the time. |
| + |
| +**E1.3. Aside.** A root-only 0700 directory on the same filesystem, both slots moved into it, and nothing else. The console directory itself stays. |
| + |
| +```bash |
| +bash -euo pipefail <<'EOF' |
| +. /root/claim-trial/e1.env |
| +D=/opt/carlos/system/console |
| +test ! -e "$ASIDE" |
| +install -d -m 0700 -o root -g root "$ASIDE" |
| +mv -T $D/console.prev "$ASIDE/console.prev" |
| +mv -T $D/console "$ASIDE/console" |
| +ls -la $D "$ASIDE" |
| +test "$(sha256sum < "$ASIDE/console" | cut -d' ' -f1)" = "$SHA_CUR" && echo aside-console-ok |
| +test "$(sha256sum < "$ASIDE/console.prev" | cut -d' ' -f1)" = "$SHA_PREV" && echo aside-prev-ok |
| +EOF |
| +``` |
| + |
| +Expected: `$D` empty, `$ASIDE` holding the two files, both `-ok` lines. |
| + |
| +**E1.4. Install the v0.28.5 console.** Dry run, then the same without `--dry-run`. It must report both slots written with the v0.28.5 console sha from the identity. |
| + |
| +```bash |
| +bash -euo pipefail <<'EOF' |
| +umask 077 |
| +cd /root/claim-trial |
| +set -a; . /etc/carlos/host.env; set +a |
| +PUB=$(cat release.pub) |
| +SRC=/opt/carlos/versions/54ae7fb9/console |
| +ID=/root/claim-trial/identity.v0.28.5.json |
| +/opt/carlos/carlos system claims install-console --identity $ID --source $SRC --bucket carlos-dev-640012953448 --aws-region eu-west-1 --public-key "$PUB" --dry-run |
| +/opt/carlos/carlos system claims install-console --identity $ID --source $SRC --bucket carlos-dev-640012953448 --aws-region eu-west-1 --public-key "$PUB" |
| +D=/opt/carlos/system/console |
| +stat -c '%n %U:%G %a links=%h size=%s' $D/console $D/console.prev |
| +sha256sum $D/console $D/console.prev |
| +EOF |
| +``` |
| + |
| +Expected (Run 9's E1): `already_installed false`, `release_tag v0.28.5`, `sha256 3ad7ab50...3c9c` (the identity's `console_artifacts.linux-arm64.sha256`), `path /opt/carlos/system/console/console`, `previous /opt/carlos/system/console/console.prev`, `mode 0755`; both slots `root:root 755 links=1 size=47317154`, both sha256 `3ad7ab50...3c9c`. A refusal here: go to step 6 at once. |
| + |
| +**E1.5. Start and check.** |
| + |
| +```bash |
| +systemctl start console.service |
| +systemctl is-active console.service |
| +p=$(systemctl show -p MainPID --value console.service); echo "pid $p" |
| +readlink /proc/$p/exe |
| +sha256sum < /proc/$p/exe |
| +tr '\0' '\n' < /proc/$p/environ | grep '^CARLOS_HOST_CLAIM=' |
| +for i in $(seq 1 30); do c=$(curl -s -o /dev/null -w '%{http_code}' http://127.0.0.1:8090/healthz); [ "$c" = 200 ] && break; sleep 1; done; echo "healthz $c" |
| +curl -sI http://127.0.0.1:8090/healthz | grep -i '^x-carlos-version' |
| +systemctl show console.service -p NRestarts -p ActiveState |
| +``` |
| + |
| +Pass: `active`; `/opt/carlos/system/console/console`; sha256 `3ad7ab50...3c9c`; `CARLOS_HOST_CLAIM=` empty; `healthz 200` within seconds (Run 9: restart 16:35:16.563Z, 200 at 17.113Z); `NRestarts=0`. The `x-carlos-version` value: record what it prints. 5.0a's record shows a ship-version string for a protected console and the v0.28.2 notes say a release console reports its tag, so expect `54ae7fb9` or `v0.28.5`; the exe sha256 is the authority. |
| + |
| +The console report must show the console process. From DOCS-T1, stage a fresh roster and revision, then on sophie run the claim runbook's 7.4 `console-report` (the dry run first): |
| + |
| +```bash |
| +box_inspect "$SOPHIE" |
| +sophie 'cd /root/claim-trial && /opt/carlos/carlos system claims console-report --bucket carlos-dev-640012953448 --aws-region eu-west-1 --expect-revision "$(cat rev)" --console-id "$(cat console-id)" --public-key "$(cat release.pub)" --dry-run' |
| +``` |
| + |
| +Then, if the dry run passes, the same command without `--dry-run`, and read the box report: |
| + |
| +```bash |
| +aws --profile kass s3 cp --quiet "s3://$DEVB/status/boxes/sophie-knitting.json" - | jq -c '{generated_at, release: .metrics.release, console_processes: (.metrics.console_processes | length)}' |
| +``` |
| + |
| +Pass: the dry run passes, and the report shows `console_processes` 1. The entry lapses at the agent's next status tick (about 5 minutes, #312); that is expected. A refusal here with the exe sha and healthz correct is not a reason to roll back by itself: STOP and tell Paul. |
| + |
| +**E1.6. Rollback (only before step 5's checks have passed).** Stop the console, move the aside files back with their recorded owner, mode and shas, delete the new slots, start it again. |
| + |
| +```bash |
| +systemctl stop console.service |
| +bash -euo pipefail <<'EOF' |
| +. /root/claim-trial/e1.env |
| +D=/opt/carlos/system/console |
| +restore() { # restore <slot> <owner> <mode> <sha> |
| + [ -e $D/$1 ] && rm -- $D/$1 |
| + mv -T "$ASIDE/$1" $D/$1 |
| + chown "$2" $D/$1 |
| + chmod "$3" $D/$1 |
| + test "$(sha256sum < $D/$1 | cut -d' ' -f1)" = "$4" && echo "$1 restored" |
| + stat -c '%n %U:%G %a links=%h' $D/$1 |
| +} |
| +restore console "$OWN_CUR" "$MODE_CUR" "$SHA_CUR" |
| +restore console.prev "$OWN_PREV" "$MODE_PREV" "$SHA_PREV" |
| +EOF |
| +systemctl start console.service |
| +systemctl is-active console.service |
| +``` |
| + |
| +Expected: both slots restored with the recorded sha256, owner, mode and one link; the console `active` on the v0.28.4 build (`8d49199f...`); healthz 200; `x-carlos-version` as recorded in 1.0. The aside directory is then empty and may stay until Paul says. After a rollback, STOP: the rehearsal cannot run, and the flagship roll can still go ahead (the flagship console is unguarded). |
| + |
| +**E1.7. Keep the aside directory** until the dev offline-move rehearsal is done (section 2). Then remove that exact directory by name, never a glob (G10, section 2.8). |
| + |
| +### 1.f The dev check (README "Checking dev", with R9-1) |
| + |
| +Once dev is rolled, with idle time allowed (wakecheck's idle is 15 minutes and bots can keep it awake): |
| + |
| +```bash |
| +carlos logs --app wakecheck --console "$DEVC" --since 30m | tail -5 |
| +curl -sS -m 40 -w '\n[%{http_code}] ttfb %{time_starttransfer}s\n' https://wakecheck.dev.carlosframework.com/ |
| +curl -sS -m 40 --resolve wakecheck.dev.carlosframework.com:443:18.200.150.210 -w '\n[%{http_code}] ttfb %{time_starttransfer}s\n' https://wakecheck.dev.carlosframework.com/ |
| +carlos status --layout --console "$DEVC" |
| +carlos system status --console "$DEVC" |
| +``` |
| + |
| +Pass, with R9-1's corrections: |
| +1. The logs end in "instance exited" (do not use `instances list --health`, #287). If not, wait for idle and read again. |
| +2. Through DNS: a 200, `host=` is the console box (`carlos-dev-ie`, sophie), about 0.6 s to first byte. |
| +3. Pinned to leo's address `18.200.150.210`: a 200 whose `host=` is `carlos-dev-ie` too. Leo has held `CARLOS_POOLS=cohort1` since step 4.2 and has no wakecheck row since 4.3, so its edge backhauls to sophie. Replace the README's "host= is that box" with this. |
| +4. `carlos status --layout` shows `wakecheck` as `nested` on the console box only. A box restarted by the roll may read "isolation not ready: ... probe fail not yet run" for the first ten minutes or so; read again later (the harness (f) and the dev journals of 2026-10-19 both show `nested by default` about ten minutes after a start). |
| +5. `hits=` going backwards from one box to the other is not a failure (#286); judge on the 200s and the `host=` values. |
| +6. All three boxes `current` at v0.28.5, console healthz 200. |
| + |
| +Record the outputs in `$EVID`. Run 9 (f) passed items 1 to 2 on the harness's console box, with the pinned request failing only for the harness's CA gap (H13b). |
| + |
| +### 1.g The evidence list |
| + |
| +Save each to `$EVID` with a UTC stamp in the file name. The roll is accepted when every row passes. |
| + |
| +| # | Evidence | Pass | |
| +|---|---|---| |
| +| 1 | 0.8 pre-flight output | signature verified, shas as 0.1 | |
| +| 2 | `channels --app console` after C2 | `canary/console 54ae7fb9 ... yes`, shipped before the identity | |
| +| 3 | `publish-identity` result | one create-only write, router `858342a3...`, console `3ad7ab50...` | |
| +| 4 | Signer close and the CloudTrail check | clean (1.a.5) | |
| +| 5 | Leo: `applied.json`, `result.json`, identities, edge exe sha, `NRestarts`, `carlos` and `.prev` | `applied`, `v0.28.4.json` and `v0.28.5.json`, exe `858342a3...`, 0, v0.28.5 and v0.28.4 | |
| +| 6 | Leo: next report | `activation_complete true`, `activations []` | |
| +| 7 | Dennis: `result.json`, versions, `NRestarts` | `applied`, v0.28.5 and v0.28.4, 0 | |
| +| 8 | Sophie router: as rows 5 and 6; the console pid and exe unchanged | as leo | |
| +| 9 | Roster revisions after each step (C4) | REV0, +1, +2, +3, +4 with `activations []` at the end | |
| +| 10 | E1: the record file, the aside listing, `install-console` output, exe sha, healthz, console report | as 1.e | |
| +| 11 | The dev check | as 1.f | |
| +| 12 | `carlos system status --console "$DEVC"` | three boxes `current` v0.28.5 | |
| + |
| +### 1.h If a step fails |
| + |
| +| Failure | Action | |
| +|---|---| |
| +| A held activation before the promote | STOP; no promote or rollback of that channel until it is released | |
| +| The agent's cache never appears (the apply block exits 3) | STOP, tell Paul. Hand-staging the cache is allowed only if it is missing, and the choice is recorded; not rehearsed in Run 9 | |
| +| A sha mismatch in the apply block | STOP; `shred -u /root/carlos-v0.28.5` | |
| +| The apply fails or the box does not report `activation_complete` | STOP; report the activation ID and the refusal line. No rollback of the channel. Leo and dennis keep serving v0.28.4 | |
| +| E1 step 4 refuses | E1.6 rollback at once | |
| +| The dev check fails | Stop before flagship; fix forward on dev or hold | |
| + |
| +--- |
| + |
| +## 2. Dev offline-move rehearsal, sophie to dennis |
| + |
| +Rehearses the whole sequence on an app shaped like the customer's: nested, a store binding, a secret, a settings bundle that renders a `config.env`, a files tree with a key file, an instance key, a schedule, a once-timer armed through the app, and a database that grows while it runs. It uses `moveprobe` (`cmd/moveprobe`, built from the release source). Both boxes are claims-off: sophie is home (`ie`), dennis is `uk`. Leo is a home-placement box with `CARLOS_POOLS=cohort1`; it takes part as a source box and does not block (M4: it publishes `offline-move-1`, an armed guard does not withhold it, and the gate applies only once leo's claims are on, after the claim window's 8.2). |
| + |
| +Gate: E1 done (1.e), the dev check passed (1.f), all three boxes and the console on v0.28.5. |
| + |
| +### 2.1 P0 pre-checks, as commands (M1, M9, R3) |
| + |
| +M1: the console that serves the doors runs the release. `carlos move offline status` answers (an older console has no offline doors). |
| + |
| +```bash |
| +carlos move offline status --host nothing.dev.carlosframework.com --app wakecheck --account bab --console "$DEVC"; echo "exit $?" |
| +``` |
| + |
| +Pass: an answer that says the host has no offline move in flight (the plan's MV-O24, "has no offline move in flight"), not a bare "not found". Both an older console and a non-operator get a byte-identical 404, so first confirm your own operator status on this console (the doors check that you are a system operator and a member of the account). |
| + |
| +Per box (leo, sophie, dennis), the same block: |
| + |
| +```bash |
| +BLOCK=' |
| +echo "== $(hostname)" |
| +echo "claim lines: $(grep -c "^CARLOS_HOST_CLAIM=." /etc/carlos/host.env || true)" |
| +echo "phase1 lines: $(grep -c "^CARLOS_MOVES_PHASE1=" /etc/carlos/host.env || true)" |
| +P=$(systemctl show -p MainPID --value carlos-edge) |
| +echo "edge env claim/phase1 vars: $(tr "\0" "\n" < /proc/$P/environ | grep -cE "^CARLOS_(HOST_CLAIM=.|MOVES_PHASE1=)" || true)" |
| +systemctl show carlos-edge -p User -p Delegate -p ActiveState |
| +echo "stage.path: $(systemctl is-active carlos-stage.path) $(systemctl is-enabled carlos-stage.path)" |
| +/opt/carlos/carlos version 2>&1 | tail -1 |
| +if [ -f /opt/carlos/system/guard/policy.json ]; then echo "guard policy present"; else echo "no guard policy"; fi |
| +echo "secrets key lines: $(grep -c "^CARLOS_SECRETS_KEY=" /etc/carlos/host.env || true)" |
| +' |
| +leo "$BLOCK" |
| +sophie "$BLOCK" |
| +dennis "$BLOCK" |
| +sophie 'P=$(systemctl show -p MainPID --value console.service); tr "\0" "\n" < /proc/$P/environ | grep -E "^CARLOS_(HOST_CLAIM|MOVES_PHASE1|SECRETS_PUBKEY)=" | sed "s/PUBKEY=.*/PUBKEY=<set>/"; sha256sum < /proc/$P/exe | cut -c1-16' |
| +``` |
| + |
| +Pass on every box: `claim lines: 0`, `phase1 lines: 0`, `edge env ... 0`, `User=carlos` (R3: the move reads bucket and tenant-reachable inputs, so it never runs where the agent runs as root; any other value is a STOP), `Delegate=yes`, `ActiveState=active`, `stage.path: active enabled` (the UK box at least), `carlos v0.28.5`, secrets key lines 1 (dennis, leo, sophie). Guard policy present on leo and sophie, absent on dennis (an armed guard is not a refusal). The console: `CARLOS_HOST_CLAIM=` empty, no `CARLOS_MOVES_PHASE1`, `CARLOS_SECRETS_PUBKEY=<set>`, exe sha `3ad7ab50...` (first 16 digits). |
| + |
| +Edges files and the stale-file check (P0.7): |
| + |
| +```bash |
| +for k in $(aws --profile kass s3 ls "s3://$DEVB/control/edges/" | awk '{print $4}'); do |
| + echo "== $k"; aws --profile kass s3 cp --quiet "s3://$DEVB/control/edges/$k" - | jq -c '{region, placement, pools, caps: .capabilities, secrets_key_fp, hibernation_configured, serves_shared_pool, data_bucket, hosts: (.hosts | length)}' |
| +done |
| +``` |
| + |
| +Pass: exactly three files, one per live box; every `caps` contains `offline-move-1`; `hibernation_configured` true; every `secrets_key_fp` is equal (P0.3's secrets key fact); sophie serves the shared pool; leo `serves_shared_pool` false; dennis `placement uk` with a `data_bucket`. Any extra file naming the home placement for a box that no longer exists blocks `seal`: STOP and ask (removal needs Paul). |
| + |
| +Claims, certificates, layout, sizes (run again for the rehearsal host after 2.2): |
| + |
| +```bash |
| +aws --profile kass s3api head-object --bucket "$DEVB" --key control/hosts-backfill.json >/dev/null 2>&1 && echo "hosts-backfill PRESENT" || echo "control/hosts-backfill.json absent" |
| +carlos status --layout --console "$DEVC" |
| +IEDATA=$(sophie 'grep "^CARLOS_HIBERNATE_BUCKET=" /etc/carlos/host.env | cut -d= -f2- | tr -d "\""' | tail -1) |
| +UKDATA=$(dennis 'grep "^CARLOS_HIBERNATE_BUCKET=" /etc/carlos/host.env | cut -d= -f2- | tr -d "\""' | tail -1) |
| +echo "ie data: $IEDATA uk data: $UKDATA" |
| +``` |
| + |
| +Pass: `control/hosts-backfill.json absent`; layout shows no stale warnings you do not understand. P0.4, the staging lane from the IE role to the UK data bucket's `moves/` prefix: the boxes have no `aws` CLI, so check the policy offline from DOCS-T1: |
| + |
| +```bash |
| +aws --profile kass iam simulate-principal-policy --policy-source-arn arn:aws:iam::640012953448:role/carlos-dev-host --action-names s3:PutObject s3:GetObject s3:DeleteObject --resource-arns "arn:aws:s3:::$UKDATA/moves/x/y" --query 'EvaluationResults[].[EvalActionName,EvalDecision]' --output text |
| +aws --profile kass iam simulate-principal-policy --policy-source-arn arn:aws:iam::640012953448:role/carlos-dev-host --action-names s3:ListBucket --resource-arns "arn:aws:s3:::$UKDATA" --context-entries ContextKeyName=s3:prefix,ContextKeyValues=moves/,ContextKeyType=string --query 'EvaluationResults[].[EvalActionName,EvalDecision]' --output text |
| +``` |
| + |
| +Pass: `allowed` for all four. This is not rehearsed (the harness's MinIO cannot answer it). If the simulation says `implicitDeny`, the staging lane is missing: STOP, infra change needs Paul. The first real `seal` is the final proof. |
| + |
| +### 2.2 The test app |
| + |
| +> **Paul's go: G7.** Creates two apps (`moverehearsal`, `rollbackrehearsal`), a store each, a secret, a schedule and an instance record each, in account `bab` on dev. They are deleted later by the claim window's block B1 (the claim runbook's G2 note names "the offline-move rehearsal app's" records), not here. |
| + |
| +Build the app from the release source and ship it. The account must be approved for object storage on dev before `store create` provisions anything; if it refuses, STOP and ask (the harness bound the store as plain app settings, H18, which needs a scratch bucket Paul names). |
| + |
| +```bash |
| +(cd "$REL/src" && CGO_ENABLED=0 GOOS=linux GOARCH=arm64 GOFLAGS=-buildvcs=false go build -o "$W/moveprobe" ./cmd/moveprobe) |
| +sha256sum "$W/moveprobe" |
| +for APP in moverehearsal rollbackrehearsal; do |
| + carlos apps create --app $APP --account bab --console "$DEVC" |
| + carlos ship --app $APP --account bab --console "$DEVC" --version mp1 --label "moveprobe 54ae7fb9 (offline-move rehearsal)" --no-prompt "$W/moveprobe" |
| + carlos promote --app $APP --account bab --console "$DEVC" --no-prompt mp1 edge |
| + AWS_PROFILE=kass CARLOS_DEPLOYMENT_BUCKET=$DEVB carlos instances enable --app $APP --account bab --domain dev.carlosframework.com --channel edge |
| + carlos store create --app $APP --account bab --console "$DEVC" --env-prefix MOVEPROBE |
| + S=$(od -An -N24 -tx1 /dev/urandom | tr -d ' \n'); (umask 077; printf '%s' "$S" > "$W/$APP.secret") |
| + carlos secrets set --app $APP --account bab --console "$DEVC" MOVEPROBE_SECRET="$S" |
| + carlos env set --app $APP --account bab --console "$DEVC" REHEARSAL_NOTE=r0285-$APP |
| + carlos schedule set --app $APP --account bab --console "$DEVC" --name every-minute --every 1m --path /tick |
| + carlos instances create --app $APP --account bab --host $APP.dev.carlosframework.com --console "$DEVC" --no-prompt |
| +done |
| +``` |
| + |
| +Expected: `instances create` prints the channel it chose and the region (`channel edge, Ireland · Dublin` in Run 9: region home, no pool). The per-app secret lives only in `$W/<app>.secret` (0600) and in the shell. |
| + |
| +Optional, not in Run 9: to resemble the customer's instances further, give `moverehearsal` a legacy `/data/<host>/` directory holding only a key copy, as the flagship's three have. Do it only if Paul wants it, as root on sophie after the first wake, copying the two files from the nested `<host>/` directory with their modes. The move should park it at `source-retire`. |
| + |
| +**M5: `config.env` before the first wake (defect 6).** About a minute after `instances create`, and before any request: |
| + |
| +```bash |
| +for APP in moverehearsal rollbackrehearsal; do |
| + sophie "set -- $APP.dev.carlosframework.com; $(cat "$W/cfg.box.sh")" |
| +done |
| +``` |
| + |
| +Pass: `config.env` lists `MOVEPROBE_*` and `REHEARSAL_NOTE` names. If it says `MISSING`, change any setting to start a new bundle generation, then read again after a minute: |
| + |
| +```bash |
| +carlos env set --app rollbackrehearsal --account bab --console "$DEVC" REHEARSAL_NOTE=r0285-rollbackrehearsal-2 |
| +``` |
| + |
| +(That is for the rehearsal apps only. On a customer's instance never change a setting to cure this: see 4.5.) |
| + |
| +Wake each on sophie only, through DNS, and arm a once-timer 45 minutes out: |
| + |
| +```bash |
| +for APP in moverehearsal rollbackrehearsal; do |
| + H=$APP.dev.carlosframework.com; S=$(cat "$W/$APP.secret") |
| + for i in 1 2 3 4 5 6; do c=$(curl -s -m 40 -o /dev/null -w '%{http_code}' https://$H/ready); echo "$APP /ready $c"; [ "$c" = 200 ] && break; sleep 10; done |
| + curl -s -m 20 -X POST -H "Authorization: Bearer $S" "https://$H/arm-once?in=2700"; echo |
| + curl -s -m 20 -H "Authorization: Bearer $S" https://$H/report | jq -c '{host,region,rows,fired,file_key_sha256,platform_key_sha256,object:.object.key,has_secret,worker_writes_committed}' |
| +done |
| +carlos status --layout --console "$DEVC" |
| +``` |
| + |
| +Pass: 200 on `/ready` (a first wake that fails the health check with a missing store variable is defect 6: apply the `env set` above), `has_secret true`, a store object key, and `nested` on sophie for both hosts. Run 9's equivalent: 61 `bg` rows, `file_key_sha256 c5a85dd6...`, `platform_key_sha256 067b3156...`. |
| + |
| +### 2.3 The move of `moverehearsal`, with the doors M2 and M5 corrected |
| + |
| +> **Paul's go: G8.** `moverehearsal` is offline from `start` until `open`. |
| + |
| +Helpers (DOCS-T1). `MVR` is Run 9's retry: it repeats a verb every 15 s while the door refuses only for a stale report or a wait (M2), up to 9 minutes. |
| + |
| +```bash |
| +H=moverehearsal.dev.carlosframework.com APP=moverehearsal ACCT=bab C=$DEVC |
| +MV() { carlos move offline "$1" --host "$H" --app "$APP" --account "$ACCT" --console "$C" ${2:-}; } |
| +ts() { date -u +%T.%3NZ; } |
| +MVR() { local i out rc; for i in $(seq 1 36); do out=$(MV "$1"); rc=$?; echo " try $i $(ts) exit=$rc: $(echo "$out" | tail -1)" |
| + case "$rc:$out" in 5:*"still runs a process"*|5:*"Waiting for"*|5:*"not current"*|4:*) sleep 15;; *) echo "$out"; return $rc;; esac; done; return $rc; } |
| +``` |
| + |
| +Never run `carlos move` as root; it refuses. |
| + |
| +**Before.** Read the app, the boxes and the leases (the box side is `facts`, Appendix A): |
| + |
| +```bash |
| +S=$(cat "$W/$APP.secret") |
| +curl -s -m 30 -H "Authorization: Bearer $S" https://$H/report | jq -c '{rows,fired,file_key_sha256,platform_key_sha256,object:.object.key}' |
| +sophie "set -- $H; $(cat "$W/facts.box.sh")" |
| +dennis "set -- $H; $(cat "$W/facts.box.sh")" |
| +aws --profile kass s3 cp --quiet "s3://$IEDATA/instances/$H/lock.json" - | jq -c . |
| +``` |
| + |
| +Record: the `/report` row counts, the env file sha and instance key digest, the `config.env` names, the files tree digest, the timers (`every-minute`, `once-1`), the lease owner `sophie:<n>`. Dennis shows nothing for the host. |
| + |
| +**The steps.** Run them back to back. `flip` must come within two minutes of the previous door, and `open` within two minutes of the flip (M2), or be retried: |
| + |
| +```bash |
| +T0=$(date +%s); echo "start $(ts)" |
| +MV start "--to uk"; echo "start exit=$? $(ts)" |
| +MV status |
| +echo "seal $(ts)"; MV seal; echo "seal exit=$? $(ts)" |
| +``` |
| + |
| +Between `seal` and `flip`, confirm the process is really gone (the plan's "operator confirms before the flip"): |
| + |
| +```bash |
| +carlos logs --app "$APP" --account "$ACCT" --console "$C" --since 15m | grep -E 'exited|stopp|fence' | tail -3 |
| +sophie "set -- $H; $(cat "$W/procs.box.sh")" |
| +echo "flip $(ts)"; MVR flip; echo "flip exit=$? $(ts)" |
| +MV status |
| +``` |
| + |
| +Pass: `instance exited` in the log; 0 processes in the slice. If `flip` exits 5 with "<box> still runs a process" and `status` shows "Its report is not current", that is a stale report, not a process. `MVR` retries every 15 s until the next pass (at most about 6 minutes). Only a current report with a process count is a real MV-O31: then STOP and abort. |
| + |
| +**After flip, before open** (M5 on the target: the landing renders `config.env` from the bundle): |
| + |
| +```bash |
| +dennis "set -- $H; $(cat "$W/facts.box.sh")" |
| +``` |
| + |
| +Pass: dennis shows the row `landing`, region uk, **flat** (`/data/<host>.db`), `<host>.env` sha equal to sophie's, the instance key digest equal, `config.env` with the same names, the files `instance.key` digest equal, both timers carried. If `config.env` is missing on the target, `abort`, do not open. |
| + |
| +```bash |
| +echo "open $(ts)"; MVR open; echo "open exit=$? $(ts)" |
| +DEN_IP=$(aws --profile kass --region eu-west-2 ec2 describe-instances --instance-ids "$DENNIS" --query 'Reservations[0].Instances[0].PublicIpAddress' --output text) |
| +for i in $(seq 1 40); do c=$(curl -s -m 30 -o /dev/null -w '%{http_code}' --resolve $H:443:$DEN_IP https://$H/ready); echo "dennis /ready $c $(ts)"; [ "$c" = 200 ] && break; sleep 3; done |
| +echo "serving: $(( $(date +%s) - T0 )) s since start" |
| +curl -s -m 30 -H "Authorization: Bearer $S" --resolve $H:443:$DEN_IP https://$H/report | jq -c '{region,rows,fired,file_key_sha256,platform_key_sha256,object:.object.key,has_secret,worker_writes_failed}' |
| +curl -s -m 30 -o /dev/null -w 'via DNS %{http_code}\n' https://$H/ready |
| +echo "finish $(ts)"; MVR finish; echo "finish exit=$? $(ts)" |
| +MV status |
| +``` |
| + |
| +Expected (Run 9): `start` prints "Moving <host> from ie to uk." and "... is offline from now until the move opens or is aborted." then "Waiting for <box> in ie ..." and "Every box in ie has stopped <host>. Run carlos move offline seal ..." exit 0 in about 2 s; `seal` "Copying ... Copied and checked. Run carlos move offline flip ..." about 6 s for 4 MB; `flip` "Stopped in ie. Starting in uk." about 4 s; `open` "<host> is served from uk. Run carlos move offline finish ..." about 4 s; the first request on dennis 404 for a moment (not ready yet) then 200 within about 6 s; `finish` takes 4 to 5 minutes (the CLI waits; nothing is offline by then) and ends "Moved. <host> is served from uk. It was offline for <n> seconds." |
| + |
| +**After finish.** |
| + |
| +M6 (defect 8), on the source box, now: |
| + |
| +```bash |
| +sophie "set -- $H check; $(cat "$W/stray.box.sh")" |
| +``` |
| + |
| +If a `<host>.env` is in `/data/.instances/<host>/` (a fresh 84-byte file holding only a new `CARLOS_ADMIN_TOKEN`, written at the first tick after `open`), move it into the park directory and record it. Never delete it: |
| + |
| +```bash |
| +sophie "set -- $H move; $(cat "$W/stray.box.sh")" |
| +``` |
| + |
| +M7: the source's `instances/<host>/lock.json` is rewritten, not deleted: |
| + |
| +```bash |
| +aws --profile kass s3 cp --quiet "s3://$IEDATA/instances/$H/lock.json" - | jq -c . |
| +aws --profile kass s3 cp --quiet "s3://$UKDATA/instances/$H/lock.json" - | jq -c . |
| +aws --profile kass s3 cp --quiet "s3://$DEVB/apps/bab/$APP/instances/$H.json" - | jq -c '{region, move, last_move, record_seq}' |
| +``` |
| + |
| +Pass: IE's lock is `owner moved:<id>`, `expires_at 1970-01-01T00:00:00Z`, `generation` 1. That expired object is the normal end state, not an abandoned move. UK's is dennis's (`dennis:<n>`, 15 minute expiry). The record: region `uk`, `move` null, `last_move {"outcome":"done","offline_s":<n>}`. |
| + |
| +### 2.4 Verification on dennis |
| + |
| +All of these must hold (Run 9 B3): |
| + |
| +| Check | How | Pass | |
| +|---|---|---| |
| +| Rows | `/report` on dennis, second read | `bg` home rows then uk rows with contiguous sequence numbers, no row lost or repeated; the count is above the pre-move read | |
| +| Instance key | `platform_key_sha256` and `<host>.env` sha (via `facts`) | equal to the pre-move values | |
| +| Files | `file_key_sha256`, `instance.key` digest | unchanged | |
| +| `config.env` | names on dennis; the app wrote and read back a new store object | all names present; `has_secret true`; a new `probe/` object | |
| +| Timers | `carlos schedule ls --app moverehearsal --account bab --console "$DEVC"`; the once-timer | `every-minute` carried (ticks due while offline did not fire, refused `maintenance fence active`, as the plan says); `once-1` fires on dennis at its due time (45 minutes after arming) with a `once` row in region uk and `last_status 200` | |
| +| Source parked, not deleted | `ls -d /data/.offline-moves/<host>/<id>/*` on sophie | `sealer/`, `source/instance/`, `source/<host>.json`; the mount view `/data/instances/<host>`, `/data/.instances/<host>` (empty) and `/opt/carlos/live/<host>` (root-owned link) stay | |
| +| Tombstone lifted | sophie journal `tombstone lifted`; the lock object (M7) | as above | |
| +| Backhaul | request through sophie and leo | 200 | |
| + |
| +### 2.5 Nesting after up to an hour (M3) |
| + |
| +After `open` the row is flat. The layout pass nests it only when asleep, or stops it after a 1-hour grace (`layout: deferred until asleep -> <host> (awake (stopped for the move in 1h0m0s unless it sleeps first))`). An app with a 1-minute schedule never reaches idle, so plan a second short stop about an hour after the first wake on dennis (Run 9: 18:26:40Z, exactly 1 h, a 24 s second stop). Read it once, at the hour. The abort rehearsal (2.6) reset `H`, `APP` and `S`, so set them back for `moverehearsal` first (`H=moverehearsal.dev.carlosframework.com APP=moverehearsal S=$(cat "$W/moverehearsal.secret")`): |
| + |
| +```bash |
| +carlos status --layout --console "$DEVC" | grep -E "$H|WARNING" |
| +carlos logs --app "$APP" --account "$ACCT" --console "$C" --since 90m | grep -E 'instance (stopping|exited|woke)' | tail -5 |
| +dennis "journalctl -u carlos-edge --no-pager --since '-80 min' | grep -E 'layout: ' | grep $H | tail -5" |
| +curl -s -m 30 -H "Authorization: Bearer $S" --resolve $H:443:$DEN_IP https://$H/report | jq -c '{rows,file_key_sha256,platform_key_sha256,worker_writes_failed}' |
| +``` |
| + |
| +Pass: the host shows `nested` (the "runs nested instances beside flat" warning gone); one `instance stopping` then `instance exited` then `instance woke`; rows contiguous; the key digests unchanged; `/ready` 200. |
| + |
| +### 2.6 The abort rehearsal on `rollbackrehearsal` |
| + |
| +> **Paul's go: G9.** `rollbackrehearsal` is offline from `start` until `abort` completes (Run 9: 23 s). |
| + |
| +```bash |
| +H=rollbackrehearsal.dev.carlosframework.com APP=rollbackrehearsal; S=$(cat "$W/$APP.secret") |
| +curl -s -m 30 -H "Authorization: Bearer $S" https://$H/report | jq -c '{rows,platform_key_sha256,file_key_sha256}' |
| +sophie "set -- $H; $(cat "$W/facts.box.sh")" |
| +T0=$(date +%s) |
| +MV start "--to uk"; echo "start exit=$?" |
| +MV seal; echo "seal exit=$?" |
| +MVR flip; echo "flip exit=$?" |
| +dennis "set -- $H; $(cat "$W/facts.box.sh")" |
| +MVR abort; echo "abort exit=$?" |
| +MV finish; echo "finish exit=$?" |
| +for i in $(seq 1 10); do c=$(curl -s -m 30 -o /dev/null -w '%{http_code}' https://$H/ready); echo "ready $c"; [ "$c" = 200 ] && break; sleep 6; done |
| +echo "back after $(( $(date +%s) - T0 )) s" |
| +``` |
| + |
| +Expected (M8): `abort` prints "Moving <host> back to ie." and then "Every box has put <host> back in ie. Run carlos move offline finish ..."; **`abort` exits 3 and so does `finish`**. That is the CLI's "aborted" code, the expected result, not a failure. `finish` prints "<host> is back in ie and serving. Nothing was lost." Run 9: abort 4.1 s, finish 0.1 s, `/ready` 200 at 0.6 s, 23 s offline in all. |
| + |
| +Verify: |
| + |
| +```bash |
| +curl -s -m 30 -H "Authorization: Bearer $S" https://$H/report | jq -c '{rows,platform_key_sha256,file_key_sha256}' |
| +sophie "set -- $H; $(cat "$W/facts.box.sh")" |
| +dennis "set -- $H; $(cat "$W/facts.box.sh")" |
| +aws --profile kass s3 cp --quiet "s3://$IEDATA/instances/$H/lock.json" - | jq -c . |
| +aws --profile kass s3 ls "s3://$UKDATA/moves/$H/" ; echo "uk moves/ exit $?" |
| +aws --profile kass s3 cp --quiet "s3://$DEVB/apps/bab/$APP/instances/$H.json" - | jq -c '{region, move, last_move}' |
| +``` |
| + |
| +Pass: rows contiguous and above the pre-move count (no write lost); key digests unchanged; sophie's row `ready` and nested, with the lease `sophie:<n>` at generation 2 (the tombstone lifted and sophie took its own lease); no lease and no `moves/` objects for the host in the UK bucket; dennis has no row, and parked what it extracted under `/data/.offline-moves/<host>/<id>/target/`; the record is back in home (`region` absent), `move` null, `last_move` outcome `aborted`. |
| + |
| +### 2.7 Pass criteria for the rehearsal |
| + |
| +All of 2.1 to 2.6 pass, nothing lost in either move, the offline seconds and the step timings recorded (section 4.3 reuses them), the stray env check done, nesting confirmed after the hour. A failure on file permissions in the nested archive (a file the agent cannot read) means STOP: the flagship plan changes (the plan's Risk 1). |
| + |
| +### 2.8 Rehearsal cleanup |
| + |
| +> **Paul's go: G10.** Removes one exact directory on sophie: the E1 aside directory. Do it only when the rehearsal has passed and Paul agrees; it holds the only copy of the v0.28.4 console. |
| + |
| +```bash |
| +sophie 'ASIDE=$(grep "^ASIDE=" /root/claim-trial/e1.env | cut -d= -f2); echo "$ASIDE"; ls -la "$ASIDE"' |
| +``` |
| + |
| +Read the printed name aloud against E1.1's record. Then, with that exact name (never a glob): |
| + |
| +```bash |
| +sophie 'ASIDE=/opt/carlos/system/console-aside-<UTC from E1.1>; test -d "$ASIDE" && ls "$ASIDE" && rm -r -- "$ASIDE" && echo removed' |
| +``` |
| + |
| +Leave in place: the rehearsal apps and records (the claim window's B1 deletes them), the parked directories under `/data/.offline-moves/` on sophie and dennis (never deleted; the claim window's B2 must move them aside, and its G5 expects nothing left under `/data/.instances`, `/data/instances`, `/data/programs` or `/opt/carlos/live` for those hosts), and the E1 record file in `/root/claim-trial`. Tell the claim session about these before its window. |
| + |
| +--- |
| + |
| +## 3. Flagship roll |
| + |
| +Boxes first, then the console, per the roll recipe. The flagship boxes are unarmed and have no floor, so this is a normal `system update` with no identity and no re-arm. The console is unguarded, so it is a normal `roll-console.sh`. The third-party deployment is never rolled. |
| + |
| +### 3.0 Gates |
| + |
| +- Section 1 passed (all of 1.g) and section 2 passed (2.7), or Paul says to go ahead without 2. |
| +- A release-specific scale check (#281): dev cannot catch scale-only failures (v0.26.0's instance-key backfill outran the 20 s update gate on 127 instances). The flagship ie box has 118 instance slices. Watch its update gate in 3.2. |
| +- Sydney (au) took longer than the gate before (`au-box-gate-failure`, fixed in 1b48ed5, 2026-09-21). Watch it. |
| + |
| +### 3.1 Read-only pre-checks (DOCS-T1) |
| + |
| +Flagship is on v0.28.0, so the operator notes of v0.28.1 to v0.28.4 all apply to this roll: v0.28.1 (each box gets an idle join unit, `carlos-system-join.path`; a box silent for 24 hours drops out of status), v0.28.2 (the console reports the release tag as its version), v0.28.3 (`install-channel --policy`, nothing runs it), v0.28.4 (console email can switch itself on when `CARLOS_MAIL_REGION` and a sending address are set; invites now arrive; 20 pending invites and 20 sent per hour per account) and v0.28.5 (`NOTES.md`). Nothing needs doing for the dormant switches. Note: the v0.28.5 notes say to leave `CARLOS_SWAP` unset, but it is set on all seven boxes (zero-downtime deploys, armed 2026-10-14); leave it as it is. |
| + |
| +```bash |
| +carlos system status --console "$FLAGC" |
| +fie 'df -h / /data | cat; /opt/carlos/carlos version 2>&1 | tail -1; ls /opt/carlos/versions | wc -l' |
| +fus 'df -h / | tail -1; /opt/carlos/carlos version 2>&1 | tail -1' |
| +fuk 'df -h / | tail -1; /opt/carlos/carlos version 2>&1 | tail -1' |
| +fau 'df -h / | tail -1; /opt/carlos/carlos version 2>&1 | tail -1' |
| +``` |
| + |
| +Pass: four boxes `current` at v0.28.0, none held; disk has room for a 50 MB binary and a stage (the ie disk was grown to 60 GiB by hand); each box prints `carlos v0.28.0`. |
| + |
| +The console mail check, the claim runbook's P9 command run on the flagship console box (profile `keymail`, `i-092c0c1eea75723cb`): |
| + |
| +```bash |
| +fie "$(cat "$W/p9.box.sh")" |
| +``` |
| + |
| +where `$W/p9.box.sh` is the P9 box command (Appendix A). Pass: `console mail: OFF`. A `SET` line means the v0.28.4 console would create an SES identity and DNS records on its first start: Paul decides before 3.5. |
| + |
| +The flagship console's door state before the roll: nothing to read yet (the offline doors arrive with 3.5). |
| + |
| +### 3.2 The boxes |
| + |
| +> **Paul's go: G11.** `carlos system update` on the flagship's stable channel rolls all four boxes (ie, us, uk, au) within the 5 minute spread. It cannot canary one box. |
| + |
| +```bash |
| +carlos system update --console "$FLAGC" --channel stable --version "$TAG" --yes |
| +carlos system status --console "$FLAGC" |
| +``` |
| + |
| +Watch for about 10 minutes (3 of 4 boxes were current in about 6 minutes for v0.19.0; au is slower): |
| + |
| +```bash |
| +carlos system status --console "$FLAGC" |
| +fie 'journalctl -u carlos-system-update.service --no-pager -n 25' |
| +fau 'journalctl -u carlos-system-update.service --no-pager -n 25' |
| +``` |
| + |
| +Pass: every box `current` at v0.28.5. A box that reads `rolled-back` or `refused` says why on the same line: fix that box, do not re-cut the release. If ie rolls back on the gate (the #281 shape), STOP and tell Paul; do not touch the console. |
| + |
| +Per-box evidence (each of `fie`, `fus`, `fuk`, `fau`): |
| + |
| +```bash |
| +BLOCK='cat /opt/carlos/system/router/result.json; echo; /opt/carlos/carlos version 2>&1 | tail -1; /opt/carlos/carlos.prev version 2>&1 | tail -1; systemctl show carlos-edge.service -p NRestarts -p ExecMainStartTimestamp -p User -p Delegate; systemctl is-active carlos-instance-control carlos-stage.path carlos-system-update.path carlos-system-join.path' |
| +fie "$BLOCK"; fus "$BLOCK"; fuk "$BLOCK"; fau "$BLOCK" |
| +``` |
| + |
| +Pass: outcome `applied` for v0.28.5, `carlos v0.28.5` and `.prev` `carlos v0.28.0`, `User=carlos`, `Delegate=yes`, the units active (`carlos-system-join.path` is new and idle; `active` is right). |
| + |
| +### 3.3 After the boxes |
| + |
| +```bash |
| +carlos system status --console "$FLAGC" |
| +``` |
| + |
| +v0.28.5's `system status` warns when a new box would boot an older build ("bootstrap/carlos is not stable's build"): it compares `bootstrap/carlos` with stable's build and names the file to copy over it. |
| + |
| +> **Paul's go: G12** (only if the warning appears). Copy exactly the file the warning names, as the release recipe's copy step does, with the `keymail` profile. Not rehearsed in Run 9 (the harness's `bootstrap/carlos` was step 6's seed). |
| + |
| +### 3.4 The edges files: every box in ie and uk publishes `offline-move-1` |
| + |
| +The capability is the first thing the doors check (MV-O21), and it is published per pass, so allow a few minutes after the roll: |
| + |
| +```bash |
| +for k in $(aws --profile keymail s3 ls "s3://$FLAGB/control/edges/" | awk '{print $4}'); do |
| + echo "== $k"; aws --profile keymail s3 cp --quiet "s3://$FLAGB/control/edges/$k" - | jq -c '{region, placement, caps: .capabilities, secrets_key_fp, hibernation_configured, serves_shared_pool, data_bucket, hosts: (.hosts | length)}' |
| +done |
| +``` |
| + |
| +Pass: |
| +- four files, one per live box, no stale file (a file naming the home placement for a box that no longer exists blocks `seal`; removal needs Paul); |
| +- the ie box and the uk box both have `offline-move-1` in `caps`; also check us and au, so a missing capability anywhere is seen; |
| +- `hibernation_configured` true on each; |
| +- every `secrets_key_fp` equal to the others (the UK box must hold the same secrets key as the console, MV-O23 checks the fingerprint); |
| +- the uk box has `placement uk` and a `data_bucket` (this is `UKDATA` for section 4). |
| + |
| +If a box is missing the capability, read its `host.env` for `CARLOS_HOST_CLAIM` and `CARLOS_MOVES_PHASE1` (both must be unset) and for `CARLOS_HIBERNATE_BUCKET` (must be set), and its edge journal. STOP and tell Paul; do not start a move. |
| + |
| +### 3.5 The console |
| + |
| +> **Paul's go: G13.** Builds the console from the clean release checkout and rolls it on the flagship, then verifies the running binary. Pass `flagship` explicitly: the script's default is `both`, which includes the third-party deployment. |
| + |
| +```bash |
| +git -C "$REL/src" status --porcelain | wc -l |
| +git -C "$REL/src" rev-parse --short HEAD |
| +"$PINFRA/scripts/roll-console.sh" "$REL/src" flagship |
| +curl -sI https://platform.carlosframework.com/ | grep -i x-carlos-version |
| +curl -sI "$FLAGC/" | grep -i x-carlos-version |
| +``` |
| + |
| +Pass: `0` and `54ae7fb9` before the script (it refuses a dirty tree); the script ends `console 54ae7fb9 live at https://platform.carlosframework.com` after "verify the running binary IS this build" (it reads `/proc/<pid>/exe` on the box and compares it to `versions/54ae7fb9/console`); both headers show the new version. Note: `roll-console.sh` builds the console itself from the checkout, so the flagship runs a build stamped `54ae7fb9`, not the prebuilt `v0.28.5` that dev runs. If Paul wants flagship to run the exact dev bytes, the alternative is `ship-app.sh` with the prebuilt file and then the script's adopt and restart steps; that is not rehearsed. |
| + |
| +Then the doors (M1) and the roll evidence: |
| + |
| +```bash |
| +carlos move offline status --host canada.bdn.oncarlos.com --app <APP> --account <ACCT> --console "$FLAGC"; echo "exit $?" |
| +carlos system status --console "$FLAGC" |
| +fie 'systemctl is-active console.service; p=$(systemctl show -p MainPID --value console.service); readlink /proc/$p/exe; tr "\0" "\n" < /proc/$p/environ | grep -E "^CARLOS_(HOST_CLAIM|MOVES_PHASE1)=" | wc -l' |
| +``` |
| + |
| +Pass: the status door answers (the plan's MV-O24 sentence) rather than a 404 (find `<APP>` and `<ACCT>` in 4.1); every box `current` at v0.28.5; the console `active`, running `versions/54ae7fb9/console`; 0 claim or Phase 1 variables. Roll back the console, if it must be, with `roll-console.sh` on the previous checkout; the app regions floor in the README does not apply (`CONSOLE_APP_REGIONS` is off). |
| + |
| +### 3.6 If a step fails |
| + |
| +| Failure | Action | |
| +|---|---| |
| +| A box `rolled-back` or `refused` | read the reason on its status line; fix that box; do not re-cut. Console waits | |
| +| ie fails the 20 s update gate | STOP; Paul | |
| +| `offline-move-1` missing on a box | STOP; no move | |
| +| The console script cannot verify the exe | do not retry blindly; read the script's message; Paul | |
| + |
| +--- |
| + |
| +## 4. The first flagship moves: canada, ips, kpmg |
| + |
| +Instances `canada.bdn.oncarlos.com`, `ips.bdn.oncarlos.com` and `kpmg.bdn.oncarlos.com`, on the ie box (`annie-welding`, `i-092c0c1eea75723cb`), from Ireland (the home placement, record region `""`, console name `ie`) to the UK (`uk`, eu-west-2, box `i-03c310ceaf50a9bab`). One at a time, each its own go, each started only after the previous one is finished and checked. No promotes to the app during a move. |
| + |
| +### 4.0 What has been measured (read-only, 2026-10-20) |
| + |
| +From `own/after236/`: |
| +- **Cgroup accounting** (`cgroup-delegation-check-20261020.md`, about 00:45Z): all seven boxes have `Delegate=yes`, `User=carlos`, controllers `cpu io memory pids`, a successful agent setup. Flagship was on v0.28.0. On ie, `carlos-exec@amadan.net` had 53 processes (a real count), 118 instance slices, 14 with processes. No box has `CARLOS_HOST_CLAIM` or `CARLOS_MOVES_PHASE1`; all have `CARLOS_HIBERNATE_BUCKET` set. |
| +- **Layout** (`flagship-layout-20261020.txt`): canada, ips and kpmg are `nested`. Each row says "still in /data from before its move, where the instance cannot see them: /data/<host>". The ie box also runs flat, foreign and external rows beside nested ones, so `carlos status --layout` warns that nested isolation on it "is not in force until none of those remains". The move does not depend on that, and does not change it. |
| +- **Legacy `/data/<host>` dirs** (`legacy-data-dirs-20261020.md`): they hold only old key and token copies, byte-identical (`cmp`) to the copies in the nested directory: canada 8K (`instance.key`), ips 12K (`instance.key`, `report.token`), kpmg 12K (the same two). Nothing live reads them. The move's `source-retire` parks `/data/<host>/`. |
| +- **Nested sizes** (the whole nested directory, litestream files included): canada 20M, ips 538M, kpmg 308M, each about 121 to 123 entries. The files tree has a 256 MiB limit (4.1 measures it). |
| +- **A question left open:** each nested `<host>/` also holds `instance.key.minted-after-migration-1791381051` (2026-10-07), different from the legacy key. Which key the live process uses was not confirmed. The move carries both byte for byte; 4.1 records the digests before so they can be compared after. |
| + |
| +### 4.1 Pre-checks on the day, as commands |
| + |
| +> **Paul's go: G14 (D8).** Moves were frozen on 2026-10-16 while the claim gate was narrowed. Lifting the freeze for this operator-run tool on flagship is Paul's decision, taken awake. Nothing below writes. |
| + |
| +Find the account and app of each instance (not recorded in the sources; set `ACCT` and `APP` for the move block from this): |
| + |
| +```bash |
| +carlos apps list --console "$FLAGC" |
| +carlos instances list --app <candidate app> --match canada --console "$FLAGC" |
| +``` |
| + |
| +P0.2 (M9) on the four flagship boxes, the same `BLOCK` as 2.1 through `fie`, `fus`, `fuk`, `fau`. Pass: claim and Phase 1 counts 0, `User=carlos` (R3: any other value is a STOP), `Delegate=yes`, `carlos-stage.path` active and enabled (the UK box at least), `carlos v0.28.5`, no guard policy (unarmed). The console (3.5) shows no claim or Phase 1 variables. |
| + |
| +P0.3: |
| + |
| +```bash |
| +for h in canada ips kpmg; do |
| + H=$h.bdn.oncarlos.com |
| + aws --profile keymail s3api head-object --bucket "$FLAGB" --key "control/hosts/$H.json" >/dev/null 2>&1 && echo "control/hosts/$H.json PRESENT" || echo "control/hosts/$H.json absent" |
| + aws --profile keymail s3 ls "s3://$FLAGB/control/certs/$H" | wc -l |
| +done |
| +aws --profile keymail s3api head-object --bucket "$FLAGB" --key control/hosts-backfill.json >/dev/null 2>&1 && echo "hosts-backfill PRESENT" || echo "control/hosts-backfill.json absent" |
| +carlos status --layout --console "$FLAGC" | grep -E 'canada|ips\.bdn|kpmg' |
| +UKDATA=$(fuk 'grep "^CARLOS_HIBERNATE_BUCKET=" /etc/carlos/host.env | cut -d= -f2- | tr -d "\""' | tail -1); echo "uk data: $UKDATA" |
| +``` |
| + |
| +Pass: all `absent`; at least one object under `control/certs/<host>` for each host (a certificate path on the UK box, #310; the edges' mirror serves it); the three rows `nested`. The `ie` box is the only box in the home region and the uk box the only one in `uk` (MV-O22, MV-O26 assume it); `3.4` showed it. |
| + |
| +The instance record, per host (class refusals are enforced by the door, but read the record before the window): |
| + |
| +```bash |
| +aws --profile keymail s3 cp --quiet "s3://$FLAGB/apps/$ACCT/$APP/instances/$H.json" - | jq . |
| +``` |
| + |
| +Pass: no seed, replica or replicas, steering, unit, fleet, pool or open run on the record; hibernating. The door refuses those classes (the plan's `class` row), so a surprise is a STOP rather than a workaround. |
| + |
| +P0.6 per instance, on the ie box (the nested directory is the real one, `/data/.instances/<host>`; `/data/instances/<host>` is the mount view): |
| + |
| +```bash |
| +for H in canada.bdn.oncarlos.com ips.bdn.oncarlos.com kpmg.bdn.oncarlos.com; do |
| + fie "set -- $H; $(cat "$W/sizes.box.sh")" |
| +done |
| +``` |
| + |
| +Pass: the files tree (`du -sb`, first number) under 268435456 bytes (256 MiB; over that the seal fails safely and the move cannot proceed); no sidecar file (MV-O28); the legacy directory holds only the key copies. Record the database size: seal and landing time scale with it. |
| + |
| +Key digests and shape, before (sha256 prefixes only): |
| + |
| +```bash |
| +for H in canada.bdn.oncarlos.com ips.bdn.oncarlos.com kpmg.bdn.oncarlos.com; do |
| + fie "set -- $H; $(cat "$W/keys.box.sh")" |
| +done |
| +``` |
| + |
| +Save to `$EVID`. P0.5: Paul's login is a system operator and a member of the customer's account (the doors check both; they answer a byte-identical 404 otherwise), and the customer's own sign-in is something Paul can test after `open`. |
| + |
| +P0.7: the edges files in 3.4 showed no stale file. The UK staging lane (P0.4): simulate the IE box role against the UK data bucket from DOCS-T1, as in 2.1, with the flagship role (find it with `aws --profile keymail ec2 describe-instances --instance-ids "$FIE" --query 'Reservations[0].Instances[0].IamInstanceProfile.Arn'` then `aws --profile keymail iam get-instance-profile --instance-profile-name <name>`). Pass: `allowed` for put, get, delete on `moves/*` and list on the `moves/` prefix. Not rehearsed. |
| + |
| +### 4.2 The return lane (infra, Paul's approval) |
| + |
| +> **Paul's go: G15.** IE's `sibling_staging_arns` includes the UK data bucket (as read in carloku-infrastructure); UK's grant to the IE data bucket is not applied. Without it, a move back after `open` is impossible and the only road is fixing forward on the UK box. Applying it is a production infra change; the plan recommends doing it before the first move (M17 approved the return lane). Decide before G16. This runbook gives no command for it: it is carloku-infrastructure work. |
| + |
| +If G15 is not given, every move is committed at `open` and the rollback paths in 4.8 are only fix-forward. |
| + |
| +### 4.3 Downtime budget |
| + |
| +Run 9 measured (M10), for a 4 MB instance: start 2.2 s, seal 6.1 s, flip 4.3 s, open 4.2 s, first request 5.7 s: about 23 to 25 s of steps. The offline total was 366 s because of defect 7 (a late first flip of 2 min 40 s of the operator's own, and about 1 min 10 s waiting for the 5 minute moves pass). So: |
| + |
| +| | Today (v0.28.5) | Once defect 7 is fixed | |
| +|---|---|---| |
| +| Offline per instance | about 6 minutes: dominated by the report wait before `flip` and again before `open` (up to about 6 minutes each if a report has gone stale, retried every 15 s) | under 1 minute for a small instance | |
| +| Worst case to plan the window for | start + seal + two stale-report waits + landing + first request: about 15 minutes for a small instance | about 2 minutes | |
| +| `finish` | 4 to 5 minutes more, with the instance serving; not downtime | same | |
| +| Second stop | about an hour after `open`, 20 to 30 s (4.6) | same | |
| + |
| +The three customer instances are larger than 4 MB: canada 20M, kpmg 308M and ips 538M of nested directory. Seal (the final mirror round) and the landing's verification scale with the replica and files, and Run 9 did not measure them. So move canada first, record its `start`, `seal`, `flip`, `open` and first-request times, and set the window for ips and kpmg from canada's seal time scaled by size. Offer the customer a window longer than the expected offline time: 15 minutes for canada, and a figure from canada's measurements for the others. |
| + |
| +Things the customer will see: timers due while the instance is offline do not fire (refused "maintenance fence active", then gone); once-timers armed by the app are carried and fire at their due time; schedule run history does not carry, so a schedule may fire once more or once less around the window. |
| + |
| +### 4.4 The customer notice line |
| + |
| +A draft for Paul to edit and send; it has not been through copy review. One line per instance: |
| + |
| +> We will move `<host>` to our UK region on `<date>` at `<time>` UTC. It will be offline for about 6 minutes, and we have booked up to `<window>`. Nothing is lost: your data moves with it, and if anything looks wrong before we reopen it, we put everything back as it was. Scheduled jobs that fall due while it is offline will not run. |
| + |
| +Send it at least a day ahead, and tell the customer's contact when each move starts and finishes. |
| + |
| +### 4.5 The move |
| + |
| +For each instance in turn: canada, then ips, then kpmg. The move block is 2.3's (`MV`, `MVR`, `ts`) with these values: |
| + |
| +```bash |
| +H=canada.bdn.oncarlos.com APP=<APP> ACCT=<ACCT> C=$FLAGC |
| +IEDATA=$(fie 'grep "^CARLOS_HIBERNATE_BUCKET=" /etc/carlos/host.env | cut -d= -f2- | tr -d "\""' | tail -1) |
| +UKIP=$(aws --profile keymail --region eu-west-2 ec2 describe-instances --instance-ids "$FUK" --query 'Reservations[0].Instances[0].PublicIpAddress' --output text) |
| +IEIP=$(aws --profile keymail --region eu-west-1 ec2 describe-instances --instance-ids "$FIE" --query 'Reservations[0].Instances[0].PublicIpAddress' --output text) |
| +``` |
| + |
| +Use `facts` through `fie` and `fuk` (Appendix A) in place of `sophie` and `dennis`, and `--profile keymail` and `$FLAGB`/`$IEDATA`/`$UKDATA` in place of the dev values. The customer's app has no `/report`; the evidence below is app-agnostic. |
| + |
| +> **Paul's go: G16 (canada), G17 (ips), G18 (kpmg).** One each. The instance is offline from `start` until `open`. Do not start the next one until `finish` has completed and 4.7 is done for this one. |
| + |
| +Before (once per instance, read-only, save to `$EVID`): |
| + |
| +```bash |
| +fie "set -- $H; $(cat "$W/facts.box.sh")" |
| +aws --profile keymail s3 cp --quiet "s3://$IEDATA/instances/$H/lock.json" - | jq -c . |
| +curl -s -m 30 -o /dev/null -w 'ie before: %{http_code} %{time_total}s\n' --resolve $H:443:$IEIP https://$H/ |
| +carlos schedule ls --app "$APP" --account "$ACCT" --console "$FLAGC" |
| +``` |
| + |
| +M5 on the customer's instance: the move's landing renders `<host>.config.env` on the target from the bundle. Do not change any setting on a customer's instance to cure a missing file. |
| + |
| +The sequence, with the corrections: |
| + |
| +```bash |
| +T0=$(date +%s); echo "start $(ts)" |
| +MV start "--to uk"; echo "start exit=$? $(ts)" |
| +MV status |
| +echo "seal $(ts)"; MV seal; echo "seal exit=$? $(ts)" |
| +MV status |
| +fie "set -- $H; $(cat "$W/procs.box.sh")" |
| +carlos logs --app "$APP" --account "$ACCT" --console "$FLAGC" --since 15m | grep -E 'exited|stopp|fence' | tail -3 |
| +echo "flip $(ts)"; MVR flip; echo "flip exit=$? $(ts)" |
| +``` |
| + |
| +Read `status` between the doors. `flip` within two minutes of `seal`, and `open` within two minutes of `flip` (M2). A stale-report refusal ("still runs a process" with "Its report is not current") is retried by `MVR`; a current report with a real process count is MV-O31: STOP and `abort`. `start` waits for every box in ie to say it stopped the host (the flagship has one): a box that never reports blocks `seal`; the move waits and `abort` is always available before `open`. |
| + |
| +Check the target before opening: |
| + |
| +```bash |
| +fuk "set -- $H; $(cat "$W/facts.box.sh")" |
| +``` |
| + |
| +Pass: the row is `landing`, region uk, flat; `<host>.env` sha equal to the IE box's; the instance key digest equal; `config.env` present with the same names as before; the `instance.key` digest equal; the timers carried. Anything missing: `abort` (4.8). Only then: |
| + |
| +```bash |
| +echo "open $(ts)"; MVR open; echo "open exit=$? $(ts)" |
| +for i in $(seq 1 60); do c=$(curl -s -m 30 -o /dev/null -w '%{http_code}' --resolve $H:443:$UKIP https://$H/); echo "uk $c $(ts)"; case "$c" in 2*|3*) break;; esac; sleep 3; done |
| +echo "serving: $(( $(date +%s) - T0 )) s since start" |
| +curl -sI --resolve $H:443:$UKIP https://$H/ | head -8 |
| +curl -sI --resolve $H:443:$IEIP https://$H/ | head -8 |
| +curl -sI https://$H/ | head -8 |
| +``` |
| + |
| +Pass: a 2xx from the UK address and from the IE address (the IE box backhauls to uk), the same headers and the expected version, and the customer's own sign-in works (Paul, or the customer's contact). The first request waits for the agent's stage and root's stage pass (about 8 s); a longer wait means `carlos-stage.path` is not armed on the UK box (3.2 showed it). A failing check after `open` is fixed forward on the UK box, where the only live copy is (abort is refused, MV-O27). |
| + |
| +Then `finish`: |
| + |
| +```bash |
| +echo "finish $(ts)"; MVR finish; echo "finish exit=$? $(ts)" |
| +MV status |
| +``` |
| + |
| +Expected: "Waiting for <box> to clean up <host>." then "Moved. <host> is served from uk. It was offline for <n> seconds." and exit 0, after 4 to 5 minutes. |
| + |
| +### 4.6 The nesting second stop |
| + |
| +After `open` the row on the UK box is flat. The layout pass nests it only when it is asleep, or stops it after a 1-hour grace and nests it (Run 9: exactly 1 h after the first wake, a 24 s second stop). A hibernating customer instance will usually sleep first, in which case there is no second stop. Tell the customer's contact to expect a stop of under a minute about an hour after the move if the instance is still awake. About an hour after `open`: |
| + |
| +```bash |
| +carlos status --layout --console "$FLAGC" | grep -E "$H|WARNING" |
| +fuk "journalctl -u carlos-edge --no-pager --since '-80 min' | grep -E 'layout: ' | grep $H | tail -5" |
| +carlos logs --app "$APP" --account "$ACCT" --console "$FLAGC" --since 90m | grep -E 'instance (stopping|exited|woke)' | tail -5 |
| +curl -s -m 30 -o /dev/null -w 'uk after nesting: %{http_code}\n' --resolve $H:443:$UKIP https://$H/ |
| +``` |
| + |
| +Pass: the host shows `nested` on the UK box (and the "nested beside flat" warning gone for that row), one stop and wake at most, the instance answers 2xx. Do the next move after this check, not before, so two instances are never being nested at once. |
| + |
| +### 4.7 Cleanup after each `finish` |
| + |
| +1. **Stray env file (M6, defect 8).** On the IE box: |
| + |
| + ```bash |
| + fie "set -- $H check; $(cat "$W/stray.box.sh")" |
| + ``` |
| + |
| + If a `<host>.env` is there (written by the source's scheduler after `open`), move it into `/data/.offline-moves/<host>/<id>/source/` and record it; never delete it: |
| + |
| + ```bash |
| + fie "set -- $H move; $(cat "$W/stray.box.sh")" |
| + ``` |
| + |
| +2. **The lease (M7).** The IE `instances/<host>/lock.json` is `owner moved:<id>` with `expires_at 1970-01-01T00:00:00Z`: that expired object is the normal end state, not an abandoned move. |
| + |
| + ```bash |
| + aws --profile keymail s3 cp --quiet "s3://$IEDATA/instances/$H/lock.json" - | jq -c . |
| + aws --profile keymail s3 cp --quiet "s3://$UKDATA/instances/$H/lock.json" - | jq -c . |
| + aws --profile keymail s3 cp --quiet "s3://$FLAGB/apps/$ACCT/$APP/instances/$H.json" - | jq -c '{region, move, last_move, record_seq}' |
| + ``` |
| + |
| + Pass: IE's is expired `moved:<id>`; UK's is the UK box's own lease; the record has region `uk`, `move` null, `last_move` outcome `done`. The cleanup recipe is only for a `moved:` owner whose `expires_at` is still in the future for a move no longer in flight (read it with the lock above; if the move is not in flight, delete that one object; the 7-day expiry frees it anyway). |
| +3. **Parked state, never deleted.** `/data/.offline-moves/<host>/<id>/` on the IE box holds `sealer/`, `source/instance/`, `source/<host>.json` and the legacy `/data/<host>/` copy. `/data/instances/<host>` (the mount view), `/data/.instances/<host>` (empty) and `/opt/carlos/live/<host>` (a root-owned link) stay in place by design. List them and add them to the record for the claim census. |
| +4. **The IE row is gone.** `carlos status --layout --console "$FLAGC" | grep "$H"` shows the host on the UK box only. |
| +5. The notice: tell the customer's contact it is done. |
| + |
| +### 4.8 Rollback paths |
| + |
| +**Before `open`: abort.** At any doubt, a failed item, a target missing `config.env`, or a real MV-O31. |
| + |
| +```bash |
| +MVR abort; echo "abort exit=$?" |
| +MV finish; echo "finish exit=$?" |
| +``` |
| + |
| +Both exit 3 (M8): the CLI's "aborted" code, the expected result, not a failure. `abort` prints "Moving <host> back to ie." and `finish` "<host> is back in ie and serving. Nothing was lost." Run 9 (abort after flip): 23 s offline in all. Verify: the IE row `ready` and nested, a 2xx from the IE address, the IE lease `<box>:<n>` at generation 2, no lease and no `moves/<host>` objects in the UK bucket, no row on the UK box (it parks what it extracted under `/data/.offline-moves/<host>/<id>/target/`), the record back in home with `last_move` outcome `aborted`. The source's local database was never purged, so nothing is lost. |
| + |
| +**After `open`.** `abort` is refused (MV-O27). The UK box holds the only live copy and may have taken writes. Two roads: |
| +1. **Fix forward on the UK box.** The usual answer. Most failures after `open` (an app that cannot boot on uk, a certificate, a store reachability problem) are found in the first minute by the checks in 4.5. |
| +2. **A new move back, uk to ie.** It needs UK's staging grant on the IE data bucket (G15, infra, Paul's approval), and it is unrehearsed. Before starting it, read the live link on the IE box: |
| + |
| + ```bash |
| + fie "H=$H; readlink /opt/carlos/live/\$H" |
| + ``` |
| + |
| + If it names a different version from the one the instance runs now (the app was promoted since), do not start: the return move's landing fails the `release` item (MV-O177), and there is no safe road to clear the root-owned link from here. Take it to Paul. If the grant is not in place, fix forward and file the gap. |
| + |
| +--- |
| + |
| +## 5. Cleanup of this runbook's own scratch |
| + |
| +At the end of the work, by exact path: |
| + |
| +```bash |
| +rm -r -- "$W" |
| +``` |
| + |
| +Remove `$W` (helpers, the identity copy, the rehearsal secrets and binary); `$D` was removed in 1.a.5. Keep `$EVID` (`~/.cache/release-v0.28.5/evidence-roll-20261020`) until Paul says. No server, watcher or background process was started by this runbook. The E1 aside directory goes in 2.8 only. |
| + |
| +--- |
| + |
| +## Appendix A. Helpers |
| + |
| +`ssm.sh` runs one command as root on a box over SSM and prints its stdout; it is the claim runbook's "How commands are run" helper with a profile argument, stdout and stderr kept apart, and a non-zero exit unless the command succeeded. One deliberate change: the command goes into a temporary file and runs with stdin closed, instead of being piped into `bash`, because `systemd-run --pipe` (the re-arm's apply step) would otherwise read the rest of the piped script. SSM returns at most 24,000 characters per command. |
| + |
| +```bash |
| +mkdir -p "$TMPDIR/v0285" |
| +cat > "$TMPDIR/v0285/ssm.sh" <<'EOF' |
| +#!/bin/bash |
| +# usage: ssm.sh <profile> <region> <instance-id> '<shell command>' |
| +set -euo pipefail |
| +profile=$1 region=$2 inst=$3 cmd=$4 |
| +b64=$(printf '%s' "$cmd" | base64 -w0) |
| +params=$(python3 -I -c 'import json,sys;print(json.dumps({"commands":["f=$(mktemp) && echo %s | base64 -d > $f && bash $f </dev/null; rc=$?; rm -f $f; exit $rc" % sys.argv[1]]}))' "$b64") |
| +id=$(aws --profile "$profile" --region "$region" ssm send-command --instance-ids "$inst" \ |
| + --document-name AWS-RunShellScript --parameters "$params" --query Command.CommandId --output text) |
| +until s=$(aws --profile "$profile" --region "$region" ssm get-command-invocation --command-id "$id" \ |
| + --instance-id "$inst" --query Status --output text 2>/dev/null) && [ "$s" != InProgress ] && [ "$s" != Pending ]; do sleep 3; done |
| +aws --profile "$profile" --region "$region" ssm get-command-invocation --command-id "$id" --instance-id "$inst" \ |
| + --query StandardOutputContent --output text |
| +aws --profile "$profile" --region "$region" ssm get-command-invocation --command-id "$id" --instance-id "$inst" \ |
| + --query StandardErrorContent --output text >&2 |
| +[ "$s" = Success ] |
| +EOF |
| +chmod 700 "$TMPDIR/v0285/ssm.sh" |
| +SSM="$TMPDIR/v0285/ssm.sh" |
| +leo() { "$SSM" kass eu-west-1 "$LEO" "$1"; } |
| +sophie() { "$SSM" kass eu-west-1 "$SOPHIE" "$1"; } |
| +dennis() { "$SSM" kass eu-west-2 "$DENNIS" "$1"; } |
| +fie() { "$SSM" keymail eu-west-1 "$FIE" "$1"; } |
| +fus() { "$SSM" keymail us-east-1 "$FUS" "$1"; } |
| +fuk() { "$SSM" keymail eu-west-2 "$FUK" "$1"; } |
| +fau() { "$SSM" keymail ap-southeast-2 "$FAU" "$1"; } |
| +``` |
| + |
| +The roster, read-only, from sophie's own credentials (C4: run it after each console-driven update, promote or rollback; it stages nothing): |
| + |
| +```bash |
| +rosterview() { |
| + sophie 'cd /root/claim-trial && /opt/carlos/carlos system claims inspect --bucket carlos-dev-640012953448 --aws-region eu-west-1 --public-key "$(cat release.pub)" 2>/dev/null' \ |
| + | jq -c '{rev: .roster.revision, activations: (.roster.activations | keys)}' |
| +} |
| +``` |
| + |
| +`p9.box.sh` is the claim runbook's P9 box command (console mail is off), verbatim. The harness kept it as a file; copy it, or extract the block from the claim runbook: |
| + |
| +```bash |
| +cp "$HOME/amadan.net/carlos/platform-harness-build/harness/scenarios/cohort1/blocks/p9.box.sh" "$W/p9.box.sh" |
| +``` |
| + |
| +`ssm_run`, `box_get`, `box_put` and `box_inspect` are the claim runbook's second helper block in "5.1 Roster and enrollment", pasted unchanged, after `export AWS_PROFILE=kass R=eu-west-1`. `box_put` writes with `>` and `box_inspect` stages `roster.json` and `rev` in `/root/claim-trial` on the box it is given (scratch, overwritten each time). |
| + |
| +`facts.box.sh` is Run 9's `facts`, a box script that takes the host as `$1`. Save it once: |
| + |
| +```bash |
| +cat > "$W/facts.box.sh" <<'EOF' |
| +H=$1 |
| +for d in /data/instances/$H /data; do [ -f $d/$H.env ] && { E=$d/$H.env; break; }; done |
| +echo " env file: ${E:-absent} $( [ -n "${E:-}" ] && sha256sum < $E | cut -c1-16) key-sha $( [ -n "${E:-}" ] && grep ^CARLOS_INSTANCE_KEY= $E | cut -d= -f2- | tr -d '"\n' | sha256sum | cut -c1-16)" |
| +for f in /data/instances/$H/$H.config.env /data/$H.config.env; do [ -f $f ] && echo " config.env $f: $(cut -d= -f1 $f | sort | tr '\n' ' ')"; done |
| +for f in /data/instances/$H/$H/instance.key /data/$H/instance.key; do [ -f $f ] && echo " files: $f sha $(sha256sum < $f | cut -c1-16)"; done |
| +ls /data/instances/$H 2>/dev/null | tr '\n' ' ' | sed 's/^/ instance dir: /'; echo |
| +python3 - $H <<'PY' |
| +import sqlite3,sys |
| +h=sys.argv[1]; c=sqlite3.connect('file:/data/registry.db?mode=ro',uri=True) |
| +r=c.execute('select status,last_error,region,db_path,next_due,replication from routes where host=?',(h,)).fetchall() |
| +print(' row:', r) |
| +try: print(' timers:', c.execute('select * from timers where host=?',(h,)).fetchall()) |
| +except Exception as e: print(' timers: ?', e) |
| +PY |
| +ls -d /data/.offline-moves/$H/*/* 2>/dev/null | sed 's/^/ parked: /' |
| +EOF |
| +``` |
| + |
| +The other small box scripts, each taking the host as `$1`. Save them once: |
| + |
| +```bash |
| +# cfg.box.sh: M5, is the nested instance's config.env rendered? |
| +cat > "$W/cfg.box.sh" <<'EOF' |
| +H=$1 |
| +echo "== $H" |
| +ls -la /data/instances/$H/ 2>&1 | head -12 |
| +f=/data/instances/$H/$H.config.env |
| +if [ -f $f ]; then echo "config.env names: $(cut -d= -f1 $f | sort | tr '\n' ' ')"; else echo "config.env MISSING"; fi |
| +EOF |
| +# procs.box.sh: how many processes the host's cgroup slice holds (the operator's check before flip) |
| +cat > "$W/procs.box.sh" <<'EOF' |
| +H=$1 |
| +f=$(find /sys/fs/cgroup/carlos.slice/carlos-instances.slice -maxdepth 1 -name "carlos-instances-$H.slice" 2>/dev/null | head -1) |
| +echo "slice: ${f:-none}" |
| +if [ -n "$f" ]; then echo "processes: $(cat $f/cgroup.procs | wc -l)"; else echo "processes: 0 (no slice)"; fi |
| +d=$(find /sys/fs/cgroup/carlos.slice/carlos-edge.service -maxdepth 1 -name "carlos-exec@$H" 2>/dev/null | head -1) |
| +if [ -n "$d" ]; then echo "exec cgroup $d processes: $(cat $d/cgroup.procs | wc -l)"; fi |
| +EOF |
| +# stray.box.sh <host> check|move: M6, the env file the source's scheduler re-creates after open (defect 8) |
| +cat > "$W/stray.box.sh" <<'EOF' |
| +H=$1 MODE=${2:-check} |
| +echo "== /data/.instances/$H"; ls -la /data/.instances/$H/ 2>&1 |
| +echo "== parked"; ls -d /data/.offline-moves/$H/*/* 2>&1 |
| +if [ "$MODE" = move ]; then |
| + ID=$(ls /data/.offline-moves/$H | head -1) |
| + if [ -z "$ID" ] || [ ! -f /data/.instances/$H/$H.env ]; then echo "nothing to move"; exit 0; fi |
| + mv -n /data/.instances/$H/$H.env /data/.offline-moves/$H/$ID/source/$H.env.stray-after-open |
| + ls -la /data/.offline-moves/$H/$ID/source/ |
| +fi |
| +EOF |
| +# sizes.box.sh: P0.6, files tree (limit 256 MiB), nested directory, database, sidecars, the legacy /data/<host> |
| +cat > "$W/sizes.box.sh" <<'EOF' |
| +H=$1; D=/data/.instances/$H |
| +echo "== $H" |
| +echo "files tree bytes: $(du -sb $D/$H 2>/dev/null | cut -f1)" |
| +echo "nested dir: $(du -sh $D | cut -f1)" |
| +ls -l $D/$H.db 2>&1 | awk '{print "db bytes:", $5}' |
| +ls $D/*sidecar* /data/$H-sidecar.env 2>&1 | head -2 |
| +ls -la /data/$H 2>&1 | head -6 |
| +EOF |
| +# keys.box.sh: sha256 prefixes of the instance key and the key files (never the values) |
| +cat > "$W/keys.box.sh" <<'EOF' |
| +H=$1; D=/data/.instances/$H |
| +echo "== $H" |
| +printf 'env CARLOS_INSTANCE_KEY %s\n' "$(grep ^CARLOS_INSTANCE_KEY= $D/$H.env | cut -d= -f2- | tr -d '"\n' | sha256sum | cut -c1-16)" |
| +for f in $D/$H/instance.key $D/$H/instance.key.minted-after-migration-*; do [ -f $f ] && printf '%s %s\n' $f "$(sha256sum < $f | cut -c1-16)"; done |
| +ls $D | head -30 |
| +EOF |
| +``` |
| + |
| +--- |
| + |
| +## Appendix B. What is not sourced exactly |
| + |
| +- **The `x-carlos-version` value of a protected console** after E1 (`54ae7fb9`, `v0.28.5`, or another string). The exe sha256 is the authority. |
| +- **E1 step 5's "console report"** is run here as `console-report` (dry run, then apply, then the box report's `console_processes` count). The ruling's words do not name the command. |
| +- **Staging `/root/carlos-v0.28.5` on a real box.** Run 9 pushed the file from the host. Here the agent's fetched cache is copied and checked against both signed shas; the hand-stage path when the cache is missing is not rehearsed. |
| +- **The account and app names of canada, ips and kpmg**, and the flagship data bucket names. 4.1 and 4.5 read them from the console and the boxes. |
| +- **P0.4's IAM check** (the staging lane) by `simulate-principal-policy`: not run in Run 9 or anywhere; the dev role names `carlos-dev-host` (sophie) and the flagship role names are from the claim runbook and must be confirmed. |
| +- **Moves of 300 to 540 MB instances.** Run 9 moved 4 MB. Timings for seal and landing at those sizes are unmeasured. |
| +- **A move back (uk to ie)**, the `--to` name for the home, and MV-O177's trigger: from the plan only. |
| +- **The v0.28.5 release notes say to leave `CARLOS_SWAP` unset**; it is set on all seven boxes by design. This runbook leaves it alone. |
| +- **Defects 6, 7 and 8** are described from the Run 9 findings and have no fix yet; their workarounds here (M2, M5, M6) are the corrections in `RUNLOG.md`. |