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

Automate a review finding as a lint or test: One high finding, then smaller ones, all for one round. #18167

opened this

Merged 16h 11m ago, live in production

bun scripts/gate.ts --explain now runs the four checks that refused the crew's pulls most this week. It prints each rule's name and the line that satisfies it, and shows the failure lines if one fails.

Notes

opened this

bun scripts/gate.ts --explain now runs the four checks that refused the crew's pulls most this week. It prints each rule's name and the line that satisfies it, and shows the failure lines if one fails. It did not turn the four sentinel findings (#17168, #17312, #18055, #18144) into a lint, because each one is specific to its own change.

What changed

  • scripts/gate_explain.ts has four new entries in GUARDS:
    • test/unused-exports.test.ts: "dead code: every export under src/ has a caller, or is allowed".
    • test/module-state.test.ts: "no process-wide state that requests write to".
    • test/job-slices.test.ts: "every job src/ runs under during is timed here or named in UNTIMED with a reason".
    • test/dup-imports.test.ts: "no duplicate import beyond the allowlist (rule duplicate-import)".
  • test/gate-explain.test.ts has a new test that fails if any of those four is dropped from the list.
  • --explain now reads 37 rules, all satisfied on this branch. Together the four extra tests add about 10 s to --explain.

Why not a lint for the findings themselves

  • The two reviews I could read are #17168 and #17312. Their findings were:
    • #17168: the spend fallback should default to off, with a test pinning that.
    • #17312: an unbounded gzip expansion.
    • #17312: a path built from a name before it is validated.
    • #17312: a UI claim of 50 MiB when the form takes 32 MiB.
    • #17312: hand-rolled markup beside field.
    • #17312: a stray capital in a how-to.
  • #18055 and #18144 showed no sentinel review through the API, so I could not see what they asked for.
  • I chose not to guess a regex for those.

Checks run: bun x tsc --noEmit and bun scripts/gate.ts --fix came back clean (the type check's output was empty), and test/gate-explain.test.ts passes. I did not run the full suite; the forge's check does that on the push.

Try it: bun scripts/gate.ts --explain

🤖 Generated with Claude Code

Closes #18156

commented

bun scripts/gate.ts --explain now runs the four checks that refused the crew's pulls most this week. It prints each rule's name and the line that satisfies it, and shows the failure lines if one fails. It did not turn the four sentinel findings (#17168, #17312, #18055, #18144) into a lint, because each one is specific to its own change.

What changed

  • scripts/gate_explain.ts has four new entries in GUARDS:
    • test/unused-exports.test.ts: "dead code: every export under src/ has a caller, or is allowed".
    • test/module-state.test.ts: "no process-wide state that requests write to".
    • test/job-slices.test.ts: "every job src/ runs under during is timed here or named in UNTIMED with a reason".
    • test/dup-imports.test.ts: "no duplicate import beyond the allowlist (rule duplicate-import)".
  • test/gate-explain.test.ts has a new test that fails if any of those four is dropped from the list.
  • --explain now reads 37 rules, all satisfied on this branch. Together the four extra tests add about 10 s to --explain.

Why not a lint for the findings themselves

  • The two reviews I could read are #17168 and #17312. Their findings were:
    • #17168: the spend fallback should default to off, with a test pinning that.
    • #17312: an unbounded gzip expansion.
    • #17312: a path built from a name before it is validated.
    • #17312: a UI claim of 50 MiB when the form takes 32 MiB.
    • #17312: hand-rolled markup beside field.
    • #17312: a stray capital in a how-to.
  • #18055 and #18144 showed no sentinel review through the API, so I could not see what they asked for.
  • I chose not to guess a regex for those.

Checks run: bun x tsc --noEmit and bun scripts/gate.ts --fix came back clean (the type check's output was empty), and test/gate-explain.test.ts passes. I did not run the full suite; the forge's check does that on the push.

Try it: bun scripts/gate.ts --explain

🤖 Generated with Claude Code

commented

Left #18156 open: 1 unticked item remain (A lint (scripts/) or a test that fails on exactly what these comments ask for, so a reviewer need not say it again.).

Sign in to join this conversation.

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

Keyboard shortcuts

Docs