front door: the apex answers an honest "control panel is restarting" page instead of a raw 502 while the control plane is down (ADR 0247 §7 amended; #1650 option a) #1651

Closed
opened 2026-09-20 04:54:11 +00:00 by ben · 2 comments
Owner

What

While the control plane is down — a second on every self-swap (ADR 0259), ~15–20 s when a swapped binary cannot boot and the #1639 guard restores the previous one — the community's apex answers a raw 502. ADR 0247 §7 chose that on purpose ("the honest answer for an operator tool") when it dropped the static shell. ADR 0259 has since made a short control-plane outage a routine, expected part of every update, so the honest answer can now say more than "502".

Ben ruled on #1650 (2026-09-20): the #1614 proof accepts the bounded outage (b), and this — (a) — is filed separately and blocks nothing.

Build

  • In the rendered front door (internal/clan/frontdoor.go), give the @apex route a handle_errors for 502/503/504 from the control-plane upstream that serves ONE static page off disk, with the same status code kept (it is still an outage — monitors and the drive's probe must still read 5xx; only the body changes).
  • Copy, plain and unbranded-safe: "This community's control panel is restarting. It is usually back within a minute — this page will retry by itself." plus a small meta-refresh/JS retry (≈10 s). No claim that an update is the cause — the front door cannot know that; a crash gets the same page.
  • The page wears the community's brand tokens if /brand/tokens.css is served off disk independently of the control plane; if it is not, ship it plain — do not make the fallback depend on the thing that is down.
  • Amend ADR 0247 §7 in the same commit (what changed and why: ADR 0259 made the outage routine), and update docs/architecture/ where the front door's apex route is drawn.

Out of scope

Gated member services also fail their /authz sign-in check during the same window. That is inherent to a one-node community restarting its only control plane and is NOT addressed here — note it in the ADR amendment; do not try to cache auth decisions.

Acceptance

  • Render test: the apex route carries the error handler; the static page is in the gateway's closure/served dir; status stays 5xx.
  • caddy fmt then caddy validate on the rendered Caddyfile (GOTCHAS #238).
  • Eval-smoke baseline regenerated in the same commit if the gateway closure moves (say so in the close-report if the sandbox cannot run it).
  • GOTCHAS + STATUS in the same commit.
## What While the control plane is down — a second on every self-swap (ADR 0259), ~15–20 s when a swapped binary cannot boot and the #1639 guard restores the previous one — the community's apex answers a **raw 502**. ADR 0247 §7 chose that on purpose ("the honest answer for an operator tool") when it dropped the static shell. ADR 0259 has since made a short control-plane outage a *routine, expected* part of every update, so the honest answer can now say more than "502". Ben ruled on #1650 (2026-09-20): the #1614 proof accepts the bounded outage **(b)**, and this — **(a)** — is filed separately and blocks nothing. ## Build - In the rendered front door (`internal/clan/frontdoor.go`), give the `@apex` route a `handle_errors` for 502/503/504 from the control-plane upstream that serves ONE static page off disk, with the same status code kept (it is still an outage — monitors and the drive's probe must still read 5xx; only the body changes). - Copy, plain and unbranded-safe: **"This community's control panel is restarting. It is usually back within a minute — this page will retry by itself."** plus a small meta-refresh/JS retry (≈10 s). No claim that an update is the cause — the front door cannot know that; a crash gets the same page. - The page wears the community's brand tokens if `/brand/tokens.css` is served off disk independently of the control plane; if it is not, ship it plain — do not make the fallback depend on the thing that is down. - **Amend ADR 0247 §7 in the same commit** (what changed and why: ADR 0259 made the outage routine), and update `docs/architecture/` where the front door's apex route is drawn. ## Out of scope Gated member services also fail their `/authz` sign-in check during the same window. That is inherent to a one-node community restarting its only control plane and is NOT addressed here — note it in the ADR amendment; do not try to cache auth decisions. ## Acceptance - [ ] Render test: the apex route carries the error handler; the static page is in the gateway's closure/served dir; status stays 5xx. - [ ] `caddy fmt` then `caddy validate` on the rendered Caddyfile (GOTCHAS #238). - [ ] Eval-smoke baseline regenerated in the same commit if the gateway closure moves (say so in the close-report if the sandbox cannot run it). - [ ] GOTCHAS + STATUS in the same commit.

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

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

close-report for #1651 — status success

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

envelope
{
  "issue": 1651,
  "status": "success",
  "commits": [
    "f31be6e2591bf3446f113a25d57466b7f640f0b0"
  ],
  "changed_files": [
    "STATUS.md",
    "docs/GOTCHAS.md",
    "docs/adr/0247-the-apex-serves-the-control-panel-and-the-portal-rests-behind-one-switch.md",
    "docs/architecture/14-brand-kit-propagation.md",
    "internal/clan/frontdoor.go",
    "internal/clan/frontdoor_apexpanel_test.go"
  ],
  "tests": [
    {
      "command": "go test ./internal/clan/",
      "exit_code": 0
    },
    {
      "command": "go test ./internal/clan/ -run IsAValidCaddyfile (caddy 2.11.4 on PATH: caddy fmt + caddy validate, both postures)",
      "exit_code": 0
    },
    {
      "command": "go vet ./internal/clan/",
      "exit_code": 0
    },
    {
      "command": "gofmt -l internal/clan/frontdoor.go internal/clan/frontdoor_apexpanel_test.go",
      "exit_code": 0
    },
    {
      "command": "nix develop .#go-ci -c golangci-lint run ./internal/clan/...",
      "exit_code": 0
    }
  ],
  "criteria": {
    "Render test: the apex route carries the error handler; the static page is in the gateway's closure/served dir; status stays 5xx": "internal/clan/frontdoor_apexpanel_test.go TestRenderFrontDoor_PanelPostureApexServesTheControlPlaneOutagePage (public+private) asserts: the @apex handle carries handle_errors 502 503 504 (scoped back to @apex); the page ships in the gateway's Nix closure via environment.etc.\"idss/frontdoor/control-plane-restarting.html\"; and file_server { status {err.status_code} } keeps the 5xx. Impl in internal/clan/frontdoor.go renderApexControlPlaneOutage + renderControlPlaneRestartingFile.",
    "caddy fmt then caddy validate on the rendered Caddyfile (GOTCHAS #238)": "TestRenderFrontDoor_IsAValidCaddyfile ran GREEN with caddy 2.11.4 (the pinned version, built from nixpkgs) on PATH — caddy fmt --overwrite then caddy validate over BOTH panel and portal postures, public/private/public-email-keyed renders. Also live-verified: a standalone caddy run with a dead upstream returned HTTP 502 with the page body (status kept, not 200).",
    "Eval-smoke baseline regenerated in the same commit if the gateway closure moves (say so in the close-report if the sandbox cannot run it)": "The gateway closure did NOT move: the baselined seed-community scopes (seed-community/gateway, seed-community/fleetgw in internal/clan/testdata/drvpath-baseline.txt) attach no front-door.nix — the eval smoke calls AttachGateway with GatewayLiveSet{Gateway: ...} only (live.FrontDoor is nil), so front-door.nix is never composed into their toplevel. This render change therefore cannot alter their drvPath, and no baseline row needs regenerating. The full IDSS_EVAL_SMOKE=1 run (downloads clan-core+nixpkgs) was not executed in the sandbox; the baseline is unchanged by inspection of what the baselined scopes import.",
    "GOTCHAS + STATUS in the same commit": "docs/GOTCHAS.md #286 (handle_errors is a site-level directive, cannot nest in a handle; custom error page must keep the 5xx status or it blinds monitors) and STATUS.md milestone entry are both in commit f31be6e2, alongside the code."
  },
  "summary": "The apex serves an honest, self-retrying, 5xx-preserving \"control panel is restarting\" page (off the gateway's own Nix closure) for a routine control-plane 502/503/504, instead of a raw 502; ADR 0247 §7 amended and the architecture diagram updated.",
  "reason": "",
  "blockers": [],
  "no_code_change": ""
}
**close-report** for #1651 — status `success` :white_check_mark: **close-report gates passed** — every claim verified against main; issue closed. <details><summary>envelope</summary> ```json { "issue": 1651, "status": "success", "commits": [ "f31be6e2591bf3446f113a25d57466b7f640f0b0" ], "changed_files": [ "STATUS.md", "docs/GOTCHAS.md", "docs/adr/0247-the-apex-serves-the-control-panel-and-the-portal-rests-behind-one-switch.md", "docs/architecture/14-brand-kit-propagation.md", "internal/clan/frontdoor.go", "internal/clan/frontdoor_apexpanel_test.go" ], "tests": [ { "command": "go test ./internal/clan/", "exit_code": 0 }, { "command": "go test ./internal/clan/ -run IsAValidCaddyfile (caddy 2.11.4 on PATH: caddy fmt + caddy validate, both postures)", "exit_code": 0 }, { "command": "go vet ./internal/clan/", "exit_code": 0 }, { "command": "gofmt -l internal/clan/frontdoor.go internal/clan/frontdoor_apexpanel_test.go", "exit_code": 0 }, { "command": "nix develop .#go-ci -c golangci-lint run ./internal/clan/...", "exit_code": 0 } ], "criteria": { "Render test: the apex route carries the error handler; the static page is in the gateway's closure/served dir; status stays 5xx": "internal/clan/frontdoor_apexpanel_test.go TestRenderFrontDoor_PanelPostureApexServesTheControlPlaneOutagePage (public+private) asserts: the @apex handle carries handle_errors 502 503 504 (scoped back to @apex); the page ships in the gateway's Nix closure via environment.etc.\"idss/frontdoor/control-plane-restarting.html\"; and file_server { status {err.status_code} } keeps the 5xx. Impl in internal/clan/frontdoor.go renderApexControlPlaneOutage + renderControlPlaneRestartingFile.", "caddy fmt then caddy validate on the rendered Caddyfile (GOTCHAS #238)": "TestRenderFrontDoor_IsAValidCaddyfile ran GREEN with caddy 2.11.4 (the pinned version, built from nixpkgs) on PATH — caddy fmt --overwrite then caddy validate over BOTH panel and portal postures, public/private/public-email-keyed renders. Also live-verified: a standalone caddy run with a dead upstream returned HTTP 502 with the page body (status kept, not 200).", "Eval-smoke baseline regenerated in the same commit if the gateway closure moves (say so in the close-report if the sandbox cannot run it)": "The gateway closure did NOT move: the baselined seed-community scopes (seed-community/gateway, seed-community/fleetgw in internal/clan/testdata/drvpath-baseline.txt) attach no front-door.nix — the eval smoke calls AttachGateway with GatewayLiveSet{Gateway: ...} only (live.FrontDoor is nil), so front-door.nix is never composed into their toplevel. This render change therefore cannot alter their drvPath, and no baseline row needs regenerating. The full IDSS_EVAL_SMOKE=1 run (downloads clan-core+nixpkgs) was not executed in the sandbox; the baseline is unchanged by inspection of what the baselined scopes import.", "GOTCHAS + STATUS in the same commit": "docs/GOTCHAS.md #286 (handle_errors is a site-level directive, cannot nest in a handle; custom error page must keep the 5xx status or it blinds monitors) and STATUS.md milestone entry are both in commit f31be6e2, alongside the code." }, "summary": "The apex serves an honest, self-retrying, 5xx-preserving \"control panel is restarting\" page (off the gateway's own Nix closure) for a routine control-plane 502/503/504, instead of a raw 502; ADR 0247 §7 amended and the architecture diagram updated.", "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.

Dependencies

No dependencies set.

Reference
Matou/idss#1651
No description provided.