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

Automate a review finding as a lint or test: Both doors: no docs/features/<name>.md is added for this behaviour. Add the how- #12973

Merged opened this

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

Merged

The "both doors" gate rule now also catches the two ways the four repeated review comments got around it. I pushed it, and the forge will run the full check on the push. What was already there.

Notes

shipped production is serving it deploy 6d0cf92

opened this

The "both doors" gate rule now also catches the two ways the four repeated review comments got around it. I pushed it, and the forge will run the full check on the push.

What was already there. The rule from #10628 (bothDoorsProblems in src/kernel/both_doors.ts, run by scripts/gate.ts) only fired when a pull added a file under src/web/pages/, src/web/render/ or src/actions/. I read the four pulls the comments were left on. None of them tripped it:

  • #12342 added its feature as src/web/studio/share_tell.ts, a directory the rule didn't watch.
  • #12444 and #12927 added their logic in new modules (src/maintain/, src/flow/) and only edited existing pages.

What changed.

  • A new src/web/studio/*.ts is now treated like a new action or renderer, so it needs a terminal screen with an entry that opens it.
  • A pull that edits an existing src/web/pages/*.ts and also adds a new module under src/ now needs both a terminal screen and a docs/features/<name>.md. Test files, src/kernel/, src/tui/ and the page, render, studio and action folders don't count as that new module.
  • The failure message still reads rule "both doors": this pull adds <files> but no <missing doors>; add them, or put a "No door: <why>" line….
  • AGENTS.md line 8 says so.
  • New cases in test/both-doors.test.ts cover the studio module, the page edit with a new module, the passing combinations, the No door: waiver, and the cases that must stay quiet.
  • test/both-doors.test.ts, test/both-doors-refusal.test.ts and bun x tsc --noEmit pass here. bun scripts/gate.ts printed nothing, which I read as a pass.

One existing assertion changed. In "both doors pass; so does a No door line…", [M page, A src/core/x.ts] used to pass, and under the new rule it would be refused. I split it into two assertions, a page edit alone and a src/core module alone, which both still pass. The old combined case is now exactly what the rule asks about.

Not done.

  • #10166's request to confirm the terminal feed screen goes through candidatesFor is a judgement about one pull, so I did not automate it.
  • An edit to an existing page that adds no new file is still not caught.
  • Action-only pulls are still asked for a screen but not a how-to, as before. #12444 and #12927 added how-tos, but they changed existing action files rather than adding new ones.

To try it. Run bun test test/both-doors.test.ts. In a branch, add src/foo/bar.ts and edit a page without adding a screen or doc, then run bun scripts/gate.ts. It should refuse with the rule named, and a No door: <why> line in a commit message waives it.

🤖 Generated with Claude Code

Closes #12972

commented

The "both doors" gate rule now also catches the two ways the four repeated review comments got around it. I pushed it, and the forge will run the full check on the push.

What was already there. The rule from #10628 (bothDoorsProblems in src/kernel/both_doors.ts, run by scripts/gate.ts) only fired when a pull added a file under src/web/pages/, src/web/render/ or src/actions/. I read the four pulls the comments were left on. None of them tripped it:

  • #12342 added its feature as src/web/studio/share_tell.ts, a directory the rule didn't watch.
  • #12444 and #12927 added their logic in new modules (src/maintain/, src/flow/) and only edited existing pages.

What changed.

  • A new src/web/studio/*.ts is now treated like a new action or renderer, so it needs a terminal screen with an entry that opens it.
  • A pull that edits an existing src/web/pages/*.ts and also adds a new module under src/ now needs both a terminal screen and a docs/features/<name>.md. Test files, src/kernel/, src/tui/ and the page, render, studio and action folders don't count as that new module.
  • The failure message still reads rule "both doors": this pull adds <files> but no <missing doors>; add them, or put a "No door: <why>" line….
  • AGENTS.md line 8 says so.
  • New cases in test/both-doors.test.ts cover the studio module, the page edit with a new module, the passing combinations, the No door: waiver, and the cases that must stay quiet.
  • test/both-doors.test.ts, test/both-doors-refusal.test.ts and bun x tsc --noEmit pass here. bun scripts/gate.ts printed nothing, which I read as a pass.

One existing assertion changed. In "both doors pass; so does a No door line…", [M page, A src/core/x.ts] used to pass, and under the new rule it would be refused. I split it into two assertions, a page edit alone and a src/core module alone, which both still pass. The old combined case is now exactly what the rule asks about.

Not done.

  • #10166's request to confirm the terminal feed screen goes through candidatesFor is a judgement about one pull, so I did not automate it.
  • An edit to an existing page that adds no new file is still not caught.
  • Action-only pulls are still asked for a screen but not a how-to, as before. #12444 and #12927 added how-tos, but they changed existing action files rather than adding new ones.

To try it. Run bun test test/both-doors.test.ts. In a branch, add src/foo/bar.ts and edit a page without adding a screen or doc, then run bun scripts/gate.ts. It should refuse with the rule named, and a No door: <why> line in a commit message waives it.

🤖 Generated with Claude Code

Approved

Approved. The gate now refuses the two ways the four reviews were walked around (a new src/web/studio module, and a new feature module beside an edited page), names the rule in the message, has tests for the new cases, and AGENTS.md says so. No UI is touched, so there is nothing to check on a phone or without JavaScript. Two things I would do next: (1) drop the EDITED_PAGE alias (it is just PAGE) and use PAGE directly; (2) add a test for a pull that edits one page and adds another, to pin the pages.length===0 guard, and one for a renamed (R) page, so the wired check is not silently status-dependent.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs