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

Automate a review finding as a lint or test: Fix first: item 1, the terminal door, then the tests in item 2. #14041

Merged opened this

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

Merged

The "both doors" rule now also refuses a pull that changes how people reach a feature through the API or an MCP tool but touches nothing under src/tui/. The gate and tsc are clean and the two both-doors test files pass (18 tests). I ran no other suites; the forge's check runs the full suite on this push.

Notes

shipped production is serving it deploy 4adf612

opened this

The "both doors" rule now also refuses a pull that changes how people reach a feature through the API or an MCP tool but touches nothing under src/tui/. The gate and tsc are clean and the two both-doors test files pass (18 tests). I ran no other suites; the forge's check runs the full suite on this push.

The four comments (#10072, #10663, #10703, #11735) were all the same ask: the terminal door was missing. The rule already covered new pages, renderers, actions and studio modules, and edited pages. The gap was work reached only through the API or MCP. #10072 added a route plus a core module, and #11735 added actions to an existing MCP tool.

  • Edited route, tool or action: an edit to an existing src/http/api.ts, src/http/api/.ts, src/http/mcp/* or src/actions/*.ts now needs a change under src/tui/, or a commit line No door: <why> (10 or more characters). The how-to is not asked of these edits.
  • New module behind a route or tool: a new feature module wired into one of those edits is now asked for the screen and docs/features/<name>.md, the same as when it is wired into an existing page.
  • Failure message: it begins rule "both doors": this pull edits <files> but has no change under src/tui/; …, so the rule is named in the log.
  • Code and docs: the change is in src/kernel/both_doors.ts, with one line added to AGENTS.md.
  • Tests: two new cases in test/both-doors.test.ts cover the edited-file refusal, the src/tui/ pass, the waiver, and a new module wired into a route. I changed one existing assertion in that file. It expected an edited src/actions/*.ts to pass with nothing else, which the new rule now refuses, so it now includes a src/tui/ change.

I did not make the rule check that the src/tui/ change is actually related to the edited route. Any src/tui/ change satisfies it, as it already does for edited pages. The No door: waiver is the way out when an edit shows nothing new.

To try it, edit src/http/api.ts on a branch with no src/tui/ change and run bun scripts/gate.ts.

Closes #14040

commented

The "both doors" rule now also refuses a pull that changes how people reach a feature through the API or an MCP tool but touches nothing under src/tui/. The gate and tsc are clean and the two both-doors test files pass (18 tests). I ran no other suites; the forge's check runs the full suite on this push.

The four comments (#10072, #10663, #10703, #11735) were all the same ask: the terminal door was missing. The rule already covered new pages, renderers, actions and studio modules, and edited pages. The gap was work reached only through the API or MCP. #10072 added a route plus a core module, and #11735 added actions to an existing MCP tool.

  • Edited route, tool or action: an edit to an existing src/http/api.ts, src/http/api/.ts, src/http/mcp/* or src/actions/*.ts now needs a change under src/tui/, or a commit line No door: <why> (10 or more characters). The how-to is not asked of these edits.
  • New module behind a route or tool: a new feature module wired into one of those edits is now asked for the screen and docs/features/<name>.md, the same as when it is wired into an existing page.
  • Failure message: it begins rule "both doors": this pull edits <files> but has no change under src/tui/; …, so the rule is named in the log.
  • Code and docs: the change is in src/kernel/both_doors.ts, with one line added to AGENTS.md.
  • Tests: two new cases in test/both-doors.test.ts cover the edited-file refusal, the src/tui/ pass, the waiver, and a new module wired into a route. I changed one existing assertion in that file. It expected an edited src/actions/*.ts to pass with nothing else, which the new rule now refuses, so it now includes a src/tui/ change.

I did not make the rule check that the src/tui/ change is actually related to the edited route. Any src/tui/ change satisfies it, as it already does for edited pages. The No door: waiver is the way out when an edit shows nothing new.

To try it, edit src/http/api.ts on a branch with no src/tui/ change and run bun scripts/gate.ts.

commented

The check's 3 failures were in tests my change doesn't touch, and they pass here. I changed only AGENTS.md, src/kernel/both_doors.ts and test/both-doors.test.ts. I ran test/pull-check-again.test.ts and test/apps-rollout.test.ts alone: 11 pass, 0 fail. The failures came from heavily loaded shards (the log shows 92 shards running at once). I'm treating them as flaky.

I have not re-run bun x tsc --noEmit or test/both-doors.test.ts in this turn. I made no code changes, so there is nothing new to push; the next push or a re-run of the check should come back green.

Pull description: The both-doors rule now treats an edited API route, MCP tool or action as needing a terminal change too, and test/both-doors.test.ts covers it. AGENTS.md says so. The check's three failures were in pull-check-again and apps-rollout, which don't involve this change. Both pass when run alone.

Approved

The both-doors gate now refuses an edited API route, MCP tool or action with no change under src/tui/, and asks a new module wired into one for the screen and the how-to. The failure message names the rule. The tests would fail without the change, and AGENTS.md carries the rule. It touches no page, so there is nothing to see in the preview.

Two things I would do next:

  1. Narrow EDITED_API. src/http/mcp/.+ also catches shared MCP plumbing such as the tools/list budget (#6217), which will need a No door: line each time. Consider limiting it to tool files.
  2. Check that the src/tui/ change is related to the edited route. Any src/tui/ edit satisfies the rule today, as it already does for edited pages.
Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs