the gateway substitutes its installer base instead of receiving 817 MB from the operator's laptop (ADR 0272) #1768

Closed
opened 2026-09-23 15:09:26 +00:00 by ben · 6 comments
Owner

Per ADR 0272 (docs/adr/0272-the-target-fetches-its-own-bytes-the-installer-carries-only-the-pre-gateway-bootstrap.md, landed 180b4975), decision 1 and 3.

Today

installer-base-cache/ + installer-base.toplevel is the largest single slot in the installer at ~817 MB (narrowed from 2.29 GB by scripts/build-installer-base-warm.sh, which drops the 1.47 GB of assembled kexec tarball / initrd / squashfs). It is built by default at release time (scripts/assemble-payload.sh:240-254), staged (:255-272), shipped in the .deb, and then imported into the gateway's store at the supply leg (internal/fleetwire/supply.go:56,63,506-530, under the shared seed deadline at :378-389). It is consumed later by the member-device takeover's on-box compose (internal/clan/installer_image.go, renderInstallerMesh).

So ~817 MB rides the operator's download and then the operator's uplink, to reach a machine with its own internet connection.

Asks

  1. The gateway substitutes the installer-base closure — the 713 MiB from cache.nixos.org, the 67 built paths from Mātou's signed cache — rather than receiving it from the founding machine.
  2. Drop installer-base-cache/ and installer-base.toplevel from the payload: assemble-payload.sh, and the slot's read side in internal/fleetwire/supply.go.
  3. Keep the trust story explicit per decision 2: a substituted path is trusted by its signature, not by having arrived in the app download. The existing --no-check-sigs import (supply.go:518, "explicit import, the payload is the trust boundary") is exactly the line that changes.
  4. A test pinning that the supply leg no longer carries this slot, so it cannot quietly return.

Blocked by the Mātou signed cache ticket — the 67 built paths have nowhere to come from until it exists. Do not start this before that lands.

Per ADR 0272 (`docs/adr/0272-the-target-fetches-its-own-bytes-the-installer-carries-only-the-pre-gateway-bootstrap.md`, landed `180b4975`), decision 1 and 3. ## Today `installer-base-cache/` + `installer-base.toplevel` is the **largest single slot in the installer at ~817 MB** (narrowed from 2.29 GB by `scripts/build-installer-base-warm.sh`, which drops the 1.47 GB of assembled kexec tarball / initrd / squashfs). It is built by default at release time (`scripts/assemble-payload.sh:240-254`), staged (`:255-272`), shipped in the `.deb`, and then **imported into the gateway's store** at the supply leg (`internal/fleetwire/supply.go:56,63,506-530`, under the shared seed deadline at `:378-389`). It is consumed later by the member-device takeover's on-box compose (`internal/clan/installer_image.go`, `renderInstallerMesh`). So ~817 MB rides the operator's download and then the operator's uplink, to reach a machine with its own internet connection. ## Asks 1. The gateway substitutes the installer-base closure — the 713 MiB from cache.nixos.org, the 67 built paths from Mātou's signed cache — rather than receiving it from the founding machine. 2. Drop `installer-base-cache/` and `installer-base.toplevel` from the payload: `assemble-payload.sh`, and the slot's read side in `internal/fleetwire/supply.go`. 3. Keep the trust story explicit per decision 2: a substituted path is trusted by its **signature**, not by having arrived in the app download. The existing `--no-check-sigs` import (`supply.go:518`, "explicit import, the payload is the trust boundary") is exactly the line that changes. 4. A test pinning that the supply leg no longer carries this slot, so it cannot quietly return. **Blocked by the Mātou signed cache ticket** — the 67 built paths have nowhere to come from until it exists. Do not start this before that lands.
Author
Owner

depends_on #1767 — the keystone. This ticket is deliberately left without ready-for-agent until #1767 is ruled and the cache exists; picking it up before then means building against a surface that has no decided home, owner or signing key.

**depends_on #1767** — the keystone. This ticket is deliberately left without `ready-for-agent` until #1767 is ruled and the cache exists; picking it up before then means building against a surface that has no decided home, owner or signing key.

This was generated by AI during triage.

Ruled by agent under ADR 0174 — veto anytime.

Triage

  • Category — enhancement. Founding succeeds today; this ticket improves it by having the gateway source its ~817 MB installer-base closure itself instead of carrying it over the operator's uplink. Nothing is broken, so it reads as an improvement, not a defect (the sibling deploy-leg ticket #1764 was filed bug; this is a two-way call — flip it if you'd rather these track as bugs).
  • State — needs-design, not ready-for-agent. Per your own comment, this is "deliberately left without ready-for-agent until #1767 is ruled and the cache exists." The contract the agent would build against — Mātou's signed binary cache, its home, owner and signing key — does not exist yet; #1767 (ready-for-human, the keystone) is where that one-way door is decided. needs-design is the state for "the thing you'd build against isn't ready; route back before implementation," and it keeps this off the swarm queue (list-ready-tasks.sh reads only ready-for-agent) until a human promotes it.
  • Not ready-for-human: the one-way-door residue (a new public surface + a new signing key) lives in #1767, which already carries ready-for-human. This ticket is delegable engineering once that contract is real — no separate human decision of its own.
  • Set depends_on #1767 as a native Forgejo dependency (your comment named it in prose; it is now machine-readable), so the block is explicit and this surfaces the moment the keystone lands.

Why this is a two-way door: every part is a label/dependency change, reversible by a later edit; nothing is committed to code and no member-facing or credential surface moves. What proves it: the dependency shows #1767 open as the blocker (GET /issues/1768/dependencies), and list-ready-tasks.sh reads only ready-for-agent, so a needs-design ticket is invisible to the swarm by construction. When #1767 is ruled and Mātou's signed cache exists, a human removes needs-design and applies ready-for-agent.

> *This was generated by AI during triage.* **Ruled by agent under ADR 0174 — veto anytime.** ## Triage - **Category — `enhancement`.** Founding succeeds today; this ticket *improves* it by having the gateway source its ~817 MB installer-base closure itself instead of carrying it over the operator's uplink. Nothing is broken, so it reads as an improvement, not a defect (the sibling deploy-leg ticket #1764 was filed `bug`; this is a two-way call — flip it if you'd rather these track as bugs). - **State — `needs-design`, not `ready-for-agent`.** Per your own comment, this is "deliberately left without `ready-for-agent` until #1767 is ruled and the cache exists." The contract the agent would build against — Mātou's signed binary cache, its home, owner and signing key — does not exist yet; #1767 (`ready-for-human`, the keystone) is where that one-way door is decided. `needs-design` is the state for "the thing you'd build against isn't ready; route back before implementation," and it keeps this off the swarm queue (`list-ready-tasks.sh` reads only `ready-for-agent`) until a human promotes it. - **Not `ready-for-human`:** the one-way-door residue (a new public surface + a new signing key) lives in #1767, which already carries `ready-for-human`. This ticket is delegable engineering once that contract is real — no separate human decision of its own. - **Set `depends_on #1767`** as a native Forgejo dependency (your comment named it in prose; it is now machine-readable), so the block is explicit and this surfaces the moment the keystone lands. **Why this is a two-way door:** every part is a label/dependency change, reversible by a later edit; nothing is committed to code and no member-facing or credential surface moves. **What proves it:** the dependency shows #1767 open as the blocker (`GET /issues/1768/dependencies`), and `list-ready-tasks.sh` reads only `ready-for-agent`, so a `needs-design` ticket is invisible to the swarm by construction. When #1767 is ruled and Mātou's signed cache exists, a human removes `needs-design` and applies `ready-for-agent`.
Author
Owner

Design ruled — ADR 0275 (75b4dc15): the installer base substitutes from https://cache.idss.nz (public read, signed by cache.idss.nz-1, listed AFTER cache.nixos.org in substituters). This ticket stays blocked until #1801 has the cache live and the public key + endpoint committed; it becomes ready-for-agent then.

Design ruled — ADR 0275 (`75b4dc15`): the installer base substitutes from `https://cache.idss.nz` (public read, signed by `cache.idss.nz-1`, listed AFTER cache.nixos.org in `substituters`). This ticket stays blocked until **#1801** has the cache live and the public key + endpoint committed; it becomes `ready-for-agent` then.
Author
Owner

Unblocked 2026-09-24 — the cache is live (#1801 closed)

  • Read side: https://nix.cache.idss.nz, key cache.idss.nz-1:jryaAm0uulUbamaQ5/9Shb9SkpMW3rVv49FkzRNOf7E=; every image and the rendered baseline already trust it via nix/matou-cache.nix / internal/clan/matoucache.go (main b5488eea).
  • What is in it: the narrowed kexec-installer-base closure (1,359 paths, signed), republished by the cache-publish workflow at each main revision that moves the toplevel; marker = packages.kexec-installer-base-toplevel.
  • Proof on a cold store: nix build --dry-run .#kexec-installer-base = 3 derivations to build (the assembled tarball/initrd/squashfs the narrowing drops) against 67 without the cache.
  • Two traps for the implementation: a path in the cache but unsigned by a trusted key silently REBUILDS (GOTCHAS #331), and Nix's negative narinfo cache pins a miss for an hour (GOTCHAS #332) — a founding gateway is never bitten by the second, a test harness can be.

This ticket had needs-design as its blocked-on-#1801 gate; there is no UI surface here. Flipping to ready-for-agent.

## Unblocked 2026-09-24 — the cache is live (#1801 closed) - Read side: **`https://nix.cache.idss.nz`**, key `cache.idss.nz-1:jryaAm0uulUbamaQ5/9Shb9SkpMW3rVv49FkzRNOf7E=`; every image and the rendered baseline already trust it via `nix/matou-cache.nix` / `internal/clan/matoucache.go` (main `b5488eea`). - What is in it: the narrowed kexec-installer-base closure (1,359 paths, signed), republished by the `cache-publish` workflow at each main revision that moves the toplevel; marker = `packages.kexec-installer-base-toplevel`. - Proof on a cold store: `nix build --dry-run .#kexec-installer-base` = **3 derivations to build** (the assembled tarball/initrd/squashfs the narrowing drops) against 67 without the cache. - Two traps for the implementation: a path in the cache but unsigned by a trusted key silently REBUILDS (GOTCHAS #331), and Nix's negative narinfo cache pins a miss for an hour (GOTCHAS #332) — a founding gateway is never bitten by the second, a test harness can be. This ticket had `needs-design` as its blocked-on-#1801 gate; there is no UI surface here. Flipping to `ready-for-agent`.

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

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

close-report for #1768 — status success

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

envelope
{
  "issue": 1768,
  "status": "success",
  "commits": [
    "5aa5c3f32bddb6b3ee6fce701836f50613dff300"
  ],
  "changed_files": [
    "STATUS.md",
    "app/PACKAGING.md",
    "docs/architecture/11-update-supply-chain.md",
    "internal/clan/installer_image_test.go",
    "internal/fleetwire/supply.go",
    "internal/fleetwire/supply_test.go",
    "scripts/assemble-payload.sh",
    "scripts/tests/keriweb-payload-test.sh",
    "scripts/tests/payload-store-mode-test.sh"
  ],
  "tests": [
    {
      "command": "nix develop .#go-ci -c go build ./...",
      "exit_code": 0
    },
    {
      "command": "nix develop .#go-ci -c go vet ./internal/fleetwire/ ./internal/clan/ ./internal/provision/ ./control-plane/...",
      "exit_code": 0
    },
    {
      "command": "nix develop .#go-ci -c gofmt -l internal/ control-plane/",
      "exit_code": 0
    },
    {
      "command": "nix develop .#go-ci -c go test ./internal/fleetwire/ ./internal/clan/ ./internal/provision/",
      "exit_code": 0
    },
    {
      "command": "bash scripts/tests/release-rail-test.sh",
      "exit_code": 0
    },
    {
      "command": "bash scripts/tests/keriweb-payload-test.sh",
      "exit_code": 0
    },
    {
      "command": "bash scripts/tests/payload-store-mode-test.sh",
      "exit_code": 0
    }
  ],
  "criteria": {
    "Ask 1 — the gateway substitutes the installer-base closure (713 MiB from cache.nixos.org, the built paths from Mātou's signed cache) rather than receiving it from the founding machine": "The gateway's rendered baseline already trusts https://nix.cache.idss.nz after cache.nixos.org (internal/clan/matoucache.go / nix/matou-cache.nix, main b5488eea); with the payload carriage removed, the on-box installer compose (renderInstallerMesh, internal/clan/installer_image.go) substitutes the pkgsStatic base from that cache at the daemon level — proven offline by TestInstallerImage_ComposingFlakeRegistersNoOffBoxSubstituter (the throwaway flake hardcodes no substituter; it lives in the gateway's nix.conf) and the #1801 step-8 dry-run (3 derivations vs 67).",
    "Ask 2 — drop installer-base-cache/ and installer-base.toplevel from the payload (assemble-payload.sh) and the slot's read side in internal/fleetwire/supply.go": "scripts/assemble-payload.sh no longer stages installer-base-cache/ or installer-base.toplevel (staging block replaced by a #1768 note; header docs + PAYLOAD.txt manifest updated). internal/fleetwire/supply.go removes seedInstallerBase, its two call sites (carry + feed path), and the PayloadInstallerBaseCache / PayloadInstallerBaseMarker constants.",
    "Ask 3 — a substituted path is trusted by its signature, not by having arrived in the app download; the --no-check-sigs import line changes": "The founding-leg `nix copy --no-check-sigs --from file://... --all` import (the 'payload is the trust boundary' line) is removed with seedInstallerBase; the gateway now substitutes signed paths (an unsigned path does not substitute — GOTCHAS #331). Recorded in supply.go comments and the STATUS.md log.",
    "Ask 4 — a test pinning that the supply leg no longer carries this slot, so it cannot quietly return": "internal/fleetwire/supply_test.go TestSupplySeed_SupplyLegCarriesNoInstallerBaseSlot builds a payload that STILL carries the old installer-base-cache/ + marker and asserts NO command references installer-base / nix copy / nix-store --add-root on BOTH the carry and feed paths."
  },
  "summary": "The ~817 MB kexec-installer-base closure leaves the founding supply leg; the gateway substitutes it from Mātou's signed cache (ADR 0272 d.3 / ADR 0275), with the carriage dropped from assemble-payload.sh and supply.go and a test pinning the slot shut.",
  "blockers": []
}
**close-report** for #1768 — status `success` :white_check_mark: **close-report gates passed** — every claim verified against main; issue closed. <details><summary>envelope</summary> ```json { "issue": 1768, "status": "success", "commits": [ "5aa5c3f32bddb6b3ee6fce701836f50613dff300" ], "changed_files": [ "STATUS.md", "app/PACKAGING.md", "docs/architecture/11-update-supply-chain.md", "internal/clan/installer_image_test.go", "internal/fleetwire/supply.go", "internal/fleetwire/supply_test.go", "scripts/assemble-payload.sh", "scripts/tests/keriweb-payload-test.sh", "scripts/tests/payload-store-mode-test.sh" ], "tests": [ { "command": "nix develop .#go-ci -c go build ./...", "exit_code": 0 }, { "command": "nix develop .#go-ci -c go vet ./internal/fleetwire/ ./internal/clan/ ./internal/provision/ ./control-plane/...", "exit_code": 0 }, { "command": "nix develop .#go-ci -c gofmt -l internal/ control-plane/", "exit_code": 0 }, { "command": "nix develop .#go-ci -c go test ./internal/fleetwire/ ./internal/clan/ ./internal/provision/", "exit_code": 0 }, { "command": "bash scripts/tests/release-rail-test.sh", "exit_code": 0 }, { "command": "bash scripts/tests/keriweb-payload-test.sh", "exit_code": 0 }, { "command": "bash scripts/tests/payload-store-mode-test.sh", "exit_code": 0 } ], "criteria": { "Ask 1 — the gateway substitutes the installer-base closure (713 MiB from cache.nixos.org, the built paths from Mātou's signed cache) rather than receiving it from the founding machine": "The gateway's rendered baseline already trusts https://nix.cache.idss.nz after cache.nixos.org (internal/clan/matoucache.go / nix/matou-cache.nix, main b5488eea); with the payload carriage removed, the on-box installer compose (renderInstallerMesh, internal/clan/installer_image.go) substitutes the pkgsStatic base from that cache at the daemon level — proven offline by TestInstallerImage_ComposingFlakeRegistersNoOffBoxSubstituter (the throwaway flake hardcodes no substituter; it lives in the gateway's nix.conf) and the #1801 step-8 dry-run (3 derivations vs 67).", "Ask 2 — drop installer-base-cache/ and installer-base.toplevel from the payload (assemble-payload.sh) and the slot's read side in internal/fleetwire/supply.go": "scripts/assemble-payload.sh no longer stages installer-base-cache/ or installer-base.toplevel (staging block replaced by a #1768 note; header docs + PAYLOAD.txt manifest updated). internal/fleetwire/supply.go removes seedInstallerBase, its two call sites (carry + feed path), and the PayloadInstallerBaseCache / PayloadInstallerBaseMarker constants.", "Ask 3 — a substituted path is trusted by its signature, not by having arrived in the app download; the --no-check-sigs import line changes": "The founding-leg `nix copy --no-check-sigs --from file://... --all` import (the 'payload is the trust boundary' line) is removed with seedInstallerBase; the gateway now substitutes signed paths (an unsigned path does not substitute — GOTCHAS #331). Recorded in supply.go comments and the STATUS.md log.", "Ask 4 — a test pinning that the supply leg no longer carries this slot, so it cannot quietly return": "internal/fleetwire/supply_test.go TestSupplySeed_SupplyLegCarriesNoInstallerBaseSlot builds a payload that STILL carries the old installer-base-cache/ + marker and asserts NO command references installer-base / nix copy / nix-store --add-root on BOTH the carry and feed paths." }, "summary": "The ~817 MB kexec-installer-base closure leaves the founding supply leg; the gateway substitutes it from Mātou's signed cache (ADR 0272 d.3 / ADR 0275), with the carriage dropped from assemble-payload.sh and supply.go and a test pinning the slot shut.", "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.

Reference
Matou/idss#1768
No description provided.