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

Move the remaining own-worded "No …" empty states onto the empty-words table #15898

Merged opened this

Check · Review · Land · Live done — Landed and live in production.

Merged

Thirty-five sentence-only empty notes now come from one table, and a ratchet test counts the eight pages that still word their own. The base branch has no test/empty-words-all.test.ts or OWNWORDS list, which is why the earlier tries declined. I built the table and the ratchet here instead.

Notes

shipped production is serving it deploy 3fede26

opened this

Thirty-five sentence-only empty notes now come from one table, and a ratchet test counts the eight pages that still word their own. The base branch has no test/empty-words-all.test.ts or OWN_WORDS list, which is why the earlier tries declined. I built the table and the ratchet here instead.

I ran 16 test files plus design-lint, gate --fix and tsc, and all pass. I did not run the whole suite: fast.ts named about 2,800 files, so I picked the files covering the pages I touched. The forge's check runs the rest on this push.

What changed

  • src/core/empty_words.ts gains NOTE_WORDS, a table of sentence-only notes: a muted paragraph with no link of its own, because the page already carries the door.
  • src/web/empty_words.ts gains emptyNote(key), which draws the table's sentence in the same <p class="muted">, so the pages look unchanged.
  • Thirty-five inline <p class="muted">No …</p> notes across 27 files now call emptyNote. These include system, bets, accounts, account, flags, billing, economics, flow-panel, boards-gates, boards-held, comments and devices.
  • test/empty-notes.test.ts holds each note to one plain sentence and checks emptyNote's output. It also pins which files still word their own, so a new one fails the test and moving one means lowering its count.

Left out

  • Eight pages keep their own wording because they interpolate values, carry a link, or are not an empty state: builds, sources, contribute, cut_over, data_move, next, now, waves. They are listed in the test.
  • The inline "Not a wave: …" note in waves is a reason, not an empty state, but the ratchet counts it too.
  • The "Nothing to preview" text in client.ts is script text, so the ratchet skips it.

Try it: open /settings/tokens with no tokens. Run bun test test/empty-notes.test.ts.

For review

  • The pre-push hook refused the first push for lack of a "Try:" commit, so I added an empty commit that carries one.
  • Every note under src/web keeps its existing sentence, so no existing test needed changing.

🤖 Generated with Claude Code

Closes #15897

7 earlier comments · 1 event
commented

Thirty-five sentence-only empty notes now come from one table, and a ratchet test counts the eight pages that still word their own. The base branch has no test/empty-words-all.test.ts or OWN_WORDS list, which is why the earlier tries declined. I built the table and the ratchet here instead.

I ran 16 test files plus design-lint, gate --fix and tsc, and all pass. I did not run the whole suite: fast.ts named about 2,800 files, so I picked the files covering the pages I touched. The forge's check runs the rest on this push.

What changed

  • src/core/empty_words.ts gains NOTE_WORDS, a table of sentence-only notes: a muted paragraph with no link of its own, because the page already carries the door.
  • src/web/empty_words.ts gains emptyNote(key), which draws the table's sentence in the same <p class="muted">, so the pages look unchanged.
  • Thirty-five inline <p class="muted">No …</p> notes across 27 files now call emptyNote. These include system, bets, accounts, account, flags, billing, economics, flow-panel, boards-gates, boards-held, comments and devices.
  • test/empty-notes.test.ts holds each note to one plain sentence and checks emptyNote's output. It also pins which files still word their own, so a new one fails the test and moving one means lowering its count.

Left out

  • Eight pages keep their own wording because they interpolate values, carry a link, or are not an empty state: builds, sources, contribute, cut_over, data_move, next, now, waves. They are listed in the test.
  • The inline "Not a wave: …" note in waves is a reason, not an empty state, but the ratchet counts it too.
  • The "Nothing to preview" text in client.ts is script text, so the ratchet skips it.

Try it: open /settings/tokens with no tokens. Run bun test test/empty-notes.test.ts.

For review

  • The pre-push hook refused the first push for lack of a "Try:" commit, so I added an empty commit that carries one.
  • Every note under src/web keeps its existing sentence, so no existing test needed changing.

🤖 Generated with Claude Code

commented

<!-- look-pages 138b5f4d942b --> Look pages for 138b5f4, from the gate:

  • look pages (inferred): this pull changes src/web/comments.ts, src/web/empty_words.ts, src/web/fleet-act.ts and 25 more; the forge pictures / (src/web/comments.ts), /docs (src/web/comments.ts), /explore (src/web/comments.ts) and 25 more, the pages whose routes import it. A "Looks: <path>" or "No look: <why>" line in a commit message overrides
commented

This push should clear the "both doors" failure. The gate no longer reports the rule after the new commit, but I did not rerun the type check or the tests.

The gate wanted a change under src/tui/ or a "No door" line, and the pull moves the empty-note sentences word for word, so I added the "No door" line to a new commit message. The commit also carries gate --fix, which found nothing to rewrap here.

The gate still prints one note: /settings/tokens isn't a page in forge.json app.looks, so my "Looks:" line was not used. It is a note, not a failure.

The pull description from my earlier message still stands.

commented

I pushed a commit with a "No look:" line to the pull, which should clear the look-pages feedback. The gate now passes on my machine, apart from the same 100-column comment note as before.

The inferred list of look pages came from src/web/comments.ts and the other files I touched. I disagree that any page needs a new picture, because every sentence moved onto the table word for word. The commit message says so, and a "No door:" line covers the terminal as well.

I did not rerun the tests for this commit, since it changes no code.

commented

I merged main into the branch and pushed it. The one conflict was in src/web/pages/template.ts.

main had rewritten the template page's file list. It now reads view.paths and prints "and N more", and it drops the "No files yet." note. I took main's version and removed the emptyNote import, which nothing in that file uses any more.

I left the noFilesYet entry in NOTE_WORDS in src/core/empty_words.ts. Nothing outside the table reads it now, so it's dead and can be deleted if you want the table tight.

Before pushing I ran bun scripts/gate.ts --fix, bun x tsc --noEmit and the empty-notes and template tests. All pass (236 tests, 0 failures). The gate only reports five other files with comment lines over 100 columns, and says the nightly rewrap on main handles them. Two sandbox network denials (kid--localhost:80, tpl--localhost:80) showed up during the test run; no test failed. I did not run the full suite, since the forge's check does that on the push.

Changes requested — before the latest push

The refactor is behaviour-neutral, every sentence is kept word for word, so the pages should read the same on a 360px phone and with JavaScript off. I did not exercise the preview beyond reading the diff. Two things to fix before it lands:

  1. Dead entry: noFilesYet in NOTE_WORDS is read by nothing in src/ after the merge with main (the template page dropped it). Only the test uses it. Delete it and point the emptyNote test at a live key.
  2. The table mixes two naming schemes: most keys are the sentence (noGateHasRunYet), a few are the place (accessCodes, computerKeys, bets, agentAsks). Pick one so a reader can find a key. Also the doc comment says pages "never word their own" while the same test pins eight that do; say "should not" and name why those eight stay.

No door: moving words only, no feature added, so no src/tui screen or docs/features entry is needed. Not a design departure: same muted paragraph, no new component.

commented

Both points are fixed and pushed. tsc, the gate and test/empty-notes.test.ts plus test/empty-states.test.ts pass (19 tests). I did not run the full suite, since the forge's check does that on the push.

  • Dead entry: I removed noFilesYet from NOTE_WORDS. The emptyNote test now checks noGateHasRunYet, which pages still read.
  • Naming: every key is now its sentence in camelCase. Four were renamed, and their call sites in account.ts, confirms.ts and bets.ts follow:
Old keyNew key
accessCodesnoAccessCodesYet
computerKeysnoComputerKeysYet
betsnoBetsYet
agentAsksnothingWaitingWhenTheAgentAsks
  • Doc comment: it now says pages "should not" word their own. It also says the eight that still do keep their own wording. Each carries a link, a variable or a reason that a plain sentence in the table cannot hold.

The sentences themselves are unchanged.

commented

The empty-note ratchet failure was mine and is fixed. Three of the four check failures are not mine and still fail on main.

Mine, fixed: main added src/web/pages/fork-offers.ts with its own <p class="muted">Nothing offered yet</p>, which pushed the count of own-worded notes past what the test allows. I moved it onto the table as nothingOfferedYet. This is the one visible change in the pull: the sentence now ends in a full stop, as every other note does. The existing fork-offers-list tests use toContain, so they still pass. I also merged the latest main and resolved a conflict in src/web/pages/week.ts, keeping both sides' imports. The empty-notes, fork-offers, tsc and gate checks pass.

Not mine, still failing: these fail the same way on a clean checkout of origin/main, so I left them alone.

  • "each first page runs no more SQL statements warm than its budget": /:owner/:name runs 52 statements against a budget of 50, and /:owner/:name/next runs 71 against 68.
  • "every GET page is within its counted work": /:owner/:name/next runs 71 against 67, /:owner/:name/pulls/:number 117 against 116, and /settings/crew 62 against 60.
  • "/llms.txt stays under its byte budget for each role": it fails on main too, and I did not look into why.

The forge's check will probably stay red until main fixes those budgets. This pull only moves words and adds no SQL.

commented

I merged main into the branch, resolved the four conflicts, and pushed. The empty-state, empty-note and template/refused-page tests pass, and bun x tsc --noEmit is clean. I did not run the whole suite or scripts/fast.ts: it said the diff was too broad to name. I ran bun scripts/gate.ts --fix, which changed nothing here, and bun scripts/design-lint.ts, whose output was lost when the command timed out, so it has not been checked.

  • src/core/empty_words.ts: I kept main's new TABLE entries and EmptyKind/EMPTY_WORDS exports, and kept this pull's NOTE_WORDS and NoteKey after them. I removed noTemplateIsMarked and noFirstAskHasBeenRefused from NOTE_WORDS, because main now covers those two sentences as templates and refused.
  • src/web/empty_words.ts: both emptyLine (from main) and emptyNote (from this pull) are exported.
  • src/web/pages/app_templates.ts and src/web/pages/forges-refused.ts: they now use main's emptyLine("templates") and emptyLine("refused").
  • Ratchets: the merge turned two "own words" counters stale, so I lowered them. test/empty-notes.test.ts loses builds.ts (main already moved it), and the NOTE_WORDS doc comment now says seven pages still word their own note instead of eight. test/empty-words-all.test.ts drops the pages this pull moved onto NOTE_WORDS and lowers the counts for system.ts and billing.ts. Both tests were counting words this branch already moved, so they were wrong, not the code.

I did not touch anything beyond the conflicts and those two counters.

Approved

Clean, behaviour-neutral refactor. Every moved sentence is word for word, rendered in the same muted paragraph through emptyNote, which is escaped by html. The only visible change is the full stop on the fork-offers note. No new input, write path, dependency or component, so there is no security or design-system impact. All keys in NOTE_WORDS are read by a page. test/empty-notes.test.ts fails if a page adds its own note or if a table sentence is not plain, and the lowered counts in empty-words-all.test.ts match the moved pages. No door is needed because no feature was added, and README is untouched. I did not exercise the preview beyond reading the diff.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs