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

A dependency the README does not justify fails the gate: “less is better” gets its enforcer #8756

Merged opened this

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

Merged

The rule "less is better" in docs/PRINCIPLES.md now has a test behind it. Every package in `package.json` needs a one-line reason in the README, and a package without one turns the gate red with its name in the failure message.

shipped production is serving it deploy 84c60a0

opened this

The rule "less is better" in docs/PRINCIPLES.md now has a test behind it. Every package in package.json needs a one-line reason in the README, and a package without one turns the gate red with its name in the failure message.

  • README.md: a new ## Dependencies section sits right after the "zero runtime dependencies" paragraph. It has one line, ` - name — why , for each of the six devDependencies: @anthropic-ai/sandbox-runtime, @types/bun, axe-core, happy-dom, typescript and typescript-api`. The paragraph used to justify only the sandbox runtime; that sentence now points to the new section. The README went from 584 to 593 lines, well under its 2329-line cap.
  • test/dependencies-named.test.ts (new): it reads package.json (both dependencies and devDependencies) and the README's Dependencies section. It checks two things:

- Each package has a non-empty line of why. - The section doesn't list a package that has been removed, so the list can't go out of date.

It also checks the parser directly, including that a bullet with no reason doesn't count. It only reads files and runs in about 1 ms. I checked the red case by adding left-pad to package.json for one run: the test failed with "does not justify: left-pad".

  • docs/PRINCIPLES.md: the principle's enforcer changes from "nothing yet" to ` test/dependencies-named.test.ts . It still says "nothing yet" for the "no new rule" half, which this pull doesn't enforce. The file is 1,356 bytes, under its 2,500-byte cap, and test/principles.test.ts` passes, including its check that each named enforcer file exists.

The test only checks that a reason is there, not whether it's a good one. Judging that is left to review. I changed no packages.

bun scripts/gate.ts and bun x tsc --noEmit are clean, and so are the tests scripts/fast.ts names plus test/principles.test.ts: 170 pass, 0 fail.

🤖 Generated with Claude Code

Closes #8740

commented

The rule "less is better" in docs/PRINCIPLES.md now has a test behind it. Every package in package.json needs a one-line reason in the README, and a package without one turns the gate red with its name in the failure message.

  • README.md: a new ## Dependencies section sits right after the "zero runtime dependencies" paragraph. It has one line, ` - name — why , for each of the six devDependencies: @anthropic-ai/sandbox-runtime, @types/bun, axe-core, happy-dom, typescript and typescript-api`. The paragraph used to justify only the sandbox runtime; that sentence now points to the new section. The README went from 584 to 593 lines, well under its 2329-line cap.
  • test/dependencies-named.test.ts (new): it reads package.json (both dependencies and devDependencies) and the README's Dependencies section. It checks two things:

- Each package has a non-empty line of why. - The section doesn't list a package that has been removed, so the list can't go out of date.

It also checks the parser directly, including that a bullet with no reason doesn't count. It only reads files and runs in about 1 ms. I checked the red case by adding left-pad to package.json for one run: the test failed with "does not justify: left-pad".

  • docs/PRINCIPLES.md: the principle's enforcer changes from "nothing yet" to ` test/dependencies-named.test.ts . It still says "nothing yet" for the "no new rule" half, which this pull doesn't enforce. The file is 1,356 bytes, under its 2,500-byte cap, and test/principles.test.ts` passes, including its check that each named enforcer file exists.

The test only checks that a reason is there, not whether it's a good one. Judging that is left to review. I changed no packages.

bun scripts/gate.ts and bun x tsc --noEmit are clean, and so are the tests scripts/fast.ts names plus test/principles.test.ts: 170 pass, 0 fail.

🤖 Generated with Claude Code

Approved

Clean. The README Dependencies section lists all six devDependencies in package.json (dependencies is empty) with a line of why each. The test fails by name for a missing package or a stale line, and the parser case is covered. It only reads files, so there is no security surface. PRINCIPLES.md names the test as its enforcer and keeps "nothing yet" for the rules half. The README stays under its cap and no feature how-to was added to it. I did not run the tests or the preview.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs