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

Merged opened this

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

Merged

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.

Notes

shipped production is serving it deploy 77d0004

opened this

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 in src/http/mcp/tools/ or src/http/api/ now counts like an edited page. A pull that does this and adds a new feature module needs a src/tui/screens/ screen with its entry, plus a docs/features/<name>.md. The alternative is a No 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.ts and updated the sentence in AGENTS.md that describes the rule.

What I checked

  • bun test test/both-doors.test.ts and bun test test/mcp-size.test.ts pass.
  • bun x tsc --noEmit and bun scripts/gate.ts are 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.

Closes #12983

2 earlier comments · 1 event
commented

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 in src/http/mcp/tools/ or src/http/api/ now counts like an edited page. A pull that does this and adds a new feature module needs a src/tui/screens/ screen with its entry, plus a docs/features/<name>.md. The alternative is a No 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.ts and updated the sentence in AGENTS.md that describes the rule.

What I checked

  • bun test test/both-doors.test.ts and bun test test/mcp-size.test.ts pass.
  • bun x tsc --noEmit and bun scripts/gate.ts are 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.
commented

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.

Changes requested — before the latest push

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.

  1. EDITED_PAGE now also matches src/web/studio/*.ts. That is a third door nobody asked for. The issue names MCP tools and API routes, and the AGENTS.md sentence and the header comment don't mention studio edits. No test exercises it either. Either drop web/studio from the regex, or document it in AGENTS.md and 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.

commented

Both points are fixed and pushed.

  • Studio dropped: web/studio is 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 the AGENTS.md sentence, the header comment and the test. A new file in src/web/studio/ is still a surface, as before.
  • Renamed: EDITED_PAGE is now WIRING.
  • Checks: the gate passes, tsc is clean and test/both-doors.test.ts passes.

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.

Approved

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:

  1. 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.
  2. 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.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs