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

Automate a review finding as a lint or test: Direction: the pipeline items (#6534, #6611, #5276, #3316, #6217, #6428, #1242, #14339

Merged opened this

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

Merged

The "pipeline first" rule now also asks the "why does this go ahead of the pipeline items?" question of pulls that add a new action, core module or HTTP route. I ran test/direction.test.ts, test/direction-refusal.test.ts and tsc; they pass. I did not run the full suite, because scripts/fast.ts could not bound the diff.

Notes

shipped production is serving it deploy 4ec2c16

opened this

The "pipeline first" rule now also asks the "why does this go ahead of the pipeline items?" question of pulls that add a new action, core module or HTTP route. I ran test/direction.test.ts, test/direction-refusal.test.ts and tsc; they pass. I did not run the full suite, because scripts/fast.ts could not bound the diff.

The gate already refused a feature pull with no pipeline change and no Direction: line (#11036), but it only recognised a page, a terminal screen or a how-to as a feature. I didn't check the five cited pulls' file lists (the forge API has no files route for pulls). I'm assuming each added an action, core module or route without a page, since the rule had stayed silent on all of them.

What changed

  • src/kernel/direction.ts: a newly added src/actions/.ts, src/core/.ts or src/http/*.ts now counts as a feature, so it needs a pipeline change or a Direction: <why> line of 10+ characters in a commit message.
  • The failure message still names rule "pipeline first" and lists the added files. The existing 2-feature and 20-file limits on a waived pull apply to these too.
  • test/direction.test.ts: the old test that said a new src/core/ file is never asked now covers edits only.
  • test/direction.test.ts: a new test covers the three module kinds, plus the passes with a Direction: line, with an edited module, and with an added src/checks/ file (a pipeline change).
  • The commit carries its own Direction: line, since gate.ts would refuse it otherwise.

What I left out

  • I did not narrow the pipeline waiver (scripts/). The existing rule counts any file under scripts/ as pipeline work, including a new feature script like app-backup.ts (#11715). Narrowing it to edits would turn test/direction-refusal.test.ts red, because it expects a new script to pass, so I kept it.
  • Edits to existing src/actions, src/core or src/http files are not asked.

To try it: bun test test/direction.test.ts test/direction-refusal.test.ts. Or add src/core/x.ts in a scratch commit and run bun scripts/gate.ts.

🤖 Generated with Claude Code

Closes #14287

commented

The "pipeline first" rule now also asks the "why does this go ahead of the pipeline items?" question of pulls that add a new action, core module or HTTP route. I ran test/direction.test.ts, test/direction-refusal.test.ts and tsc; they pass. I did not run the full suite, because scripts/fast.ts could not bound the diff.

The gate already refused a feature pull with no pipeline change and no Direction: line (#11036), but it only recognised a page, a terminal screen or a how-to as a feature. I didn't check the five cited pulls' file lists (the forge API has no files route for pulls). I'm assuming each added an action, core module or route without a page, since the rule had stayed silent on all of them.

What changed

  • src/kernel/direction.ts: a newly added src/actions/.ts, src/core/.ts or src/http/*.ts now counts as a feature, so it needs a pipeline change or a Direction: <why> line of 10+ characters in a commit message.
  • The failure message still names rule "pipeline first" and lists the added files. The existing 2-feature and 20-file limits on a waived pull apply to these too.
  • test/direction.test.ts: the old test that said a new src/core/ file is never asked now covers edits only.
  • test/direction.test.ts: a new test covers the three module kinds, plus the passes with a Direction: line, with an edited module, and with an added src/checks/ file (a pipeline change).
  • The commit carries its own Direction: line, since gate.ts would refuse it otherwise.

What I left out

  • I did not narrow the pipeline waiver (scripts/). The existing rule counts any file under scripts/ as pipeline work, including a new feature script like app-backup.ts (#11715). Narrowing it to edits would turn test/direction-refusal.test.ts red, because it expects a new script to pass, so I kept it.
  • Edits to existing src/actions, src/core or src/http files are not asked.

To try it: bun test test/direction.test.ts test/direction-refusal.test.ts. Or add src/core/x.ts in a scratch commit and run bun scripts/gate.ts.

🤖 Generated with Claude Code

Approved

The gate now asks the pipeline-first question of a newly added src/actions, src/core or src/http module. The failure still names rule "pipeline first" and the added path. The test covers the three kinds, the Direction: pass, edits and a pipeline-companion pass. No UI is touched; I read the diff and did not run the suite. Two things I would do next: (1) simplify the filter predicate (see comment); (2) the five cited pulls were not checked against the rule, so replay their file lists through directionProblems to confirm it would have fired on each.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs