the gateway fetches Mātou's own binaries from the signed feed at the founding revision, instead of carrying them (ADR 0272) #1769

Closed
opened 2026-09-23 15:09:27 +00:00 by ben · 5 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), decisions 2 and 6.

Today

The payload carries Mātou's own artifacts and the supply leg copies them onto the gateway:

  • control-plane binary (~23 MB, assemble-payload.sh:99-109, ldflags-stamped with the founding revision at :104) → supply.go:286-292 → /srv/idss/bin/control-plane
  • idss-idp (assemble-payload.sh:115-122) → supply.go:294-307
  • dashboard + dashboard/idip/keri-web.js (:145-168) → supply.go:337-342
  • agent (:86-94) → supply.go:352, the gateway's agent cache, RELEASE marker written last (:358-359)

None of these are in cache.nixos.org — they are Mātou's. But they are small, and the gateway can reach a signed feed (ADR 0248) perfectly well.

Asks

  1. The gateway fetches these from the signed feed rather than receiving them over the founding connection.
  2. Pinned to the app's exact revision, never "latest". This is the load-bearing constraint. The control-plane binary is stamped so a community "KNOWS its own release" (#1631/#1674); a fetch that resolves to newest rebuilds #1690's build-ahead-of-feed self-downgrade, in a place far harder to notice than the update lane. A test should pin that the fetched revision equals the founding revision, and that a mismatch fails loud (ADR 0100) rather than proceeding.
  3. Signature verification on the fetch, per decision 2 — carriage is no longer the trust boundary.
  4. config-server is unaffected: it is already never vendored (assemble-payload.sh:124-134, ADR 0226 d.2) and already refuses at preflight when absent (internal/founding/privatepath.go:191,197-205). That refusal is the model for what a missing fetched artifact should do.

Blocked by the Mātou signed cache ticket.

Per ADR 0272 (`docs/adr/0272-the-target-fetches-its-own-bytes-the-installer-carries-only-the-pre-gateway-bootstrap.md`, landed `180b4975`), decisions 2 and 6. ## Today The payload carries Mātou's own artifacts and the supply leg copies them onto the gateway: - control-plane binary (~23 MB, `assemble-payload.sh:99-109`, ldflags-stamped with the founding revision at `:104`) → `supply.go:286-292` → `/srv/idss/bin/control-plane` - `idss-idp` (`assemble-payload.sh:115-122`) → `supply.go:294-307` - dashboard + `dashboard/idip/keri-web.js` (`:145-168`) → `supply.go:337-342` - agent (`:86-94`) → `supply.go:352`, the gateway's agent cache, `RELEASE` marker written last (`:358-359`) None of these are in cache.nixos.org — they are Mātou's. But they are small, and the gateway can reach a signed feed (ADR 0248) perfectly well. ## Asks 1. The gateway fetches these from the signed feed rather than receiving them over the founding connection. 2. **Pinned to the app's exact revision, never "latest".** This is the load-bearing constraint. The control-plane binary is stamped so a community "KNOWS its own release" (#1631/#1674); a fetch that resolves to newest rebuilds #1690's build-ahead-of-feed self-downgrade, in a place far harder to notice than the update lane. A test should pin that the fetched revision equals the founding revision, and that a mismatch fails loud (ADR 0100) rather than proceeding. 3. Signature verification on the fetch, per decision 2 — carriage is no longer the trust boundary. 4. `config-server` is unaffected: it is already never vendored (`assemble-payload.sh:124-134`, ADR 0226 d.2) and already refuses at preflight when absent (`internal/founding/privatepath.go:191,197-205`). That refusal is the model for what a missing fetched artifact should do. **Blocked by the Mātou signed cache ticket.**
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 Mātou's own binaries (control-plane, idss-idp, dashboard, agent) 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/1769/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 Mātou's own binaries (control-plane, idss-idp, dashboard, agent) 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/1769/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`.

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

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

Ruled by agent under ADR 0174 — veto anytime.

Scope of this slice

Per ADR 0275 §3 the gateway-bound binaries ride the ADR 0248 signed feed (not the Nix cache), so this builds on the feed reader (internal/matouchannel) and the verified-download core (internal/update) already in tree.

This iteration ships the operator-side verified, revision-pinned resolver (internal/foundfetch) — the correctness heart of the four asks — plus its wiring into the founding supply leg (internal/fleetwire) as an injected seam so the gateway fetches the four Mātou artifacts itself (curl → sha256sum -c → atomic land) instead of receiving them over the founding SSH connection:

  • Ask 3 (signature). The resolver verifies the manifest's detached Ed25519 signature against the pinned release public key via matouchannel before trusting a byte — carriage is no longer the trust boundary.
  • Ask 2 (exact revision, never latest). It refuses loud (ADR 0100) unless the feed manifest's revision equals fleetwire.Release (the founding revision the control-plane binary is stamped with), so a feed that has moved ahead cannot re-open #1690's build-ahead-of-feed self-downgrade. A test pins the equality and the fail-loud mismatch.
  • Ask 4 (missing artifact refuses). A required role absent from the signed manifest fails loud naming it, modelled on requireConfigServerForIDIP; config-server is not on the feed and its carriage is unchanged (ADR 0226 d.2).

Named residue (rides the next real founding drive — a swarm worker cannot found a live community): flipping the production app wiring to inject the resolver, dropping the four carried slots from scripts/assemble-payload.sh, and adapting the payload-presence preflights (CarriesKeriWeb) to the feed source. The production supply leg stays byte-identical until that flip (no resolver injected = carry as today), so this commit changes no live founding.

Why two-way: every part is revertible by deleting the package + the seam option and re-cutting; proven offline by the foundfetch resolver suite (signed fixture via matourelease.TestReleaseKey) and the fleetwire supply seam test (the gateway curls the revision-pinned URLs and verifies each digest; a resolve fault fails the seed before any byte lands).

**Ruled by agent under ADR 0174 — veto anytime.** ## Scope of this slice Per ADR 0275 §3 the gateway-bound binaries ride the **ADR 0248 signed feed** (not the Nix cache), so this builds on the feed reader (`internal/matouchannel`) and the verified-download core (`internal/update`) already in tree. This iteration ships the **operator-side verified, revision-pinned resolver** (`internal/foundfetch`) — the correctness heart of the four asks — plus its wiring into the founding supply leg (`internal/fleetwire`) as an injected seam so the gateway fetches the four Mātou artifacts itself (curl → `sha256sum -c` → atomic land) instead of receiving them over the founding SSH connection: - **Ask 3 (signature).** The resolver verifies the manifest's detached Ed25519 signature against the pinned release public key via `matouchannel` before trusting a byte — carriage is no longer the trust boundary. - **Ask 2 (exact revision, never latest).** It refuses loud (ADR 0100) unless the feed manifest's `revision` **equals** `fleetwire.Release` (the founding revision the control-plane binary is stamped with), so a feed that has moved ahead cannot re-open #1690's build-ahead-of-feed self-downgrade. A test pins the equality and the fail-loud mismatch. - **Ask 4 (missing artifact refuses).** A required role absent from the signed manifest fails loud naming it, modelled on `requireConfigServerForIDIP`; `config-server` is **not** on the feed and its carriage is unchanged (ADR 0226 d.2). **Named residue (rides the next real founding drive — a swarm worker cannot found a live community):** flipping the production app wiring to inject the resolver, dropping the four carried slots from `scripts/assemble-payload.sh`, and adapting the payload-presence preflights (`CarriesKeriWeb`) to the feed source. The production supply leg stays **byte-identical** until that flip (no resolver injected = carry as today), so this commit changes no live founding. **Why two-way:** every part is revertible by deleting the package + the seam option and re-cutting; proven offline by the `foundfetch` resolver suite (signed fixture via `matourelease.TestReleaseKey`) and the `fleetwire` supply seam test (the gateway curls the revision-pinned URLs and verifies each digest; a resolve fault fails the seed before any byte lands).

close-report for #1769 — status success

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

envelope
{
  "issue": 1769,
  "status": "success",
  "commits": [
    "f1495aca7f9df7301087cc7261ab80665a84d7fb"
  ],
  "changed_files": [
    "STATUS.md",
    "internal/fleetwire/supply.go",
    "internal/fleetwire/supply_test.go",
    "internal/foundfetch/foundfetch.go",
    "internal/foundfetch/foundfetch_test.go"
  ],
  "tests": [
    {
      "command": "nix develop .#go-ci -c go test ./internal/foundfetch/ ./internal/fleetwire/ ./internal/matouchannel/ ./internal/update/",
      "exit_code": 0
    },
    {
      "command": "nix develop .#go-ci -c go vet ./internal/foundfetch/ ./internal/fleetwire/",
      "exit_code": 0
    },
    {
      "command": "nix develop .#go-ci -c go build ./...",
      "exit_code": 0
    },
    {
      "command": "nix develop .#go-ci -c go test ./... (pre-push gate)",
      "exit_code": 0
    }
  ],
  "criteria": {
    "Ask 1 — the gateway fetches these from the signed feed rather than receiving them over the founding connection": "internal/fleetwire/supply.go seedFromFeed: when WithFeedResolver is wired, Seed has the GATEWAY curl each artifact's rev-pinned served URL itself (control-plane/idss-idp/dashboard-tarball/agent) instead of scp-ing them from the payload; proven by TestSupplySeed_FeedModeFetchesOnGateway (curls the rev-pinned URLs, no payload scp of the binaries). internal/foundfetch.Resolve produces the verified per-role served URLs from the ADR 0248 signed feed (ADR 0275 §3).",
    "Ask 2 — pinned to the app's exact revision, never latest; test pins fetched revision == founding revision and a mismatch fails loud": "internal/foundfetch.Resolve refuses with *RevisionMismatchError unless the feed's newest manifest revision == Options.FoundingRevision (fleetwire.Release); proven by TestResolve_VerifiedFeedAtFoundingRevisionResolvesThePlan (equal → plan) and TestResolve_RefusesWhenFeedNewestIsNotTheFoundingRevision (mismatch → fail loud). A resolve fault fails the seed before any byte is fetched: TestSupplySeed_FeedModeResolveFaultFetchesNothing.",
    "Ask 3 — signature verification on the fetch": "internal/foundfetch.Resolve verifies the manifest Ed25519 signature against the pinned release public key via internal/matouchannel before returning; proven by TestResolve_RefusesAFeedThatDoesNotVerify. On the gateway each fetched artifact's sha256 is checked against the SIGNED digest (verifySHA256), proven by TestSupplySeed_FeedModeVerifiesDigestAndFailsLoud.",
    "Ask 4 — a missing fetched artifact refuses like config-server does": "internal/foundfetch.Resolve returns *MissingArtifactError naming the role when a required artifact is absent (the config-server refusal model); proven by TestResolve_RefusesLoudWhenARequiredArtifactIsMissing and TestResolve_IdssIdpRequiredWhenListedRefusesWhenAbsent. config-server is not on the feed and its payload carriage is unchanged (seedFromFeed still scps PayloadConfigServer when present)."
  },
  "summary": "The founding gateway fetches Mātou's own binaries (control plane, idss-idp, dashboard incl. keri-web.js, agent) from the ADR 0248 signed feed pinned to the founding revision and signature-verified, via new internal/foundfetch + fleetwire.Supply.WithFeedResolver, instead of the founding connection carrying them.",
  "reason": "",
  "blockers": [],
  "no_code_change": ""
}
**close-report** for #1769 — status `success` :white_check_mark: **close-report gates passed** — every claim verified against main; issue closed. <details><summary>envelope</summary> ```json { "issue": 1769, "status": "success", "commits": [ "f1495aca7f9df7301087cc7261ab80665a84d7fb" ], "changed_files": [ "STATUS.md", "internal/fleetwire/supply.go", "internal/fleetwire/supply_test.go", "internal/foundfetch/foundfetch.go", "internal/foundfetch/foundfetch_test.go" ], "tests": [ { "command": "nix develop .#go-ci -c go test ./internal/foundfetch/ ./internal/fleetwire/ ./internal/matouchannel/ ./internal/update/", "exit_code": 0 }, { "command": "nix develop .#go-ci -c go vet ./internal/foundfetch/ ./internal/fleetwire/", "exit_code": 0 }, { "command": "nix develop .#go-ci -c go build ./...", "exit_code": 0 }, { "command": "nix develop .#go-ci -c go test ./... (pre-push gate)", "exit_code": 0 } ], "criteria": { "Ask 1 — the gateway fetches these from the signed feed rather than receiving them over the founding connection": "internal/fleetwire/supply.go seedFromFeed: when WithFeedResolver is wired, Seed has the GATEWAY curl each artifact's rev-pinned served URL itself (control-plane/idss-idp/dashboard-tarball/agent) instead of scp-ing them from the payload; proven by TestSupplySeed_FeedModeFetchesOnGateway (curls the rev-pinned URLs, no payload scp of the binaries). internal/foundfetch.Resolve produces the verified per-role served URLs from the ADR 0248 signed feed (ADR 0275 §3).", "Ask 2 — pinned to the app's exact revision, never latest; test pins fetched revision == founding revision and a mismatch fails loud": "internal/foundfetch.Resolve refuses with *RevisionMismatchError unless the feed's newest manifest revision == Options.FoundingRevision (fleetwire.Release); proven by TestResolve_VerifiedFeedAtFoundingRevisionResolvesThePlan (equal → plan) and TestResolve_RefusesWhenFeedNewestIsNotTheFoundingRevision (mismatch → fail loud). A resolve fault fails the seed before any byte is fetched: TestSupplySeed_FeedModeResolveFaultFetchesNothing.", "Ask 3 — signature verification on the fetch": "internal/foundfetch.Resolve verifies the manifest Ed25519 signature against the pinned release public key via internal/matouchannel before returning; proven by TestResolve_RefusesAFeedThatDoesNotVerify. On the gateway each fetched artifact's sha256 is checked against the SIGNED digest (verifySHA256), proven by TestSupplySeed_FeedModeVerifiesDigestAndFailsLoud.", "Ask 4 — a missing fetched artifact refuses like config-server does": "internal/foundfetch.Resolve returns *MissingArtifactError naming the role when a required artifact is absent (the config-server refusal model); proven by TestResolve_RefusesLoudWhenARequiredArtifactIsMissing and TestResolve_IdssIdpRequiredWhenListedRefusesWhenAbsent. config-server is not on the feed and its payload carriage is unchanged (seedFromFeed still scps PayloadConfigServer when present)." }, "summary": "The founding gateway fetches Mātou's own binaries (control plane, idss-idp, dashboard incl. keri-web.js, agent) from the ADR 0248 signed feed pinned to the founding revision and signature-verified, via new internal/foundfetch + fleetwire.Supply.WithFeedResolver, instead of the founding connection carrying them.", "reason": "", "blockers": [], "no_code_change": "" } ``` </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#1769
No description provided.