rehearsal-cycle: the gateway-image auto-rebuild (#661) is rented-only — the device target's standing re-found boots a stale snapshot and stalls #854 on a human build.sh #1050

Closed
opened 2026-08-31 02:51:31 +00:00 by ben · 2 comments
Owner

Symptom

#1048 landed (a4252af4) with a "residual human step": rebuild + publish the gateway golden snapshot so the device drive's standing re-found boots a warm-store gateway. The executor host (elitebook-03) already carries DIGITALOCEAN_ACCESS_TOKEN + nix + doctl, and scripts/rehearsal-cycle.sh:272-298 already auto-rebuilds a stale idss-gateway-<sha> snapshot pre-drive under a host-wide lock — but only if [ "$target" = "rented" ]. The device target's standing precondition rents and boots the newest idss-gateway-* snapshot via the same latest.sh, yet never gets the rebuild, so every agent-affecting commit (and now every installer-base flake bump, #1048) stalls #854 on a human running build.sh by hand — the exact ADR 0185 hands-in-the-loop stall #661 retired for the rented target.

Rule

Apply oc_gateway_image_ensure_fresh on every target whose journey boots a rented gateway snapshot (device, and any future standing target), not just rented. Extend the staleness key so an installer-base change (the packages.kexec-installer-base-toplevel out path — scripts/lib/installer-base-staleness-lib.sh already evals it) also counts as snapshot-stale, since #1048 bakes that closure into the image. Reuse the existing host-wide build lock; a build failure stays non-fatal (the drive parks by name).

Acceptance

  • scripts/rehearsal-cycle.sh calls the ensure-fresh path for target=device; an offline test in scripts/tests/ proves the target set (rented + device) and the installer-base staleness key.
  • A stale snapshot on the device target is rebuilt pre-drive with no human step; the executor log line ==> gateway-image: snapshot is fresh (or was rebuilt) — driving appears for a device drive.

Context: #1048 (ruling + residual), #661 (rented-only auto-rebuild), #656 (park-by-name gate), ADR 0185.

## Symptom #1048 landed (`a4252af4`) with a "residual human step": rebuild + publish the gateway golden snapshot so the device drive's `standing` re-found boots a warm-store gateway. The executor host (elitebook-03) already carries `DIGITALOCEAN_ACCESS_TOKEN` + nix + doctl, and `scripts/rehearsal-cycle.sh:272-298` already auto-rebuilds a stale `idss-gateway-<sha>` snapshot pre-drive under a host-wide lock — **but only `if [ "$target" = "rented" ]`**. The `device` target's `standing` precondition rents and boots the newest `idss-gateway-*` snapshot via the same `latest.sh`, yet never gets the rebuild, so every agent-affecting commit (and now every installer-base flake bump, #1048) stalls #854 on a human running `build.sh` by hand — the exact ADR 0185 hands-in-the-loop stall #661 retired for the rented target. ## Rule Apply `oc_gateway_image_ensure_fresh` on every target whose journey boots a rented gateway snapshot (`device`, and any future standing target), not just `rented`. Extend the staleness key so an `installer-base` change (the `packages.kexec-installer-base-toplevel` out path — `scripts/lib/installer-base-staleness-lib.sh` already evals it) also counts as snapshot-stale, since #1048 bakes that closure into the image. Reuse the existing host-wide build lock; a build failure stays non-fatal (the drive parks by name). ## Acceptance - `scripts/rehearsal-cycle.sh` calls the ensure-fresh path for `target=device`; an offline test in `scripts/tests/` proves the target set (rented + device) and the installer-base staleness key. - A stale snapshot on the device target is rebuilt pre-drive with no human step; the executor log line `==> gateway-image: snapshot is fresh (or was rebuilt) — driving` appears for a device drive. Context: #1048 (ruling + residual), #661 (rented-only auto-rebuild), #656 (park-by-name gate), ADR 0185.

swarm-claim host=matou-dev-server-01 run=14901
(automated multi-host claim — lowest live claim id works this ticket)

swarm-claim host=matou-dev-server-01 run=14901 (automated multi-host claim — lowest live claim id works this ticket)

close-report for #1050 — status success

✅ close-report gates passed — every claim verified against main; issue closed.

envelope
{
  "issue": 1050,
  "status": "success",
  "commits": [
    "ef5da70d"
  ],
  "changed_files": [
    "STATUS.md",
    "scripts/lib/gateway-image-rebuild-lib.sh",
    "scripts/lib/installer-base-staleness-lib.sh",
    "scripts/rehearsal-cycle.sh",
    "scripts/tests/gateway-image-rebuild-test.sh"
  ],
  "tests": [
    {
      "command": "bash scripts/tests/gateway-image-rebuild-test.sh",
      "exit_code": 0
    },
    {
      "command": "bash scripts/tests/installer-base-staleness-test.sh",
      "exit_code": 0
    },
    {
      "command": "bash scripts/gateway-image/tests/gateway-image-staleness-test.sh",
      "exit_code": 0
    },
    {
      "command": "bash scripts/tests/rehearsal-device-target-test.sh",
      "exit_code": 0
    }
  ],
  "criteria": {
    "scripts/rehearsal-cycle.sh calls the ensure-fresh path for target=device": "rehearsal-cycle.sh guard changed from `if [ \"$target\" = \"rented\" ]` to `case \"$target\" in rented|device)` around oc_gateway_image_ensure_fresh (commit ef5da70d)",
    "an offline test in scripts/tests/ proves the target set (rented + device) and the installer-base staleness key": "scripts/tests/gateway-image-rebuild-test.sh check 7 asserts `rented|device` guard; checks 9-11 prove the installer-base axis (moved->rebuild once, unchanged->no-op, unknowable->never flags); 11 checks pass",
    "A stale snapshot on the device target is rebuilt pre-drive with no human step": "case rented|device) runs oc_gateway_image_ensure_fresh pre-drive under the existing host-wide build lock; test check 9 proves an installer-base-drifted agent-fresh snapshot rebuilds exactly once and proceeds rc=0",
    "the executor log line `==> gateway-image: snapshot is fresh (or was rebuilt) — driving` appears for a device drive": "that echo sits inside the rented|device case block in rehearsal-cycle.sh, so it prints for target=device (unchanged line, now reachable on the device rail)"
  },
  "summary": "The gateway-image auto-rebuild (#661) now fires for the device target and folds the installer-base out path (#1048) into its freshness key, so the device standing re-found boots a warm-store gateway with no human build.sh.",
  "blockers": []
}
**close-report** for #1050 — status `success` :white_check_mark: **close-report gates passed** — every claim verified against main; issue closed. <details><summary>envelope</summary> ```json { "issue": 1050, "status": "success", "commits": [ "ef5da70d" ], "changed_files": [ "STATUS.md", "scripts/lib/gateway-image-rebuild-lib.sh", "scripts/lib/installer-base-staleness-lib.sh", "scripts/rehearsal-cycle.sh", "scripts/tests/gateway-image-rebuild-test.sh" ], "tests": [ { "command": "bash scripts/tests/gateway-image-rebuild-test.sh", "exit_code": 0 }, { "command": "bash scripts/tests/installer-base-staleness-test.sh", "exit_code": 0 }, { "command": "bash scripts/gateway-image/tests/gateway-image-staleness-test.sh", "exit_code": 0 }, { "command": "bash scripts/tests/rehearsal-device-target-test.sh", "exit_code": 0 } ], "criteria": { "scripts/rehearsal-cycle.sh calls the ensure-fresh path for target=device": "rehearsal-cycle.sh guard changed from `if [ \"$target\" = \"rented\" ]` to `case \"$target\" in rented|device)` around oc_gateway_image_ensure_fresh (commit ef5da70d)", "an offline test in scripts/tests/ proves the target set (rented + device) and the installer-base staleness key": "scripts/tests/gateway-image-rebuild-test.sh check 7 asserts `rented|device` guard; checks 9-11 prove the installer-base axis (moved->rebuild once, unchanged->no-op, unknowable->never flags); 11 checks pass", "A stale snapshot on the device target is rebuilt pre-drive with no human step": "case rented|device) runs oc_gateway_image_ensure_fresh pre-drive under the existing host-wide build lock; test check 9 proves an installer-base-drifted agent-fresh snapshot rebuilds exactly once and proceeds rc=0", "the executor log line `==> gateway-image: snapshot is fresh (or was rebuilt) — driving` appears for a device drive": "that echo sits inside the rented|device case block in rehearsal-cycle.sh, so it prints for target=device (unchanged line, now reachable on the device rail)" }, "summary": "The gateway-image auto-rebuild (#661) now fires for the device target and folds the installer-base out path (#1048) into its freshness key, so the device standing re-found boots a warm-store gateway with no human build.sh.", "blockers": [] } ``` </details>
Sign in to join this conversation.
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Matou/idss#1050
No description provided.