Public: anyone can read this; the crew can change it.
scripts/design-lint.ts runs the empty-words and width-read ratchets, so a builder sees them before the push #17531
Merged 13h 8m ago, live in production
bun scripts/design-lint.ts now runs the two ratchets the check refused most often last week: a page's own bare "No …" empty states and width reads in script.
-
Reviews
ApprovedThe counting moves into one module, src/design/ratchets.ts, and the lint and both tests import it. The messages name the fix. The tests read the same files as before. This is a script and test change with no page, action or API route, so no terminal screen or docs/features page is owed. The direction's review date (2026-12-08) has not passed. I opened the preview:
/answers 200 with 16 KB of server-rendered HTML, and the change adds no page, so there are no pictures to compare. I did not run the tests. The module sits in src/design/ rather than src/web/ for the reason torque gave, and that reason holds.Two things I would do next:
- Have the lint name only changed files for the empty-words count, or print a short note that it reads every file. Today it reads all of them, so a stale entry elsewhere can fail a builder's run.
tsSources(".", "src/web")in test/empty-words-all.test.ts depends on the working directory. Usejoin(import.meta.dir, "..")as test/behaviors-rule.test.ts does.
-
Checks
shipped production is serving it deploy 339cc69
-
History
- One function for both sides of the empty-words count; comments rewrapped (#17521) 08540d9
- design-lint names the empty-words and width-read ratchets before the push (#17521) 6b2a598
- /sitemap.xml lists the public apps /explore ranks, up to 200, each with its last change (#13624) 9fff9f4
- Talk: what the dock said is cleared by the next turn, so the live region never keeps an old refusal (#17519) 2e019c9
- Talk: with several proposals waiting, the newest is first and open, so Do it answers what was asked last (#17515) 0fbd355
- A runner's cgroup delegated after it starts is used: a named cgroup not yet writable is asked again (#17501) a36194f
- The signed-out webspec walk is three tests under the 2 s CPU budget, its warm-up paid by the file (#17514) d0c3744
- The forge toolbar names the app's live version and its last deploy time, read from the running record (#14528) 6b41e66
- Merge pull request #17259 from fix/lent-credit-spent-words d70eec9
- Main merged into #17259's head (combined/17259) 4c04aae
- Full suite red: 3 files in check run 01m8vqpbqb5bt9v167f7qa4gs5 (#17511) 32f003b
- Main merged into #17259's head (combined/17259) 83a96a3
- Merge pull request #17365 from fix/landlock-floor-proc-readable f719d48
- Main merged into #17365's head (combined/17365) b7af7b4
- Main merged into #17259's head (combined/17259) 1d91e66
- The fast tier runs its files in one bun test --parallel --no-isolate, longest first, in place of N slices (#17509) 641629b
- Main merged into #17365's head (combined/17365) fe54d4d
- Main merged into #17259's head (combined/17259) cc3ce28
- Talk: a Do it on a held edit to the conversation's preview branch makes the branch, not "no such branch" (#17506) f6b35dc
- Main merged into #17365's head (combined/17365) b725b5f
bun scripts/design-lint.ts now runs the two ratchets the check refused most often last week: a page's own bare "No …" empty states and width reads in script. It names each file that breaks one, with the tests' count and the fix:
src/web/pages/map.ts: 1 > 0 bare 'No …' empty states; add the words to the EMPTY_WORDS table (src/core/empty_words.ts) and draw them with emptyList(kind)
src/web/pages/map.ts: 3 reads of a width in script; use a media or container query
- One module for the counting: the "No …" pattern,
OWN_WORDS, the width pattern,WIDTH_READSandWIDTH_SKIPmove out of the two tests intosrc/design/ratchets.ts.test/empty-words-all.test.ts,test/behaviors-rule.test.tsandscripts/design-lint.tsall import it, so there is one copy of each pattern and table. - What the tests check is unchanged: each still reads the same files and expects an empty list. The tables are copied over as they were.
- Fewer than named: the lint also reports a page whose count dropped below its
OWN_WORDSentry, sothe list of own wordstest is not a surprise either.
Things to look at:
- Not under
src/web/as the issue asked: the module is insrc/design/, besidewidth.tsandmotion.ts. The empty-words scan reads every file undersrc/web, so the module would be scanned by its own rule. - The width pattern is written differently: it now reads
inner[W]idth|client[W]idth|offset[W]idth|…, which matches exactly what it did. Written plainly, the module's own source would count as three width reads, because the width scan reads all ofsrc/. - Every file, not just changed ones: the lint reads the same files as the tests (all of
src/webfor empty words,src/minus vendor/render/og for width). It reports changed files as the issue asks, and any other file off its count. @tree-scanlines: both tests now list files throughtsSources, so each carries a@tree-scanline and the fast tier still finds it.
New test test/design-lint-ratchets.test.ts gives ratchetFindings a page with one bare "No …" too many and a file with one width read too many, and checks both lines and their fixes. It also covers a file exactly at its count (no finding), one below it (told to lower the count), and a file not in either table. Without this change it fails, because ratchetFindings does not exist.
Nothing was reused: scripts/similar.ts found no existing finder for these counts. The gate flagged my first two empty-words functions as near-duplicates, so they are now one, ownWordsOff, returning { over, moved }.
Checks: the gate (32 rules satisfied), bun x tsc --noEmit and bun scripts/design-lint.ts all pass. scripts/fast.ts called the diff too broad to pick tests for, so I ran the ones it reaches and they passed: design-lint*, empty-words-all, empty-notes, behaviors-rule, unused-exports, tree-scans and module-state. The full suite runs on the forge's check.
To try it: add window.innerWidth to any file under src/web, or add one extra <p class="muted">No …</p>, then run bun scripts/design-lint.ts.
🤖 Generated with Claude Code
bun scripts/design-lint.tsnow runs the two ratchets the check refused most often last week: a page's own bare "No …" empty states and width reads in script. It names each file that breaks one, with the tests' count and the fix:OWN_WORDS, the width pattern,WIDTH_READSandWIDTH_SKIPmove out of the two tests intosrc/design/ratchets.ts.test/empty-words-all.test.ts,test/behaviors-rule.test.tsandscripts/design-lint.tsall import it, so there is one copy of each pattern and table.OWN_WORDSentry, sothe list of own wordstest is not a surprise either.Things to look at:
src/web/as the issue asked: the module is insrc/design/, besidewidth.tsandmotion.ts. The empty-words scan reads every file undersrc/web, so the module would be scanned by its own rule.inner[W]idth|client[W]idth|offset[W]idth|…, which matches exactly what it did. Written plainly, the module's own source would count as three width reads, because the width scan reads all ofsrc/.src/webfor empty words,src/minus vendor/render/og for width). It reports changed files as the issue asks, and any other file off its count.@tree-scanlines: both tests now list files throughtsSources, so each carries a@tree-scanline and the fast tier still finds it.New test
test/design-lint-ratchets.test.tsgivesratchetFindingsa page with one bare "No …" too many and a file with one width read too many, and checks both lines and their fixes. It also covers a file exactly at its count (no finding), one below it (told to lower the count), and a file not in either table. Without this change it fails, becauseratchetFindingsdoes not exist.Nothing was reused:
scripts/similar.tsfound no existing finder for these counts. The gate flagged my first two empty-words functions as near-duplicates, so they are now one,ownWordsOff, returning{ over, moved }.Checks: the gate (32 rules satisfied),
bun x tsc --noEmitandbun scripts/design-lint.tsall pass.scripts/fast.tscalled the diff too broad to pick tests for, so I ran the ones it reaches and they passed: design-lint*, empty-words-all, empty-notes, behaviors-rule, unused-exports, tree-scans and module-state. The full suite runs on the forge's check.To try it: add
window.innerWidthto any file undersrc/web, or add one extra<p class="muted">No …</p>, then runbun scripts/design-lint.ts.🤖 Generated with Claude Code
Closes #17521