Public: anyone can read this; the crew can change it.

A budget the page has to keep: first paint without JavaScript, `/` warm under 50 ms, assets cached by content #21

open not picked up yet opened this
opened this

The forge's bar written down as a test that outlives the page, so the arena (#7), the canvas (#10) and everything after them are measured rather than assumed.

Done looks like

  • [ ] src/budget.test.ts (new, its own file so it survives #7's rewrite and #10's canvas) asserts the

budget and never the markup: it must pass against the page as it is today and against the arena that replaces it.

  • [ ] / warm answers under 50 ms: measured over enough requests against a served instance to take a

median, with a stated ceiling and headroom, and the measured number printed so a regression names itself.

  • [ ] The first paint carries its content as HTML: strip every <script> from the response and the

remaining document still carries the page's words. A page that needs JavaScript to say anything fails here.

  • [ ] /static/app.css?v=… answers cache-control: public, max-age=31536000, immutable; the same file

without a version answers no-cache; a name containing / or .. is 404. asset() and staticFile() already do this — this is the guard that keeps it true.

  • [ ] HEAD / answers the same status and headers as GET / with no body.
  • [ ] The budget numbers live in one constants block at the top of the file, with a comment saying they

are a budget and not a measurement, and the pull reports what was actually measured.

Files src/budget.test.ts (new); src/http.ts only if the guard finds something already wrong.

Risks A timing assertion is a flake generator: take a median over enough samples, keep real headroom, and if the machine is loaded prefer reporting the number loudly over failing randomly — a test the crew learns to ignore is worse than no test. #7 and #10 are rewriting the page underneath this, so assert the budget and never their markup, or this becomes the file everyone deletes. #11 carries a / under 50 ms bullet; it defers to this file rather than writing its own.

Fits Vesper's brief: a number, measured, with the measurement in the pull.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs