gateway-image: a snapshot rebuilt on another host bakes THAT host's vm-guest.tar — the driving host's supply seed then copies 2.6 GB (#1191 short-circuit misses) and reds at its budget #1858

Closed
opened 2026-09-24 23:24:05 +00:00 by ben · 3 comments
Owner

Seen on WKT-DEMO Drive A fire 1 (drive 20260924T224155Z, #1855): bens-mac-04 (no DO ssh key registered, so it cannot run scripts/gateway-image/build.sh itself) drove against snapshot idss-gateway-9fdb5a5f8813, rebuilt by hand on matou-workstation. The workstation's vm-guest slot rebuilt its tar fresh (de0c0165…, key 8741152f94dc3a80) and baked it; bens-mac-04's payload carries the 2026-09-22 tar (6aaabd71…). The supply seed's sha short-circuit (vm-guest.tar.sha256) missed, the seed spent its whole 300 s envelope on a copy the mac's uplink cannot finish, and the row redded at 420 s ("bar at 9%, no activity line"). The preflight's freshness gate (gateway-image-fresh: snapshot carries every agent-affecting commit) said FRESH — it compares the agent pin only, never the baked vm-guest sha, so a snapshot that is fresh for one executor is stale for another and nothing says so before the rent.

Wanted (either, both is better):

  1. The freshness gate compares the baked vm-guest sha (the snapshot's marker) against $IDSS_PAYLOAD_DIR/vm-guest.tar's sha and parks by name — gateway image bakes vm-guest <sha> but this host's payload carries <sha>: sync the payload's tar to the bake (or rebuild the snapshot from this host) — instead of letting supply discover it 30 min later on a rented box.
  2. The vm-guest slot build is reproducible across hosts for the same key, so two executors with the same inputs produce the same bytes and the bake matches everywhere; or the assembled payload publishes its tar to the cache the gateway substitutes from (#1768's move for the installer base), taking it off the operator's uplink for good.

Workaround used 2026-09-24: rsync --compress the workstation's tar onto bens-mac-04's payload (~6:1, ~1 MB/s) before re-firing.

Refs #1191, #1768, #1855, #1836.

**Seen** on WKT-DEMO Drive A fire 1 (drive `20260924T224155Z`, #1855): bens-mac-04 (no DO ssh key registered, so it cannot run `scripts/gateway-image/build.sh` itself) drove against snapshot `idss-gateway-9fdb5a5f8813`, rebuilt by hand on matou-workstation. The workstation's vm-guest slot rebuilt its tar fresh (`de0c0165…`, key `8741152f94dc3a80`) and baked it; bens-mac-04's payload carries the 2026-09-22 tar (`6aaabd71…`). The `supply` seed's sha short-circuit (`vm-guest.tar.sha256`) missed, the seed spent its whole 300 s envelope on a copy the mac's uplink cannot finish, and the row redded at 420 s ("bar at 9%, no activity line"). The preflight's freshness gate (`gateway-image-fresh: snapshot carries every agent-affecting commit`) said FRESH — it compares the agent pin only, never the baked vm-guest sha, so a snapshot that is fresh for one executor is stale for another and nothing says so before the rent. **Wanted (either, both is better):** 1. The freshness gate compares the baked vm-guest sha (the snapshot's marker) against `$IDSS_PAYLOAD_DIR/vm-guest.tar`'s sha and parks by name — `gateway image bakes vm-guest <sha> but this host's payload carries <sha>: sync the payload's tar to the bake (or rebuild the snapshot from this host)` — instead of letting `supply` discover it 30 min later on a rented box. 2. The vm-guest slot build is reproducible across hosts for the same key, so two executors with the same inputs produce the same bytes and the bake matches everywhere; or the assembled payload publishes its tar to the cache the gateway substitutes from (#1768's move for the installer base), taking it off the operator's uplink for good. Workaround used 2026-09-24: `rsync --compress` the workstation's tar onto bens-mac-04's payload (~6:1, ~1 MB/s) before re-firing. Refs #1191, #1768, #1855, #1836.

This was generated by AI during triage.

Ruled by agent under ADR 0174 — veto anytime

Ruling. ready-for-agent, category bug, scoped to Wanted #1 (the
preflight freshness gate learns the snapshot's baked vm-guest.tar sha and
parks by name when this host's payload carries a different one). Wanted #2
(cross-host reproducible vm-guest build, or publishing the tar to the substituter
per #1768) stays out of this ticket — the implementing agent may split it into a
follow-up.

Why this is a two-way door. The fix is a comparison added to a preflight gate
plus a marker surfaced off-box — all under scripts/ (not a protected
.sandcastle/ path), revertible by a later commit, and provable offline by
the existing gate harness scripts/gateway-image/tests/gateway-image-staleness-test.sh
(fake doctl + fixtures, halves A/B/C — this adds a fourth). It touches no
personal credentials, no security posture, no member-facing trust surface, no
data destruction, and no non-routine spend, so it is off the one-way-door list.
Ben's veto is async and non-blocking — reclassify anytime.

What proves it. A new half of gateway-image-staleness-test.sh: with the
snapshot's recorded vm-guest sha X and a fixture $IDSS_PAYLOAD_DIR/vm-guest.tar
whose sha is Y ≠ X, the preflight parks by name; with X = Y it proceeds. The
real-host round-trip (build.sh recording the sha on an actual DO snapshot, read at
a real rent) is exercised by the next WKT-DEMO / rehearsal drive, not a landing
blocker — consistent with how this whole gate is already validated offline.


Agent brief

Context. Seen on WKT-DEMO Drive A fire 1 (drive 20260924T224155Z, #1855):
bens-mac-04 (no DO ssh key, so it cannot run scripts/gateway-image/build.sh)
drove against snapshot idss-gateway-9fdb5a5f8813, which had been rebuilt by hand
on matou-workstation. The workstation's vm-guest slot rebuilt its tar fresh
(de0c0165…) and baked that; bens-mac-04's standing payload still carries the
2026-09-22 tar (6aaabd71…). Same vm-guest key (8741152f94dc3a80), different
bytes
— the non-reproducibility that is Wanted #2. The founding supply seed's
sha short-circuit (gateway-image-vm-guest-lib.sh:107, the
test "$(cat vm-guest.tar.sha256)" = "$sha" reuse branch) therefore missed on the
rented box, the seed spent its whole 300 s envelope copying a 2.6 GB tar the mac's
uplink cannot finish, and the row redded at 420 s. The preflight freshness gate
had said FRESH: it compares the agent pin and the recipe git commits only
(OC_GWIMAGE_RECIPE_PATHS), never the baked vm-guest bytes, so a snapshot that
is fresh for the host that baked it is stale for a different executor and nothing
says so before the rent.

The gap, precisely.

  • The preflight entry oc_gateway_image_ensure_fresh()
    (scripts/lib/gateway-image-rebuild-lib.sh:241) reads only the newest
    snapshot's name — idss-gateway-<git-sha> (25 chars) — and runs
    oc_gateway_image_staleness()
    (scripts/lib/gateway-image-staleness-lib.sh:164). The recipe axis there
    (OC_GWIMAGE_RECIPE_PATHS, verdict messages ~:190–:196) is a git-commit
    behind-count over recipe source paths — it cannot see that two hosts at the
    same git sha baked different tar bytes.
  • The baked vm-guest sha is recorded, but only on the box / inside the
    snapshot
    : oc_gwvg_* writes it to OC_GWVG_MARKER
    ($OC_GWVG_DIR/vm-guest.tar.sha256, gateway-image-vm-guest-lib.sh:33, written
    last at :131). Nothing surfaces it to the preflight host before the rent.

Do.

  1. Surface the snapshot's baked vm-guest sha off-box so preflight can read it
    without booting the snapshot. It must be the sha recorded at bake time by the
    building host, not a local recompute
    — recompute would give this host's tar
    bytes, which this bug proves can differ from the snapshot's. Choose the
    mechanism (a DO snapshot tag alongside the idss-gateway-<sha> name that
    doctl compute snapshot list already returns is the least-new-infra home; a
    published side-file keyed by the snapshot sha is an alternative). You may rule
    the mechanism under ADR 0174
    — it is revertible and offline-provable; record
    the ruling on this ticket.
  2. Extend the freshness gate so oc_gateway_image_ensure_fresh (or the
    staleness lib) also compares that recorded vm-guest sha against
    $IDSS_PAYLOAD_DIR/vm-guest.tar's sha and, on mismatch, parks by name with
    a message in the gate's existing voice, e.g.:
    gateway image bakes vm-guest <sha> but this host's payload carries <sha>: sync the payload's tar to the bake (or rebuild the snapshot from this host)
    — instead of letting supply discover it ~30 min later on a rented box. Keep
    the I/O boundary (reading the recorded sha) overridable by a fixture, matching
    how oc_gwimage_published_agents is overridden in the test.
  3. Prove it offline — add a fourth half to
    scripts/gateway-image/tests/gateway-image-staleness-test.sh: recorded sha X
    • fixture payload tar sha Y ≠ X → park by name; X = Y → proceed; an
      unreadable recorded sha keeps the current (agent-pin/recipe) verdict rather
      than parking (never park on a key you cannot read — same doctrine as the
      agent-pin shortcut at staleness-lib and the installer-base axis).
  4. GOTCHAS + STATUS. Append a numbered docs/GOTCHAS.md entry (a snapshot fresh
    for its builder is stale for another executor when the vm-guest build is
    non-reproducible), and update STATUS.md in the same commit if this changes a
    gate's stated coverage. Refs #1191 (the vm-guest bundle short-circuit), #1768
    (the cache-substitution move), #1855/#1836 (the drive that surfaced it).

Out of scope (split to a follow-up if pursued). Wanted #2 — making the
vm-guest slot build byte-reproducible across hosts for the same key, or publishing
the assembled tar to the substituter the gateway pulls from (#1768's move), taking
it off the operator's uplink for good. That is the durable fix; this ticket only
stops the late, budget-blowing discovery.

Acceptance.

  • Preflight parks by name, before any rent, when the newest snapshot's recorded
    vm-guest sha differs from this host's $IDSS_PAYLOAD_DIR/vm-guest.tar sha.
  • gateway-image-staleness-test.sh covers park-on-mismatch, proceed-on-match, and
    keep-verdict-on-unreadable-marker, and passes offline.
  • No regression to the agent-pin / recipe axes (existing halves still green).
> *This was generated by AI during triage.* ## Ruled by agent under ADR 0174 — veto anytime **Ruling.** `ready-for-agent`, category `bug`, scoped to **Wanted #1** (the preflight freshness gate learns the snapshot's baked `vm-guest.tar` sha and parks by name when this host's payload carries a different one). **Wanted #2** (cross-host reproducible vm-guest build, or publishing the tar to the substituter per #1768) stays out of this ticket — the implementing agent may split it into a follow-up. **Why this is a two-way door.** The fix is a comparison added to a preflight gate plus a marker surfaced off-box — all under `scripts/` (not a protected `.sandcastle/` path), revertible by a later commit, and **provable offline** by the existing gate harness `scripts/gateway-image/tests/gateway-image-staleness-test.sh` (fake `doctl` + fixtures, halves A/B/C — this adds a fourth). It touches no personal credentials, no security posture, no member-facing trust surface, no data destruction, and no non-routine spend, so it is off the one-way-door list. Ben's veto is async and non-blocking — reclassify anytime. **What proves it.** A new half of `gateway-image-staleness-test.sh`: with the snapshot's recorded vm-guest sha `X` and a fixture `$IDSS_PAYLOAD_DIR/vm-guest.tar` whose sha is `Y ≠ X`, the preflight parks by name; with `X = Y` it proceeds. The real-host round-trip (build.sh recording the sha on an actual DO snapshot, read at a real rent) is exercised by the next WKT-DEMO / rehearsal drive, not a landing blocker — consistent with how this whole gate is already validated offline. --- ## Agent brief **Context.** Seen on WKT-DEMO Drive A fire 1 (drive `20260924T224155Z`, #1855): `bens-mac-04` (no DO ssh key, so it cannot run `scripts/gateway-image/build.sh`) drove against snapshot `idss-gateway-9fdb5a5f8813`, which had been rebuilt by hand on `matou-workstation`. The workstation's vm-guest slot rebuilt its tar fresh (`de0c0165…`) and baked that; `bens-mac-04`'s standing payload still carries the 2026-09-22 tar (`6aaabd71…`). Same vm-guest key (`8741152f94dc3a80`), **different bytes** — the non-reproducibility that is Wanted #2. The founding `supply` seed's sha short-circuit (`gateway-image-vm-guest-lib.sh:107`, the `test "$(cat vm-guest.tar.sha256)" = "$sha"` reuse branch) therefore missed on the rented box, the seed spent its whole 300 s envelope copying a 2.6 GB tar the mac's uplink cannot finish, and the row redded at 420 s. The preflight freshness gate had said FRESH: it compares the **agent pin** and the **recipe git commits** only (`OC_GWIMAGE_RECIPE_PATHS`), never the baked vm-guest **bytes**, so a snapshot that is fresh for the host that baked it is stale for a different executor and nothing says so before the rent. **The gap, precisely.** - The preflight entry `oc_gateway_image_ensure_fresh()` (`scripts/lib/gateway-image-rebuild-lib.sh:241`) reads only the newest snapshot's **name** — `idss-gateway-<git-sha>` (25 chars) — and runs `oc_gateway_image_staleness()` (`scripts/lib/gateway-image-staleness-lib.sh:164`). The recipe axis there (`OC_GWIMAGE_RECIPE_PATHS`, verdict messages ~`:190`–`:196`) is a **git-commit** behind-count over recipe source paths — it cannot see that two hosts at the *same* git sha baked *different* tar bytes. - The baked vm-guest sha **is** recorded, but only **on the box / inside the snapshot**: `oc_gwvg_*` writes it to `OC_GWVG_MARKER` (`$OC_GWVG_DIR/vm-guest.tar.sha256`, `gateway-image-vm-guest-lib.sh:33`, written last at `:131`). Nothing surfaces it to the preflight host before the rent. **Do.** 1. **Surface the snapshot's baked vm-guest sha off-box** so preflight can read it without booting the snapshot. It **must be the sha recorded at bake time by the building host, not a local recompute** — recompute would give *this* host's tar bytes, which this bug proves can differ from the snapshot's. Choose the mechanism (a DO snapshot tag alongside the `idss-gateway-<sha>` name that `doctl compute snapshot list` already returns is the least-new-infra home; a published side-file keyed by the snapshot sha is an alternative). You may **rule the mechanism under ADR 0174** — it is revertible and offline-provable; record the ruling on this ticket. 2. **Extend the freshness gate** so `oc_gateway_image_ensure_fresh` (or the staleness lib) also compares that recorded vm-guest sha against `$IDSS_PAYLOAD_DIR/vm-guest.tar`'s sha and, on mismatch, **parks by name** with a message in the gate's existing voice, e.g.: `gateway image bakes vm-guest <sha> but this host's payload carries <sha>: sync the payload's tar to the bake (or rebuild the snapshot from this host)` — instead of letting `supply` discover it ~30 min later on a rented box. Keep the I/O boundary (reading the recorded sha) overridable by a fixture, matching how `oc_gwimage_published_agents` is overridden in the test. 3. **Prove it offline** — add a fourth half to `scripts/gateway-image/tests/gateway-image-staleness-test.sh`: recorded sha `X` + fixture payload tar sha `Y ≠ X` → park by name; `X = Y` → proceed; an **unreadable** recorded sha keeps the current (agent-pin/recipe) verdict rather than parking (never park on a key you cannot read — same doctrine as the agent-pin shortcut at `staleness-lib` and the installer-base axis). 4. **GOTCHAS + STATUS.** Append a numbered `docs/GOTCHAS.md` entry (a snapshot fresh for its builder is stale for another executor when the vm-guest build is non-reproducible), and update `STATUS.md` in the same commit if this changes a gate's stated coverage. Refs #1191 (the vm-guest bundle short-circuit), #1768 (the cache-substitution move), #1855/#1836 (the drive that surfaced it). **Out of scope (split to a follow-up if pursued).** Wanted #2 — making the vm-guest slot build byte-reproducible across hosts for the same key, or publishing the assembled tar to the substituter the gateway pulls from (#1768's move), taking it off the operator's uplink for good. That is the durable fix; this ticket only stops the late, budget-blowing discovery. **Acceptance.** - Preflight parks by name, before any rent, when the newest snapshot's recorded vm-guest sha differs from this host's `$IDSS_PAYLOAD_DIR/vm-guest.tar` sha. - `gateway-image-staleness-test.sh` covers park-on-mismatch, proceed-on-match, and keep-verdict-on-unreadable-marker, and passes offline. - No regression to the agent-pin / recipe axes (existing halves still green).

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

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

close-report for #1858 — status success

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

envelope
{
  "issue": 1858,
  "status": "success",
  "commits": [
    "c3acaca0"
  ],
  "changed_files": [
    "STATUS.md",
    "docs/GOTCHAS.md",
    "scripts/gateway-image/build.sh",
    "scripts/gateway-image/latest.sh",
    "scripts/gateway-image/tests/gateway-image-staleness-test.sh",
    "scripts/gateway-image/tests/latest-test.sh",
    "scripts/lib/gateway-image-rebuild-lib.sh",
    "scripts/lib/gateway-image-staleness-lib.sh",
    "scripts/lib/gateway-image-vm-guest-lib.sh",
    "scripts/smoke-private-path.sh",
    "scripts/tests/gateway-image-vm-guest-test.sh"
  ],
  "tests": [
    {
      "command": "bash scripts/gateway-image/tests/gateway-image-staleness-test.sh",
      "exit_code": 0
    },
    {
      "command": "bash scripts/gateway-image/tests/latest-test.sh",
      "exit_code": 0
    },
    {
      "command": "bash scripts/tests/gateway-image-vm-guest-test.sh",
      "exit_code": 0
    },
    {
      "command": "bash scripts/tests/gateway-image-rebuild-test.sh",
      "exit_code": 0
    }
  ],
  "criteria": {
    "Wanted 1 — the freshness gate compares the baked vm-guest sha against $IDSS_PAYLOAD_DIR/vm-guest.tar's sha and parks by name before the rent": "oc_gwimage_vm_guest_freshness in scripts/lib/gateway-image-staleness-lib.sh emits the exact 'gateway image bakes vm-guest <sha> but this host's payload carries <sha>: sync the payload's tar to the bake ... or rebuild the snapshot from this host' park; wired into scripts/smoke-private-path.sh (die_host on rc=1); the baked sha is sourced from the snapshot NAME's -vg suffix that build.sh now stamps. Pinned by staleness-test section F (F4 mismatch→by-name park) and F8 (smoke wiring).",
    "Baked sha made preflight-readable without booting the snapshot": "build.sh captures oc_gwimage_bake_vm_guest's stdout sha and stamps snapname=idss-gateway-$short-vg${vg_sha:0:12}; latest.sh matches the 40-char form; oc_gwimage_name_vmguest_sha reads it back. Pinned by latest-test case 3 + vm-guest-test check 9.",
    "No regression to the agent/recipe axes or the auto-rebuild": "oc_gwimage_name_git_sha strips the -vg suffix in both smoke-private-path.sh and gateway-image-rebuild-lib.sh so the git sha still resolves; staleness-test 27 checks and rebuild-test 17 checks green.",
    "Graceful degradation (older snapshot, no payload tar, no sha256sum)": "oc_gwimage_vm_guest_freshness returns 0 (proceed) in each case — pinned by staleness-test F5/F6."
  },
  "summary": "The gateway snapshot name now carries the baked vm-guest sha (-vg suffix) so the preflight freshness gate parks a host whose payload tar differs before the rent, instead of letting the founding supply seed discover the mismatch and red at its budget.",
  "blockers": []
}
**close-report** for #1858 — status `success` :white_check_mark: **close-report gates passed** — every claim verified against main; issue closed. <details><summary>envelope</summary> ```json { "issue": 1858, "status": "success", "commits": [ "c3acaca0" ], "changed_files": [ "STATUS.md", "docs/GOTCHAS.md", "scripts/gateway-image/build.sh", "scripts/gateway-image/latest.sh", "scripts/gateway-image/tests/gateway-image-staleness-test.sh", "scripts/gateway-image/tests/latest-test.sh", "scripts/lib/gateway-image-rebuild-lib.sh", "scripts/lib/gateway-image-staleness-lib.sh", "scripts/lib/gateway-image-vm-guest-lib.sh", "scripts/smoke-private-path.sh", "scripts/tests/gateway-image-vm-guest-test.sh" ], "tests": [ { "command": "bash scripts/gateway-image/tests/gateway-image-staleness-test.sh", "exit_code": 0 }, { "command": "bash scripts/gateway-image/tests/latest-test.sh", "exit_code": 0 }, { "command": "bash scripts/tests/gateway-image-vm-guest-test.sh", "exit_code": 0 }, { "command": "bash scripts/tests/gateway-image-rebuild-test.sh", "exit_code": 0 } ], "criteria": { "Wanted 1 — the freshness gate compares the baked vm-guest sha against $IDSS_PAYLOAD_DIR/vm-guest.tar's sha and parks by name before the rent": "oc_gwimage_vm_guest_freshness in scripts/lib/gateway-image-staleness-lib.sh emits the exact 'gateway image bakes vm-guest <sha> but this host's payload carries <sha>: sync the payload's tar to the bake ... or rebuild the snapshot from this host' park; wired into scripts/smoke-private-path.sh (die_host on rc=1); the baked sha is sourced from the snapshot NAME's -vg suffix that build.sh now stamps. Pinned by staleness-test section F (F4 mismatch→by-name park) and F8 (smoke wiring).", "Baked sha made preflight-readable without booting the snapshot": "build.sh captures oc_gwimage_bake_vm_guest's stdout sha and stamps snapname=idss-gateway-$short-vg${vg_sha:0:12}; latest.sh matches the 40-char form; oc_gwimage_name_vmguest_sha reads it back. Pinned by latest-test case 3 + vm-guest-test check 9.", "No regression to the agent/recipe axes or the auto-rebuild": "oc_gwimage_name_git_sha strips the -vg suffix in both smoke-private-path.sh and gateway-image-rebuild-lib.sh so the git sha still resolves; staleness-test 27 checks and rebuild-test 17 checks green.", "Graceful degradation (older snapshot, no payload tar, no sha256sum)": "oc_gwimage_vm_guest_freshness returns 0 (proceed) in each case — pinned by staleness-test F5/F6." }, "summary": "The gateway snapshot name now carries the baked vm-guest sha (-vg suffix) so the preflight freshness gate parks a host whose payload tar differs before the rent, instead of letting the founding supply seed discover the mismatch and red at its budget.", "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#1858
No description provided.