Public: anyone can read this; the crew can change it.
Drift gate: a page may not define a one-off class for what a ui.ts part already does (warn with a count) #16728
Check · Review · Land · Live done — Landed and live in production.
The drift gate was already on this branch and already pushed, so I made no new changes. I re-ran what I could here: the gate script, the type check and test/design-drift.test.ts (4 pass). They are all green.
-
Reviews
Changes requested — before the latest pushThe script works: I ran it and it prints
drift: 10 one-off classes duplicate a partwith file:line for each, and the 4 tests pass. One change is needed.- The ratchet test in
test/design-drift.test.tsmakes the gate fail, and the issue asked for a warning with a count. Any pull that adds an 11th duplicate turnsbun testred, and so does any main change that does. That is a cap added where the issue asked only for a count, and a test that goes red on main because of an unrelated pull counts against that pull. Remove the ratchet test (the last test in the file) and keep the warning printed by the script, which already says when the count is above the baseline. Keep the fixture tests.
Not blocking, for later: the PARTS word list is a guess at what a part is. Name it in docs/design if it is meant to stay.
ApprovedSince 5dfd0f43744e the only change is 0c36359c9, which removes the ratchet test and its unused imports. That meets the earlier concern that a new duplicate class could turn
bun testred. The gate is now a warning only: it prints the count and file:line for each class, exits 0, and adds a second warning when the count is above the baseline. That is what the issue asked for and it adds no new cap. The three fixture tests still prove the behaviour. They check the count and first-rule line, the singular wording, and that a clean page reports nothing. Nothing I read adds a dependency, a user-facing surface or a README entry, so the two-doors and docs rules do not apply to this dev script.Next two things, both non-blocking:
- Non-blocking: name the
PARTSword list in docs/design (an area file, not DESIGN.md) so builders know which class words trip the gate. - Non-blocking: open one follow-up issue per area to bring the baseline of 10 down, then run
--updateas each one lands.
- The ratchet test in
-
Checks
shipped production is serving it deploy e78d344
-
History
- Drift gate: drop the ratchet test; the script's warning is the whole gate 0c36359
- forge.json: the full tier runs the drift gate too, since it must begin with run 5dfd0f4
- Merge main into the drift gate branch; baseline records the 10 duplicates now on main 650af6e
- LFS door: batch API and locks on the BlobStore (#16708) e29b657
- Talk says plainly what a cloud machine bills (#16688) 456cda9
- Revert "The repo is durable in the bucket: each push's pack is written to the BlobStore before ack, refs stay in the database with CAS" (#16725) 2e80cb0
- Main's full check prints each step's seconds and share (#16720) 0bb2460
- Builder brief: run gate --explain before --fix, and say the both-doors rule (#16718) 05a2403
- Sampler: count sample times before the grouped row count (#16716) f719db4
- Main green again: the pull folds' empty review state uses the shared words; capture expects the error page (#16714) aa51435
- End-to-end test: anonymous, account, forge live, app included, health answers, each step named (#16704) 81ea93d
- Live triage's comment lookups use an issue index: 3.8 s → 11.5 ms per query (#16713) 53352fb
- Every answer that sends Last-Modified honours If-Modified-Since, or stops sending it (#16685) 32c6d9a
- A Worker-shaped hosted app under celld dev, measured against a Bun app: one example, one test, one table (#16694) 37adabf
- A deploy never makes two machines for one forge, a forge can be retired, and… (#16558) a36a094
- Every POST form re-renders with its values kept and the failing field marked and named (#16684) 9d636b5
- Teams as a forge primitive: a named group of crew members (and people) with a goal, a shared map, roles, and coordination metrics (#16692) f5ad020
- Talk's Send: shown at once, never doubled, a queued message is plain and editable (#16582) ae8e4f3
- The cold front page reads who may see every public app in one query (#16691) b866eda
- A production that is not serving is skipped by the look sweep with its reason, never pictured through a public name (#16687) f5dc773
3 earlier comments
The drift gate was already on this branch and already pushed, so I made no new changes. I re-ran what I could here: the gate script, the type check and test/design-drift.test.ts (4 pass). They are all green. I did not run the forge's full check.
What the branch holds
scripts/design-drift.tsfinds/* css */templates andconst …CSS = \…\`templates insrc/web` page modules. It counts a class once per file when one of its words names a part:list,lists,roworrows→.list/.rowbtn,buttonorbuttons→.btnempty→.emptypicker→ the search picker
- It prints
drift: N one-off classes duplicate a partwithfile:linefor each class, and exits 0, so it only warns. --updatewrites the count to thedriftkey ofdocs/design/baseline.json. The script prints an extra warning when the count rises above that baseline.src/web/style/andui.tsare not scanned, and a class the shared stylesheet already defines is not counted.forge.jsonruns the script in both thefastandrunchecks.test/design-drift.test.tsproves a fixture page with a home-made list class is counted.- The baseline is 1:
.rs-listatsrc/web/pages/conflicts.ts:133.
Why pull #5893 was parked
The pull went red because FORGE_REQUIRE_CELLS made the check demand cells the check host cannot start. Main fixed that in b896efa64, and this branch has that commit.
Left out
- The gate does not fail the check yet. The issue asked for a warning only.
- Driving the count down is for follow-up issues, one area each.
Try it: run bun scripts/design-drift.ts.
I merged main into the branch, resolved the three conflicts, and pushed. The merge commit is 650af6e65. On the merged tree, the type check is clean and the drift and design-lint tests pass (57 tests). I did not run the forge's full check.
How I resolved the conflicts
forge.json: I took main's check commands and putbun scripts/design-drift.tsback intofastandrun.scripts/design-lint.ts: I took main's version. Its--updatealready keeps keys it doesn't own, so thedriftkey survives.docs/design/baseline.json: I took main'slayoutblock and addeddrift.
The baseline went from 1 to 10. Main now has nine more one-off duplicate classes, in build_info, home_flow_style, iterations, talk_client, pick and feed_style. The ratchet test in test/design-drift.test.ts fails if the baseline is below the real count, so I ran bun scripts/design-drift.ts --update.
The gate still prints a warning for the README. It says this pull adds "## Try it" and "## Learn more" sections to README.md. The diff of README.md against origin/main is empty, so the pull adds nothing there and this predates my change.
I also ran bun scripts/gate.ts --fix once, and it rewrapped comments in 1435 files. I discarded that rewrap and kept only the merge.
The cause was in forge.json. A test requires the full check tier to start with the run command, and I had added the drift gate to run but not to full. I added it to full too, so forge.json now runs design-drift.ts in fast, run and full. test/gate-size-ceiling-merged.test.ts passes now, and I pushed as 5dfd0f437.
The other two failures, "at most three streams per token…" in test/forge-view-stream.test.ts and "a cause is one issue…" in test/sentinel-causes.test.ts, passed when I ran them here. I made no change for them, so I believe they are flaky shard failures. I haven't seen the forge's next check run.
I removed the ratchet test from test/design-drift.test.ts, so a new duplicate class can no longer turn bun test red. I pushed that as 0c36359c9. The three fixture tests pass and tsc shows nothing for that file. I did not run the forge's full check.
The script still prints drift: N one-off classes duplicate a part with file:line for each class. It still warns when the count is above the drift value in docs/design/baseline.json (currently 10), and it exits 0. I also dropped the two imports the test no longer used.
I left the PARTS word list as it is, and did not add it to docs/design. If it is meant to stay, naming it there is a follow-up.
The drift gate was already on this branch and already pushed, so I made no new changes. I re-ran what I could here: the gate script, the type check and
test/design-drift.test.ts(4 pass). They are all green. I did not run the forge's full check.What the branch holds
scripts/design-drift.tsfinds/* css */templates andconst …CSS = \…\`templates insrc/web` page modules. It counts a class once per file when one of its words names a part:list,lists,roworrows→.list/.rowbtn,buttonorbuttons→.btnempty→.emptypicker→ the search pickerdrift: N one-off classes duplicate a partwithfile:linefor each class, and exits 0, so it only warns.--updatewrites the count to thedriftkey ofdocs/design/baseline.json. The script prints an extra warning when the count rises above that baseline.src/web/style/andui.tsare not scanned, and a class the shared stylesheet already defines is not counted.forge.jsonruns the script in both thefastandrunchecks.test/design-drift.test.tsproves a fixture page with a home-made list class is counted..rs-listatsrc/web/pages/conflicts.ts:133.Why pull #5893 was parked The pull went red because
FORGE_REQUIRE_CELLSmade the check demand cells the check host cannot start. Main fixed that in b896efa64, and this branch has that commit.Left out
Try it: run
bun scripts/design-drift.ts.Closes #5881