updates (#1562-2d): a refused release is retried every 5 minutes forever and never quarantined — make a refusal an attempt, carry it as data, and surface a refused release list (DDR 0250) #1577

Closed
opened 2026-09-18 13:53:29 +00:00 by ben · 2 comments
Owner

Parent: #1562 — contract: DDR 0250 (design), ADR 0248, ADR 0067

Found while running the #1571 design interview (2026-09-18). One defect and two seams the designed screen needs. No design is outstanding — DDR 0250 rules all of it.

The defect: a refused rollout is retried every five minutes, forever

control-plane/cmd/control-plane/updates_scheduler.go tick marks a release attempted-this-window only when Rollout returns without an error (if err != nil { …; continue }). A land refusal (internal/update/rollout.go, the StageLand block) returns an error, so:

  • the per-window throttle never engages — the release is re-attempted on every 5-minute tick for the whole maintenance window, re-downloading the whole bundle (hundreds of MB) each time;
  • the refusal never counts against ADR 0067's two-attempt budget, so it can never be quarantined — the exact loop ADR 0067 exists to prevent, through a door it did not know about.

What to build (DDR 0250)

  1. A refusal is an attempt. A land refusal — a digest mismatch OR a fetch fault — counts against the two-attempt budget and engages the per-window throttle exactly as a rolled-back attempt does. First refusal: tried once more at the next window. Second consecutive refusal: quarantined, in the same held list, with its own reason. RetryByHand still works on it and still counts (a retry re-verifies every file, so it can never land what was refused). History records the outcome as refused, never rolled-back.
  2. Carry the refusal as data, not a string. Today it is RolloutView.Fault / StageResult.Fault, a Go error string the control panel would have to parse. Add a structured refusal to the rollout view and the history entry: the check (fingerprint-mismatch | fetch-failed), the artifact role (control-plane | control-panel | agent), the signed and received sha256 (mismatch only), the attempt number, and when. Keep Fault for anything that is not a refusal. Update the OpenAPI spec and regenerate the TS client (check:client gates it).
  3. Surface a refused release LIST. A feed whose signature does not verify makes Poll return an error that only the scheduler's log sees; the Updates surface says nothing and the community silently stops taking updates. Add a standing channel refused fact to update.Surface — first-refused-at, last-checked-at, the check (list-signature), the channel and feed URL — set on a failed verification and cleared on the next poll that verifies. It carries nothing from the refused list (no title, notes or revision — unsigned words are never rendered, DDR 0250). It has no attempt budget: a list names no release. A transport fault reaching the feed is NOT a refusal — keep that distinction (it is "could not check", not "refused").
  4. The land stage only appears in a view when the release carries artifacts (a closure-only release skips it) — confirm the view already behaves so and pin it with a test.

Acceptance (seam)

  • Given a release whose control-panel artifact mismatches, When the scheduler ticks repeatedly inside one window, Then the bundle is fetched once, the release shows attempt 1 of 2 refused, and nothing is deployed
  • Given the same release refused again at the next window, Then it is quarantined with a refused reason, and later releases are not blocked
  • Given a quarantined refused release, When the operator retries by hand and the files now verify, Then it rolls out normally
  • Given a refusal, Then the rollout view and history carry check + artifact role + both fingerprints + attempt as typed fields, and the TS client matches the spec
  • Given a feed with a bad signature, Then the surface carries the standing channel-refused fact with no field sourced from the feed body; Given the next poll verifies, Then it is gone
  • Given the feed host is unreachable, Then the surface does NOT say refused
  • Full Go gate + check:client green; STATUS.md in the same commit

Does not touch dashboard/ screens — that is #1571, which builds against these fields.

## Parent: #1562 — contract: DDR 0250 (design), ADR 0248, ADR 0067 Found while running the #1571 design interview (2026-09-18). One defect and two seams the designed screen needs. No design is outstanding — DDR 0250 rules all of it. ## The defect: a refused rollout is retried every five minutes, forever `control-plane/cmd/control-plane/updates_scheduler.go` `tick` marks a release attempted-this-window only when `Rollout` returns **without** an error (`if err != nil { …; continue }`). A land refusal (`internal/update/rollout.go`, the `StageLand` block) returns an error, so: - the per-window throttle never engages — the release is re-attempted on **every** 5-minute tick for the whole maintenance window, re-downloading the whole bundle (hundreds of MB) each time; - the refusal never counts against ADR 0067's two-attempt budget, so it can **never** be quarantined — the exact loop ADR 0067 exists to prevent, through a door it did not know about. ## What to build (DDR 0250) 1. **A refusal is an attempt.** A land refusal — a digest mismatch OR a fetch fault — counts against the two-attempt budget and engages the per-window throttle exactly as a rolled-back attempt does. First refusal: tried once more at the next window. Second consecutive refusal: quarantined, in the same held list, with its own reason. `RetryByHand` still works on it and still counts (a retry re-verifies every file, so it can never land what was refused). History records the outcome as **refused**, never rolled-back. 2. **Carry the refusal as data, not a string.** Today it is `RolloutView.Fault` / `StageResult.Fault`, a Go error string the control panel would have to parse. Add a structured refusal to the rollout view and the history entry: the **check** (`fingerprint-mismatch` | `fetch-failed`), the **artifact role** (`control-plane` | `control-panel` | `agent`), the signed and received `sha256` (mismatch only), the attempt number, and when. Keep `Fault` for anything that is not a refusal. Update the OpenAPI spec and regenerate the TS client (`check:client` gates it). 3. **Surface a refused release LIST.** A feed whose signature does not verify makes `Poll` return an error that only the scheduler's log sees; the Updates surface says nothing and the community silently stops taking updates. Add a standing `channel refused` fact to `update.Surface` — first-refused-at, last-checked-at, the check (`list-signature`), the channel and feed URL — **set** on a failed verification and **cleared** on the next poll that verifies. It carries **nothing from the refused list** (no title, notes or revision — unsigned words are never rendered, DDR 0250). It has no attempt budget: a list names no release. A transport fault reaching the feed is NOT a refusal — keep that distinction (it is "could not check", not "refused"). 4. The `land` stage only appears in a view when the release carries artifacts (a closure-only release skips it) — confirm the view already behaves so and pin it with a test. ## Acceptance (seam) - [ ] Given a release whose control-panel artifact mismatches, When the scheduler ticks repeatedly inside one window, Then the bundle is fetched **once**, the release shows attempt 1 of 2 refused, and nothing is deployed - [ ] Given the same release refused again at the next window, Then it is quarantined with a refused reason, and later releases are not blocked - [ ] Given a quarantined refused release, When the operator retries by hand and the files now verify, Then it rolls out normally - [ ] Given a refusal, Then the rollout view and history carry check + artifact role + both fingerprints + attempt as typed fields, and the TS client matches the spec - [ ] Given a feed with a bad signature, Then the surface carries the standing channel-refused fact with no field sourced from the feed body; Given the next poll verifies, Then it is gone - [ ] Given the feed host is unreachable, Then the surface does NOT say refused - [ ] Full Go gate + `check:client` green; STATUS.md in the same commit Does not touch `dashboard/` screens — that is #1571, which builds against these fields.

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

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

close-report for #1577 — status success

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

envelope
{
  "issue": 1577,
  "status": "success",
  "commits": [
    "44a7deddb579ba770250eda9d438ea7d23b2bf3c"
  ],
  "changed_files": [
    "STATUS.md",
    "control-plane/cmd/control-plane/main.go",
    "control-plane/cmd/control-plane/updates_scheduler_refusal_test.go",
    "dashboard/src/lib/api/generated.ts",
    "internal/matouchannel/matouchannel.go",
    "internal/update/history.go",
    "internal/update/land.go",
    "internal/update/refusal.go",
    "internal/update/rollback.go",
    "internal/update/rollout.go",
    "internal/update/rollout_land_test.go",
    "internal/update/rollout_refusal_test.go",
    "internal/update/rolloutview.go",
    "internal/update/store.go",
    "internal/update/surface.go",
    "internal/update/update.go",
    "packages/openapi-spec/openapi.yaml"
  ],
  "tests": [
    {
      "command": "nix develop .#go-ci -c go build ./...",
      "exit_code": 0
    },
    {
      "command": "nix develop .#go-ci -c go vet ./internal/update/... ./internal/matouchannel/... ./control-plane/cmd/control-plane/",
      "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/matouchannel/... ./control-plane/cmd/control-plane/",
      "exit_code": 0
    },
    {
      "command": "node packages/openapi-spec/scripts/generate-client.mjs --check",
      "exit_code": 0
    },
    {
      "command": "CI=true pnpm --filter @idss/openapi-spec run test",
      "exit_code": 0
    }
  ],
  "criteria": {
    "Given a release whose control-panel artifact mismatches, When the scheduler ticks repeatedly inside one window, Then the bundle is fetched once, the release shows attempt 1 of 2 refused, and nothing is deployed": "TestUpdateScheduler_RefusedFetchedOnceThenNextWindowQuarantines (control-plane) proves fetches unchanged on the second same-window tick, history outcome refused, current stays old-rev; TestRollout_DigestMismatchRefusesLoudNothingDeployed proves attempt 1 of 2 with nothing landed/deployed. Fix: rollout.go returns nil on a LandRefusal so the scheduler marks it attempted (throttle engages)",
    "Given the same release refused again at the next window, Then it is quarantined with a refused reason, and later releases are not blocked": "TestRollout_SecondRefusalQuarantinesWithReason (quarantine carries q.Refusal, empty FailingNode; a later release applies over it) + the scheduler test's next-window quarantine; recordRefusal in rollback.go",
    "Given a quarantined refused release, When the operator retries by hand and the files now verify, Then it rolls out normally": "TestRollout_RetryByHandVerifiesNowRollsOut — rollable(revision, manual=true) reaches StateQuarantined; retry re-fetches, verifies, lands on all nodes, applies, drops off the held list",
    "Given a refusal, Then the rollout view and history carry check + artifact role + both fingerprints + attempt as typed fields, and the TS client matches the spec": "update.Refusal on RolloutResult/RolloutView/HistoryEntry/QuarantineView (rollout.go, rolloutview.go, history.go, surface.go); asserted in TestRollout_DigestMismatchRefusesLoudNothingDeployed (view.Refusal + h.Refusal) and TestRollout_FetchFaultRefusesAsFetchFailed; openapi.yaml gains RolloutRefusal + UpdateRefusalCheck; generated.ts regenerated, check:client exit 0",
    "Given a feed with a bad signature, Then the surface carries the standing channel-refused fact with no field sourced from the feed body; Given the next poll verifies, Then it is gone": "TestPoll_BadListSignatureSetsAndClearsChannelRefused — surface.ChannelRefused set (list-signature, channel, feed_url, first/last stamps, non-resting), first-refused-at held across repeats, cleared on the next verifying poll; matouchannel returns typed FeedRefusedError, Poll sets/clears the fact (update.go, surface.go, refusal.go)",
    "Given the feed host is unreachable, Then the surface does NOT say refused": "TestPoll_TransportFaultIsNotRefused — a plain (non-FeedRefusedError) error leaves ChannelRefused nil; matouchannel keeps the fetch/transport error unwrapped",
    "Full Go gate + check:client green; STATUS.md in the same commit": "go build/vet/test ./... + golangci-lint all exit 0; check:client exit 0; STATUS.md updated in commit 44a7dedd",
    "The land stage only appears when the release carries artifacts (closure-only skips it) — pinned by test": "TestRollout_ClosureOnlyReleaseHasNoLandStage — a closure-only applied rollout's view has no StageLand"
  },
  "summary": "A refused release is now a completed attempt carried as structured data (not a five-minute retry loop), and a refused release list is surfaced — DDR 0250's backend defect fix plus the seams #1571 builds against.",
  "reason": "",
  "blockers": [],
  "no_code_change": ""
}
**close-report** for #1577 — status `success` :white_check_mark: **close-report gates passed** — every claim verified against main; issue closed. <details><summary>envelope</summary> ```json { "issue": 1577, "status": "success", "commits": [ "44a7deddb579ba770250eda9d438ea7d23b2bf3c" ], "changed_files": [ "STATUS.md", "control-plane/cmd/control-plane/main.go", "control-plane/cmd/control-plane/updates_scheduler_refusal_test.go", "dashboard/src/lib/api/generated.ts", "internal/matouchannel/matouchannel.go", "internal/update/history.go", "internal/update/land.go", "internal/update/refusal.go", "internal/update/rollback.go", "internal/update/rollout.go", "internal/update/rollout_land_test.go", "internal/update/rollout_refusal_test.go", "internal/update/rolloutview.go", "internal/update/store.go", "internal/update/surface.go", "internal/update/update.go", "packages/openapi-spec/openapi.yaml" ], "tests": [ { "command": "nix develop .#go-ci -c go build ./...", "exit_code": 0 }, { "command": "nix develop .#go-ci -c go vet ./internal/update/... ./internal/matouchannel/... ./control-plane/cmd/control-plane/", "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/matouchannel/... ./control-plane/cmd/control-plane/", "exit_code": 0 }, { "command": "node packages/openapi-spec/scripts/generate-client.mjs --check", "exit_code": 0 }, { "command": "CI=true pnpm --filter @idss/openapi-spec run test", "exit_code": 0 } ], "criteria": { "Given a release whose control-panel artifact mismatches, When the scheduler ticks repeatedly inside one window, Then the bundle is fetched once, the release shows attempt 1 of 2 refused, and nothing is deployed": "TestUpdateScheduler_RefusedFetchedOnceThenNextWindowQuarantines (control-plane) proves fetches unchanged on the second same-window tick, history outcome refused, current stays old-rev; TestRollout_DigestMismatchRefusesLoudNothingDeployed proves attempt 1 of 2 with nothing landed/deployed. Fix: rollout.go returns nil on a LandRefusal so the scheduler marks it attempted (throttle engages)", "Given the same release refused again at the next window, Then it is quarantined with a refused reason, and later releases are not blocked": "TestRollout_SecondRefusalQuarantinesWithReason (quarantine carries q.Refusal, empty FailingNode; a later release applies over it) + the scheduler test's next-window quarantine; recordRefusal in rollback.go", "Given a quarantined refused release, When the operator retries by hand and the files now verify, Then it rolls out normally": "TestRollout_RetryByHandVerifiesNowRollsOut — rollable(revision, manual=true) reaches StateQuarantined; retry re-fetches, verifies, lands on all nodes, applies, drops off the held list", "Given a refusal, Then the rollout view and history carry check + artifact role + both fingerprints + attempt as typed fields, and the TS client matches the spec": "update.Refusal on RolloutResult/RolloutView/HistoryEntry/QuarantineView (rollout.go, rolloutview.go, history.go, surface.go); asserted in TestRollout_DigestMismatchRefusesLoudNothingDeployed (view.Refusal + h.Refusal) and TestRollout_FetchFaultRefusesAsFetchFailed; openapi.yaml gains RolloutRefusal + UpdateRefusalCheck; generated.ts regenerated, check:client exit 0", "Given a feed with a bad signature, Then the surface carries the standing channel-refused fact with no field sourced from the feed body; Given the next poll verifies, Then it is gone": "TestPoll_BadListSignatureSetsAndClearsChannelRefused — surface.ChannelRefused set (list-signature, channel, feed_url, first/last stamps, non-resting), first-refused-at held across repeats, cleared on the next verifying poll; matouchannel returns typed FeedRefusedError, Poll sets/clears the fact (update.go, surface.go, refusal.go)", "Given the feed host is unreachable, Then the surface does NOT say refused": "TestPoll_TransportFaultIsNotRefused — a plain (non-FeedRefusedError) error leaves ChannelRefused nil; matouchannel keeps the fetch/transport error unwrapped", "Full Go gate + check:client green; STATUS.md in the same commit": "go build/vet/test ./... + golangci-lint all exit 0; check:client exit 0; STATUS.md updated in commit 44a7dedd", "The land stage only appears when the release carries artifacts (closure-only skips it) — pinned by test": "TestRollout_ClosureOnlyReleaseHasNoLandStage — a closure-only applied rollout's view has no StageLand" }, "summary": "A refused release is now a completed attempt carried as structured data (not a five-minute retry loop), and a refused release list is surfaced — DDR 0250's backend defect fix plus the seams #1571 builds against.", "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#1577
No description provided.