Skip to content
Toolkit

010-artifact-hosting — what an author already built is hosted, and every byte of it is served on the product's terms

Chartered: 2026-08-30 · Status: ACTIVE · Source: product gap assessment .archives/removal-safe/docs/assessments/PRODUCT-GAP-ASSESSMENT-082926.md §Host · Predecessor: 009, closed 2026-08-30 (close-out)

Problem

The overview sells bring what you already built: static HTML, zips, React builds, Markdown, SVG. Re-verified against the tree at 7fe909f rather than inherited from the assessment — which is a month old and is now wrong in two places, both because 008 shipped in between:

  • HTML is not blocked. handlers/static_pages.go:105 accepts text/html and application/zip for a static page, with a declared-vs-sniffed agreement check beside it; 008's ADR-0103 serves that HTML as an inert document (sandbox, default-src 'none', no script, no outbound fetch). The allowlist the assessment quotes — services.AllowedFileTypes — governs the file link type and generic uploads, not static pages.
  • archive/zip is used, in handlers/account.go, for the account data export. Nothing unpacks an upload, which is the claim that still holds.

What is actually missing, verified:

  • A zip is stored and never unpacked. stored_static.go:84 refuses a static page whose document is not HTML with a 404, and names this track as its owner. An author who uploads the zip the product accepted gets a page that does not exist.
  • A bundle has no address for its second file. The serving path reads one file_path and streams one document. Nothing resolves /{slug}/assets/app.css, and static_pages.go's List and Get compose static_url from static/<folder>/index.html — an address nothing ever wrote (008's close-out).
  • Markdown and SVG are nowhere. No allowlist in either tree carries text/markdown; image/svg+xml is excluded twice, deliberately, with F-5's reason in the comment. Neither has a serving path to be excluded from yet.
  • No React or bundle concept, and ADR-0103 is why it is not a small step: an author's document is given no script and no origin of its own, on the origin where sessions live. A build output is script by definition.
  • Storage is neither measured nor billed. One constant caps every upload at 10 MB (services.MaxUploadSize), and the plan quota registry's fourteen axes are all counts — static_limit, files_limit — with nothing in bytes.
  • /uploads/* is still a second, ungated address for every stored document (cmd/server/main.go:988), which is 008's open item and this track's to hold, since it is the same bytes seen from the other side.

Objective

An artifact an author already built is hosted: stored under a stated model, unpacked where it is a bundle, addressed file by file under the resource's own slug, and served through the same gate, schedule and limit every other public document passes — with the product deciding each file's content type rather than inheriting the author's word for it.

The bar is the one 007 set and 008, 006 and 009 kept: the serving path obeys. A stored artifact no request path reads is not done, and a byte served outside the gate is a second address, not a feature.

Phases

Each is independently shippable and revertible. Phase 00 mints the ledger and its gate before any unpacking lands, for the reason five tracks have recorded: a scoreboard minted after the work measures nothing.

PhaseOutcomeDone when
00 — The hosting ledger and its gateOne row per artifact kind — html, markdown, svg, zip-bundle, bundle-asset — naming what stores it, the serving path that must read it, the limit key that bounds it, and its behaviour testnpm run check:hosting prints N of M served, starts with html alone (008's, already true), is watched failing on a deliberately broken input, and a row flips only in the commit that adds its serving path
01 — A kind is stored only with the path that serves itMarkdown and SVG become storable, each with its own safety story rather than a shared oneEach kind lands in one slice: the allowlist entry, the sniff agreement, the serving path, and the ADR that says what the product does with those bytes. Markdown is rendered by the product, never handed over as the author's HTML; SVG is served as a document, never inline on this origin — F-5's exclusion is answered, not deleted
02 — A bundle is unpacked, and nothing it contains decides anythingA zip becomes a stored set of files with a manifest, or is refused wholeTraversal (.., absolute paths, symlinks), entry count, per-entry size, total size and compression ratio are all bounded by configuration read before the first entry is written, and every refusal is the whole upload — a half-unpacked bundle is never stored. Proved against a live database and a real backend, with a hostile archive per rule
03 — A bundle is served as a site/{slug} serves the bundle's index and /{slug}/<path> its assets, through the gateThe asset path resolves through the manifest, never by joining a visitor's path onto a storage root; the content type is the product's decision per entry; and the gate, the schedule, the click limit and 009's lifecycle predicate hold on every entry, not just the index — 009's "seven doors" rule applied to a directory
04 — Storage is measured, bounded and freedWhat a workspace stores is a number the product knows and a plan can boundBytes stored per workspace is derived from what is stored, exposed on the owner's own read, and bounded by a registry-shaped quota axis (011 owns the ladder and the numbers); the 10 MB constant becomes configuration with a stated default; and deleting a resource frees what it held, proved by the number moving
05 — One address per documentThe storage mount stops being a second, ungated door/uploads/* and the composed static_url are closed or made equivalent to the gated path, every in-app consumer moved first, and the E2E asserts a gated document is refused at both addresses. Sized as its own phase because 008 recorded the blast radius: every image the app draws comes from that mount

Out of scope

Subdomain addressing and name.card.site (009 phase 06, gated on its own owner decision); the plan ladder, pricing and the storage quota's numbers (011 — phase 04 must leave the axis registry-shaped, not seeded); ACME/SSL, which this tree has no runner for; a CDN or edge cache, which is an operational decision; any new analytics surface; and re-opening what a file link does — 008 settled that in ADR-0102 and this track widens what may be stored, not what a download means.

Blockers — owner decisions

Each is named here with options and a recommendation and is answered by nobody in the meantime. None blocks the buildable remainder: 00–02 and 04–05 proceed around them, and 03 needs the third only for the part of it that is script.

  1. What is the storage model for a bundle? Options: (a) expand at upload into the existing backend under a per-resource prefix, with a stored manifest; (b) keep the zip and read entries on demand; (c) an object store addressed natively, which this tree does not have. Recommendation: (a) — the read path is then the one 008 already built (FileStorage.Open, local under a root guard or a signed S3 GET), and the manifest is what makes the asset path a lookup rather than a path join. (b) buys nothing but a smaller upload step and puts a decompressor on the request path.

  2. What may a plan store? Options: any triple of per-file cap, per-bundle cap and per-workspace bytes. Recommendation: keep the per-file cap as configuration with the current 10 MB as its default, add a per-workspace bytes axis to the quota registry with the value left unset, and let 011 seed the tiers. An unset quota must unlimit, which is the quotas' existing fail-open (004) and the opposite of the capabilities' default deny.

  3. What may a hosted artifact execute, and on which origin? This is the one that decides whether "bring your React build" can ship honestly at all. ADR-0103 gives an author's document no script and no origin of its own, because the product's origin is where sessions live (ADR-0096). Options: (a) no script, ever — bundles are documents with CSS, images and fonts; (b) script on a separate, session-free origin, which is 007's blocker 2 and 008's re-presentation of it, arriving here for the third time with a concrete need; (c) script on this origin, which hands an author's build the session token. Recommendation: (a) now and (b) as the answer — build 03 so the origin is configuration and the script decision is one policy in one place, and refuse (c) outright. A track that answers this alone has left the charter.

  4. What happens to documents already stored at the shared paths? Raised by phase 05's second slice (ADR-0133) and named rather than guessed at, because it is an act on live data. Every gated document written from that slice on goes under documents/, which the ungated mount refuses; every one written before it is at <date>/<random>.<ext>, indistinguishable there from an avatar by construction — the two were minted alike, which is the defect. So those rows keep a second, ungated address until somebody moves their bytes. Options: (a) a one-off relocation — copy each gated document to a minted document path, update its row, delete the old object — run by an operator against a live bucket, on both backends; (b) a path→row lookup on every /uploads/* request, which closes old and new alike but puts a query in front of every avatar, makes the answer depend on a mutable row (a deleted row un-gates its orphaned bytes) and re-opens the normalisation question the cleaned-path check exists for; (c) leave them, and let the exposure age out as authors re-upload. Recommendation: (a) — it keeps the mount's test a pure shape test on where the product put the bytes, which is the property the whole slice is, and it is finite work on a known set. It is an operator's act, not a session's, which is why it is here.

A fifth question this charter answers rather than asks: the product decides the content type. Every byte served here was uploaded by a stranger, so no entry's declared type, extension or first bytes may choose what the response says it is.

Verification

The bar is the one the last five tracks kept, and it is not restated per phase:

  • npm run verify exit 0 and go vet ./... && go test ./... green before every merge; the merge gate is local (ROADMAP "Standing policy").
  • A live E2E spec per new surface, asserting a database read rather than rendered text.
  • Every new or widened gate watched failing once on a deliberately broken input, transcribed in evidence/.
  • A hostile archive per unpacking rule. Traversal, a bomb, a symlink, a duplicate name and an entry that lies about its size are fixtures in the suite, not a review checklist. Each is watched refusing the whole upload.
  • Migrations at the next free number with a .down.sql, applied and rolled back against a live database before any handler reads the column.

Risks

RiskAnswer
An unpacked bundle writes outside its own prefixPhase 02 bounds every entry before the first is written and refuses the whole upload; the asset path in 03 is a manifest lookup, never a path join, so a traversal has nothing to resolve against
A zip bomb spends the box on one uploadEntry count, per-entry size, total size and compression ratio are configuration read before unpacking, with the refusal being the upload rather than a partial store
An author's bundle becomes script on the origin holding sessionsBlocker 3 gates exactly that part of phase 03; ADR-0103's sandbox and default-src 'none' are the floor until the owner provisions an origin, and option (c) is refused rather than offered
A hosted file becomes a second address around the gatePhase 05 is that item's own phase, and phase 03's rule is that the gate holds on every entry — 009's seven-doors finding applied to a directory
Storage grows with nothing measuring itPhase 04 derives the number from what is stored, shows it to the owner, and leaves the ladder to 011 rather than inventing tiers

Source: .station/jobs/010-artifact-hosting/README.md

Library