Public: anyone can read this; the crew can change it.
Automate a review finding as a lint or test: README.md is capped and is not where a feature's how-to goes; remove the added s #12487
Check · Review · Land · Live done — Landed and live in production.
`bun scripts/gate.ts` now refuses a pull that adds a section to `README.md` or makes it longer. The gate and `tsc` are clean and the four new tests pass. I did not run the wider test files around `gate.ts`. `scripts/fast.ts` said the diff is too broad to name them, and the forge runs the full check on push.
shipped production is serving it deploy d003798
bun scripts/gate.ts now refuses a pull that adds a section to README.md or makes it longer. The gate and tsc are clean and the four new tests pass. I did not run the wider test files around gate.ts. scripts/fast.ts said the diff is too broad to name them, and the forge runs the full check on push.
- The rule:
src/kernel/readme_cap.tscomparesREADME.mdwith the pull's base. The## Dependenciessection is left out of that comparison, so a new package's line still goes there. - Heading failure: a new heading fails with "README.md is capped and is not where a feature's how-to goes: this pull adds the section "## X" to README.md; move it to docs/features/<name>.md and link it from docs/README.md".
- Growth failure: growth outside Dependencies fails with the same rule name and the number of lines added.
- Where it runs:
readmeCapRefusalinscripts/gate.tsis added to the gate's refusal list. It passes when no base resolves, as the other pull checks do. - Tests:
test/gate-readme-cap.test.tscovers an added section, plain growth, the passes (a new Dependencies bullet, an edit in place, a shrink), and a real-repository run againstFORGE_CHECK_BASE.
I chose a "no growth" rule because README.md has no numeric cap to test against. It is strict: adding a link to the "Learn more" list also fails. I did not add a numeric cap, change the MCP tools, or touch AGENTS.md.
The gate now fails a pull that adds a heading to README.md or grows it outside ## Dependencies, and the message names the rule and points to docs/features/<name>.md. The module is small, has no new dependency, and the tests include a real-git-repo run. This is a lint, so it adds no page, tool or screen and the both-doors rule does not apply. Two things I would do next: (1) skip fenced code blocks in withoutDependencies, because a # comment line in a bash block that replaces another line is read as a new section, and add a test for it; (2) put the cap rule in AGENTS.md or docs so the failing message links to a place that explains the no-growth choice, including that a Learn-more link now fails.
bun scripts/gate.tsnow refuses a pull that adds a section toREADME.mdor makes it longer. The gate andtscare clean and the four new tests pass. I did not run the wider test files aroundgate.ts.scripts/fast.tssaid the diff is too broad to name them, and the forge runs the full check on push.src/kernel/readme_cap.tscomparesREADME.mdwith the pull's base. The## Dependenciessection is left out of that comparison, so a new package's line still goes there.readmeCapRefusalinscripts/gate.tsis added to the gate's refusal list. It passes when no base resolves, as the other pull checks do.test/gate-readme-cap.test.tscovers an added section, plain growth, the passes (a new Dependencies bullet, an edit in place, a shrink), and a real-repository run againstFORGE_CHECK_BASE.I chose a "no growth" rule because
README.mdhas no numeric cap to test against. It is strict: adding a link to the "Learn more" list also fails. I did not add a numeric cap, change the MCP tools, or touchAGENTS.md.Closes #12392