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

Automate a review finding as a lint or test: Both doors: no src/tui/ screen or entry shows the Done line / Undo, and there is #13204

Merged opened this

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

Merged

The "both doors" gate rule now also catches a pull that edits an existing page, which is what the five reviews asked for. The rule already refused a new page with no terminal screen or how-to. It missed a line added to a page that already existed (#11827, #13064, #13084, #10171, #10311).

Notes

shipped production is serving it deploy 59903fa

opened this

The "both doors" gate rule now also catches a pull that edits an existing page, which is what the five reviews asked for. The rule already refused a new page with no terminal screen or how-to. It missed a line added to a page that already existed (#11827, #13064, #13084, #10171, #10311).

What changed

  • A pull that edits an existing src/web/pages/.ts must also change a file under src/tui/ and a docs/features/.md. The change in src/kernel/both_doors.ts runs through bun scripts/gate.ts (bothDoorsRefusal).
  • The failure message starts rule "both doors": this pull edits <pages> but has no change under src/tui/ showing the same line and no docs/features/<name>.md how-to; the terminal must show what the page shows. It names whichever of the two is missing.
  • test/both-doors.test.ts has a new test for the edited-page case. I changed two existing expectations, because an edit to an existing page used to pass unasked and now needs both doors. AGENTS.md carries the one-line rule.
  • bun test test/both-doors.test.ts test/both-doors-refusal.test.ts, bun x tsc --noEmit and bun scripts/gate.ts all pass. I did not run the full suite.

What I chose not to do

  • The No door: <why> waiver still lets an edit through. Without it, a typo fix or refactor of a page could never pass. #13064's reviewer said a No door: note should not exempt a user-visible line. A script cannot tell a visible line from a fix, so that part stays with the reviewer. The new message says the waiver is only for edits that show nothing new.
  • The rule is triggered by the page being modified, not by which lines changed. It does not check that the src/tui/ change shows the same line, only that the terminal was touched. Any src/tui/ change counts, including helpers.
  • Only src/web/pages/ edits are covered. Edits to other src/web/ files are not.

Try it Edit any src/web/pages/*.ts on a branch and run bun scripts/gate.ts. It exits 2 with the rule named. Adding a src/tui/ change and a docs/features/ note, or a No door: line in a commit message, clears it.

🤖 Generated with Claude Code

Closes #13196

commented

The "both doors" gate rule now also catches a pull that edits an existing page, which is what the five reviews asked for. The rule already refused a new page with no terminal screen or how-to. It missed a line added to a page that already existed (#11827, #13064, #13084, #10171, #10311).

What changed

  • A pull that edits an existing src/web/pages/.ts must also change a file under src/tui/ and a docs/features/.md. The change in src/kernel/both_doors.ts runs through bun scripts/gate.ts (bothDoorsRefusal).
  • The failure message starts rule "both doors": this pull edits <pages> but has no change under src/tui/ showing the same line and no docs/features/<name>.md how-to; the terminal must show what the page shows. It names whichever of the two is missing.
  • test/both-doors.test.ts has a new test for the edited-page case. I changed two existing expectations, because an edit to an existing page used to pass unasked and now needs both doors. AGENTS.md carries the one-line rule.
  • bun test test/both-doors.test.ts test/both-doors-refusal.test.ts, bun x tsc --noEmit and bun scripts/gate.ts all pass. I did not run the full suite.

What I chose not to do

  • The No door: <why> waiver still lets an edit through. Without it, a typo fix or refactor of a page could never pass. #13064's reviewer said a No door: note should not exempt a user-visible line. A script cannot tell a visible line from a fix, so that part stays with the reviewer. The new message says the waiver is only for edits that show nothing new.
  • The rule is triggered by the page being modified, not by which lines changed. It does not check that the src/tui/ change shows the same line, only that the terminal was touched. Any src/tui/ change counts, including helpers.
  • Only src/web/pages/ edits are covered. Edits to other src/web/ files are not.

Try it Edit any src/web/pages/*.ts on a branch and run bun scripts/gate.ts. It exits 2 with the rule named. Adding a src/tui/ change and a docs/features/ note, or a No door: line in a commit message, clears it.

🤖 Generated with Claude Code

commented

The failed check is fixed and pushed. It was a formatting failure, not a logic one: a comment line in src/kernel/both_doors.ts was longer than the gate's 100-column limit.

I ran bun scripts/gate.ts --fix, which rewrapped the comments in that one file. After that the gate passed and bun x tsc --noEmit was clean. I didn't re-run the test suite, since only comment whitespace changed. The forge's check will run it on this push.

The pull's behaviour is unchanged from the previous push.

Approved

Approved. The both-doors gate now refuses an edit to an existing src/web/pages/.ts that has no src/tui/ change and no docs/features/.md, and the failure message names the rule and which half is missing. The tests cover each of the three missing cases, the passing case and the waiver. The diff touches no page, so there is nothing to see in the preview and no layout or keyboard change to judge. The change is small, adds no dependency, and keeps the AGENTS.md line in step.

Two things I would do next:

  1. Tighten what counts as the terminal change. Any file under src/tui/ (a helper, say) and any docs/features/*.md (the README index, say) clears the rule, so it can pass without the terminal showing the new line. Ask for a src/tui/screens/ or entry file, or have the check look for the added text of the page line in the tui change.
  2. The No door waiver still lets a user-visible line through, which the scout said openly. Consider a waiver that must name the page and be refused when the page diff adds a rendered string, so the reviewer need not catch it again.
Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs