rehearsal-4: preflight gate — a rented drive parks when the gateway snapshot's agent pin predates agent-affecting commits (the #600 gate for images) #656

Closed
opened 2026-08-22 11:16:07 +00:00 by ben · 2 comments
Owner

Prep finding 2026-08-22 (phase-4 pre-arming). The rented path has no get.idss.nz install leg, so #600's bootstrap-staleness gate never fires for it — but the SAME staleness exists one layer down: the gateway snapshot bakes the agent at a pinned sha (nix/gateway-image/agent-pin.json, today 8585a95). If a later commit changes agent/ (or anything the agent's enroll/relay contract depends on), every rented drive boots a stale agent and reds late and misleadingly at pair.

Ask: in scripts/smoke-private-path.sh (or rehearsal-cycle.sh preflight), for --target rented: read the newest idss-gateway-<sha> via scripts/gateway-image/latest.sh, compare against agent-affecting commits since that sha (reuse #600's path-classifier — the same list of agent-affecting paths), and park the drive by name ("gateway image stale: built at X, agent changed in Y — rebuild with scripts/gateway-image/build.sh") rather than spend a droplet. Offline test with a fake doctl + a fixture git log, the #600 shape. Depends on #654 (pin resolution) landing first so the rebuild instruction is actually runnable on HEAD.

Non-goal: auto-rebuilding the image (that is the ADR 0185 revisit — CI-driven image builds, later).

**Prep finding 2026-08-22 (phase-4 pre-arming).** The rented path has no `get.idss.nz` install leg, so #600's bootstrap-staleness gate never fires for it — but the SAME staleness exists one layer down: the gateway snapshot bakes the agent at a pinned sha (`nix/gateway-image/agent-pin.json`, today `8585a95`). If a later commit changes `agent/` (or anything the agent's enroll/relay contract depends on), every rented drive boots a stale agent and reds late and misleadingly at `pair`. **Ask:** in `scripts/smoke-private-path.sh` (or `rehearsal-cycle.sh` preflight), for `--target rented`: read the newest `idss-gateway-<sha>` via `scripts/gateway-image/latest.sh`, compare against agent-affecting commits since that sha (reuse #600's path-classifier — the same list of agent-affecting paths), and **park the drive by name** ("gateway image stale: built at X, agent changed in Y — rebuild with scripts/gateway-image/build.sh") rather than spend a droplet. Offline test with a fake `doctl` + a fixture git log, the #600 shape. Depends on #654 (pin resolution) landing first so the rebuild instruction is actually runnable on HEAD. Non-goal: auto-rebuilding the image (that is the ADR 0185 revisit — CI-driven image builds, later).

swarm-claim host=elitebook-distributed-server-03 run=8733
(automated multi-host claim — lowest live claim id works this ticket)

swarm-claim host=elitebook-distributed-server-03 run=8733 (automated multi-host claim — lowest live claim id works this ticket)

close-report for #656 — status success

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

envelope
{
  "issue": 656,
  "status": "success",
  "commits": [
    "1a53f2c0e0b95a71a4e335179045ebc3ca438313"
  ],
  "changed_files": [
    "STATUS.md",
    "scripts/gateway-image/tests/gateway-image-staleness-test.sh",
    "scripts/lib/gateway-image-staleness-lib.sh",
    "scripts/smoke-private-path.sh"
  ],
  "tests": [
    {
      "command": "bash scripts/gateway-image/tests/gateway-image-staleness-test.sh",
      "exit_code": 0
    },
    {
      "command": "bash scripts/tests/bootstrap-staleness-test.sh",
      "exit_code": 0
    },
    {
      "command": "bash scripts/gateway-image/tests/latest-test.sh",
      "exit_code": 0
    },
    {
      "command": "bash -n scripts/smoke-private-path.sh",
      "exit_code": 0
    }
  ],
  "criteria": {
    "For --target rented, read the newest idss-gateway-<sha> via scripts/gateway-image/latest.sh": "scripts/smoke-private-path.sh — the rented preflight block runs `bash scripts/gateway-image/latest.sh`, extracts the sha from the idss-gateway-<sha> name; grep-verified by check C of the test",
    "Compare against agent-affecting commits since that sha reusing #600's path-classifier": "scripts/lib/gateway-image-staleness-lib.sh sources bootstrap-staleness-lib.sh and reuses OC_BOOTSTRAP_AGENT_PATHS verbatim; test cases 3 (agent/) and 4 (internal/) prove the classifier reach",
    "Park the drive by name (gateway image stale: built at X, agent changed in Y — rebuild with scripts/gateway-image/build.sh) rather than spend a droplet": "oc_gateway_image_staleness emits that verdict and returns 1; smoke-private-path.sh die_hosts on it before any droplet work (preflight, guarded to rented); test case 3 asserts the exact message shape",
    "Offline test with a fake doctl + a fixture git log, the #600 shape": "scripts/gateway-image/tests/gateway-image-staleness-test.sh — 10 checks, throwaway git repo + fake doctl->latest.sh->sha-extraction chain, no network; exit 0",
    "Depends on #654 (pin resolution) landing first so the rebuild instruction is runnable on HEAD": "#654 landed (scripts/gateway-image/pin-agent.sh present on origin/main); the named rebuild recipe scripts/gateway-image/build.sh resolves the newest published ancestor so a docs-only HEAD is buildable"
  },
  "summary": "rehearsal-4 preflight gains a gateway-image-staleness gate that parks a --target rented drive by name when the newest idss-gateway-<sha> snapshot predates an agent-affecting commit.",
  "blockers": []
}
**close-report** for #656 — status `success` :white_check_mark: **close-report gates passed** — every claim verified against main; closing. <details><summary>envelope</summary> ```json { "issue": 656, "status": "success", "commits": [ "1a53f2c0e0b95a71a4e335179045ebc3ca438313" ], "changed_files": [ "STATUS.md", "scripts/gateway-image/tests/gateway-image-staleness-test.sh", "scripts/lib/gateway-image-staleness-lib.sh", "scripts/smoke-private-path.sh" ], "tests": [ { "command": "bash scripts/gateway-image/tests/gateway-image-staleness-test.sh", "exit_code": 0 }, { "command": "bash scripts/tests/bootstrap-staleness-test.sh", "exit_code": 0 }, { "command": "bash scripts/gateway-image/tests/latest-test.sh", "exit_code": 0 }, { "command": "bash -n scripts/smoke-private-path.sh", "exit_code": 0 } ], "criteria": { "For --target rented, read the newest idss-gateway-<sha> via scripts/gateway-image/latest.sh": "scripts/smoke-private-path.sh — the rented preflight block runs `bash scripts/gateway-image/latest.sh`, extracts the sha from the idss-gateway-<sha> name; grep-verified by check C of the test", "Compare against agent-affecting commits since that sha reusing #600's path-classifier": "scripts/lib/gateway-image-staleness-lib.sh sources bootstrap-staleness-lib.sh and reuses OC_BOOTSTRAP_AGENT_PATHS verbatim; test cases 3 (agent/) and 4 (internal/) prove the classifier reach", "Park the drive by name (gateway image stale: built at X, agent changed in Y — rebuild with scripts/gateway-image/build.sh) rather than spend a droplet": "oc_gateway_image_staleness emits that verdict and returns 1; smoke-private-path.sh die_hosts on it before any droplet work (preflight, guarded to rented); test case 3 asserts the exact message shape", "Offline test with a fake doctl + a fixture git log, the #600 shape": "scripts/gateway-image/tests/gateway-image-staleness-test.sh — 10 checks, throwaway git repo + fake doctl->latest.sh->sha-extraction chain, no network; exit 0", "Depends on #654 (pin resolution) landing first so the rebuild instruction is runnable on HEAD": "#654 landed (scripts/gateway-image/pin-agent.sh present on origin/main); the named rebuild recipe scripts/gateway-image/build.sh resolves the newest published ancestor so a docs-only HEAD is buildable" }, "summary": "rehearsal-4 preflight gains a gateway-image-staleness gate that parks a --target rented drive by name when the newest idss-gateway-<sha> snapshot predates an agent-affecting commit.", "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#656
No description provided.