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

No new terminal screen for a thing that has a web page: a rule test lists today's screens and the list can only shrink #18519

opened this

Merged 2h 44m ago, live in production

I added a rule test that fails any new terminal screen for a thing that already has a web page. It passes, bun x tsc --noEmit is clean, and bun scripts/gate.ts --fix changed nothing. I did not run the other checks or the full suite, which the forge runs on push.

Notes

opened this

I added a rule test that fails any new terminal screen for a thing that already has a web page. It passes, bun x tsc --noEmit is clean, and bun scripts/gate.ts --fix changed nothing. I did not run the other checks or the full suite, which the forge runs on push.

How it works

  • Every file in src/tui/screens/ (366 today) counts as a screen.
  • A screen is paired with a page in src/web/pages/ when the file names match, ignoring case, - and _.
  • A pair can also be declared by hand in test/screen-page-pairs.json, which holds one entry today (proposeupstream → offer-upstream).
  • 128 screens have a page today. They are the frozen list in test/screens-with-pages.json, which is plain data and sorted.

What the test fails on

  • A new screen with a page. The message names the screen and the page, and says to build the web page instead.
  • A name on the list whose screen or page is gone. The list can only shrink.
  • A list that is unsorted or has repeats.
  • An explicit pair that names a missing screen or page.
  • A fourth check keeps the pairing logic itself honest.

What I left out

  • No screen is deleted and nothing under src/ changed.
  • Same-name matching covers most of the 128. Screens and pages with different names pair only through screen-page-pairs.json, so a screen with such a page escapes the rule until someone adds the pair.
  • A wrong guess can only flag a screen that has a page of the same name.
  • Reused: the pattern of the form-reload rule test (test/in-place-rule.test.ts).

To try it: bun test test/terminal-screens-rule.test.ts. To see it fail, add src/tui/screens/<name>.ts where a src/web/pages/<name>.ts exists.

No door: this is a rule test and two data files under test/, with no page, action, route or tool change.

Closes #18518

commented

I added a rule test that fails any new terminal screen for a thing that already has a web page. It passes, bun x tsc --noEmit is clean, and bun scripts/gate.ts --fix changed nothing. I did not run the other checks or the full suite, which the forge runs on push.

How it works

  • Every file in src/tui/screens/ (366 today) counts as a screen.
  • A screen is paired with a page in src/web/pages/ when the file names match, ignoring case, - and _.
  • A pair can also be declared by hand in test/screen-page-pairs.json, which holds one entry today (proposeupstream → offer-upstream).
  • 128 screens have a page today. They are the frozen list in test/screens-with-pages.json, which is plain data and sorted.

What the test fails on

  • A new screen with a page. The message names the screen and the page, and says to build the web page instead.
  • A name on the list whose screen or page is gone. The list can only shrink.
  • A list that is unsorted or has repeats.
  • An explicit pair that names a missing screen or page.
  • A fourth check keeps the pairing logic itself honest.

What I left out

  • No screen is deleted and nothing under src/ changed.
  • Same-name matching covers most of the 128. Screens and pages with different names pair only through screen-page-pairs.json, so a screen with such a page escapes the rule until someone adds the pair.
  • A wrong guess can only flag a screen that has a page of the same name.
  • Reused: the pattern of the form-reload rule test (test/in-place-rule.test.ts).

To try it: bun test test/terminal-screens-rule.test.ts. To see it fail, add src/tui/screens/<name>.ts where a src/web/pages/<name>.ts exists.

No door: this is a rule test and two data files under test/, with no page, action, route or tool change.

Sign in to join this conversation.

Search
↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs