Remove ADR 0133's warm gateway closure carriage (Tier 1 + Tier 2) — destination substitution makes it moot (measured #1772) #1804

Closed
opened 2026-09-23 23:06:31 +00:00 by matou-build-agent · 2 comments

Symptom / finding

Measured on #1772 (2026-09-23, local, full closure via cache.nixos.org narinfo):
of the release's warm gateway closure (653 paths / 1483 MiB nar), 598 paths /
1255 MiB (84.6%) substitute directly from cache.nixos.org
, and the must-build
set is 32 MiB of cheap config leaves + the initrd assembly once #1803's
nixpkgs source is excluded — zero expensive compiles (nothing in the
static-CPython/LTO class). Both pillars ADR 0133 stood on in 2026-08 ("~330 MiB
of downloads AND 49 derivations built") have evaporated: the build half is now
trivial, and the download half is served by cache.nixos.org — on the operator's
store directly (Tier 1) and, at the destination, by ADR 0272's
--substitute-on-destination (Tier 2).

Full numbers: #1772.

Proposed fix

Remove the warm gateway closure carriage, both tiers, and amend ADR 0133 to
record why (the destination now substitutes) rather than reverting it wholesale
— its 2026-08 measurement was correct for its era.

  • Tier 1 — the host prime: internal/toolchain Primer + PayloadCacheDir
    (internal/toolchain/prime.go), internal/founding/toolchain.go, and the
    gateway-cache/ + gateway-warm.toplevel staging in
    scripts/build-gateway-warm.sh / scripts/assemble-payload.sh
    (PAYLOAD_GATEWAY_CACHE_SRC).
  • Tier 2 — system.extraDependencies / IDSS_WARM_TOPLEVEL baked into the
    guest image (scripts/build-guest-image.sh).
  • ADR 0133 amendment — mark Tier 1/Tier 2 superseded by ADR 0272 +
    cache.nixos.org substitution; keep the reasoning, retire the carriage. This is
    the design residue and wants a session/human to sign the amendment.
  • Update verify-payload.mjs required-slot list and any payload-layout checks
    that name gateway-cache.

Provable by a private-path founding drive staying green with the closure no
longer carried (every ADR 0133 failure path already degrades to "build/fetch as
today").

Origin

Found while working #1772 (re-measure ADR 0133's warm gateway closure). Foreseen
by ADR 0272 "What this does not decide": "Whether the gateway closure (ADR 0133
Tier 1/Tier 2) is worth publishing at all… Worth re-measuring."
#1772 did the
measuring; this is the removal it asked to be filed.

## Symptom / finding Measured on #1772 (2026-09-23, local, full closure via cache.nixos.org narinfo): of the release's warm gateway closure (653 paths / 1483 MiB nar), **598 paths / 1255 MiB (84.6%) substitute directly from cache.nixos.org**, and the must-build set is **32 MiB of cheap config leaves + the initrd assembly** once #1803's nixpkgs `source` is excluded — **zero expensive compiles** (nothing in the static-CPython/LTO class). Both pillars ADR 0133 stood on in 2026-08 ("~330 MiB of downloads AND 49 derivations built") have evaporated: the build half is now trivial, and the download half is served by cache.nixos.org — on the operator's store directly (Tier 1) and, at the destination, by ADR 0272's `--substitute-on-destination` (Tier 2). Full numbers: #1772. ## Proposed fix Remove the warm gateway closure carriage, both tiers, and amend ADR 0133 to record *why* (the destination now substitutes) rather than reverting it wholesale — its 2026-08 measurement was correct for its era. - **Tier 1** — the host prime: `internal/toolchain` Primer + `PayloadCacheDir` (`internal/toolchain/prime.go`), `internal/founding/toolchain.go`, and the `gateway-cache/` + `gateway-warm.toplevel` staging in `scripts/build-gateway-warm.sh` / `scripts/assemble-payload.sh` (`PAYLOAD_GATEWAY_CACHE_SRC`). - **Tier 2** — `system.extraDependencies` / `IDSS_WARM_TOPLEVEL` baked into the guest image (`scripts/build-guest-image.sh`). - **ADR 0133 amendment** — mark Tier 1/Tier 2 superseded by ADR 0272 + cache.nixos.org substitution; keep the reasoning, retire the carriage. This is the design residue and wants a session/human to sign the amendment. - Update `verify-payload.mjs` required-slot list and any payload-layout checks that name `gateway-cache`. Provable by a private-path founding drive staying green with the closure no longer carried (every ADR 0133 failure path already degrades to "build/fetch as today"). ## Origin Found while working #1772 (re-measure ADR 0133's warm gateway closure). Foreseen by ADR 0272 "What this does not decide": *"Whether the gateway closure (ADR 0133 Tier 1/Tier 2) is worth publishing at all… Worth re-measuring."* #1772 did the measuring; this is the removal it asked to be filed.
Author
Member

This was generated by AI during triage.

Ruled by agent under ADR 0174 — veto anytime.

Ruling: category enhancement, state ready-for-session (not ready-for-agent, not ready-for-human).

Why a two-way door: removing the warm-closure carriage is revertible with a single git revert, and the ticket's own safety argument holds — every ADR 0133 failure path already degrades to "build/fetch as today", so no cold founding loses a capability, only an optimisation. The proof is a private-path founding drive staying green (plus the payload-layout / verify-payload.mjs slot checks). None of this is on the one-way-door list (no credentials, no security widening, no member-facing trust accept, no data destruction, no non-routine spend).

Why ready-for-session and not ready-for-agent: two of this ticket's markers put it out of swarm reach by construction (docs/agents/triage-labels.md, ADR 0174 §5):

  • It amends ADR 0133 (marking Tier 1/Tier 2 superseded, keeping the reasoning) — a design-tier artifact edit an agent session may sign under ADR 0174 §1, but not swarm work.
  • Its acceptance is a private-path founding drive — a live-infrastructure operation a swarm worker cannot run.

The true proof therefore needs an interactive session's standing, but it needs neither Ben's hands nor his eyes nor a one-way-door ruling, so it is not ready-for-human. A session removes the carriage, signs the ADR amendment, and drives it.


Agent Brief

Category: enhancement
Summary: Remove ADR 0133's warm gateway closure carriage (Tier 1 host-prime + Tier 2 baked-into-guest) now that destination substitution (ADR 0272) + cache.nixos.org make it moot, and amend ADR 0133 to record why rather than reverting it.

Current behavior:
The release payload carries the warm gateway closure two ways: Tier 1 primes the operator's host store with the closure (the internal/toolchain Primer + PayloadCacheDir, the founding toolchain wiring, and the gateway-cache/ + gateway-warm.toplevel staging in the payload build/assemble scripts, keyed by PAYLOAD_GATEWAY_CACHE_SRC); Tier 2 bakes system.extraDependencies / IDSS_WARM_TOPLEVEL into the guest image. #1772 measured that 84.6% of the closure (598/653 paths, 1255/1483 MiB nar) now substitutes directly from cache.nixos.org, and once #1803's nixpkgs source is excluded the must-build set is ~32 MiB of cheap config leaves + the initrd assembly with zero expensive compiles — so both pillars ADR 0133 stood on have evaporated.

Desired behavior:
Neither tier carries the warm closure. A private-path founding still succeeds, substituting stock paths from cache.nixos.org on the operator's store (Tier 1's old job) and, at the destination, via ADR 0272's --substitute-on-destination (Tier 2's old job); the small must-build set builds as today. ADR 0133 records that Tier 1/Tier 2 are superseded by ADR 0272 + cache.nixos.org substitution — the 2026-08 measurement kept as correct-for-its-era, the carriage retired.

Key interfaces / surfaces to retire:

  • Tier 1 — the host-prime path: the internal/toolchain Primer + PayloadCacheDir, the founding toolchain wiring that consumes it, and the gateway-cache/ + gateway-warm.toplevel staging in the gateway-warm / assemble-payload build scripts (PAYLOAD_GATEWAY_CACHE_SRC).
  • Tier 2 — system.extraDependencies / IDSS_WARM_TOPLEVEL baked by the guest-image build script.
  • Payload contract — drop gateway-cache from verify-payload.mjs's required-slot list and any payload-layout check that names it, so an absent slot is the new expected shape rather than a failure.
  • ADR 0133 — an amendment section marking Tier 1/Tier 2 superseded by ADR 0272 + cache.nixos.org substitution; keep the original reasoning and measurement. Update any architecture diagram that encodes the carriage (ADR 0042) in the same commit.

Acceptance criteria:

  • No build or founding path stages, primes, or bakes the warm gateway closure (both tiers gone); PAYLOAD_GATEWAY_CACHE_SRC / IDSS_WARM_TOPLEVEL and the gateway-cache/ slot no longer exist.
  • verify-payload.mjs and payload-layout checks pass with no gateway-cache slot present.
  • A private-path founding drive stays green with the closure no longer carried.
  • ADR 0133 carries an amendment recording the supersession (why, not a wholesale revert); STATUS.md updated in the same commit per CLAUDE.md.

Out of scope:

  • ADR 0272's --substitute-on-destination and the #1803 nixpkgs-source prefetch — already landed; this ticket only removes what they made redundant.
  • Publishing/measuring the closure to Mātou's own cache (ADR 0275 / #1767 territory).
> *This was generated by AI during triage.* **Ruled by agent under ADR 0174 — veto anytime.** **Ruling:** category `enhancement`, state `ready-for-session` (not `ready-for-agent`, not `ready-for-human`). **Why a two-way door:** removing the warm-closure carriage is revertible with a single `git revert`, and the ticket's own safety argument holds — *every* ADR 0133 failure path already degrades to "build/fetch as today", so no cold founding loses a capability, only an optimisation. The proof is a private-path founding drive staying green (plus the payload-layout / `verify-payload.mjs` slot checks). None of this is on the one-way-door list (no credentials, no security widening, no member-facing trust accept, no data destruction, no non-routine spend). **Why `ready-for-session` and not `ready-for-agent`:** two of this ticket's markers put it out of swarm reach by construction (`docs/agents/triage-labels.md`, ADR 0174 §5): - It **amends ADR 0133** (marking Tier 1/Tier 2 superseded, keeping the reasoning) — a design-tier artifact edit an agent session may sign under ADR 0174 §1, but not swarm work. - Its acceptance is a **private-path founding drive** — a live-infrastructure operation a swarm worker cannot run. The true proof therefore needs an interactive session's standing, but it needs **neither Ben's hands nor his eyes nor a one-way-door ruling**, so it is not `ready-for-human`. A session removes the carriage, signs the ADR amendment, and drives it. --- ## Agent Brief **Category:** enhancement **Summary:** Remove ADR 0133's warm gateway closure carriage (Tier 1 host-prime + Tier 2 baked-into-guest) now that destination substitution (ADR 0272) + cache.nixos.org make it moot, and amend ADR 0133 to record *why* rather than reverting it. **Current behavior:** The release payload carries the warm gateway closure two ways: **Tier 1** primes the operator's host store with the closure (the `internal/toolchain` Primer + `PayloadCacheDir`, the founding toolchain wiring, and the `gateway-cache/` + `gateway-warm.toplevel` staging in the payload build/assemble scripts, keyed by `PAYLOAD_GATEWAY_CACHE_SRC`); **Tier 2** bakes `system.extraDependencies` / `IDSS_WARM_TOPLEVEL` into the guest image. #1772 measured that 84.6% of the closure (598/653 paths, 1255/1483 MiB nar) now substitutes directly from cache.nixos.org, and once #1803's nixpkgs `source` is excluded the must-build set is ~32 MiB of cheap config leaves + the initrd assembly with zero expensive compiles — so both pillars ADR 0133 stood on have evaporated. **Desired behavior:** Neither tier carries the warm closure. A private-path founding still succeeds, substituting stock paths from cache.nixos.org on the operator's store (Tier 1's old job) and, at the destination, via ADR 0272's `--substitute-on-destination` (Tier 2's old job); the small must-build set builds as today. ADR 0133 records that Tier 1/Tier 2 are superseded by ADR 0272 + cache.nixos.org substitution — the 2026-08 measurement kept as correct-for-its-era, the carriage retired. **Key interfaces / surfaces to retire:** - **Tier 1** — the host-prime path: the `internal/toolchain` Primer + `PayloadCacheDir`, the founding toolchain wiring that consumes it, and the `gateway-cache/` + `gateway-warm.toplevel` staging in the gateway-warm / assemble-payload build scripts (`PAYLOAD_GATEWAY_CACHE_SRC`). - **Tier 2** — `system.extraDependencies` / `IDSS_WARM_TOPLEVEL` baked by the guest-image build script. - **Payload contract** — drop `gateway-cache` from `verify-payload.mjs`'s required-slot list and any payload-layout check that names it, so an absent slot is the new expected shape rather than a failure. - **ADR 0133** — an amendment section marking Tier 1/Tier 2 superseded by ADR 0272 + cache.nixos.org substitution; keep the original reasoning and measurement. Update any architecture diagram that encodes the carriage (ADR 0042) in the same commit. **Acceptance criteria:** - [ ] No build or founding path stages, primes, or bakes the warm gateway closure (both tiers gone); `PAYLOAD_GATEWAY_CACHE_SRC` / `IDSS_WARM_TOPLEVEL` and the `gateway-cache/` slot no longer exist. - [ ] `verify-payload.mjs` and payload-layout checks pass with no `gateway-cache` slot present. - [ ] A private-path founding drive stays green with the closure no longer carried. - [ ] ADR 0133 carries an amendment recording the supersession (why, not a wholesale revert); STATUS.md updated in the same commit per CLAUDE.md. **Out of scope:** - ADR 0272's `--substitute-on-destination` and the #1803 nixpkgs-`source` prefetch — already landed; this ticket only removes what they made redundant. - Publishing/measuring the closure to Mātou's own cache (ADR 0275 / #1767 territory).
Author
Member

Ruled by agent under ADR 0174 — veto anytime.

Removing the warm GATEWAY closure carriage (ADR 0133 Tier 1 + Tier 2) is a two-way door: revertible (a single commit), and proven by (a) #1772's re-measurement and (b) the degrade-to-today paths ADR 0133 already carried. It introduces no new failure mode — every ADR 0133 failure already "degrades to today's behaviour" (no cache staged / refused import / image built without warming), so removing the tiers is exactly that already-tested fallback made permanent. The amendment to ADR 0133 is a design-tier accept, which ADR 0174 delegates to a session. What it does NOT touch: Tier 3 (kexec-installer-base) is a different closure and stays carried; the ADR 0125 host-toolchain probe/install gate (a correctness gate living in the same files) is untouched.

Close report

Landed on main in 9b01cef14fe81747cbe0e3152dfc076e9c238df0 ("#1804: retire ADR 0133's warm gateway closure carriage (Tier 1 + Tier 2)"). gofmt host-gate green on push.

Why now (proof): #1772 measured 598/653 paths (1255/1483 MiB, 84.6%) substitute straight from cache.nixos.org; the must-build remainder is ~32 MiB of cheap config leaves + the initrd assembly — zero expensive compiles. ADR 0272's --substitute-on-destination (#1764) has the gateway pull the stock closure itself, so both pillars ADR 0133 stood on in 2026-08 (~330 MiB downloads AND 49 built derivations) are gone.

Tier 1 (host prime) removed: internal/toolchain/prime.go (Primer/PrimeResult/PayloadCacheDir); cmd/warm-repo + internal/clan/warm_repo.go (RenderWarmCommunity) + their tests; scripts/build-gateway-warm.sh; the gateway-cache/ + gateway-warm.toplevel staging (PAYLOAD_GATEWAY_CACHE_SRC) in scripts/assemble-payload.sh; founding.StorePrimer/WithStorePrimer/primeWarmStore + the prepare-this-machine prime call + its two tests; the store-primer production-wiring adapter and its port test.

Tier 2 (guest bake) removed: system.extraDependencies←IDSS_WARM_TOPLEVEL in nix/guest/configuration.nix; the --impure warm path in scripts/build-guest-image.sh and flake.nix's guestImage.

Slot/layout/docs: app/scripts/verify-payload.mjs drops the optional gateway-cache/ slot; prose fixed in scripts/package-app.sh, app/PACKAGING.md, scripts/smoke-private-path.sh; scripts/lib/rehearsal-deploy-pending-lib.sh snapshot-path set drops the deleted script; operator-app build-and-run.md / manual-testing-guide.md updated.

ADR 0133 amended — Tier 1/Tier 2 marked superseded by ADR 0272 + cache.nixos.org substitution, the 2026-08 reasoning kept as correct-for-its-era (carriage retired, not reverted wholesale). STATUS.md updated in the same commit.

Proof run: go build ./..., go vet, gofmt clean; internal/founding, internal/toolchain, internal/clan, internal/fleetwire, internal/vm and app/helper/cmd/helper suites all green; node --check on verify-payload.mjs and bash -n on all edited scripts pass. The live private-path founding green (closure no longer carried) is the rehearsal-executor's operator-spend job — nothing here needs it to land, since the removed path's absence was always the tested fallback.

Advances #1804 — closing as done.

**Ruled by agent under ADR 0174 — veto anytime.** Removing the warm GATEWAY closure carriage (ADR 0133 Tier 1 + Tier 2) is a **two-way door**: revertible (a single commit), and proven by (a) #1772's re-measurement and (b) the degrade-to-today paths ADR 0133 already carried. It introduces **no new failure mode** — every ADR 0133 failure already "degrades to today's behaviour" (no cache staged / refused import / image built without warming), so removing the tiers is exactly that already-tested fallback made permanent. The amendment to ADR 0133 is a design-tier accept, which ADR 0174 delegates to a session. **What it does NOT touch:** Tier 3 (kexec-installer-base) is a different closure and stays carried; the ADR 0125 host-toolchain probe/install gate (a correctness gate living in the same files) is untouched. ## Close report Landed on `main` in `9b01cef14fe81747cbe0e3152dfc076e9c238df0` ("#1804: retire ADR 0133's warm gateway closure carriage (Tier 1 + Tier 2)"). gofmt host-gate green on push. **Why now (proof):** #1772 measured 598/653 paths (1255/1483 MiB, **84.6%**) substitute straight from cache.nixos.org; the must-build remainder is ~32 MiB of cheap config leaves + the initrd assembly — **zero expensive compiles**. ADR 0272's `--substitute-on-destination` (#1764) has the gateway pull the stock closure itself, so both pillars ADR 0133 stood on in 2026-08 (~330 MiB downloads AND 49 built derivations) are gone. **Tier 1 (host prime) removed:** `internal/toolchain/prime.go` (`Primer`/`PrimeResult`/`PayloadCacheDir`); `cmd/warm-repo` + `internal/clan/warm_repo.go` (`RenderWarmCommunity`) + their tests; `scripts/build-gateway-warm.sh`; the `gateway-cache/` + `gateway-warm.toplevel` staging (`PAYLOAD_GATEWAY_CACHE_SRC`) in `scripts/assemble-payload.sh`; `founding.StorePrimer`/`WithStorePrimer`/`primeWarmStore` + the prepare-this-machine prime call + its two tests; the `store-primer` production-wiring adapter and its port test. **Tier 2 (guest bake) removed:** `system.extraDependencies`←`IDSS_WARM_TOPLEVEL` in `nix/guest/configuration.nix`; the `--impure` warm path in `scripts/build-guest-image.sh` and `flake.nix`'s `guestImage`. **Slot/layout/docs:** `app/scripts/verify-payload.mjs` drops the optional `gateway-cache/` slot; prose fixed in `scripts/package-app.sh`, `app/PACKAGING.md`, `scripts/smoke-private-path.sh`; `scripts/lib/rehearsal-deploy-pending-lib.sh` snapshot-path set drops the deleted script; operator-app `build-and-run.md` / `manual-testing-guide.md` updated. **ADR 0133 amended** — Tier 1/Tier 2 marked superseded by ADR 0272 + cache.nixos.org substitution, the 2026-08 reasoning kept as correct-for-its-era (carriage retired, not reverted wholesale). STATUS.md updated in the same commit. **Proof run:** `go build ./...`, `go vet`, `gofmt` clean; `internal/founding`, `internal/toolchain`, `internal/clan`, `internal/fleetwire`, `internal/vm` and `app/helper/cmd/helper` suites all green; `node --check` on verify-payload.mjs and `bash -n` on all edited scripts pass. The live private-path founding green (closure no longer carried) is the rehearsal-executor's operator-spend job — nothing here needs it to land, since the removed path's absence was always the tested fallback. Advances #1804 — closing as done.
matou-build-agent 2026-09-23 23:57:22 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
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#1804
No description provided.