A founded gateway parks EVERY patch as "pending your decision" and never auto-applies: its own sequence is unknown (current.sequence 0 — the single-manifest feed never lists the founding revision), so the #1690 no-floor guard treats each release as u… #1816

Closed
opened 2026-09-24 05:00:45 +00:00 by ben · 3 comments
Owner

Proven (whakatohea-demo, control plane ff4a5263 = seq 2699, 2026-09-24)

Policy on the box: channel: testing, security: apply-automatically, feature: ask-me-first, window 02:00–04:00. Six kind: patch releases are tracked; every one is state: pending, last_attempt_at zero, and the Updates screen shows them under PENDING YOUR DECISION with lane label FEATURE and badge PATCH (screenshot). One full window passed with no attempt.

update.go:396-418:

noFloor := rel.Sequence > 0 && floor == 0
state := StatePending
if !noFloor && o.store.policy.modeFor(rel.Kind) == ModeAuto { state = StateAutomatic }
…
if !noFloor { o.store.recordAccepted(ch, rel.Sequence) }

floor is the channel high-water, seeded from current.Sequence. On this gateway update.json current is {revision: ff4a5263…, converged: 1, total: 1} — no sequence, i.e. 0. So noFloor is true for every release: each is surfaced pending (never automatic, whatever the policy says), and the mark is never advanced — so the NEXT poll hits the same gate. The guard is #1690's, and it is doing exactly what it was written to do for a build-AHEAD-of-feed community; it cannot tell that case from this one.

Why the floor never heals: adoptOwnReleaseSequence (update.go:431-441) lifts current.Sequence "the moment the feed lists our own revision". The feed (channel/testing.json) is a single manifest = the newest cut (#1814). This gateway was founded at 2699 and its first poll saw 2725; the feed will never again list 2699. So the floor is 0 forever, every release is pending forever, and the security lane (apply-automatically) is dead letter on every real community founded from a build that is not the very newest cut — which is every community.

Fix

  1. Stamp the sequence at build time. The control plane already knows its revision (ldflags, #1631/#1674); git rev-list --count <rev> is knowable in the same build step. Stamp it, and seed current.Sequence from it at first boot. Then floor is never 0 for a stamped binary and the #1690 guard fires only for genuinely unstamped builds (its actual target).
  2. And/or heal from the feed once #1814 lists recent cuts: if the gateway's own revision appears anywhere in the listed window, adopt its sequence.
  3. The Updates row lane label must follow the release KIND under policy (modeFor), not the resting state: a patch in pending because of the no-floor guard should say so — "waiting for your decision because this community cannot rank it yet" — not sit under FEATURE. Today the label lies about why.
  4. Test: a store with current.Sequence stamped 2699 polling a feed at 2725 under security: auto → state automatic, mark advanced; the same with sequence 0 → pending with the reason surfaced.

Relates to: #1690, #1579, #1631/#1674, #1814, #1811, the review crash (previous ticket number), #1562, ADR 0248, ADR 0068.

## Proven (whakatohea-demo, control plane `ff4a5263` = seq 2699, 2026-09-24) Policy on the box: `channel: testing`, `security: apply-automatically`, `feature: ask-me-first`, window 02:00–04:00. Six `kind: patch` releases are tracked; **every one is `state: pending`**, `last_attempt_at` zero, and the Updates screen shows them under **PENDING YOUR DECISION** with lane label **FEATURE** and badge **PATCH** (screenshot). One full window passed with no attempt. `update.go:396-418`: ```go noFloor := rel.Sequence > 0 && floor == 0 state := StatePending if !noFloor && o.store.policy.modeFor(rel.Kind) == ModeAuto { state = StateAutomatic } … if !noFloor { o.store.recordAccepted(ch, rel.Sequence) } ``` `floor` is the channel high-water, seeded from `current.Sequence`. On this gateway `update.json` `current` is `{revision: ff4a5263…, converged: 1, total: 1}` — **no `sequence`**, i.e. 0. So `noFloor` is true for every release: each is surfaced `pending` (never `automatic`, whatever the policy says), and the mark is never advanced — so the NEXT poll hits the same gate. The guard is #1690's, and it is doing exactly what it was written to do for a build-AHEAD-of-feed community; it cannot tell that case from this one. Why the floor never heals: `adoptOwnReleaseSequence` (`update.go:431-441`) lifts `current.Sequence` "the moment the feed lists our own revision". The feed (`channel/testing.json`) is a single manifest = the newest cut (#1814). This gateway was founded at 2699 and its first poll saw 2725; the feed will never again list 2699. So the floor is 0 forever, every release is pending forever, and the security lane (`apply-automatically`) is dead letter on every real community founded from a build that is not the very newest cut — which is every community. ## Fix 1. **Stamp the sequence at build time.** The control plane already knows its revision (ldflags, #1631/#1674); `git rev-list --count <rev>` is knowable in the same build step. Stamp it, and seed `current.Sequence` from it at first boot. Then `floor` is never 0 for a stamped binary and the #1690 guard fires only for genuinely unstamped builds (its actual target). 2. **And/or** heal from the feed once #1814 lists recent cuts: if the gateway's own revision appears anywhere in the listed window, adopt its sequence. 3. The Updates row lane label must follow the release KIND under policy (`modeFor`), not the resting state: a `patch` in `pending` because of the no-floor guard should say so — "waiting for your decision because this community cannot rank it yet" — not sit under FEATURE. Today the label lies about why. 4. Test: a store with `current.Sequence` stamped 2699 polling a feed at 2725 under `security: auto` → state `automatic`, mark advanced; the same with sequence 0 → `pending` with the reason surfaced. Relates to: #1690, #1579, #1631/#1674, #1814, #1811, the review crash (previous ticket number), #1562, ADR 0248, ADR 0068.
Author
Owner

Cross-reference: the review-screen crash referred to as "previous ticket number" is #1815.

Cross-reference: the review-screen crash referred to as "previous ticket number" is **#1815**.

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

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

close-report for #1816 — status success

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

envelope
{
  "issue": 1816,
  "status": "success",
  "commits": [
    "11e69444a39ae532f48862d6e32e1325a57dff80"
  ],
  "changed_files": [
    "STATUS.md",
    "internal/founding/stamp_test.go",
    "internal/founding/testdata/seqstampcheck/main.go",
    "internal/update/downgrade_test.go",
    "scripts/assemble-payload.sh",
    "scripts/lib/release-rail-lib.sh",
    "scripts/release-rail/publish.sh",
    "scripts/tests/release-rail-test.sh"
  ],
  "tests": [
    {
      "command": "bash scripts/tests/release-rail-test.sh",
      "exit_code": 0
    },
    {
      "command": "nix develop .#go-ci -c go test ./internal/founding/ ./internal/update/ -count=1",
      "exit_code": 0
    },
    {
      "command": "nix develop .#go-ci -c go test ./internal/update/... ./internal/founding/... ./control-plane/cmd/control-plane/ -count=1",
      "exit_code": 0
    },
    {
      "command": "nix develop .#go-ci -c go vet ./internal/update/ ./internal/founding/",
      "exit_code": 0
    }
  ],
  "criteria": {
    "Fix 1 — stamp the founding sequence at build time and seed current.Sequence from it": "scripts/lib/release-rail-lib.sh oc_release_ldflags now stamps founding.ReleaseChannelSequence=<seq> beside the revision; publish.sh build_tree and assemble-payload.sh compute git rev-list --count <rev> and feed it. The runtime seed (founding.ReleaseChannelSequence -> foundingCurrent -> update.Current.Sequence) was already wired (#1631/#1674); this closes the missing build-time stamp so floor is never 0 for a stamped binary.",
    "Fix 4 — test: stamped sequence 2699 vs feed 2725 under security:auto -> automatic + mark advanced; sequence 0 -> pending, mark unmoved": "internal/update/downgrade_test.go TestPoll_FoundingSequenceStampReenablesTheSecurityLane pins both halves; internal/founding/stamp_test.go round-trips the -X path so a linker-silent drift is caught (mirrors #1674's fleetwire.Release guard); release-rail-test.sh pins the two-arg helper + both call sites (53 checks green).",
    "Fix 3 — lane label follows KIND under policy, not resting state (DEFERRED)": "Deferred to a follow-up: a P4b-U surface change; with the build-time stamp landed the #1690 no-floor guard fires only for genuinely unstamped dev builds, so the mislabelled-pending state no longer occurs on real communities. Noted in STATUS.md and the commit message."
  },
  "summary": "The release build now stamps founding.ReleaseChannelSequence, so a real community founded from any cut but the feed's newest seeds a non-zero replay floor and the security lane auto-applies instead of parking every release pending.",
  "reason": "",
  "blockers": []
}
**close-report** for #1816 — status `success` :white_check_mark: **close-report gates passed** — every claim verified against main; issue closed. <details><summary>envelope</summary> ```json { "issue": 1816, "status": "success", "commits": [ "11e69444a39ae532f48862d6e32e1325a57dff80" ], "changed_files": [ "STATUS.md", "internal/founding/stamp_test.go", "internal/founding/testdata/seqstampcheck/main.go", "internal/update/downgrade_test.go", "scripts/assemble-payload.sh", "scripts/lib/release-rail-lib.sh", "scripts/release-rail/publish.sh", "scripts/tests/release-rail-test.sh" ], "tests": [ { "command": "bash scripts/tests/release-rail-test.sh", "exit_code": 0 }, { "command": "nix develop .#go-ci -c go test ./internal/founding/ ./internal/update/ -count=1", "exit_code": 0 }, { "command": "nix develop .#go-ci -c go test ./internal/update/... ./internal/founding/... ./control-plane/cmd/control-plane/ -count=1", "exit_code": 0 }, { "command": "nix develop .#go-ci -c go vet ./internal/update/ ./internal/founding/", "exit_code": 0 } ], "criteria": { "Fix 1 — stamp the founding sequence at build time and seed current.Sequence from it": "scripts/lib/release-rail-lib.sh oc_release_ldflags now stamps founding.ReleaseChannelSequence=<seq> beside the revision; publish.sh build_tree and assemble-payload.sh compute git rev-list --count <rev> and feed it. The runtime seed (founding.ReleaseChannelSequence -> foundingCurrent -> update.Current.Sequence) was already wired (#1631/#1674); this closes the missing build-time stamp so floor is never 0 for a stamped binary.", "Fix 4 — test: stamped sequence 2699 vs feed 2725 under security:auto -> automatic + mark advanced; sequence 0 -> pending, mark unmoved": "internal/update/downgrade_test.go TestPoll_FoundingSequenceStampReenablesTheSecurityLane pins both halves; internal/founding/stamp_test.go round-trips the -X path so a linker-silent drift is caught (mirrors #1674's fleetwire.Release guard); release-rail-test.sh pins the two-arg helper + both call sites (53 checks green).", "Fix 3 — lane label follows KIND under policy, not resting state (DEFERRED)": "Deferred to a follow-up: a P4b-U surface change; with the build-time stamp landed the #1690 no-floor guard fires only for genuinely unstamped dev builds, so the mislabelled-pending state no longer occurs on real communities. Noted in STATUS.md and the commit message." }, "summary": "The release build now stamps founding.ReleaseChannelSequence, so a real community founded from any cut but the feed's newest seeds a non-zero replay floor and the security lane auto-applies instead of parking every release pending.", "reason": "", "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.

Dependencies

No dependencies set.

Reference
Matou/idss#1816
No description provided.