Repository navigation
RFC-0043: Site status pages and maintenance mode - #118
Merged
Merged
Conversation
Renderer-owned status pages served before Astro (not-published, maintenance, unavailable, error, preview-expired), translated, with an optional theme hook; and a production maintenance mode: a per-site D1 record outside snapshots, windows with Retry-After, person approval for agents, signed bypass links, purge on toggle, a status feature handshake and a health endpoint that tells maintenance from down. The contract was checked with pnpm gen (TypeScript and Rust) and reverted. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Madraka <8898640+Madraka@users.noreply.github.com>
Resolve the 14 open questions as recommended in a Decisions section and
work in the design notes: the site health endpoint shares the admin's
{ ok, state } shape, static builds of an unpublished or hidden site
write the status page (cloudhal build --published, Docker site-build,
a Caddy 503 block), the published site's theme tokens on maintenance
and preview-expired pages, no-store plus a tag purge for the path-keyed
Workers Cache with a two-host test, every registered Studio language
through the i18n exchange flow with simple ICU arguments only, the
site state on get_site for agents with the RFC-0044 scope mapping, and
status-page views through the existing render events. Reorder the
rollout so PR 1 (status pages in the renderer) ships on its own and PR 2
is the static-build path. Wrap lines under 100 characters.
Refs #117
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Signed-off-by: Madraka <8898640+Madraka@users.noreply.github.com>
This was referenced Nov 8, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
From #117. Status: Accepted (2026-11-08). Every open question decided as recommended; the design notes of 2026-11-08 are worked in. Implementation starts with rollout PR 1 (status pages in the renderer), which ships on its own.
Status pages (the renderer serves them before Astro, from a pure
statusPage(state, input) → Response)not-publishedmaintenanceunavailableerrorcf-raypreview-expiredno-storeon browser and edge,Vary: Hoston top: Workers Cache keys on the path, not the host (the cloudhal.com www-redirect lesson), so a cached status page would be shared across hosts; a workerd test asserts two hosts of one Worker never share one. A self-contained page of at most 8 KB with its own CSP, no admin link.en(no Accept-Language); RTL from the registry, Western digits for Arabic and Persian. The renderer's catalog covers every registered Studio language throughpnpm i18n:export/import(a second source of the exchange script); messages use simple ICU arguments only, so no compiler ships in the site Worker.maintenanceandpreview-expiredmay use the published snapshot's theme tokens (brand, surface, text colors, the font pairing); the other states stay neutral.statusPageintheme.tsreturns HTML only. It falls back on throw, > 50 ms or > 64 KB, and is never used forerror. Old themes get the built-in page unchanged; the starter's routes usestatusPage/statusPlainas their own fallback.GET /__cloudhal/healthanswers{ "ok": true, "state": "published" | "not-published" | "maintenance" }, the admin's/api/healthshape plusstate, so Docker, Caddy and cloudhal.com's post-deploy check read both with one rule.cloudhal build --publishedwrites the status page as the whole output of an unpublished or hidden site (index.html,404.html,robots.txt,_headers, a.cloudhal-statusmarker); the Dockersite-buildpasses the flag and the Caddyfile serves it with 503. The self-host static path never serves an empty directory.Maintenance mode
SiteMaintenance, a new root contract) outside snapshots, bundles and push/pull, so a rollback never toggles it.off,on(optional end) andwindow(start and end). Wording ismaintenanceorcoming-soon, with a plain-text message per locale of at most 280 characters. It ends per request; no scheduler is involved.site:settings. Agents useset_maintenanceonly with approval from a person holdingsite:settings, in every mode (turning it off too). Every change is audited.get_sitegains astatusfield so an agent learns the state before it acts; RFC-0044 tokens carry the same key scopes and neversite:settings.private, no-store; links last 1 hour by default, 24 hours at most.robots.txt(a 503 there would pause Google crawling), media, static assets and/.well-known. Feeds, sitemap andllms.txtanswer a plain 503.{gates: 2, status: 1}; until then, writes getstatus_unsupported(409).get_maintenance,set_maintenance), CLI (cloudhal maintenance …) and Studio (a card and a banner). The playground blocks all of it.Decisions (2026-11-08): the 14 recommended defaults, listed one line each at the end of the RFC, plus the seven design notes and where each went. Rollout: 7 PRs; PR 1 status pages in the renderer (self-contained), PR 2 static builds, PR 3 maintenance in the renderer (with the contract and its ADR), PR 4 writers, PR 5 MCP, PR 6 Studio, PR 7 ops and docs.
Schema check: the new
site-maintenance.schema.json, with 4 valid and 12 invalid fixtures, passedpnpm gen, the core-contracts tests andcargo teston the draft branch, then was reverted; it lands with PR 3.🤖 Generated with Claude Code