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

Automate a review finding as a lint or test: Two changes before this lands. #12486

Merged opened this

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

Merged

The "both doors" gate now also fires when a pull adds a new file kind renderer or a new action without a terminal screen. That is the one finding automated here; the other comments in these four reviews are not.

shipped production is serving it deploy 635dde5

opened this

The "both doors" gate now also fires when a pull adds a new file kind renderer or a new action without a terminal screen. That is the one finding automated here; the other comments in these four reviews are not.

Three of the four reviews (#11287, #11626, #12333) had comments asking for a terminal screen or a test that pins the behaviour. Only the missing terminal screen on a new renderer (#11287) or action (#11626) is a rule a check can state. The gate already refused a new page (src/web/pages/.ts) with no terminal screen or how-to, but a new src/web/render/.ts or src/actions/*.ts got through. That is the gap.

What changed

  • src/kernel/both_doors.ts: a pull that adds src/web/render/.ts or src/actions/.ts with no new src/tui/ file is now refused. The failure reads rule "both doors": this pull adds <file> but no terminal screen in src/tui/ (entry where AGENTS.md says); add them, or put a "No door: <why>" line (10+ characters) in a commit message, so the message names the rule.
  • A renderer or action is asked for the screen only, not a docs/features/<name>.md how-to. Pages are still asked for both.
  • Only added files trigger the rule. Edits don't.
  • The existing No door: <why> commit-line waiver covers the new case too.
  • test/both-doors.test.ts has a new test that fails without the change. It covers the refusal for each path, the screen satisfying it, the waiver, and an edit passing.
  • AGENTS.md carries the one-line rule update.

Not done

  • The "assert the default exactly" comment (#12333) and the "add a test for the cap and for extend type" comment (#11287). A check can't tell whether an assertion pins a value.
  • The comment that response/error leak to non-writers (#11626). It needs a security review, not a lint.
  • The docs paragraph placement comment (#12333).
  • #12033 had no review comments on record.
  • Any change to actions that already exist. Because the rule only fires on additions, none is flagged retroactively.

Checked: test/both-doors.test.ts, test/both-doors-refusal.test.ts, bun scripts/gate.ts and bun x tsc --noEmit are green.

To try it: add src/actions/x.ts on a branch with no src/tui/ file and run bun scripts/gate.ts.

Closes #12393

commented

The "both doors" gate now also fires when a pull adds a new file kind renderer or a new action without a terminal screen. That is the one finding automated here; the other comments in these four reviews are not.

Three of the four reviews (#11287, #11626, #12333) had comments asking for a terminal screen or a test that pins the behaviour. Only the missing terminal screen on a new renderer (#11287) or action (#11626) is a rule a check can state. The gate already refused a new page (src/web/pages/.ts) with no terminal screen or how-to, but a new src/web/render/.ts or src/actions/*.ts got through. That is the gap.

What changed

  • src/kernel/both_doors.ts: a pull that adds src/web/render/.ts or src/actions/.ts with no new src/tui/ file is now refused. The failure reads rule "both doors": this pull adds <file> but no terminal screen in src/tui/ (entry where AGENTS.md says); add them, or put a "No door: <why>" line (10+ characters) in a commit message, so the message names the rule.
  • A renderer or action is asked for the screen only, not a docs/features/<name>.md how-to. Pages are still asked for both.
  • Only added files trigger the rule. Edits don't.
  • The existing No door: <why> commit-line waiver covers the new case too.
  • test/both-doors.test.ts has a new test that fails without the change. It covers the refusal for each path, the screen satisfying it, the waiver, and an edit passing.
  • AGENTS.md carries the one-line rule update.

Not done

  • The "assert the default exactly" comment (#12333) and the "add a test for the cap and for extend type" comment (#11287). A check can't tell whether an assertion pins a value.
  • The comment that response/error leak to non-writers (#11626). It needs a security review, not a lint.
  • The docs paragraph placement comment (#12333).
  • #12033 had no review comments on record.
  • Any change to actions that already exist. Because the rule only fires on additions, none is flagged retroactively.

Checked: test/both-doors.test.ts, test/both-doors-refusal.test.ts, bun scripts/gate.ts and bun x tsc --noEmit are green.

To try it: add src/actions/x.ts on a branch with no src/tui/ file and run bun scripts/gate.ts.

commented

I merged main into the branch, resolved the two conflicts, and pushed.

The src/kernel/both_doors.ts conflict was against main's change that makes the terminal screen a file in src/tui/screens/ that something else imports. I kept both. A new renderer (src/web/render/.ts) or action (src/actions/.ts) is asked for a screen only, and that screen must also be opened by an entry. Pages are still asked for the how-to as well.

In AGENTS.md I took main's wording and added one clause saying a new renderer or action is asked for the screen alone.

I updated my renderer/action test in test/both-doors.test.ts for the new imported argument that main added to bothDoorsProblems.

test/both-doors.test.ts and test/both-doors-refusal.test.ts pass (12 tests), and bun scripts/gate.ts and bun x tsc --noEmit are clean. I did not run the full suite. The forge's check does that on this push.

Approved

Small, single-purpose, and it closes the gap: a new src/web/render/.ts or src/actions/.ts now trips the both-doors gate for the missing terminal screen (and an unimported one), is not asked for a how-to, edits and the No door waiver still pass, and the failure message names the rule. The new test fails without the change. No README growth, no dependency, no web surface touched, so the previews are unaffected. Two things I would do next: (1) pin the full failure string for a mixed pull (a page plus a renderer) so the 3-item and N more listing is covered; (2) have the gate message say which kind (page, renderer, action) each listed file is, so the ask is clear when the how-to is absent.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs