Skip to content
Toolkit

ADR-0103 — An author's static page is served as an inert document

Status: Accepted · Date: 2026-08-30 · Track: 008-card-view, phase 03

Context

A static link is a page its author uploaded — HTML, or a zip the product accepts and has never unpacked. Until this slice, visiting one took h.redirectTo, which reads links.location_url: a column the static write path never sets, exactly as the file half found (ADR-0102). So a static page either 404'd or bounced the visitor somewhere its author never named, and the only address the document had was the storage URL — which answers to no gate, no schedule and no click limit.

ADR-0102 settled the file half and said, in as many words, that it did not settle this one. Its rule 5 is an allowlist of four raster types, and HTML is not on it for the reason it cannot be: an author's HTML rendered on the API's origin is the author's script running as the product, on the origin whose localStorage holds the session token (ADR-0096, ADR-0094). Its rule 4 is the other half of the bind: default-src 'none'; sandbox serves a static page as unstyled text, which is not the product the author bought.

The origin that would dissolve both halves — a public origin holding no session — is the owner decision this track carries as Blocker 1, and every renderer here is built without it.

Decision

A static page's document is served by the product, as the author's markup with the author's presentation, and nothing else.

  1. The redirect path serves the document itself. case models.LinkTypeStatic streams the stored bytes; the storage path, the storage origin and the filesystem appear in no response. The gates, the schedule, the limit and the click record ran above the type switch, so the document inherits all four by being served here rather than from storage. There is no hand-off to an app page (ADR-0099's shape): the document is the page, and product chrome around it would mean framing the author's markup, which rule 4 refuses.
  2. The type is declared, never derived. text/html; charset=utf-8, because this branch serves HTML and only HTML — the file half derives a type from the stored extension because it serves whatever was uploaded; here the type is a property of the branch.
  3. The document is inert: no script, no origin, no outbound fetch. Content-Security-Policy: sandbox; default-src 'none'; style-src 'unsafe-inline'; img-src data:; font-src data:, beside nosniff.
    • sandbox with no flags is the whole of it: no script runs, and the document is in an opaque origin, so it could not read the session out of localStorage even if one did.
    • style-src 'unsafe-inline' is what makes the page a page rather than ADR-0102 rule 4's unstyled text. With no script permitted, an inline <style> block and a style= attribute are presentation and nothing else.
    • data: for images and fonts, and no scheme at all for anything else, so a single-file static page draws itself completely and cannot fetch outward. That is deliberate: a static page free to request https://anywhere would be an unlisted tracking pixel, emitting from the visitor's browser past the per-provider honesty 007 phase 03 built into the pickers (ADR-0096). What a link may emit, and to whom, is a decision that already has an owner; a static page does not get to route around it.
  4. Framing is refused — X-Frame-Options: DENY — so the author's document cannot be dressed up as the product, or as anyone else.
  5. A stored document that is not HTML answers 404. Today that is the zip the upload allowlist accepts and nothing unpacks; unpacking a bundle to a served site is track 010's, named there. It is not offered as a download instead: a file link is the product that hands a visitor a file, and a static link that quietly became one would be a different promise than the author made. It never falls back to the redirect this branch replaces, because the fallback is the defect (ADR-0102 rule 3).
  6. A static link with no readable document answers 404 — no storage backend wired, no file_path on the row, or bytes that are gone — for the same reason.

Consequences

  • A static page is gated, scheduled, limited and counted like every other link, because it is now served by the path that does all four.
  • An uploaded page whose design depends on script, or on a CDN stylesheet, will render without them. That is the visible cost of serving it on the session origin, and it is the honest one: the alternative is not a richer page, it is the author's script with the product's origin. Lifting the ceiling is what Blocker 1 buys, and this ADR is one of the surfaces to re-present with it.
  • Zip-backed static links stay unserved until 010 unpacks them. They were never served before either; the difference is that the ledger now says so, and the visitor gets a missing page rather than a bounce to a storage URL.
  • static_url, composed for the author's own editor as static/<folder>/index.html, is an address nothing has ever written — the write path stores at file_path. The serving path reads file_path and does not guess at the other; the editor-side key is a separate repair, recorded as an open item rather than fixed quietly here.
  • Range requests are not supported, as in the file half. A static page is markup, so this costs less here than it does there.

Source: docs/decisions/0103-an-authors-static-page-is-served-as-an-inert-document.md

Library