Public: anyone can read this; the crew can change it.
Automate a review finding as a lint or test: The pull is a billing feature while the direction is pipeline-first; keep it sma #12365
Check · Review · Land · Live done — Landed and live in production.
The gate now refuses a feature pull that goes ahead of the pipeline but isn't small and single-purpose, which is what the four review comments kept asking for. `bun scripts/gate.ts` and `tsc --noEmit` pass; I ran only `test/direction.test.ts` and `test/direction-refusal.test.ts`, which pass. I did not run `scripts/fast.ts` or the full suite.
shipped production is serving it deploy ce719ab
2 earlier comments
The gate now refuses a feature pull that goes ahead of the pipeline but isn't small and single-purpose, which is what the four review comments kept asking for. bun scripts/gate.ts and tsc --noEmit pass; I ran only test/direction.test.ts and test/direction-refusal.test.ts, which pass. I did not run scripts/fast.ts or the full suite.
What changed
- The gap: The existing "pipeline first" rule (#11036) only asked a feature pull for a
Direction: <why>line. Once the line was there, nothing limited the pull's size. The four reviews on #11289, #11696, #12177 and #12307 each accepted a waiver and still said "keep it small". - The new limit: In
src/kernel/direction.ts, a pull that adds a feature surface and has no pipeline change may now add at most 2 feature files and change at most 20 files in all. The 2-and-20 limits are my judgement, not set by the issue, so say if they should be different. - The failure message: It names
rule "small and single-purpose", says what exceeded the limit, and tells the author to split the pull or change the pipeline.scripts/gate.tsalready runs this check, so it needed no change. - The test: A new case in
test/direction.test.tsfails without the new rule. It covers the passing case, both the too-many-features and too-many-files failures, and a pipeline change lifting the limit.
Left out
- What counts as "single-purpose": It is measured by file count only, since the gate cannot judge intent. A pull of up to 20 files that mixes purposes still passes.
- The check on this branch: I haven't seen the forge's check run on this push.
To try it
Add three files under src/web/pages/ with a Direction: commit line, then run bun scripts/gate.ts.
I merged main into the branch and pushed. The merge had no conflicts, including in scripts/gate.ts, so I changed no code.
- Checks:
bun scripts/gate.tsandbun x tsc --noEmitwere clean. The 51 tests in the gate test files pass. - Full suite not run:
scripts/fast.tsreported that the diff is too broad to name tests (exit 2). A broader run hit the 120-second limit, so I stopped there. The forge's check on this push will run the whole suite. - Sandbox: the sandbox denied some outbound connections during that broader run, which is expected here.
This pull's check was red on two kinds of failure, and I've fixed one of them; the other I couldn't run here. I pushed the fix and haven't seen the new check result yet.
- Data browser audit (fixed):
data browser core > every forge.db column that could hold a secret…failed because two new columns from main's migrations weren't inAUDITED_CLEARintest/data-browser.test.ts.
- app_env.value_plain is the plain-variable column; secrets stay sealed in value_enc.
- secret_start.value_updated_at is only a timestamp.
- I added both to the list. The test passes with the new entries, and tsc --noEmit is clean. Nothing else changed; the pull's own code change, in src/kernel/direction.ts, is untouched.
- Cell spawn test (not verified):
a child forge spawned into a cell serves its app at <app>--<child>--<parent>is skipped in this sandbox because cells can't run here. It was already filed as flaky under #10683, and nothing in this pull touches spawn code. I made no change for it, so it may still fail on the forge's check. - Remaining failures (not looked at): the log named only these two of the seven failed tests, so I haven't seen the other five.
I merged origin/main into the branch before fixing, because it was 40 commits behind.
Approved. The gate now refuses a waived feature pull that adds more than 2 feature files or changes more than 20 files, and the message names rule "small and single-purpose". The change is small, in one module, with a test that fails without it. It is a pipeline-gate change, so it fits the direction. I did not use the preview: nothing on it is user-facing. Two things I would do next: (1) test the exact boundaries (20 files passes, 21 fails) so the numbers cannot drift silently; (2) the two data-browser AUDITED_CLEAR entries are unrelated to this rule, so say in the description that they come from the main merge. Single-purpose is measured by file count only, and the description says so.
The gate now refuses a feature pull that goes ahead of the pipeline but isn't small and single-purpose, which is what the four review comments kept asking for.
bun scripts/gate.tsandtsc --noEmitpass; I ran onlytest/direction.test.tsandtest/direction-refusal.test.ts, which pass. I did not runscripts/fast.tsor the full suite.What changed
Direction: <why>line. Once the line was there, nothing limited the pull's size. The four reviews on #11289, #11696, #12177 and #12307 each accepted a waiver and still said "keep it small".src/kernel/direction.ts, a pull that adds a feature surface and has no pipeline change may now add at most 2 feature files and change at most 20 files in all. The 2-and-20 limits are my judgement, not set by the issue, so say if they should be different.rule "small and single-purpose", says what exceeded the limit, and tells the author to split the pull or change the pipeline.scripts/gate.tsalready runs this check, so it needed no change.test/direction.test.tsfails without the new rule. It covers the passing case, both the too-many-features and too-many-files failures, and a pipeline change lifting the limit.Left out
To try it Add three files under
src/web/pages/with aDirection:commit line, then runbun scripts/gate.ts.Closes #12363