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

Automate a review finding as a lint or test: Both doors: nothing in src/tui/ for the archive or for sending a patch. Add a sc #14371

Merged opened this

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

Merged

The "both doors" rule from #10628 now catches the cases behind these four comments that it used to miss. bun test test/both-doors.test.ts test/both-doors-refusal.test.ts and tsc --noEmit pass, and scripts/gate.ts --fix ran clean, so I pushed. Most of what the four reviews asked for was already enforced.

Notes

shipped production is serving it deploy 2829c4f

opened this

The "both doors" rule from #10628 now catches the cases behind these four comments that it used to miss. bun test test/both-doors.test.ts test/both-doors-refusal.test.ts and tsc --noEmit pass, and scripts/gate.ts --fix ran clean, so I pushed.

Most of what the four reviews asked for was already enforced. The new-page, edited-page, new-action, studio-module and edited-API cases (#10628, #12972, #13196, #14040) cover #11901, #12566 and #12953. Reading the files those pulls changed, two routes still got through:

  • #11849, the archive: src/http/archive.ts was added and wired only into src/http/server.ts. A server.ts edit never counted as wiring, so nothing asked for a screen or a how-to. A new module under src/ plus an edit to server.ts now needs both a terminal screen and a docs/features page.
  • New API or MCP tool files: a new src/http/api/.ts or src/http/mcp/tools/.ts is now treated like a new action and needs a terminal screen. Before, it only counted if an edited API file sat beside it.

A bare edit to server.ts still asks for nothing. Both rules take the existing No door: <why> commit line as a waiver.

The failure message names rule "both doors" and the added files. test/both-doors.test.ts has a new test that fails without the change. I also added a line to AGENTS.md saying the same.

Not done: new files under src/contract/openapi/routes/ are not covered, since they describe a route rather than add one. The wider rule still passes a pull that adds a screen without its page in the same shape, because checking that the screen matches the page would need a parser.

To try it: bun test test/both-doors.test.ts, or push a pull that adds a src/http/*.ts module and edits server.ts and see bun scripts/gate.ts refuse it.

Closes #14320

commented

The "both doors" rule from #10628 now catches the cases behind these four comments that it used to miss. bun test test/both-doors.test.ts test/both-doors-refusal.test.ts and tsc --noEmit pass, and scripts/gate.ts --fix ran clean, so I pushed.

Most of what the four reviews asked for was already enforced. The new-page, edited-page, new-action, studio-module and edited-API cases (#10628, #12972, #13196, #14040) cover #11901, #12566 and #12953. Reading the files those pulls changed, two routes still got through:

  • #11849, the archive: src/http/archive.ts was added and wired only into src/http/server.ts. A server.ts edit never counted as wiring, so nothing asked for a screen or a how-to. A new module under src/ plus an edit to server.ts now needs both a terminal screen and a docs/features page.
  • New API or MCP tool files: a new src/http/api/.ts or src/http/mcp/tools/.ts is now treated like a new action and needs a terminal screen. Before, it only counted if an edited API file sat beside it.

A bare edit to server.ts still asks for nothing. Both rules take the existing No door: <why> commit line as a waiver.

The failure message names rule "both doors" and the added files. test/both-doors.test.ts has a new test that fails without the change. I also added a line to AGENTS.md saying the same.

Not done: new files under src/contract/openapi/routes/ are not covered, since they describe a route rather than add one. The wider rule still passes a pull that adds a screen without its page in the same shape, because checking that the screen matches the page would need a parser.

To try it: bun test test/both-doors.test.ts, or push a pull that adds a src/http/*.ts module and edits server.ts and see bun scripts/gate.ts refuse it.

commented

I merged main into this branch and pushed it. The only conflict was in AGENTS.md.

  • Conflict: both sides edited the "both doors" rule. I kept my sentence, which asks for the terminal screen when a pull adds a new src/http/api/.ts or src/http/mcp/tools/.ts file. It also asks for both the screen and a features doc when a module is wired into src/http/server.ts (#14320). I also kept the paragraph main added about test/doorless.test.ts and scripts/doorless-allow.json (#14289).
  • Checks: bun scripts/gate.ts --fix and bun x tsc --noEmit were clean. scripts/fast.ts returned exit 2 (diff too broad to name, because src/kernel/both_doors.ts changed), so I ran the door tests by hand: test/doorless.test.ts, test/both-doors.test.ts and test/both-doors-refusal.test.ts. All pass. I did not run the full suite; the forge runs it on the push.
Approved

The rule now catches the two walks that got through: a new module wired only through server.ts (the archive), and a new src/http/api or src/http/mcp/tools file. A bare server.ts edit still asks nothing, and kernel/ and tui/ modules stay exempt. The test fails without the change, and the failure names rule "both doors" and the added file. The pull changes no src/web, so the preview has no new surface. Next: (1) add the openapi/routes case the pull says it left out, or open an issue for it; (2) the AGENTS.md rule is now one very long line, so split it into a short list.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs