updates (#1562-12): a freshly founded gateway does not know its own release — it offers the release it was FOUNDED with as an update, and would self-swap onto its own bits the first night #1631

Closed
opened 2026-09-19 14:16:41 +00:00 by ben · 3 comments
Owner

Parent: #1562 — found live by the #1614 proof drive (run 2, 2026-09-19). Must land before founding's channel pin (#1582, held on pin-testing-1582-held) goes live.

What's true today

A freshly founded gateway does not know which release it is running, so it lists the release it was founded with as an update waiting to apply.

Evidence — run 20260919T135211Z, the live GET /api/v1/updates a minute after founding, from a gateway founded from release A and tuned to a feed whose newest release IS A:

"resting": false, "channel": "testing", "pending": null,
"automatic": [ { "revision": "6bfde109…", "title": "Founding release A (…)", "sequence": 1, … } ]

Cause: composeWhole seeds the store with update.Current{} (control-plane/cmd/control-plane/whole_composition.go:603) — empty revision, zero sequence. Orchestrator.Poll accepts any release whose revision differs from current and is not in the fleet's history, so A (≠ "") qualifies. update.Current.Sequence's own doc comment already says what was meant and never wired: "A newly founded community starts its per-channel high-water mark from this — the founding payload knows its own release's sequence".

Why it matters

With the pin live, every newly founded community would, on its first night (patch releases apply automatically 02:00–04:00, Security: ModeAuto): download 35 MB, swap its own control plane, restart and resume — onto the bits it is already running; and until then its Updates screen says an update is pending when none is. A pointless first-night self-swap is also the worst moment to meet a rollout defect. And the replay floor (#1579) starts at zero instead of at the founding release's sequence.

What to build

  • Give the gateway its own release identity at founding: the founding payload's revision and signed sequence, carried the way the channel pin is (a founding fact, persisted in the render-inputs sidecar so a re-render keeps it), and seeded into update.Current / the per-channel high-water mark when the control plane composes. Decide the carrier under ADR 0174 and record it (amend ADR 0248); fleetwire.Release already stamps the build's revision — reuse it rather than inventing a second stamp.
  • A payload that was NOT cut as a release (a dev build, today's rehearsal payload) has no signed sequence: say what Current is then, honestly (ADR 0100) — and make sure the drive's founding release A is not then offered back to the gateway it founded.
  • Poll must not offer a release whose revision equals the running one or whose sequence is ≤ the running sequence.

Acceptance

  • Given a gateway founded from release A and a feed whose newest is A, Then Updates is at rest — nothing pending, nothing automatic — and no rollout runs in the window
  • Given that gateway and a feed that advances to B (higher sequence), Then B is offered and A never is
  • Given a founding with no release identity, Then the surface says so and nothing is fabricated
  • The replay floor after founding is A's sequence, not zero
  • Seam-proven here; add the assertion to #1614's updates-open leg ("at rest after founding") so the drive holds it live
  • go build ./... && go vet ./... && go test ./... + lint green; STATUS.md in the same commit

Filed from the #1614 drive's evidence. Nothing in this body is a drive marker.

## Parent: #1562 — found live by the #1614 proof drive (run 2, 2026-09-19). Must land before founding's channel pin (#1582, held on `pin-testing-1582-held`) goes live. ## What's true today A freshly founded gateway **does not know which release it is running**, so it lists the release it was *founded with* as an update waiting to apply. Evidence — run `20260919T135211Z`, the live `GET /api/v1/updates` a minute after founding, from a gateway founded from release A and tuned to a feed whose newest release IS A: ``` "resting": false, "channel": "testing", "pending": null, "automatic": [ { "revision": "6bfde109…", "title": "Founding release A (…)", "sequence": 1, … } ] ``` Cause: `composeWhole` seeds the store with `update.Current{}` (`control-plane/cmd/control-plane/whole_composition.go:603`) — empty revision, zero sequence. `Orchestrator.Poll` accepts any release whose revision differs from current and is not in the fleet's history, so A (≠ "") qualifies. `update.Current.Sequence`'s own doc comment already says what was meant and never wired: *"A newly founded community starts its per-channel high-water mark from this — the founding payload knows its own release's sequence"*. ## Why it matters With the pin live, **every newly founded community** would, on its first night (patch releases apply automatically 02:00–04:00, `Security: ModeAuto`): download 35 MB, swap its own control plane, restart and resume — onto the bits it is already running; and until then its Updates screen says an update is pending when none is. A pointless first-night self-swap is also the worst moment to meet a rollout defect. And the replay floor (#1579) starts at zero instead of at the founding release's sequence. ## What to build - Give the gateway its own release identity at founding: the founding payload's **revision and signed sequence**, carried the way the channel pin is (a founding fact, persisted in the render-inputs sidecar so a re-render keeps it), and seeded into `update.Current` / the per-channel high-water mark when the control plane composes. Decide the carrier under ADR 0174 and record it (amend ADR 0248); `fleetwire.Release` already stamps the build's revision — reuse it rather than inventing a second stamp. - A payload that was NOT cut as a release (a dev build, today's rehearsal payload) has no signed sequence: say what `Current` is then, honestly (ADR 0100) — and make sure the drive's founding release A is not then offered back to the gateway it founded. - `Poll` must not offer a release whose revision equals the running one **or** whose sequence is ≤ the running sequence. ## Acceptance - [ ] Given a gateway founded from release A and a feed whose newest is A, Then Updates is at rest — nothing pending, nothing automatic — and no rollout runs in the window - [ ] Given that gateway and a feed that advances to B (higher sequence), Then B is offered and A never is - [ ] Given a founding with no release identity, Then the surface says so and nothing is fabricated - [ ] The replay floor after founding is A's sequence, not zero - [ ] Seam-proven here; add the assertion to #1614's `updates-open` leg ("at rest after founding") so the drive holds it live - [ ] `go build ./... && go vet ./... && go test ./...` + lint green; STATUS.md in the same commit --- *Filed from the #1614 drive's evidence. Nothing in this body is a drive marker.*

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

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

More evidence from run 3, via the drive reporter's #1633 (now blocked by this ticket so nobody builds it twice). U1 on the fresh gateway read: REVISION testing · — 0 of 0 nodes converged, with Founding release A … queued for tonight's window above it. So update.Current is empty in all three parts that the screen shows — revision, and Converged/Total — not only the revision and sequence this body names. Please seed (or honestly derive) the node counts too, or say on #1633 that they are out of scope here. The drive's updates-open leg gates on a real fleet revision on U1; do not loosen it.

**More evidence from run 3, via the drive reporter's #1633 (now blocked by this ticket so nobody builds it twice).** U1 on the fresh gateway read: `REVISION testing · — 0 of 0 nodes converged`, with *Founding release A … queued for tonight's window* above it. So `update.Current` is empty in all three parts that the screen shows — **revision, and `Converged`/`Total`** — not only the revision and sequence this body names. Please seed (or honestly derive) the node counts too, or say on #1633 that they are out of scope here. The drive's `updates-open` leg gates on a real fleet revision on U1; do not loosen it.

close-report for #1631 — status success

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

envelope
{
  "issue": 1631,
  "status": "success",
  "commits": [
    "1c1784232c4c8859f97497538af821b2bfa745a1"
  ],
  "changed_files": [
    "STATUS.md",
    "app/helper/cmd/helper/wiring_prod.go",
    "app/helper/cmd/helper/wiring_test.go",
    "app/tests/e2e/fixtures/updatesDrive.ts",
    "app/tests/e2e/journey.updates.spec.ts",
    "control-plane/cmd/control-plane/release_identity.go",
    "control-plane/cmd/control-plane/release_identity_test.go",
    "control-plane/cmd/control-plane/whole_composition.go",
    "docs/adr/0248-design-fleet-auto-update-lands-a-signed-release-on-a-running-community.md",
    "internal/clan/clan.go",
    "internal/clan/releasechannel_test.go",
    "internal/clan/vmguest.go",
    "internal/founding/orchestrator.go",
    "internal/founding/releasechannel.go",
    "internal/founding/releasechannel_internal_test.go",
    "internal/update/downgrade_test.go",
    "internal/update/export_test.go",
    "scripts/smoke-private-path.sh",
    "scripts/tests/rehearsal-local-updates-target-test.sh"
  ],
  "tests": [
    {
      "command": "nix develop .#go-ci -c go build ./...",
      "exit_code": 0
    },
    {
      "command": "nix develop .#go-ci -c go vet ./...",
      "exit_code": 0
    },
    {
      "command": "nix develop .#go-ci -c go test ./...",
      "exit_code": 0
    },
    {
      "command": "nix develop .#go-ci -c golangci-lint run ./internal/update/... ./internal/clan/... ./internal/founding/... ./control-plane/... ./app/helper/...",
      "exit_code": 0
    },
    {
      "command": "bash scripts/tests/rehearsal-local-updates-target-test.sh",
      "exit_code": 0
    },
    {
      "command": "CI=true pnpm exec vue-tsc -p app/tsconfig.json --noEmit",
      "exit_code": 0
    }
  ],
  "criteria": {
    "Given a gateway founded from release A and a feed whose newest is A, Then Updates is at rest — nothing pending, nothing automatic — and no rollout runs in the window": "internal/update/downgrade_test.go TestPoll_RestsWhenFeedNewestIsTheFoundingRelease asserts Pending/Automatic empty, ChannelRefused nil and Resting=true (revision-match early return in update.go Poll); no release surfaced -> nothing queued to StateAutomatic -> no rollout. The gateway seeds current from foundingCurrent (control-plane/cmd/control-plane/release_identity.go). Live rides #1614.",
    "Given that gateway and a feed that advances to B (higher sequence), Then B is offered and A never is": "Same test: after resting on A, publishing B (seq 2) surfaces B (rev-B); A never resurfaces (revision-match + high-water floor).",
    "Given a founding with no release identity, Then the surface says so and nothing is fabricated": "control-plane/cmd/control-plane/release_identity_test.go TestFoundingCurrent 'no identity is an honest empty current' returns update.Current{} (empty revision, zero sequence, no fabricated convergence) when buildRev is 'unknown' and no env override (ADR 0100).",
    "The replay floor after founding is A's sequence, not zero": "TestPoll_RestsWhenFeedNewestIsTheFoundingRelease asserts HighWaterFloorForTest == 1 (A's sequence); export_test.go adds HighWaterFloorForTest exposing the effective floor.",
    "Seam-proven here; add the assertion to #1614's updates-open leg ('at rest after founding') so the drive holds it live": "app/tests/e2e/journey.updates.spec.ts updates-open leg now asserts [data-status=resting] visible and pending/automatic/channel-refused count 0; the drive exports IDSS_RELEASE_REVISION/_SEQUENCE (scripts/smoke-private-path.sh), pinned offline by scripts/tests/rehearsal-local-updates-target-test.sh. Live proof rides #1614.",
    "go build ./... && go vet ./... && go test ./... + lint green; STATUS.md in the same commit": "All four Go commands exit 0 (see tests); golangci-lint 0 issues; STATUS.md updated in commit 1c178423."
  },
  "summary": "A freshly founded gateway now carries its own founding release identity (revision from fleetwire.Release, signed sequence as a founding fact) and seeds update.Current from it, so it rests on its founding release instead of offering it back and self-swapping the first night.",
  "reason": "",
  "blockers": [],
  "no_code_change": ""
}
**close-report** for #1631 — status `success` :white_check_mark: **close-report gates passed** — every claim verified against main; issue closed. <details><summary>envelope</summary> ```json { "issue": 1631, "status": "success", "commits": [ "1c1784232c4c8859f97497538af821b2bfa745a1" ], "changed_files": [ "STATUS.md", "app/helper/cmd/helper/wiring_prod.go", "app/helper/cmd/helper/wiring_test.go", "app/tests/e2e/fixtures/updatesDrive.ts", "app/tests/e2e/journey.updates.spec.ts", "control-plane/cmd/control-plane/release_identity.go", "control-plane/cmd/control-plane/release_identity_test.go", "control-plane/cmd/control-plane/whole_composition.go", "docs/adr/0248-design-fleet-auto-update-lands-a-signed-release-on-a-running-community.md", "internal/clan/clan.go", "internal/clan/releasechannel_test.go", "internal/clan/vmguest.go", "internal/founding/orchestrator.go", "internal/founding/releasechannel.go", "internal/founding/releasechannel_internal_test.go", "internal/update/downgrade_test.go", "internal/update/export_test.go", "scripts/smoke-private-path.sh", "scripts/tests/rehearsal-local-updates-target-test.sh" ], "tests": [ { "command": "nix develop .#go-ci -c go build ./...", "exit_code": 0 }, { "command": "nix develop .#go-ci -c go vet ./...", "exit_code": 0 }, { "command": "nix develop .#go-ci -c go test ./...", "exit_code": 0 }, { "command": "nix develop .#go-ci -c golangci-lint run ./internal/update/... ./internal/clan/... ./internal/founding/... ./control-plane/... ./app/helper/...", "exit_code": 0 }, { "command": "bash scripts/tests/rehearsal-local-updates-target-test.sh", "exit_code": 0 }, { "command": "CI=true pnpm exec vue-tsc -p app/tsconfig.json --noEmit", "exit_code": 0 } ], "criteria": { "Given a gateway founded from release A and a feed whose newest is A, Then Updates is at rest — nothing pending, nothing automatic — and no rollout runs in the window": "internal/update/downgrade_test.go TestPoll_RestsWhenFeedNewestIsTheFoundingRelease asserts Pending/Automatic empty, ChannelRefused nil and Resting=true (revision-match early return in update.go Poll); no release surfaced -> nothing queued to StateAutomatic -> no rollout. The gateway seeds current from foundingCurrent (control-plane/cmd/control-plane/release_identity.go). Live rides #1614.", "Given that gateway and a feed that advances to B (higher sequence), Then B is offered and A never is": "Same test: after resting on A, publishing B (seq 2) surfaces B (rev-B); A never resurfaces (revision-match + high-water floor).", "Given a founding with no release identity, Then the surface says so and nothing is fabricated": "control-plane/cmd/control-plane/release_identity_test.go TestFoundingCurrent 'no identity is an honest empty current' returns update.Current{} (empty revision, zero sequence, no fabricated convergence) when buildRev is 'unknown' and no env override (ADR 0100).", "The replay floor after founding is A's sequence, not zero": "TestPoll_RestsWhenFeedNewestIsTheFoundingRelease asserts HighWaterFloorForTest == 1 (A's sequence); export_test.go adds HighWaterFloorForTest exposing the effective floor.", "Seam-proven here; add the assertion to #1614's updates-open leg ('at rest after founding') so the drive holds it live": "app/tests/e2e/journey.updates.spec.ts updates-open leg now asserts [data-status=resting] visible and pending/automatic/channel-refused count 0; the drive exports IDSS_RELEASE_REVISION/_SEQUENCE (scripts/smoke-private-path.sh), pinned offline by scripts/tests/rehearsal-local-updates-target-test.sh. Live proof rides #1614.", "go build ./... && go vet ./... && go test ./... + lint green; STATUS.md in the same commit": "All four Go commands exit 0 (see tests); golangci-lint 0 issues; STATUS.md updated in commit 1c178423." }, "summary": "A freshly founded gateway now carries its own founding release identity (revision from fleetwire.Release, signed sequence as a founding fact) and seeds update.Current from it, so it rests on its founding release instead of offering it back and self-swapping the first night.", "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#1631
No description provided.