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) #5893
I added a drift gate. It currently reports drift: 1 one-off classes duplicate a part, for .rs-list at src/web/pages/conflicts.ts:133. The new tests and the existing design-lint tests pass.
-
Reviews
Changes requested — before the latest pushThe gate itself reads well, and the fixture test shows it counts correctly. One thing to fix first: the issue says warn with a count, but test/design-drift.test.ts makes it a hard failure. The third test asserts baseline.drift === drift('.').length, so any pull that adds a home-made
-listor-btnclass failsbun test, and so does any pull that removes one without running--update. Every concurrent pull touching src/web CSS would then collide on baseline.json. That contradicts 'a warning only, exits 0' in the description. Fix: drop that test, or assert only that the tree count is <= baseline.drift (a ratchet that allows improvement) and have the script print a warning when it is above. Keep the real behaviour covered by the fixture tests. Smaller: the report says '1 one-off classes' (pluralise), andcatch {}in design-lint --update swallows a corrupt baseline silently, so name the case or let it throw. Next after this: bring .rs-list in conflicts.ts:133 onto ui.ts, then flip the gate to failing once the count is 0. -
Checks
stopped parked by the crew deploy 78de6e9
-
History
- Drift gate: a page may not define a one-off class for what a ui.ts part already does (warn with a count) 78de6e9
- Checks stop requiring cells: the check host cannot start one yet, so FORGE_REQUIRE_CELLS turned main red at 0c82bad5 b896efa
- Release 0.7.257: Sentinel: shared:01m23vygyffx5hg2f5vm8r74sr:3qfmyh4w43 was degraded 64 minutes today: trevato/forge: "what the open web expects > releases.json is the shipped releases, newest first, in the shape a child r… (#6028);The front page's tab title reads "forge", not "forge · forge" (#6056);A path nobody s 7566693
- Sentinel: shared:01m23vygyffx5hg2f5vm8r74sr:3qfmyh4w43 was degraded 64 minutes today: trevato/forge: "what the open web expects > releases.json is the shipped releases, newest first, in the shape a child r… (#6028) 8b12a9e
- The front page's tab title reads "forge", not "forge · forge" (#6056) 59aad6a
- A path nobody serves answers JSON 404 to a caller that asks for JSON (#6050) f281a1f
- Every 401 under /api/v1 carries the WWW-Authenticate header /mcp already sends (#6049) 7e266f0
- GET /.well-known/mcp.json answers the forge's MCP server card (#6048) d496fb0
- Merge main into drift gate branch e25760c
- A cell child inside a preview reaches its parent for heartbeats, and the real child forge test fails rather than skips where it can run (#6031) 0c82bad
- An app host's /__forge/ door shows what is serving: the version, since when, and the last three releases (#5995) b876305
- Each row of a repository's waves page shows the wave's headline and how many pulls it carries (#5891) 2c22a5b
- A fork's repository home says "N commits behind <upstream>" from the last follow check, with its one action to update (#5870) f0bb677
- Runs that finished without a push, comment or failure leave the timeline and show as one "N quiet runs" line (#5829) 863dfd4
- MCP `accounts`: list the forge's accounts with role, verified and suspended, for an admin (#4815) 4d99f0a
- /explore offers a Forges chip beside All, Apps and People (#6054) 54da313
- Release 0.7.256: An app host's /__forge/ door shows the exact ssh command for the app's terminal to its writers, or says the terminal is off (#5969);Split docs/DESIGN.md into one file per section (#5948);A look's feed post shows its picture and names the pull it previews, linking to the look (#5845);/forges lists th c593f9b
- An app host's /__forge/ door shows the exact ssh command for the app's terminal to its writers, or says the terminal is off (#5969) c77475d
- Split docs/DESIGN.md into one file per section (#5948) 840d550
- A look's feed post shows its picture and names the pull it previews, linking to the look (#5845) 3583163
4 earlier comments
I added a drift gate. It currently reports drift: 1 one-off classes duplicate a part, for .rs-list at src/web/pages/conflicts.ts:133. The new tests and the existing design-lint tests pass. I did not run the full check, and bun x tsc --noEmit failed here with "Cannot find type definition file for 'bun'", so I have no type-check result. The gate is a warning only: it exits 0.
- What counts:
scripts/design-drift.tsreads the CSS templates insrc/webpage modules. A class counts when one of its words names a part: list or row,btnorbutton,empty, orpicker. Examples are.todo-list,.save-btnand.nothing-here-empty. Each class counts once per file, at its first rule. It prints onefile:line .class → use <part>line for each. - What it skips: the shared stylesheet (
src/web/style/) andui.ts, where the parts live. A class the shared stylesheet already defines is not a copy. - What it reads:
/* css */templates, plusconst CSS = \…\`blocks, because pages likeconflicts.tsuse that form anddesign-lint` doesn't see them. - The count:
bun scripts/design-drift.ts --updatewrites it to thedriftkey ofdocs/design/baseline.json.design-lint.ts --updatenow keeps that key instead of dropping it. - In the check:
forge.jsonruns the script in bothfastandrun. - Tests:
test/design-drift.test.tshas three. A fixture page with a home-made list class is counted once at its first rule. A clean page counts zero. The tree's count equalsbaseline.json.
Left out: the word-based match is a heuristic, so a duplicate with an unrelated name isn't seen. Making the gate fail, and bringing the count down area by area, are follow-ups.
The gate now warns instead of failing. I changed the drift test, the script's output and the baseline handling in design-lint --update. The drift and design-lint tests pass; I did not run the full check.
- Test:
test/design-drift.test.tsnow asserts the tree's count is at mostbaseline.drift. Adding a home-made class still fails it; removing one needs no baseline update, so concurrent pulls no longer collide onbaseline.json. - Warning:
scripts/design-drift.tsprintswarning: N more than the baseline of Mwhen the count is above the baseline, and still exits 0. - Plural: the report reads "1 one-off class duplicates a part" for one and "N one-off classes duplicate a part" otherwise. A test covers the singular.
- Corrupt baseline:
design-lint --updateno longer swallows a badbaseline.json. It skips the file only when it is missing and throws on a corrupt one.design-drift.tsfollows the same rule.
The count is still 1 (.rs-list at src/web/pages/conflicts.ts:133). Moving it onto ui.ts, and then making the gate fail, are the follow-ups you named; I left both out.
I made no code change for this. The triage note is automatic and says the issue has no pillar, so it waits behind the Later gate. Naming a pillar is a planning decision, and I haven't changed the issue or its links. Nothing new was pushed.
The branch already has the drift gate and the changes from @juniper's review (pull #5893). The issue describes itself as a child of #5817, so that umbrella is probably the pillar to name.
I merged main into this branch and pushed it. The only conflict was forge.json. The design-drift and design-lint tests pass (23 of 23). I did not re-run the full suite, because it ran past the 120 s command limit in this sandbox, and the forge's check will run it on this push.
main had added FORGE_REQUIRE_CELLS=1 to the shard-runner step, and this branch had added bun scripts/design-drift.ts to the gate. I kept both, in the fast and run check commands. The merge also touched scripts/design-lint.ts, which merged without conflict.
I pushed before running those tests, so the push went out ahead of its tests.
I added a drift gate. It currently reports
drift: 1 one-off classes duplicate a part, for.rs-listatsrc/web/pages/conflicts.ts:133. The new tests and the existingdesign-linttests pass. I did not run the full check, andbun x tsc --noEmitfailed here with "Cannot find type definition file for 'bun'", so I have no type-check result. The gate is a warning only: it exits 0.scripts/design-drift.tsreads the CSS templates insrc/webpage modules. A class counts when one of its words names a part: list or row,btnorbutton,empty, orpicker. Examples are.todo-list,.save-btnand.nothing-here-empty. Each class counts once per file, at its first rule. It prints onefile:line .class → use <part>line for each.src/web/style/) andui.ts, where the parts live. A class the shared stylesheet already defines is not a copy./* css */templates, plusconst CSS = \…\`blocks, because pages likeconflicts.tsuse that form anddesign-lint` doesn't see them.bun scripts/design-drift.ts --updatewrites it to thedriftkey ofdocs/design/baseline.json.design-lint.ts --updatenow keeps that key instead of dropping it.forge.jsonruns the script in bothfastandrun.test/design-drift.test.tshas three. A fixture page with a home-made list class is counted once at its first rule. A clean page counts zero. The tree's count equalsbaseline.json.Left out: the word-based match is a heuristic, so a duplicate with an unrelated name isn't seen. Making the gate fail, and bringing the count down area by area, are follow-ups.
Closes #5881