ADR-0132 — A document has one address, and it is the one the gate answers
Status: Accepted · Date: 2026-08-30 · Track: 010 phase 05, first slice · Builds on: ADR-0102, ADR-0128
Context
Every hosted kind is now served through the resource's own address, where the gate, the display rules, the schedule, the click limit and 009's lifecycle predicate are all evaluated. And the bytes were reachable at a second address the whole time.
Three of them, in fact:
/uploads/*. A file server mounted on the storage directory. It answers to a path, so it consults nothing at all: not the gate, not the schedule, not the limit, not the lifecycle state. 008 recorded it as an open item and sized its blast radius; a bundle multiplies that by the number of files in the archive.file_url, composed onto every file link the owner reads, pointing at that mount. The product was handing the author a working link that goes around the gate the author had set.static_url, composed onto every static page the owner reads fromstatic/<folder>/index.html— a directory nothing in this tree has ever written. It did not go around the gate; it went nowhere. Every owner who followed it got a 404.
Decision
A document has one address: the resource's own. This slice takes the first half of the mount and both composed addresses.
The mount stops serving expansions. handlers.GuardUngatedUploads refuses
anything under services.BundlePrefixRoot. A bundle is where the second
address costs the most and where it buys the least: every entry has had an
address of its own since phase 03, under the resource's slug and behind the
same gate its index passes, so the mount's copy is not a fallback — it is the
way around. The refusal reads the cleaned path, because the cleaned path is
what a file server opens; a check on the raw one answers about a string nothing
acts on. It tests the prefix the product mints, never anything a request or an
archive says about itself.
The mount's headers move into the same function and are set on both answers, refusal included. They are what stops a stored scriptable type executing as same-origin script (F-5), and a refusal is still a response.
Neither second address is composed any more. file_url and static_url are
gone from the payload, and the two owner surfaces link to shortLinkUrl(url) —
the resource's own address. For a file link that is strictly better than what it
replaced: the owner still gets a working link, and it is now the one that
answers to their gate. For a static page it is the first working link that
surface has ever had.
What is left
The mount still serves uploads/<date>/<random> paths, which is where a file
link's document and a static page's archive both live beside genuinely ungated
uploads — an avatar, an image in an editor. Telling those apart is the rest of
phase 05: the paths are minted identically today, so the answer is either a
prefix the product mints per purpose or a lookup from path to row, and choosing
between them is its own slice with its own migration question. Nothing in this
slice forecloses either.
Consequences
- A bundle entry is reachable at exactly one address, and that address is gated.
- The
/uploads/*mount keeps working for what it is actually for. - An owner following the "view"/"download" button now passes their own gate, which is a visible behaviour change and the correct one: a password-protected document asks for the password.
Source: docs/decisions/0132-a-document-has-one-address-and-it-is-the-one-the-gate-answers.md