Skip to content
Toolkit

ADR-0128 — Every entry of a bundle is a door the product opens

Status: Accepted · Date: 2026-08-30 · Track: 010 phase 03, second slice

Context

A bundle serves its index (ADR-0127). Its other files have no address at all, so the index of a real site reaches a stylesheet that is not there. Giving them addresses is where this track's two standing dangers meet: a second address — 008 found one at /uploads/* answering to no gate, and 009 found seven doors behind one lapse — and something inside the artifact deciding, because an entry arrives with a name, a suffix and a claim about what it is, all written by a stranger.

Three things this slice has to settle, and one it must not.

Decision

  1. An entry is reached through Handle, not a route of its own. /l/{slug}/* is the same handler as /l/{slug}, so the lifecycle predicate, the targeting rules, the schedule, the click limit and all three interstitials run for the hundredth file exactly as they run for the index. A second serving function is how one of them gets left out — which is the defect 008 recorded and phase 05 owns, not one to add a second instance of.
  2. The visitor's path is a manifest KEY and nothing else. It reaches no filesystem call and is joined onto no root; BundleManifest.Lookup decides, and a name the manifest does not hold resolves to nothing at all. So a traversal has nothing to traverse, and the product's own manifest.json is not an entry and is not reachable.
  3. The content type comes from the product's own closed table, keyed by the entry's suffix. The suffix is a lookup key into what this tree wrote, never a value copied into a response: the set of answers a stranger's archive can produce is exactly the table, and an unknown suffix takes application/octet-stream. JavaScript is deliberately absent from it — sandbox runs no script, so a bundle's .js cannot execute either way, and calling it a script would be the response saying what ADR-0103's floor refuses. nosniff is what makes that answer stick.
  4. An entry is evaluated by the click limit and never spends it. A browser fetching the stylesheet of a page it was already given has not arrived at anything: counting entries would make a bundle's click count a measure of how many files its author split their site into, and would spend a limit the visitor never used. An exhausted resource still serves no more of itself. The tracking cookie goes with it, for the same reason.
  5. A bundle's own address is a directory. /l/{slug} 302s to /l/{slug}/, below every refusal and above the click record, so a relative reference in the author's own document resolves under the resource instead of at /l/assets/app.css — another resource's slug. One visit stays one click.
  6. The origin a bundle may load its own files from is configuration, read in one place (HOSTING_ARTIFACT_ORIGIN, config.ArtifactOrigin). This is a CSP fact rather than a preference: sandbox puts the document in an opaque origin, and 'self' is exactly the source expression an opaque origin does not match. The widening is one origin wide and admits only what a page draws itself with — styles, images, fonts, media. There is still no script-src, no connect-src and no 'self', so a bundle cannot fetch outward and cannot become the unlisted beacon 007 phase 03 refused. An unset origin keeps ADR-0103's floor whole, and a value that is not a scheme and a host is treated as unset, so a typo costs a stylesheet rather than the policy.

What this does not decide

Which origin that should be is the charter's Blocker 3 and the owner's — 007's public-origin question arriving a third time. This ADR makes the origin a seam that answer moves, and refuses outright the option that hands an author's build the origin where sessions live.

Consequences

  • A gated bundle's subresources are refused, not served: a grant travels in the query (ADR-0092) and a browser fetching a stylesheet does not carry it. The gate holding is the phase bar and it holds; a grant a subresource could carry would be a change to 007's mechanism, and it is an open item rather than something this slice takes on the side.
  • /l/{url}/splash is a product surface, registered as a literal segment, so chi matches it before this wildcard. A bundle whose author named a file splash at its root is unreachable at that one address.
  • bundle-asset flips to served in the hosting ledger — 5 of 5 — with its bound reading HOSTING_MAX_ENTRY_BYTES and hostile fixtures of its own.

Source: docs/decisions/0128-every-entry-of-a-bundle-is-a-door-the-product-opens.md

Library