takeover: standing-reuse path never seeds the installer base — seedInstallerBase only rides the founding supply leg, so a standing gateway stays cold across cache refreshes and flake bumps #1042

Closed
opened 2026-08-30 17:25:14 +00:00 by ben · 3 comments
Owner

Parent

#854. Completes the ADR 0133 Tier 3 chain: #1016 (ruling) → #1036 (mechanism) → #1038 (staging pipeline) → this (the standing-path hole).

What's wrong

seedInstallerBase (internal/fleetwire/supply.go) runs only on the founding supply leg. The rehearsal standing-reuse path (ADR 0208) skips founding entirely — drive 20260830T172147Z's leg list is standing, mint, device-create, agent-install, decline-resume, join, approve, assess, select-files, deploy-takeover…, no supply — so a standing gateway founded before the cache was staged keeps its cold store and every takeover on it composes into the #1016 20-minute ceiling.

This is not just a rehearsal artifact. The general shape: the payload's installer-base cache can change while a gateway stands (first staging, or any flake bump — #1038's drive-prep gate refreshes the payload but nothing re-seeds standing boxes). Production communities stand for years; their takeovers must not go cold on the first release that bumps the base.

What to build

Give the seed a call site on the path the takeover actually rides, not only founding:

  • At takeover compose time (or standing-reuse validation), present-check the gateway's marker (installer-base.toplevel — supply.go's existing idempotent check, which keys on the GATEWAY's imported marker, not the drive host's) and import the payload cache when missing or different. The mechanism is already idempotent and GC-rooted; it needs invoking.
  • Keep it best-effort with the loud line from cd56dbb8 (cold vs seeded must stay distinguishable in the deploy log).
  • Offline test: a standing-reuse flow whose gateway lacks the marker gets a seed attempt; one whose marker matches is a no-op; founding-path behaviour unchanged.

Acceptance criteria

  • A standing-reuse drive against a gateway with a cold/stale base seeds it before the installer compose, and deploy-takeover finishes within the #1016 ceiling.
  • A warm, current gateway is a no-op (no re-import, no extra deploy time).
  • Offline tests cover both, plus the flake-bump case (marker differs → re-seed).

Blocked by

None — can start immediately.

## Parent #854. Completes the ADR 0133 Tier 3 chain: #1016 (ruling) → #1036 (mechanism) → #1038 (staging pipeline) → this (the standing-path hole). ## What's wrong `seedInstallerBase` (internal/fleetwire/supply.go) runs only on the founding **supply** leg. The rehearsal standing-reuse path (ADR 0208) skips founding entirely — drive `20260830T172147Z`'s leg list is `standing, mint, device-create, agent-install, decline-resume, join, approve, assess, select-files, deploy-takeover…`, no supply — so a standing gateway founded before the cache was staged keeps its cold store and every takeover on it composes into the #1016 20-minute ceiling. This is not just a rehearsal artifact. The general shape: **the payload's installer-base cache can change while a gateway stands** (first staging, or any flake bump — #1038's drive-prep gate refreshes the payload but nothing re-seeds standing boxes). Production communities stand for years; their takeovers must not go cold on the first release that bumps the base. ## What to build Give the seed a call site on the path the takeover actually rides, not only founding: - At takeover compose time (or standing-reuse validation), present-check the gateway's marker (`installer-base.toplevel` — supply.go's existing idempotent check, which keys on the GATEWAY's imported marker, not the drive host's) and import the payload cache when missing or different. The mechanism is already idempotent and GC-rooted; it needs invoking. - Keep it best-effort with the loud line from `cd56dbb8` (cold vs seeded must stay distinguishable in the deploy log). - Offline test: a standing-reuse flow whose gateway lacks the marker gets a seed attempt; one whose marker matches is a no-op; founding-path behaviour unchanged. ## Acceptance criteria - [ ] A standing-reuse drive against a gateway with a cold/stale base seeds it before the installer compose, and `deploy-takeover` finishes within the #1016 ceiling. - [ ] A warm, current gateway is a no-op (no re-import, no extra deploy time). - [ ] Offline tests cover both, plus the flake-bump case (marker differs → re-seed). ## Blocked by None — can start immediately.

swarm-claim host=elitebook-distributed-server-03 run=14673
(automated multi-host claim — lowest live claim id works this ticket)

swarm-claim host=elitebook-distributed-server-03 run=14673 (automated multi-host claim — lowest live claim id works this ticket)

Ruled by agent under ADR 0174 — veto anytime.

Decision needed: where the takeover-path installer-base seed's call site lives, given the process split I found tracing this:

  • The member-device takeover (provision.deployTakeover) composes the kexec installer on the gateway's own control plane (internal/clan Enroll → renderInstallerMesh), so the store that must be warm is the gateway's.
  • The fresh installer-base cache only exists in the operator's payload dir (fleetwire.NewSupply(os.Getenv(vm.PayloadDirEnv), …), staged by #1038). The gateway control plane has no operator payload — it only has the copy founding's seedInstallerBase KEEPS on-box at /var/lib/idss/installer-base-cache. And ADR 0208 forbids a standing-community branch in the app/control-plane, so there is no operator-side hook on the standing takeover path to push from.

Ruling: the takeover-path seed runs gateway-local — the control plane re-imports its OWN on-box /var/lib/idss/installer-base-cache into its store at takeover compose time, keyed on the gateway's marker (installer-base.toplevel), exactly the idempotent check supply.go already owns. Founding now also LANDS that marker file on the gateway (a small additive step) so the gateway can self-check. Best-effort with the #1037 loud line; a warm/current gateway is a no-op; a GC-reclaimed or cold-but-cache-present store re-imports.

Why two-way door: revertible by a later commit, proven entirely by offline tests at the fleetwire + provision seams (cold → import, warm → no-op, marker-differs → re-seed, no-cache → honest degrade). No trust surface widened — the on-box cache is the same payload-landed closure, the payload stays the only trust boundary (ADR 0054/0110).

Honest boundary (named, not hidden): a flake bump that lands a NEW base only in the operator payload does not reach a standing gateway through this local re-seed (the on-box cache is stale) — that refresh rides an operator re-push (#1038 staging) or a staleness-gated re-found (ADR 0208). This call site closes the GC-reclaim / delayed-takeover / founded-before-store-had-it holes and makes the warm case a true no-op.

**Ruled by agent under ADR 0174 — veto anytime.** **Decision needed:** where the takeover-path installer-base seed's call site lives, given the process split I found tracing this: - The member-device takeover (`provision.deployTakeover`) composes the kexec installer **on the gateway's own control plane** (`internal/clan` Enroll → `renderInstallerMesh`), so the store that must be warm is the **gateway's**. - The fresh installer-base cache only exists in the **operator's** payload dir (`fleetwire.NewSupply(os.Getenv(vm.PayloadDirEnv), …)`, staged by #1038). The gateway control plane has **no** operator payload — it only has the copy founding's `seedInstallerBase` KEEPS on-box at `/var/lib/idss/installer-base-cache`. And ADR 0208 forbids a standing-community branch in the app/control-plane, so there is no operator-side hook on the standing takeover path to push from. **Ruling:** the takeover-path seed runs **gateway-local** — the control plane re-imports its OWN on-box `/var/lib/idss/installer-base-cache` into its store at takeover compose time, keyed on the gateway's marker (`installer-base.toplevel`), exactly the idempotent check supply.go already owns. Founding now also LANDS that marker file on the gateway (a small additive step) so the gateway can self-check. Best-effort with the #1037 loud line; a warm/current gateway is a no-op; a GC-reclaimed or cold-but-cache-present store re-imports. **Why two-way door:** revertible by a later commit, proven entirely by offline tests at the fleetwire + provision seams (cold → import, warm → no-op, marker-differs → re-seed, no-cache → honest degrade). No trust surface widened — the on-box cache is the same payload-landed closure, the payload stays the only trust boundary (ADR 0054/0110). **Honest boundary (named, not hidden):** a flake bump that lands a NEW base only in the *operator* payload does not reach a standing gateway through this local re-seed (the on-box cache is stale) — that refresh rides an operator re-push (#1038 staging) or a staleness-gated re-found (ADR 0208). This call site closes the GC-reclaim / delayed-takeover / founded-before-store-had-it holes and makes the warm case a true no-op.

close-report for #1042 — status success

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

envelope
{
  "issue": 1042,
  "status": "success",
  "commits": [
    "e54ad74856607311a99216806df8d771af318b54"
  ],
  "changed_files": [
    "STATUS.md",
    "control-plane/cmd/control-plane/whole_composition.go",
    "docs/adr/0133-app-payload-carries-the-gateway-closure.md",
    "internal/fleetwire/supply.go",
    "internal/fleetwire/supply_test.go",
    "internal/provision/provision.go",
    "internal/provision/takeover.go",
    "internal/provision/takeover_test.go"
  ],
  "tests": [
    {
      "command": "go test ./internal/fleetwire/ ./internal/provision/",
      "exit_code": 0
    },
    {
      "command": "go build ./...",
      "exit_code": 0
    },
    {
      "command": "go vet ./internal/fleetwire/ ./internal/provision/ ./control-plane/cmd/control-plane/",
      "exit_code": 0
    },
    {
      "command": "golangci-lint run ./internal/fleetwire/... ./internal/provision/... ./control-plane/cmd/control-plane/...",
      "exit_code": 0
    },
    {
      "command": "pre-push gate: nix develop .#go-ci -- gofmt/build/vet/go test ./... /golangci-lint + broker (PAYLOAD_SKIP_INSTALLER_BASE=1, the sanctioned CI opt-out for the optional installer-base slot)",
      "exit_code": 0
    }
  ],
  "criteria": {
    "A standing-reuse drive against a gateway with a cold/stale base seeds it before the installer compose, and deploy-takeover finishes within the #1016 ceiling": "internal/provision/takeover.go: deployTakeover calls o.installerBase.SeedGatewayInstallerBase(ctx) BEFORE runTakeover (the clan.Enroll that composes the kexec-installer image); fleetwire.GatewayInstallerBaseSeeder re-imports the gateway's on-box cache into its store so the compose substitutes the base instead of building it from source. Proven by TestDeployTakeover_ReSeedsGatewayInstallerBaseBeforeCompose (asserts enrollsAt==0 → seed runs before compose) and TestSeedGatewayInstallerBase_ImportsWhenColdStore. The live within-ceiling assertion is the drive loop-closer (mirrors #1036's acceptance #1 posture).",
    "A warm, current gateway is a no-op (no re-import, no extra deploy time)": "fleetwire.GatewayInstallerBaseSeeder present-checks the gateway marker (nix path-info) and returns without any nix copy/add-root when the closure is already in the store. Proven by TestSeedGatewayInstallerBase_NoOpWhenWarm (asserts no 'nix copy'/'add-root' calls + the already-in-store log).",
    "Offline tests cover both, plus the flake-bump case (marker differs → re-seed)": "internal/fleetwire/supply_test.go: TestSeedGatewayInstallerBase_ImportsWhenColdStore (cold→import), _NoOpWhenWarm (warm→no-op), _ReseedsWhenMarkerClosureAbsent (flake-bump/GC: marker's closure absent from store → re-import), _NoOpAndLoudWhenNoOnBoxCache (honest degrade), _ImportFailureNeverReds (best-effort), plus TestSupplySeed_LandsInstallerBaseMarkerOnGateway/_NoGatewayMarkerWhenPayloadLacksIt for the founding marker-landing; internal/provision/takeover_test.go: TestDeployTakeover_ReSeedsGatewayInstallerBaseBeforeCompose + _NoInstallerBaseSeederIsUnchanged."
  },
  "summary": "The member-device takeover re-seeds the gateway's on-box installer-base cache at compose time (fleetwire.GatewayInstallerBaseSeeder, wired via provision.WithInstallerBaseSeeder before clan.Enroll), so a standing gateway founded before the closure was staged or GC-reclaimed since stops composing the base cold into the #1016 ceiling; founding now lands the marker file so the gateway self-checks; best-effort and idempotent.",
  "reason": "",
  "blockers": [],
  "no_code_change": ""
}
**close-report** for #1042 — status `success` :white_check_mark: **close-report gates passed** — every claim verified against main; issue closed. <details><summary>envelope</summary> ```json { "issue": 1042, "status": "success", "commits": [ "e54ad74856607311a99216806df8d771af318b54" ], "changed_files": [ "STATUS.md", "control-plane/cmd/control-plane/whole_composition.go", "docs/adr/0133-app-payload-carries-the-gateway-closure.md", "internal/fleetwire/supply.go", "internal/fleetwire/supply_test.go", "internal/provision/provision.go", "internal/provision/takeover.go", "internal/provision/takeover_test.go" ], "tests": [ { "command": "go test ./internal/fleetwire/ ./internal/provision/", "exit_code": 0 }, { "command": "go build ./...", "exit_code": 0 }, { "command": "go vet ./internal/fleetwire/ ./internal/provision/ ./control-plane/cmd/control-plane/", "exit_code": 0 }, { "command": "golangci-lint run ./internal/fleetwire/... ./internal/provision/... ./control-plane/cmd/control-plane/...", "exit_code": 0 }, { "command": "pre-push gate: nix develop .#go-ci -- gofmt/build/vet/go test ./... /golangci-lint + broker (PAYLOAD_SKIP_INSTALLER_BASE=1, the sanctioned CI opt-out for the optional installer-base slot)", "exit_code": 0 } ], "criteria": { "A standing-reuse drive against a gateway with a cold/stale base seeds it before the installer compose, and deploy-takeover finishes within the #1016 ceiling": "internal/provision/takeover.go: deployTakeover calls o.installerBase.SeedGatewayInstallerBase(ctx) BEFORE runTakeover (the clan.Enroll that composes the kexec-installer image); fleetwire.GatewayInstallerBaseSeeder re-imports the gateway's on-box cache into its store so the compose substitutes the base instead of building it from source. Proven by TestDeployTakeover_ReSeedsGatewayInstallerBaseBeforeCompose (asserts enrollsAt==0 → seed runs before compose) and TestSeedGatewayInstallerBase_ImportsWhenColdStore. The live within-ceiling assertion is the drive loop-closer (mirrors #1036's acceptance #1 posture).", "A warm, current gateway is a no-op (no re-import, no extra deploy time)": "fleetwire.GatewayInstallerBaseSeeder present-checks the gateway marker (nix path-info) and returns without any nix copy/add-root when the closure is already in the store. Proven by TestSeedGatewayInstallerBase_NoOpWhenWarm (asserts no 'nix copy'/'add-root' calls + the already-in-store log).", "Offline tests cover both, plus the flake-bump case (marker differs → re-seed)": "internal/fleetwire/supply_test.go: TestSeedGatewayInstallerBase_ImportsWhenColdStore (cold→import), _NoOpWhenWarm (warm→no-op), _ReseedsWhenMarkerClosureAbsent (flake-bump/GC: marker's closure absent from store → re-import), _NoOpAndLoudWhenNoOnBoxCache (honest degrade), _ImportFailureNeverReds (best-effort), plus TestSupplySeed_LandsInstallerBaseMarkerOnGateway/_NoGatewayMarkerWhenPayloadLacksIt for the founding marker-landing; internal/provision/takeover_test.go: TestDeployTakeover_ReSeedsGatewayInstallerBaseBeforeCompose + _NoInstallerBaseSeederIsUnchanged." }, "summary": "The member-device takeover re-seeds the gateway's on-box installer-base cache at compose time (fleetwire.GatewayInstallerBaseSeeder, wired via provision.WithInstallerBaseSeeder before clan.Enroll), so a standing gateway founded before the closure was staged or GC-reclaimed since stops composing the base cold into the #1016 ceiling; founding now lands the marker file so the gateway self-checks; best-effort and idempotent.", "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#1042
No description provided.