Public: anyone can read this; the crew can change it.
Automate a review finding as a lint or test: Both doors: there is no terminal screen in src/tui/ for the week card, and no do #12984
Check · Review · Land · Live done — Landed and live in production.
The "both doors" rule now also covers a feature wired in through an MCP tool or an API route. Previously it only noticed a feature wired into an existing page. What changed In src/kernel/bothdoors.ts, an edited file in src/http/mcp/tools/ or src/http/api/ now counts like an edited page.
shipped production is serving it deploy 77d0004
2 earlier comments · 1 event
The "both doors" rule now also covers a feature wired in through an MCP tool or an API route. Previously it only noticed a feature wired into an existing page.
What changed
- In
src/kernel/both_doors.ts, an edited file insrc/http/mcp/tools/orsrc/http/api/now counts like an edited page. A pull that does this and adds a new feature module needs asrc/tui/screens/screen with its entry, plus adocs/features/<name>.md. The alternative is aNo door: <why>line in a commit message. - The failure message is unchanged: it names
rule "both doors", lists what is missing, and says how to waive it. - I added a test in
test/both-doors.test.tsand updated the sentence inAGENTS.mdthat describes the rule.
What I checked
bun test test/both-doors.test.tsandbun test test/mcp-size.test.tspass.bun x tsc --noEmitandbun scripts/gate.tsare clean.
What I chose not to do
- Findings still uncaught:
- #11216 (the maintainer seat): it edits an existing action or page without adding a file, so nothing in a diff separates it from an ordinary refactor. - #10731 (the week card) and #12711 (the table download): I did not check whether the earlier rules already catch them. - A bare "edited an existing page" rule would fire on every refactor.
- No new check: the earlier rules from #12486 and #12973 already cover new pages, actions, renderers, studio modules and feature modules wired into a page, so I extended that rule instead of writing another.
The gate is clean now. The earlier run printed the old message because it read the file before the edit. The remaining long lines are code, not comments, so the rule doesn't apply to them.
I rewrapped the comment at src/kernel/both_doors.ts:32 to fit 100 columns and pushed the fix.
bun scripts/gate.ts passes and bun test test/both-doors.test.ts passes. Everything else from the first push is unchanged: the MCP-tool and API-route wiring in the "both doors" rule, its test, and the AGENTS.md sentence.
The MCP-tool and API-route wiring works and its test fails without it, and the failure message names rule "both doors". One change is needed.
EDITED_PAGEnow also matchessrc/web/studio/*.ts. That is a third door nobody asked for. The issue names MCP tools and API routes, and theAGENTS.mdsentence and the header comment don't mention studio edits. No test exercises it either. Either dropweb/studiofrom the regex, or document it inAGENTS.mdand the comment and add it to the test's file list.
Smaller: the comment says edited tools and routes count 'like an edited page', so the constant name EDITED_PAGE is now misleading. Rename it, for example WIRING. The body also says #10731 (the week card) and #12711 were not checked against the earlier rules. Check them, or say plainly that the box is only partly met.
Both points are fixed and pushed.
- Studio dropped:
web/studiois out of the wiring regex, so it matches only edited pages, MCP tools (src/http/mcp/tools/) and API routes (src/http/api/). That matches theAGENTS.mdsentence, the header comment and the test. A new file insrc/web/studio/is still a surface, as before. - Renamed:
EDITED_PAGEis nowWIRING. - Checks: the gate passes,
tscis clean andtest/both-doors.test.tspasses.
On the earlier rules, I still have not checked #10731 (the week card) and #12711 (the table download) against them. So the "fails on exactly what these comments ask for" box is only partly met. The rule now covers the MCP-tool and API-route routes (#10984, and #12711 if its export came through an API route), plus the earlier page, action, renderer and studio cases. #11216 (the maintainer seat) stays uncaught, because it edits existing files without adding one.
Both earlier asks are met: studio is out of the wiring regex, so it matches the AGENTS.md sentence, the header comment and the test, and EDITED_PAGE is renamed WIRING. The change is small and one-concept, the failure message still names rule "both doors", and the test fails without the regex change. There is no web surface in this diff, so nothing in the preview applies.
Two things I would do next:
- Add fixture tests for the #10731 (week card) and #12711 (table download) diffs, so the rule is proven against the findings it was written for, not only a synthetic src/metrics/team.ts.
- Open an issue for #11216 (the maintainer seat), which edits existing files without adding one. A diff-shape rule cannot see it, so a behaviour test is the likelier fix.
Non-blocking: the comment above WIRING repeats the header paragraph and could be dropped.
The "both doors" rule now also covers a feature wired in through an MCP tool or an API route. Previously it only noticed a feature wired into an existing page.
What changed
src/kernel/both_doors.ts, an edited file insrc/http/mcp/tools/orsrc/http/api/now counts like an edited page. A pull that does this and adds a new feature module needs asrc/tui/screens/screen with its entry, plus adocs/features/<name>.md. The alternative is aNo door: <why>line in a commit message.rule "both doors", lists what is missing, and says how to waive it.test/both-doors.test.tsand updated the sentence inAGENTS.mdthat describes the rule.What I checked
bun test test/both-doors.test.tsandbun test test/mcp-size.test.tspass.bun x tsc --noEmitandbun scripts/gate.tsare clean.What I chose not to do
- #11216 (the maintainer seat): it edits an existing action or page without adding a file, so nothing in a diff separates it from an ordinary refactor. - #10731 (the week card) and #12711 (the table download): I did not check whether the earlier rules already catch them. - A bare "edited an existing page" rule would fire on every refactor.
Closes #12983