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

Automate a review finding as a lint or test: Direction: the repository is PIPELINE FIRST (#6534, #6611, #5276, #3316, #6217, #11037

opened this

Merged 25d 2h ago, live in production

The gate now fails a pull that adds a feature and changes no pipeline code, unless a commit message carries a Direction: line saying why. I ran bun scripts/gate.ts, bun x tsc --noEmit and the new test file alongside test/both-doors-refusal.test.ts, and all pass.

Notes

opened this

The gate now fails a pull that adds a feature and changes no pipeline code, unless a commit message carries a Direction: line saying why. I ran bun scripts/gate.ts, bun x tsc --noEmit and the new test file alongside test/both-doors-refusal.test.ts, and all pass. I did not run the full suite; the forge's check does that on this push.

  • The rule: the rule is in src/kernel/direction.ts and wired into scripts/gate.ts as directionRefusal, next to the "both doors" and "try it" rules. A feature here means a new file under src/web/pages/, src/tui/ or docs/features/. A pipeline change is any change under scripts/, src/flow/, src/nightly/ or src/checks/, or an edit to forge.json.
  • The failure message: it names the rule: rule "pipeline first": this pull adds a feature (<files>) and no pipeline change (…); change the pipeline, or put a "Direction: <why this goes ahead of the pipeline items>" line (10+ characters) in a commit message.
  • Tests: test/direction.test.ts covers the refusal and its wording, the two ways to pass, a Direction: line that is too short, and edits or non-feature files being left alone.
  • Left out: the gate side, directionRefusal, has no git-repository test. bothDoorsRefusal has one, and the two functions are identical apart from the rule they call.
  • Left out: the rule does not check the specific pipeline issue numbers (#6534, #6611, …) or whether they are still open. It only enforces that the pull says why it goes first, which is what the four review comments asked for.

Closes #11036

commented

The gate now fails a pull that adds a feature and changes no pipeline code, unless a commit message carries a Direction: line saying why. I ran bun scripts/gate.ts, bun x tsc --noEmit and the new test file alongside test/both-doors-refusal.test.ts, and all pass. I did not run the full suite; the forge's check does that on this push.

  • The rule: the rule is in src/kernel/direction.ts and wired into scripts/gate.ts as directionRefusal, next to the "both doors" and "try it" rules. A feature here means a new file under src/web/pages/, src/tui/ or docs/features/. A pipeline change is any change under scripts/, src/flow/, src/nightly/ or src/checks/, or an edit to forge.json.
  • The failure message: it names the rule: rule "pipeline first": this pull adds a feature (<files>) and no pipeline change (…); change the pipeline, or put a "Direction: <why this goes ahead of the pipeline items>" line (10+ characters) in a commit message.
  • Tests: test/direction.test.ts covers the refusal and its wording, the two ways to pass, a Direction: line that is too short, and edits or non-feature files being left alone.
  • Left out: the gate side, directionRefusal, has no git-repository test. bothDoorsRefusal has one, and the two functions are identical apart from the rule they call.
  • Left out: the rule does not check the specific pipeline issue numbers (#6534, #6611, …) or whether they are still open. It only enforces that the pull says why it goes first, which is what the four review comments asked for.
commented

Both review points are fixed and pushed. The new tests, bun x tsc --noEmit and bun scripts/gate.ts all pass here; I did not run the full suite, which the forge's check does on push.

  • Wiring tested: the new test/direction-refusal.test.ts builds a temp git repo with a base commit, then a branch that adds src/web/pages/machines.ts.
    • directionRefusal: it returns the rule "pipeline first" line, and returns [] once a Direction: commit message is added.
    • Entry point: the test also runs bun scripts/gate.ts as a subprocess in that repo. Its stderr must contain the rule without the waiver and must not contain it with one. Removing the directionRefusal call from the import.meta.main list therefore turns this test red.
    • Pipeline change: a second test shows a page added together with a scripts/ change passes.
  • Waiver on one line: WAIVER in src/kernel/direction.ts now uses [ \t]* after the colon, so the reason must sit on the Direction: line itself. test/direction.test.ts has a test that Direction:\n\nsome later paragraph of text is refused.

I agreed with both points and have no disagreements.

Sign in to join this conversation.

Search
↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs