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

Automate a review finding as a lint or test: Two things to fix, first one first. #9301

Parked opened this
Closed without merging

I added a test that fails on a new fixed sleep in a test file. It rests on a guess about what the repeated comment asks for, and I didn't confirm that guess. I merged current main into the branch and pushed, so the forge will run the full check again.

Notes

stopped parked by the crew deploy a08fb85

opened this

I added a test that fails on a new fixed sleep in a test file. It rests on a guess about what the repeated comment asks for, and I didn't confirm that guess. I merged current main into the branch and pushed, so the forge will run the full check again.

What the repeated comment is. "Two things to fix, first one first" is the reviewer's verdict wording, not a rule. The concrete asks inside those reviews (I only found them on #7080) included a fixed 300 ms sleep to replace with a poll that has a deadline. They also included a wall-clock margin that flakes under CI load. I picked the fixed sleep, since it's the one I could turn into a test. I did not automate the wall-clock-margin ask, and I didn't find the actual comments on #7547, #8101 or #9253. If the finding is something else, say so and I'll change the rule.

What the rule does.

  • scripts/review-rules.ts fails on any new Bun.sleep(n) or sleep(n) of 250 ms or more in test/.
  • Sleeps already in the tests are pinned in a baseline, so existing tests don't fail.
  • The failure message starts review rule fixed-sleep, then gives the file and line, and says to poll with a deadline instead.
  • test/review-rules.test.ts has four tests: the tests are clean beyond the baseline, a planted sleep is named with its rule and line, short sleeps and polling pass, and the baseline only names files that exist.

Checks. bun scripts/gate.ts, tsc --noEmit and test/review-rules.test.ts all pass after the merge. scripts/fast.ts could not name tests (exit 2), so I ran only the new test file, not the full suite.

Not done.

  • The rule lives in a test, not in scripts/gate.ts. Gate already runs a similar rule from src/kernel/review_rules.ts, so moving the new one there is possible if you want it.
  • bun scripts/hollow.ts reports src/actions/pin_demos.ts exports with no caller. That comes from main, not from this branch, and it isn't part of gate.ts.
  • The branch also adds src/arcade/cover.ts to scripts/unreached-allow.json and drops two stale entries from scripts/hollow-allow.ts.

Closes #9268

🤖 Generated with Claude Code

Closes #9268

3 earlier comments
commented

I added a test that fails on a new fixed sleep in a test file. It rests on a guess about what the repeated comment asks for, and I didn't confirm that guess. I merged current main into the branch and pushed, so the forge will run the full check again.

What the repeated comment is. "Two things to fix, first one first" is the reviewer's verdict wording, not a rule. The concrete asks inside those reviews (I only found them on #7080) included a fixed 300 ms sleep to replace with a poll that has a deadline. They also included a wall-clock margin that flakes under CI load. I picked the fixed sleep, since it's the one I could turn into a test. I did not automate the wall-clock-margin ask, and I didn't find the actual comments on #7547, #8101 or #9253. If the finding is something else, say so and I'll change the rule.

What the rule does.

  • scripts/review-rules.ts fails on any new Bun.sleep(n) or sleep(n) of 250 ms or more in test/.
  • Sleeps already in the tests are pinned in a baseline, so existing tests don't fail.
  • The failure message starts review rule fixed-sleep, then gives the file and line, and says to poll with a deadline instead.
  • test/review-rules.test.ts has four tests: the tests are clean beyond the baseline, a planted sleep is named with its rule and line, short sleeps and polling pass, and the baseline only names files that exist.

Checks. bun scripts/gate.ts, tsc --noEmit and test/review-rules.test.ts all pass after the merge. scripts/fast.ts could not name tests (exit 2), so I ran only the new test file, not the full suite.

Not done.

  • The rule lives in a test, not in scripts/gate.ts. Gate already runs a similar rule from src/kernel/review_rules.ts, so moving the new one there is possible if you want it.
  • bun scripts/hollow.ts reports src/actions/pin_demos.ts exports with no caller. That comes from main, not from this branch, and it isn't part of gate.ts.
  • The branch also adds src/arcade/cover.ts to scripts/unreached-allow.json and drops two stale entries from scripts/hollow-allow.ts.

Closes #9268

🤖 Generated with Claude Code

commented

This pull adds scripts/review-rules.ts and updates test/review-rules.test.ts. The fix on this push is a duplicate src/arcade/cover.ts line I had added to scripts/unreached-allow.json, which is now removed. Two checks still fail on this branch, and I did not fix them because they fail the same way without my changes.

  • Still red, from main: src/actions/pin_demos.ts (from #9284) is exported but nothing reaches it. That fails bun scripts/hollow.ts, the "carries no hollow work" test, and test/unreached.test.ts. It needs a caller or an allow entry owned by #9284.
  • Passing now: I merged the latest origin/main, and test/conversation-queue-api.test.ts and test/review-rules.test.ts pass. I did not rerun the other conversation-queue tests from the failed check, such as the run-state and landing ones. They may have been fixed by the merge or may still fail.
  • Type check: bun x tsc --noEmit is clean.

To try it, run bun test test/review-rules.test.ts.

commented

I merged the latest origin/main into the branch and pushed, but the check will probably still fail, because failures on main itself remain. My change is only scripts/review-rules.ts and test/review-rules.test.ts, and none of the failing tests touch those files.

  • Still red after the merge: src/actions/pin_demos.ts, which came in with #9284, is exported but nothing reaches it. Locally that fails bun scripts/hollow.ts and test/unreached.test.ts, and the "carries no hollow work" test in shard 54 fails for the same reason. The fix is a caller or an allow entry in scripts/hollow-allow.ts and scripts/unreached-allow.json, owned by #9284.
  • Not run again: I did not rerun the message-queue tests (#8819) or the "live previews" test. The live-previews test timed out at 120 s, so it looks like load on the check machine.
  • Run locally: test/work-branch.test.ts, which passed, and test/unreached.test.ts, which failed on the pin_demos.ts problem above.

I left pin_demos.ts alone because it belongs to #9284.

commented

Parked by the crew: the check stayed red through 2 automatic tries

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs