Workbench / The TiffinBox Build
S33 · V2·33
Release 0.2.0, Gated by Real Users
Volume 2, chapter 33, the end of the volume. The chapter's eight projects are the ones TiffinBox has already built across stages 12–32; this stage maps them, closes the loose ends, and ships release 0.2.0 through a check that ends with a canary. A gate reads the RUM summary and promotes, holds or rolls back a release by comparing it with the one it replaces on what real page views measured. Its first run promoted a release that blocked the main thread for 300 ms at start-up, because the server renders the first screen and LCP never saw the delay; only long tasks per beacon did, and now they're part of the gate. The release check runs everything from Volume 1's crash test to two identical clean builds, and the canary rolls back the slow release and promotes a harmless one.
Stage 33: release 0.2.0, gated by real users
The brief
What you'll build.
web-tests/gate.mjs: reads/rum/summaryand compares a candidate release with its baseline per page: LCP and INP at p75 (more than 1.2× and more than 50 ms or 20 ms worse is a regression), long tasks per beacon at p75 (more than half a task more), errors per beacon (twice as many and 2 more per 100); fewer than 20 samples on either side is "hold", never "promote"; exit codes 0, 1, 2;web-tests/canary.py: a release, 25 real page views, then two candidates (one that adds 300 ms of start-up work, one that only adds a CSS comment), each gated too early (must hold), then after 25 views (must roll back, must promote); the rollback isrelease.mjs --rollback;release-check.shextended: after Volume 1's checks, the JS checks and build, the browser suite and performance budgets,repro.sh, and the canary;RELEASE-0.2.0.mdand the release check's output,release-0.2.out;gate.test.mjs(4 tests).
Why a real company needs this. A release that passes every test can still be worse for users: tests check what someone thought to check. A canary judged by real measurements is the last line, and the only one that sees what nobody predicted. Gating also makes releasing routine: when a bad release rolls itself back, releasing often is safe.
Why now. Chapter 33 is Volume 2's projects: an accessible static site, an interactive cart, an ordering SPA, an offline-first PWA, a server-rendered storefront with a budget, a design system, live order tracking and a production pipeline. TiffinBox has built each of them as stages, and stage 32 produced the field data a gate needs.
What you'll have at the end.
- release 0.2.0, checked end to end;
- a gate that rolls back a release real users would notice;
- the eight projects mapped to the code that implements them.
Theory to own
- The definition of done. What has to be true before a project is finished, as opposed to working? (The chapter, "The working method".)
- Canaries. What does a canary need to decide well: how many samples, compared with what? (Companion, Gaps 2.)
- What a metric can't see. Why might a release that's slower for users pass on LCP? (Companion, Gaps 1.)
- Holding. When is "not enough data" the right answer, and why is it different from "pass"? (The chapter's P5; Companion, Code walkthrough.)
Build it
Step 1: the gate
Write gate.mjs with parse(text) for the summary's rows and errors, beacons per release (each beacon carries one long-task count, so that series' n counts beacons), and decide(summary, base, cand). Write gate.test.mjs: too few samples holds; LCP just over and just under the limit; more errors.
Checkpoint. # pass 4.
Step 2: the canary
Write canary.py: release the current build, start the server on it, place one order, then send 25 kitchen page views (each loads the page, waits for "Live", navigates away so the page sends its beacon, and the script waits until the server has counted it). For each candidate: release it, gate immediately (must hold), send 25 views, gate (slow: roll back, then --rollback; harmless: promote).
Checkpoint. canary: as expected.
Step 3: the release check
Add Volume 2's steps to release-check.sh: check-js.sh, the suite and the perf budgets, repro.sh, the canary. Run it from a clean checkout and keep its output as release-0.2.out.
Checkpoint. release check passed.
Step 4: the eight projects, mapped
Write the portfolio table in the README: for each of the chapter's projects, the stages and files that implement it and the evidence.
Checkpoint. Every project row names code, tests and a measured result.
Senior and architect lens
1. Automate the decision you'd make at 2 a.m. The gate encodes the judgement "is this release worse?" with explicit thresholds, so it's made the same way every time and can be reviewed and changed like code.
2. ADR-0035: releasing. Write it with these points:
- Gate: LCP and INP at p75, long tasks per beacon, errors per beacon; thresholds in
gate.mjs; 20 samples minimum per side; hold rather than guess. - Canary: the whole site switches today (one server); with traffic splitting (Volume 7), a fraction of users get the candidate and the gate compares the two concurrently.
- Release check: every release, from a clean checkout; its output kept with the release notes.
- Versioning: 0.2.0 marks the end of Volume 2; the deprecated pricing fields go in 0.3.0.
3. Metrics are chosen by what they miss. LCP missed a 300 ms block; long tasks caught it. Every gate metric should have a known blind spot and a companion that covers it.
4. Sequential canaries compare different moments. A before-and-after canary compares different times of day and traffic; concurrent canaries compare like with like. Ours is sequential because there's one server.
What breaks first, and when it's addressed:
| Pressure | What breaks | Where it's addressed |
|---|---|---|
| one server | candidates can't run beside the baseline | Volume 7 (traffic splitting), Volume 16 (progressive delivery) |
| low traffic | 20 samples take hours at night | Volume 16 (minimum duration and sample rules per time of day) |
| a fixed threshold | real but small regressions pass | Volume 9 (statistical tests, error budgets) |
| the server half | the gate sees only the browser | Volume 3 (server latency and errors per release) |
Evidence
release-check.shpasses from a clean checkout;release-0.2.outis committed.gate.test.mjspasses;canary.pyprintscanary: as expected.RELEASE-0.2.0.mdand the portfolio table are in the repository.- ADR-0035 is committed; the release is tagged
v0.2.0.
Carry forward
- The release check gains Volume 3's server checks (database migrations, API contract tests).
- The gate gains server metrics per release in Volume 3.
- The deprecated pricing fields are removed in 0.3.0.
- Volume 3 starts from here: staff accounts, a real database, and the API that the display and ordering pages already call.