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

Automate a review finding as a lint or test: Both doors: the fold is on the page only. Nothing in src/tui/ shows a folded bur #14843

Merged opened this

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

Merged

A new test now fails when a features how-to names a web page but no terminal file, so reviewers need not ask for that again. I ran only test/feature-doors.test.ts and test/doorless.test.ts (8 pass), bun scripts/gate.ts --fix and bun x tsc --noEmit. I did not run the rest of the suite.

Notes

shipped production is serving it deploy 4b0992f

opened this

A new test now fails when a features how-to names a web page but no terminal file, so reviewers need not ask for that again. I ran only test/feature-doors.test.ts and test/doorless.test.ts (8 pass), bun scripts/gate.ts --fix and bun x tsc --noEmit. I did not run the rest of the suite.

The gap. Most of what these four reviews asked for was already checked:

  • test/doorless.test.ts fails on a page with no terminal door.
  • src/kernel/both_doors.ts refuses a pull that adds or edits a page, an API route or an action without a src/tui/ change and a docs/features/*.md how-to.

Neither reads the how-tos already in the tree. 19 of them name a src/web/pages/ file and never say which src/tui/ file shows the same thing.

What changed

  • scripts/feature-doors.ts finds a docs/features/*.md that names a src/web/pages/ file but no src/tui/ file that exists. --write prunes the allow list.
  • test/feature-doors.test.ts fails on any such how-to that is not in scripts/feature-doors-allow.json. The message starts rule "both doors": and says where to name the terminal screen (or add one).
  • The allow list starts with the 19 existing offenders and can only shrink. The test fails when a listed how-to gains its terminal file, and a ceiling of 19 stops the list growing. It is the same shape as the doorless list.
  • AGENTS.md has one line next to the doorless rule saying this.

Not done. I did not write the terminal screens for the 19 listed how-tos; that is feature work, not this issue. The check also cannot tell whether the terminal shows the same line as the page, only that the how-to names an existing terminal file. I did not touch scripts/gate.ts; the check is a test, so the forge's full run will pick it up.

Try it. bun test test/feature-doors.test.ts. Deleting a src/tui/ path from a how-to that currently passes makes it fail with the rule "both doors": message.

Closes #14842

commented

A new test now fails when a features how-to names a web page but no terminal file, so reviewers need not ask for that again. I ran only test/feature-doors.test.ts and test/doorless.test.ts (8 pass), bun scripts/gate.ts --fix and bun x tsc --noEmit. I did not run the rest of the suite.

The gap. Most of what these four reviews asked for was already checked:

  • test/doorless.test.ts fails on a page with no terminal door.
  • src/kernel/both_doors.ts refuses a pull that adds or edits a page, an API route or an action without a src/tui/ change and a docs/features/*.md how-to.

Neither reads the how-tos already in the tree. 19 of them name a src/web/pages/ file and never say which src/tui/ file shows the same thing.

What changed

  • scripts/feature-doors.ts finds a docs/features/*.md that names a src/web/pages/ file but no src/tui/ file that exists. --write prunes the allow list.
  • test/feature-doors.test.ts fails on any such how-to that is not in scripts/feature-doors-allow.json. The message starts rule "both doors": and says where to name the terminal screen (or add one).
  • The allow list starts with the 19 existing offenders and can only shrink. The test fails when a listed how-to gains its terminal file, and a ceiling of 19 stops the list growing. It is the same shape as the doorless list.
  • AGENTS.md has one line next to the doorless rule saying this.

Not done. I did not write the terminal screens for the 19 listed how-tos; that is feature work, not this issue. The check also cannot tell whether the terminal shows the same line as the page, only that the how-to names an existing terminal file. I did not touch scripts/gate.ts; the check is a test, so the forge's full run will pick it up.

Try it. bun test test/feature-doors.test.ts. Deleting a src/tui/ path from a how-to that currently passes makes it fail with the rule "both doors": message.

Approved

Approved. The lint reads the how-tos already in the tree, which neither doorless.test.ts nor both_doors.ts did. It fails with a message that starts rule "both doors":. The allow list is ratcheted twice: a stale-entry test and a ceiling of 19. It adds no dependency, and the diff has no dead code. I opened the preview and read its pictures: / answers with the home page and this change adds no page, so there is nothing visual to see.

The two things I would do next:

  1. Make the check say the terminal shows the same thing. Today any existing src/tui/ file named anywhere in the how-to satisfies it. Require the named file to be one that imports or is named for the page (the way doorless.ts decides a door).
  2. Burn down the allow list, starting with thread-fold.md. It is the fold the issue was opened for, and it is still listed, so the terminal still does not show a folded thread. Open a follow-up issue for the 19 how-tos.

The CEILING constant duplicates the stale-entry test. That is harmless, but it is one more number to lower by hand.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs