A VM-mode member device downloads the guest bundle UNCOMPRESSED — 2.6 GB, measured ~52 min on a real home line, with no resume #1753

Closed
opened 2026-09-23 04:44:44 +00:00 by ben · 6 comments
Owner

What a real member device actually waits for

A VM-mode member device stages the guest bundle from its own community gateway:
GET /get?arch=x86_64&artifact=vm-guest → /var/lib/idss/vm-guest. The doorway
serves vm-guest.tar, uncompressed — 2,598,615,040 bytes (2.6 GB).

Between two droplets that is a couple of minutes, which is why no drive has ever
surfaced it: every device lane until now rented its member box in the same region
as the gateway.

Measured on real hardware (ADR 0264's bring-your-own fixture, elitebook-03
on a home line, pulling from the rehearsal-m gateway):

curl -r 0-400000000 'https://rehearsal-m.idss.nz/get?arch=x86_64&artifact=vm-guest'
=> 37,569,024 B in 45.0 s = 835 KB/s

At 835 KB/s the full bundle needs ~52 minutes. On a slower line it is worse,
and there is no resume: the staging one-liner is a single curl -sSf … -o, so a
dropped connection restarts from zero.

This is the experience for a community adding its first real machine: "run this
on the machine", then most of an hour with no progress, on a link that may not
survive it.

Why it is fixable

The payload inside is a NixOS qcow2 (2.2 GB) plus a relocatable QEMU dist. A
NixOS disk image compresses hard — zstd should bring the transfer to a few
hundred MB, cutting the measured wait from ~52 min to a handful of minutes, for
every member device on every line.

Shape (for a ruling, not a decision taken)

  1. Serve the bundle compressed from the doorway (vm-guest.tar.zst), and have
    the staging command stream-decompress it. The marker stays a sha over the
    bundle, so the seed short-circuit and the snapshot bake are unaffected.
  2. Make the fetch resumable (curl -C -), so a dropped home link costs the
    remainder, not the whole.
  3. Consider showing the operator progress — today the one-liner is silent for
    the whole transfer.

How this was found

ADR 0264's first fire, fire 5: red at agent-install with the fetch still
running and healthy at the 300 s ceiling. The drive's byo carrier now carries a
measured 75-minute stage ceiling so the journey can be proven end to end; that
budget is the WORKAROUND, and this issue is the thing itself.

Related: #1153 (Task 2, the doorway), #1191 (the snapshot bake — the same
transfer cost, solved for the gateway only), GOTCHAS #310/#312 (the other
first-fire findings).

## What a real member device actually waits for A VM-mode member device stages the guest bundle from its own community gateway: `GET /get?arch=x86_64&artifact=vm-guest` → `/var/lib/idss/vm-guest`. The doorway serves **`vm-guest.tar`, uncompressed — 2,598,615,040 bytes (2.6 GB)**. Between two droplets that is a couple of minutes, which is why no drive has ever surfaced it: every device lane until now rented its member box in the same region as the gateway. **Measured on real hardware** (ADR 0264's bring-your-own fixture, `elitebook-03` on a home line, pulling from the `rehearsal-m` gateway): ``` curl -r 0-400000000 'https://rehearsal-m.idss.nz/get?arch=x86_64&artifact=vm-guest' => 37,569,024 B in 45.0 s = 835 KB/s ``` At 835 KB/s the full bundle needs **~52 minutes**. On a slower line it is worse, and there is no resume: the staging one-liner is a single `curl -sSf … -o`, so a dropped connection restarts from zero. This is the experience for a community adding its first real machine: "run this on the machine", then most of an hour with no progress, on a link that may not survive it. ## Why it is fixable The payload inside is a NixOS qcow2 (2.2 GB) plus a relocatable QEMU dist. A NixOS disk image compresses hard — zstd should bring the transfer to a few hundred MB, cutting the measured wait from ~52 min to a handful of minutes, for every member device on every line. ## Shape (for a ruling, not a decision taken) 1. Serve the bundle compressed from the doorway (`vm-guest.tar.zst`), and have the staging command stream-decompress it. The marker stays a sha over the bundle, so the seed short-circuit and the snapshot bake are unaffected. 2. Make the fetch resumable (`curl -C -`), so a dropped home link costs the remainder, not the whole. 3. Consider showing the operator progress — today the one-liner is silent for the whole transfer. ## How this was found ADR 0264's first fire, fire 5: red at `agent-install` with the fetch still running and healthy at the 300 s ceiling. The drive's byo carrier now carries a measured 75-minute stage ceiling so the journey can be proven end to end; that budget is the WORKAROUND, and this issue is the thing itself. Related: #1153 (Task 2, the doorway), #1191 (the snapshot bake — the same transfer cost, solved for the gateway only), GOTCHAS #310/#312 (the other first-fire findings).

This was generated by AI during triage.

Ruled by agent under ADR 0174 — veto anytime

Ruling: categorised bug, moved to ready-for-agent adopting the issue's proposed shape as the default — Shape steps 1 (serve compressed) and 2 (resumable fetch) are in scope; step 3 (operator progress display) is split out as a design-gated follow-up (see below).

Why it is a two-way door: compressing the served artifact and adding a resumable client fetch are both revertible with a single commit, and provable by an existing test/drive/probe — the ADR 0264 bring-your-own fixture already measures the stage time on a real home line, and an HTTP probe can assert the doorway now advertises Accept-Ranges/answers 206 and that the transfer is a few hundred MB instead of 2.6 GB. It is on none of the one-way-door list items: no personal credentials, no security-posture widening (auth is unchanged), no member-facing trust surface, no data destruction, no non-routine spend.

Why not needs-design: steps 1 and 2 are pure infra (server wire format + client fetch loop) with no flow or wireframe dependency. Only step 3 touches a UI surface (the device-add "run this on the machine" screen), so that part alone is needs-design and is carved out here rather than blocking the fix.

What proves it: the byo device drive's agent-install leg staging from a home-line gateway; an HTTP-level probe of /get?arch=…&artifact=vm-guest for Accept-Ranges: bytes and a 206 on curl -r; the seed-short-circuit + snapshot-bake sha marker staying green (the marker is taken over the on-box vm-guest.tar, the artifact of record — leave that untouched).


Agent Brief

Category: bug
Summary: The VM-guest bundle is served and fetched uncompressed (2.6 GB) with no resume, so a member device adding its first real machine on a home line waits ~52 min and any dropped connection restarts from zero. Serve it compressed and make the fetch resumable.

Current behavior:

  • The install doorway's GET /get?arch=…&artifact=vm-guest handler streams the on-disk vm-guest.tar byte-for-byte with io.Copy and an explicit 200. It sets no Content-Encoding, and because it does not use the range-capable serve primitive it advertises no Accept-Ranges and ignores inbound Range: headers — every retry re-downloads the full 2.6 GB.
  • The production client (the guest-payload stager invoked by idss-agent install) opens its temp file O_TRUNC and does a single io.Copy, sending no Range header — a dropped transfer restarts at byte 0. The e2e device-add fixture's one-liner mirrors this: curl -sSf … -o …tar.tmp with no -C -, no --retry.
  • Measured on real hardware (ADR 0264 byo fixture, home line): ~835 KB/s ⇒ ~52 min for the full bundle; red at agent-install at the 300 s drive ceiling. The current workaround is a 75-min byo stage ceiling in the drive carrier — this ticket removes the need for it.
  • #1191 solved the same transfer cost for the gateway only, by baking the tar into the golden snapshot and short-circuiting the copy against a sha marker — it did not compress anything, so there is no compression precedent to reuse (there is a deterministic-gzip precedent in the control-panel release packer, and a -C - + --retry resume precedent in the release-rail pull script).

Desired behavior:

  1. Serve compressed. The doorway serves a compressed bundle (the issue proposes vm-guest.tar.zst; zstd preferred for the ratio/speed on a NixOS qcow2, but the codec is the implementer's two-way call — it must be deterministic so the snapshot bake stays reproducible). The compressed artifact is produced wherever the uncompressed tar is produced/staged today (the payload assembler and the slot stager, kept in lockstep), so the doorway can serve it directly.
  2. Resumable + range-capable. The doorway advertises Accept-Ranges: bytes and honours Range: (i.e. serve the static compressed file through the range-capable serve primitive rather than a bare io.Copy). The production client fetch resumes from a partial temp file (curl -C --style / an HTTP Range request) and retries a stalled transfer, then stream-decompresses (zstd -d | tar -x, or download-then-decompress) into /var/lib/idss/vm-guest. The e2e fixture one-liner is updated to match the production stager.
  3. Do not disturb the sha marker / short-circuit / bake. The seed short-circuit and the golden-snapshot bake compare a sha taken over the on-box vm-guest.tar — keep vm-guest.tar the artifact of record (the sha stays over the uncompressed bundle); the compressed .tar.zst is a transfer representation derived from it. Verify the seed short-circuit and bake still no-op when the on-box tar already matches.

Key interfaces:

  • The doorway handler that dispatches on artifact=vm-guest and its guest-payload serving helper — switch from io.Copy(200) to a range-honouring serve over the file source; serve the compressed representation.
  • The guest-cache source that opens the artifact from disk — teach it about the compressed representation alongside vm-guest.tar.
  • The production guest-payload stager's download helper — add resume (partial-file offset + Range request) + retry, then decompress.
  • The two lockstepped tar producers (payload assembler + slot stager) — emit the compressed artifact deterministically alongside the tar.
  • The e2e device-add fixture's stage command generator — mirror the new production fetch (resume + decompress).
  • The sha-marker constants/logic in the fleet-supply seed path and the gateway-image bake — leave the sha over vm-guest.tar; confirm no drift.

Acceptance criteria:

  • The doorway responds to curl -sfI …&artifact=vm-guest (or the compressed artifact request) with Accept-Ranges: bytes, and to curl -r 0-N … with 206 Partial Content.
  • The bytes transferred for a full vm-guest fetch are materially smaller than the uncompressed 2.6 GB (target: a few hundred MB) on the same input.
  • A member-device stage that loses its connection mid-transfer resumes from the partial file and costs only the remainder, not the whole (covered by a test/probe, not just manual).
  • After staging, /var/lib/idss/vm-guest contains the same decompressed contents as today (the qcow2 + relocatable QEMU dist), byte-for-byte equivalent to unpacking the uncompressed tar.
  • The compressed artifact is produced deterministically (same input ⇒ same bytes), and the seed short-circuit and snapshot bake still no-op against an already-matching on-box vm-guest.tar (sha marker unchanged).
  • The e2e device-add fixture's stage one-liner matches the production stager (resume + decompress) and the byo/device drive lanes stay green.

Out of scope:

  • Operator progress display during the transfer (Shape step 3) — the one-liner is silent today; showing progress on the device-add "run this on the machine" surface is a UI change that needs the flow/wireframe, filed separately as a needs-design follow-up.
  • Changing the sha-marker scheme, the seed short-circuit, or the snapshot-bake mechanism (#1191) — they must remain green, over the uncompressed vm-guest.tar.
  • Re-architecting the doorway auth or the /get route surface.
> *This was generated by AI during triage.* ## Ruled by agent under ADR 0174 — veto anytime **Ruling:** categorised **bug**, moved to **ready-for-agent** adopting the issue's proposed shape as the default — Shape steps **1 (serve compressed) and 2 (resumable fetch)** are in scope; step **3 (operator progress display)** is split out as a design-gated follow-up (see below). **Why it is a two-way door:** compressing the served artifact and adding a resumable client fetch are both revertible with a single commit, and provable by an existing test/drive/probe — the ADR 0264 bring-your-own fixture already *measures* the stage time on a real home line, and an HTTP probe can assert the doorway now advertises `Accept-Ranges`/answers `206` and that the transfer is a few hundred MB instead of 2.6 GB. It is on none of the one-way-door list items: no personal credentials, no security-posture widening (auth is unchanged), no member-facing trust surface, no data destruction, no non-routine spend. **Why not `needs-design`:** steps 1 and 2 are pure infra (server wire format + client fetch loop) with no flow or wireframe dependency. Only step 3 touches a UI surface (the device-add "run this on the machine" screen), so that part alone is `needs-design` and is carved out here rather than blocking the fix. **What proves it:** the byo device drive's `agent-install` leg staging from a home-line gateway; an HTTP-level probe of `/get?arch=…&artifact=vm-guest` for `Accept-Ranges: bytes` and a `206` on `curl -r`; the seed-short-circuit + snapshot-bake sha marker staying green (the marker is taken over the on-box `vm-guest.tar`, the artifact of record — leave that untouched). --- ## Agent Brief **Category:** bug **Summary:** The VM-guest bundle is served and fetched uncompressed (2.6 GB) with no resume, so a member device adding its first real machine on a home line waits ~52 min and any dropped connection restarts from zero. Serve it compressed and make the fetch resumable. **Current behavior:** - The install doorway's `GET /get?arch=…&artifact=vm-guest` handler streams the on-disk `vm-guest.tar` byte-for-byte with `io.Copy` and an explicit `200`. It sets no `Content-Encoding`, and because it does not use the range-capable serve primitive it advertises no `Accept-Ranges` and ignores inbound `Range:` headers — every retry re-downloads the full 2.6 GB. - The production client (the guest-payload stager invoked by `idss-agent install`) opens its temp file `O_TRUNC` and does a single `io.Copy`, sending no `Range` header — a dropped transfer restarts at byte 0. The e2e device-add fixture's one-liner mirrors this: `curl -sSf … -o …tar.tmp` with no `-C -`, no `--retry`. - Measured on real hardware (ADR 0264 byo fixture, home line): ~835 KB/s ⇒ ~52 min for the full bundle; red at `agent-install` at the 300 s drive ceiling. The current workaround is a 75-min byo stage ceiling in the drive carrier — this ticket removes the need for it. - #1191 solved the *same* transfer cost for the gateway only, by baking the tar into the golden snapshot and short-circuiting the copy against a sha marker — it did **not** compress anything, so there is no compression precedent to reuse (there is a deterministic-gzip precedent in the control-panel release packer, and a `-C -` + `--retry` resume precedent in the release-rail pull script). **Desired behavior:** 1. **Serve compressed.** The doorway serves a compressed bundle (the issue proposes `vm-guest.tar.zst`; zstd preferred for the ratio/speed on a NixOS qcow2, but the codec is the implementer's two-way call — it must be **deterministic** so the snapshot bake stays reproducible). The compressed artifact is produced wherever the uncompressed tar is produced/staged today (the payload assembler and the slot stager, kept in lockstep), so the doorway can serve it directly. 2. **Resumable + range-capable.** The doorway advertises `Accept-Ranges: bytes` and honours `Range:` (i.e. serve the static compressed file through the range-capable serve primitive rather than a bare `io.Copy`). The production client fetch resumes from a partial temp file (`curl -C -`-style / an HTTP `Range` request) and retries a stalled transfer, then stream-decompresses (`zstd -d | tar -x`, or download-then-decompress) into `/var/lib/idss/vm-guest`. The e2e fixture one-liner is updated to match the production stager. 3. **Do not disturb the sha marker / short-circuit / bake.** The seed short-circuit and the golden-snapshot bake compare a sha taken over the on-box `vm-guest.tar` — keep `vm-guest.tar` the artifact of record (the sha stays over the uncompressed bundle); the compressed `.tar.zst` is a transfer representation derived from it. Verify the seed short-circuit and bake still no-op when the on-box tar already matches. **Key interfaces:** - The doorway handler that dispatches on `artifact=vm-guest` and its guest-payload serving helper — switch from `io.Copy(200)` to a range-honouring serve over the file source; serve the compressed representation. - The guest-cache source that opens the artifact from disk — teach it about the compressed representation alongside `vm-guest.tar`. - The production guest-payload stager's `download` helper — add resume (partial-file offset + `Range` request) + retry, then decompress. - The two lockstepped tar producers (payload assembler + slot stager) — emit the compressed artifact deterministically alongside the tar. - The e2e device-add fixture's stage command generator — mirror the new production fetch (resume + decompress). - The sha-marker constants/logic in the fleet-supply seed path and the gateway-image bake — leave the sha over `vm-guest.tar`; confirm no drift. **Acceptance criteria:** - [ ] The doorway responds to `curl -sfI …&artifact=vm-guest` (or the compressed artifact request) with `Accept-Ranges: bytes`, and to `curl -r 0-N …` with `206 Partial Content`. - [ ] The bytes transferred for a full `vm-guest` fetch are materially smaller than the uncompressed 2.6 GB (target: a few hundred MB) on the same input. - [ ] A member-device stage that loses its connection mid-transfer resumes from the partial file and costs only the remainder, not the whole (covered by a test/probe, not just manual). - [ ] After staging, `/var/lib/idss/vm-guest` contains the same decompressed contents as today (the qcow2 + relocatable QEMU dist), byte-for-byte equivalent to unpacking the uncompressed tar. - [ ] The compressed artifact is produced deterministically (same input ⇒ same bytes), and the seed short-circuit and snapshot bake still no-op against an already-matching on-box `vm-guest.tar` (sha marker unchanged). - [ ] The e2e device-add fixture's stage one-liner matches the production stager (resume + decompress) and the byo/device drive lanes stay green. **Out of scope:** - **Operator progress display** during the transfer (Shape step 3) — the one-liner is silent today; showing progress on the device-add "run this on the machine" surface is a UI change that needs the flow/wireframe, filed separately as a `needs-design` follow-up. - Changing the sha-marker scheme, the seed short-circuit, or the snapshot-bake mechanism (#1191) — they must remain green, over the uncompressed `vm-guest.tar`. - Re-architecting the doorway auth or the `/get` route surface.

swarm-claim host=bens-mac-04 run=30673
(automated multi-host claim — lowest live claim id works this ticket)

swarm-claim host=bens-mac-04 run=30673 (automated multi-host claim — lowest live claim id works this ticket)

Ruled by agent under ADR 0174 — veto anytime

Building the accepted shape (compress + resumable fetch; operator-progress stays the carved-out needs-design follow-up). Two implementer's-choice calls, both two-way doors, recorded here:

Codec = gzip, not zstd. The served representation is vm-guest.tar.gz and the device stages it with tar -xzf. Why a two-way door: revertible in one commit and provable by an offline size/round-trip test. Why gzip over the issue's proposed zstd: the device is a stock-Ubuntu machine and the staging one-liner is curl … | … | tar, so gzip/tar -z is universally present where zstd/unzstd is not guaranteed; and this repo already carries a deterministic-gzip precedent (internal/matourelease/pack.go: gzip.BestCompression + gzip.Header{OS:255}, no embedded name/modtime), which gives acceptance's "same input ⇒ same bytes" for free. A NixOS qcow2 still compresses hard under gzip — materially under the 2.6 GB, a handful of hundred MB.

The gateway derives the compressed representation from the on-box vm-guest.tar (lazy, deterministic, cached beside the tar, mtime-keyed), rather than the seed/bake carrying a second artefact. Why a two-way door: revertible in one commit, provable by an httptest over the guest-cache source. Why this shape: it leaves the #1191 sha-marker seed short-circuit and the snapshot bake byte-for-byte untouched — they keep carrying and keying on the uncompressed vm-guest.tar (the out-of-scope contract), and the .tar.gz is a pure transfer representation the doorway range-serves. The materialization is keyed on the tar's mtime so a nix/guest bump that replaces the tar re-derives the .tar.gz (no #1215-class staleness), and it is cached so only the first device on a fresh gateway pays the one-time compression.

What proves it (all offline): the doorway answers Accept-Ranges: bytes + 206 on a range request; the derived .tar.gz is materially smaller than the tar and round-trips to the identical bytes; the device stager sends a Range: from its partial temp file and resumes on a dropped copy; the seed/bake tests stay green unchanged. The live proof is the byo device drive's agent-install stage.

## Ruled by agent under ADR 0174 — veto anytime Building the accepted shape (compress + resumable fetch; operator-progress stays the carved-out `needs-design` follow-up). Two implementer's-choice calls, both two-way doors, recorded here: **Codec = gzip, not zstd.** The served representation is `vm-guest.tar.gz` and the device stages it with `tar -xzf`. *Why a two-way door:* revertible in one commit and provable by an offline size/round-trip test. *Why gzip over the issue's proposed zstd:* the device is a stock-Ubuntu machine and the staging one-liner is `curl … | … | tar`, so `gzip`/`tar -z` is universally present where `zstd`/`unzstd` is not guaranteed; and this repo already carries a **deterministic-gzip precedent** (`internal/matourelease/pack.go`: `gzip.BestCompression` + `gzip.Header{OS:255}`, no embedded name/modtime), which gives acceptance's "same input ⇒ same bytes" for free. A NixOS qcow2 still compresses hard under gzip — materially under the 2.6 GB, a handful of hundred MB. **The gateway derives the compressed representation from the on-box `vm-guest.tar` (lazy, deterministic, cached beside the tar, mtime-keyed), rather than the seed/bake carrying a second artefact.** *Why a two-way door:* revertible in one commit, provable by an httptest over the guest-cache source. *Why this shape:* it leaves the #1191 sha-marker seed short-circuit and the snapshot bake **byte-for-byte untouched** — they keep carrying and keying on the uncompressed `vm-guest.tar` (the out-of-scope contract), and the `.tar.gz` is a pure transfer representation the doorway range-serves. The materialization is keyed on the tar's mtime so a `nix/guest` bump that replaces the tar re-derives the `.tar.gz` (no #1215-class staleness), and it is cached so only the first device on a fresh gateway pays the one-time compression. **What proves it (all offline):** the doorway answers `Accept-Ranges: bytes` + `206` on a range request; the derived `.tar.gz` is materially smaller than the tar and round-trips to the identical bytes; the device stager sends a `Range:` from its partial temp file and resumes on a dropped copy; the seed/bake tests stay green unchanged. The live proof is the byo device drive's `agent-install` stage.

close-report for #1753 — status success

⛔ close-report gates REFUSED this close — the following claims did not verify:

  • commit 3d9c72239f is not a valid commit object (fabricated, or never pushed)
  • changed_files: 'STATUS.md' is not in the diff of the claimed commits
  • changed_files: 'app/tests/e2e/fixtures/deviceAdd.test.ts' is not in the diff of the claimed commits
  • changed_files: 'app/tests/e2e/fixtures/deviceAdd.ts' is not in the diff of the claimed commits
  • changed_files: 'internal/controlapi/install_doorway.go' is not in the diff of the claimed commits
  • changed_files: 'internal/controlapi/install_doorway_test.go' is not in the diff of the claimed commits
  • changed_files: 'internal/install/guestcache.go' is not in the diff of the claimed commits
  • changed_files: 'internal/install/guestcache_test.go' is not in the diff of the claimed commits
  • changed_files: 'internal/install/guestpayload.go' is not in the diff of the claimed commits
  • changed_files: 'internal/install/guestpayload_test.go' is not in the diff of the claimed commits
envelope
{
  "issue": 1753,
  "status": "success",
  "commits": [
    "3d9c72239f"
  ],
  "changed_files": [
    "STATUS.md",
    "app/tests/e2e/fixtures/deviceAdd.test.ts",
    "app/tests/e2e/fixtures/deviceAdd.ts",
    "internal/controlapi/install_doorway.go",
    "internal/controlapi/install_doorway_test.go",
    "internal/install/guestcache.go",
    "internal/install/guestcache_test.go",
    "internal/install/guestpayload.go",
    "internal/install/guestpayload_test.go"
  ],
  "tests": [
    {
      "command": "go test ./internal/install/... ./internal/controlapi/... ./internal/fleetwire/... ./control-plane/...",
      "exit_code": 0
    },
    {
      "command": "go build ./...",
      "exit_code": 0
    },
    {
      "command": "gofmt -l internal/install internal/controlapi (clean) && go vet ./internal/install/... ./internal/controlapi/...",
      "exit_code": 0
    },
    {
      "command": "pnpm vitest run tests/e2e/fixtures/deviceAdd.test.ts (76 passed)",
      "exit_code": 0
    }
  ],
  "criteria": {
    "The doorway responds with Accept-Ranges: bytes, and 206 on a Range request": "internal/controlapi/install_doorway.go serveGuestPayload uses http.ServeContent (application/gzip); proven by TestInstallDoorway_VMGuestRouteServesTheBundle (Accept-Ranges) + TestInstallDoorway_VMGuestRouteHonoursRange (206) in install_doorway_test.go",
    "Bytes transferred for a full vm-guest fetch are materially smaller than 2.6 GB": "internal/install/guestcache.go materializeCompressedBundle gzip's the tar; TestGuestCache_ServesCompressedRoundTrip asserts served < tar for a compressible bundle",
    "A stage that loses its connection mid-transfer resumes from the partial file and costs only the remainder": "internal/install/guestpayload.go download() sends a Range from fileSize(partial) with retry; TestGuestPayload_ResumesADroppedTransfer asserts the resume Range=bytes=6- and full reassembly; deviceAdd.ts stageGuestPayloadCommand uses curl -C - --retry-all-errors",
    "After staging, /var/lib/idss/vm-guest contains the same decompressed contents as today": "device stager runs tar -xzf (guestpayload.go); gateway gz round-trips to the exact tar bytes (TestGuestCache_ServesCompressedRoundTrip)",
    "The compressed artifact is deterministic and the seed short-circuit and snapshot bake still no-op over the uncompressed vm-guest.tar": "TestGuestCache_DeterministicCompression proves same tar => same gz; supply.go/#1191 seed short-circuit and gateway-image-vm-guest-lib.sh bake are byte-for-byte untouched (internal/fleetwire tests green); the gz is a derived transfer representation, the tar stays the artefact of record",
    "The e2e device-add fixture's stage one-liner matches the production stager (resume + decompress)": "app/tests/e2e/fixtures/deviceAdd.ts stageGuestPayloadCommand + guestPayloadHeaderFault updated; deviceAdd.test.ts 76 tests green"
  },
  "summary": "The gateway serves the VM-guest bundle compressed (application/gzip) and range-capable and the device stages it resumably with tar -xzf, removing the ~52-min uncompressed home-line stage.",
  "blockers": []
}
**close-report** for #1753 — status `success` :no_entry: **close-report gates REFUSED this close** — the following claims did not verify: - commit 3d9c72239f is not a valid commit object (fabricated, or never pushed) - changed_files: 'STATUS.md' is not in the diff of the claimed commits - changed_files: 'app/tests/e2e/fixtures/deviceAdd.test.ts' is not in the diff of the claimed commits - changed_files: 'app/tests/e2e/fixtures/deviceAdd.ts' is not in the diff of the claimed commits - changed_files: 'internal/controlapi/install_doorway.go' is not in the diff of the claimed commits - changed_files: 'internal/controlapi/install_doorway_test.go' is not in the diff of the claimed commits - changed_files: 'internal/install/guestcache.go' is not in the diff of the claimed commits - changed_files: 'internal/install/guestcache_test.go' is not in the diff of the claimed commits - changed_files: 'internal/install/guestpayload.go' is not in the diff of the claimed commits - changed_files: 'internal/install/guestpayload_test.go' is not in the diff of the claimed commits <details><summary>envelope</summary> ```json { "issue": 1753, "status": "success", "commits": [ "3d9c72239f" ], "changed_files": [ "STATUS.md", "app/tests/e2e/fixtures/deviceAdd.test.ts", "app/tests/e2e/fixtures/deviceAdd.ts", "internal/controlapi/install_doorway.go", "internal/controlapi/install_doorway_test.go", "internal/install/guestcache.go", "internal/install/guestcache_test.go", "internal/install/guestpayload.go", "internal/install/guestpayload_test.go" ], "tests": [ { "command": "go test ./internal/install/... ./internal/controlapi/... ./internal/fleetwire/... ./control-plane/...", "exit_code": 0 }, { "command": "go build ./...", "exit_code": 0 }, { "command": "gofmt -l internal/install internal/controlapi (clean) && go vet ./internal/install/... ./internal/controlapi/...", "exit_code": 0 }, { "command": "pnpm vitest run tests/e2e/fixtures/deviceAdd.test.ts (76 passed)", "exit_code": 0 } ], "criteria": { "The doorway responds with Accept-Ranges: bytes, and 206 on a Range request": "internal/controlapi/install_doorway.go serveGuestPayload uses http.ServeContent (application/gzip); proven by TestInstallDoorway_VMGuestRouteServesTheBundle (Accept-Ranges) + TestInstallDoorway_VMGuestRouteHonoursRange (206) in install_doorway_test.go", "Bytes transferred for a full vm-guest fetch are materially smaller than 2.6 GB": "internal/install/guestcache.go materializeCompressedBundle gzip's the tar; TestGuestCache_ServesCompressedRoundTrip asserts served < tar for a compressible bundle", "A stage that loses its connection mid-transfer resumes from the partial file and costs only the remainder": "internal/install/guestpayload.go download() sends a Range from fileSize(partial) with retry; TestGuestPayload_ResumesADroppedTransfer asserts the resume Range=bytes=6- and full reassembly; deviceAdd.ts stageGuestPayloadCommand uses curl -C - --retry-all-errors", "After staging, /var/lib/idss/vm-guest contains the same decompressed contents as today": "device stager runs tar -xzf (guestpayload.go); gateway gz round-trips to the exact tar bytes (TestGuestCache_ServesCompressedRoundTrip)", "The compressed artifact is deterministic and the seed short-circuit and snapshot bake still no-op over the uncompressed vm-guest.tar": "TestGuestCache_DeterministicCompression proves same tar => same gz; supply.go/#1191 seed short-circuit and gateway-image-vm-guest-lib.sh bake are byte-for-byte untouched (internal/fleetwire tests green); the gz is a derived transfer representation, the tar stays the artefact of record", "The e2e device-add fixture's stage one-liner matches the production stager (resume + decompress)": "app/tests/e2e/fixtures/deviceAdd.ts stageGuestPayloadCommand + guestPayloadHeaderFault updated; deviceAdd.test.ts 76 tests green" }, "summary": "The gateway serves the VM-guest bundle compressed (application/gzip) and range-capable and the device stages it resumably with tar -xzf, removing the ~52-min uncompressed home-line stage.", "blockers": [] } ``` </details>

close-report for #1753 — status success

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

envelope
{
  "issue": 1753,
  "status": "success",
  "commits": [
    "3d9c72230d7b1029c9ea1616905b31bb8c7b2661"
  ],
  "changed_files": [
    "STATUS.md",
    "app/tests/e2e/fixtures/deviceAdd.test.ts",
    "app/tests/e2e/fixtures/deviceAdd.ts",
    "internal/controlapi/install_doorway.go",
    "internal/controlapi/install_doorway_test.go",
    "internal/install/guestcache.go",
    "internal/install/guestcache_test.go",
    "internal/install/guestpayload.go",
    "internal/install/guestpayload_test.go"
  ],
  "tests": [
    {
      "command": "go test ./internal/install/... ./internal/controlapi/... ./internal/fleetwire/... ./control-plane/...",
      "exit_code": 0
    },
    {
      "command": "go build ./...",
      "exit_code": 0
    },
    {
      "command": "gofmt -l internal/install internal/controlapi (clean) && go vet ./internal/install/... ./internal/controlapi/...",
      "exit_code": 0
    },
    {
      "command": "pnpm vitest run tests/e2e/fixtures/deviceAdd.test.ts (76 passed)",
      "exit_code": 0
    }
  ],
  "criteria": {
    "The doorway responds with Accept-Ranges: bytes, and 206 on a Range request": "internal/controlapi/install_doorway.go serveGuestPayload uses http.ServeContent (application/gzip); proven by TestInstallDoorway_VMGuestRouteServesTheBundle (Accept-Ranges) + TestInstallDoorway_VMGuestRouteHonoursRange (206) in install_doorway_test.go",
    "Bytes transferred for a full vm-guest fetch are materially smaller than 2.6 GB": "internal/install/guestcache.go materializeCompressedBundle gzip's the tar; TestGuestCache_ServesCompressedRoundTrip asserts served < tar for a compressible bundle",
    "A stage that loses its connection mid-transfer resumes from the partial file and costs only the remainder": "internal/install/guestpayload.go download() sends a Range from fileSize(partial) with retry; TestGuestPayload_ResumesADroppedTransfer asserts the resume Range=bytes=6- and full reassembly; deviceAdd.ts stageGuestPayloadCommand uses curl -C - --retry-all-errors",
    "After staging, /var/lib/idss/vm-guest contains the same decompressed contents as today": "device stager runs tar -xzf (guestpayload.go); gateway gz round-trips to the exact tar bytes (TestGuestCache_ServesCompressedRoundTrip)",
    "The compressed artifact is deterministic and the seed short-circuit and snapshot bake still no-op over the uncompressed vm-guest.tar": "TestGuestCache_DeterministicCompression proves same tar => same gz; supply.go/#1191 seed short-circuit and gateway-image-vm-guest-lib.sh bake are byte-for-byte untouched (internal/fleetwire tests green); the gz is a derived transfer representation, the tar stays the artefact of record",
    "The e2e device-add fixture's stage one-liner matches the production stager (resume + decompress)": "app/tests/e2e/fixtures/deviceAdd.ts stageGuestPayloadCommand + guestPayloadHeaderFault updated; deviceAdd.test.ts 76 tests green"
  },
  "summary": "The gateway serves the VM-guest bundle compressed (application/gzip) and range-capable and the device stages it resumably with tar -xzf, removing the ~52-min uncompressed home-line stage.",
  "blockers": []
}
**close-report** for #1753 — status `success` :white_check_mark: **close-report gates passed** — every claim verified against main; issue closed. <details><summary>envelope</summary> ```json { "issue": 1753, "status": "success", "commits": [ "3d9c72230d7b1029c9ea1616905b31bb8c7b2661" ], "changed_files": [ "STATUS.md", "app/tests/e2e/fixtures/deviceAdd.test.ts", "app/tests/e2e/fixtures/deviceAdd.ts", "internal/controlapi/install_doorway.go", "internal/controlapi/install_doorway_test.go", "internal/install/guestcache.go", "internal/install/guestcache_test.go", "internal/install/guestpayload.go", "internal/install/guestpayload_test.go" ], "tests": [ { "command": "go test ./internal/install/... ./internal/controlapi/... ./internal/fleetwire/... ./control-plane/...", "exit_code": 0 }, { "command": "go build ./...", "exit_code": 0 }, { "command": "gofmt -l internal/install internal/controlapi (clean) && go vet ./internal/install/... ./internal/controlapi/...", "exit_code": 0 }, { "command": "pnpm vitest run tests/e2e/fixtures/deviceAdd.test.ts (76 passed)", "exit_code": 0 } ], "criteria": { "The doorway responds with Accept-Ranges: bytes, and 206 on a Range request": "internal/controlapi/install_doorway.go serveGuestPayload uses http.ServeContent (application/gzip); proven by TestInstallDoorway_VMGuestRouteServesTheBundle (Accept-Ranges) + TestInstallDoorway_VMGuestRouteHonoursRange (206) in install_doorway_test.go", "Bytes transferred for a full vm-guest fetch are materially smaller than 2.6 GB": "internal/install/guestcache.go materializeCompressedBundle gzip's the tar; TestGuestCache_ServesCompressedRoundTrip asserts served < tar for a compressible bundle", "A stage that loses its connection mid-transfer resumes from the partial file and costs only the remainder": "internal/install/guestpayload.go download() sends a Range from fileSize(partial) with retry; TestGuestPayload_ResumesADroppedTransfer asserts the resume Range=bytes=6- and full reassembly; deviceAdd.ts stageGuestPayloadCommand uses curl -C - --retry-all-errors", "After staging, /var/lib/idss/vm-guest contains the same decompressed contents as today": "device stager runs tar -xzf (guestpayload.go); gateway gz round-trips to the exact tar bytes (TestGuestCache_ServesCompressedRoundTrip)", "The compressed artifact is deterministic and the seed short-circuit and snapshot bake still no-op over the uncompressed vm-guest.tar": "TestGuestCache_DeterministicCompression proves same tar => same gz; supply.go/#1191 seed short-circuit and gateway-image-vm-guest-lib.sh bake are byte-for-byte untouched (internal/fleetwire tests green); the gz is a derived transfer representation, the tar stays the artefact of record", "The e2e device-add fixture's stage one-liner matches the production stager (resume + decompress)": "app/tests/e2e/fixtures/deviceAdd.ts stageGuestPayloadCommand + guestPayloadHeaderFault updated; deviceAdd.test.ts 76 tests green" }, "summary": "The gateway serves the VM-guest bundle compressed (application/gzip) and range-capable and the device stages it resumably with tar -xzf, removing the ~52-min uncompressed home-line stage.", "blockers": [] } ``` </details>
Author
Owner

Second finding, same bundle: the DEVICE's stage never short-circuits, so it downloads twice

Found on ADR 0264's fire 6 (the first run to get past the stage at all).

idss-agent install is the only caller of install.GuestPayload.StageGuest
(join/cli.go InstallAgent), and StageGuest has no short-circuit
(internal/install/guestpayload.go): it fetches the bundle unconditionally, even
when /var/lib/idss/vm-guest already holds exactly that bundle.

So a device that re-runs the published one-liner — which is the ordinary thing to
do after a declined request, a retry, or a re-enrol — pays the full ~2.6 GB again.
On the measured home line that is a second ~52 minutes, and it is silent:
the transcript stops after idss: fetching this community's pinned agent from <apex>… and prints nothing until the consent prompt, so the operator sees a dead
terminal for most of an hour.

The asymmetry is the tell: the GATEWAY's seed already solves this. fleetwire.Supply
writes vm-guest.tar.sha256 beside the landed tar and skips the copy when it
matches (PayloadVMGuestMarker, #1191). The device's own stage — the side on the
slow link, where it matters far more — has no equivalent.

Shape

  • Give StageGuest the mirror of the seed's short-circuit: compare the staged
    slot against the doorway's sha (a sidecar, or a HEAD the doorway already
    serves) and skip when they match.
  • With that, a re-run of the one-liner is instant instead of a second hour, and
    the compression work above cuts what remains.

Drive impact

The byo drive stages twice by construction: once in agent-install (so the
decline-resume honesty leg has a guest to tear down), then again inside the join
one-liner. Until this lands, both legs carry the measured 75-minute stage budget,
which is why a bring-your-own fire now runs ~2.5 h. Fixing this halves it.

## Second finding, same bundle: the DEVICE's stage never short-circuits, so it downloads twice Found on ADR 0264's fire 6 (the first run to get past the stage at all). `idss-agent install` is the only caller of `install.GuestPayload.StageGuest` (`join/cli.go InstallAgent`), and **`StageGuest` has no short-circuit** (`internal/install/guestpayload.go`): it fetches the bundle unconditionally, even when `/var/lib/idss/vm-guest` already holds exactly that bundle. So a device that re-runs the published one-liner — which is the ordinary thing to do after a declined request, a retry, or a re-enrol — pays the full ~2.6 GB again. On the measured home line that is a second **~52 minutes**, and it is **silent**: the transcript stops after `idss: fetching this community's pinned agent from <apex>…` and prints nothing until the consent prompt, so the operator sees a dead terminal for most of an hour. The asymmetry is the tell: the GATEWAY's seed already solves this. `fleetwire.Supply` writes `vm-guest.tar.sha256` beside the landed tar and skips the copy when it matches (`PayloadVMGuestMarker`, #1191). The device's own stage — the side on the slow link, where it matters far more — has no equivalent. ## Shape - Give `StageGuest` the mirror of the seed's short-circuit: compare the staged slot against the doorway's sha (a sidecar, or a `HEAD` the doorway already serves) and skip when they match. - With that, a re-run of the one-liner is instant instead of a second hour, and the compression work above cuts what remains. ## Drive impact The byo drive stages twice by construction: once in `agent-install` (so the decline-resume honesty leg has a guest to tear down), then again inside the join one-liner. Until this lands, both legs carry the measured 75-minute stage budget, which is why a bring-your-own fire now runs ~2.5 h. Fixing this halves it.
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#1753
No description provided.