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

Follow-up to #16879: restore the timers-named allow-list entry and add the fs… #16949

Merged opened this in answer to

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

Merged

This pull narrows the timers allow-list entry, adds the fs.watch re-check, and adds a test that a page 2x over its budget still fails. It touches only tests, so no page, action, route or tool changed. The commit line says No door: test-only change.

Notes

opened this

This pull narrows the timers allow-list entry, adds the fs.watch re-check, and adds a test that a page 2x over its budget still fails. It touches only tests, so no page, action, route or tool changed. The commit line says No door: test-only change. tsc is clean. page-budget, timers-named and crew-review-budget pass (18 tests). I did not run the whole suite. The gate printed only a note about two over-long comment lines, which the nightly rewrap handles. I ran --fix before committing, and it changed nothing in the commit.

  • Allow-list (test/timers-named.test.ts): the src/crew/runner.ts entry matched any timer whose text started with overrun. The timer is now setTimeout(overrun, ms) in the default review clock. I added an exact flag, set on that one entry, so it matches only the bare identifier overrun. A new test shows that overrun2, the old inline body and overrun(); doWork() no longer match.
  • fs.watch re-check (test/helpers/crew-standin.ts): the stand-in's spentWhenStarted watch now also re-reads the started file every 100 ms. The interval is cleared when the watch stops, so a missed event can't leave the review budget unspent.
  • Page budget (test/page-budget.test.ts): I pulled the scaling into scaled() and the wall-clock check into wallFinding(). The real test now calls both, so the new test exercises the code that runs. The new test shows that, at the quiet-host calibration, a page taking 2x the 500 ms ceiling (1000 ms wall) fails with a finding. It also shows a page at 2x its CPU median budget fails, and a time is never scaled up. A host that is really 2x slower is forgiven by exactly 2x and no more.

I left out any change to the quiet-host calibration constant and loosened no other test.

To try it: bun test test/page-budget.test.ts test/timers-named.test.ts test/crew-review-budget.test.ts.

🤖 Generated with Claude Code

Closes #16907

commented

This pull narrows the timers allow-list entry, adds the fs.watch re-check, and adds a test that a page 2x over its budget still fails. It touches only tests, so no page, action, route or tool changed. The commit line says No door: test-only change. tsc is clean. page-budget, timers-named and crew-review-budget pass (18 tests). I did not run the whole suite. The gate printed only a note about two over-long comment lines, which the nightly rewrap handles. I ran --fix before committing, and it changed nothing in the commit.

  • Allow-list (test/timers-named.test.ts): the src/crew/runner.ts entry matched any timer whose text started with overrun. The timer is now setTimeout(overrun, ms) in the default review clock. I added an exact flag, set on that one entry, so it matches only the bare identifier overrun. A new test shows that overrun2, the old inline body and overrun(); doWork() no longer match.
  • fs.watch re-check (test/helpers/crew-standin.ts): the stand-in's spentWhenStarted watch now also re-reads the started file every 100 ms. The interval is cleared when the watch stops, so a missed event can't leave the review budget unspent.
  • Page budget (test/page-budget.test.ts): I pulled the scaling into scaled() and the wall-clock check into wallFinding(). The real test now calls both, so the new test exercises the code that runs. The new test shows that, at the quiet-host calibration, a page taking 2x the 500 ms ceiling (1000 ms wall) fails with a finding. It also shows a page at 2x its CPU median budget fails, and a time is never scaled up. A host that is really 2x slower is forgiven by exactly 2x and no more.

I left out any change to the quiet-host calibration constant and loosened no other test.

To try it: bun test test/page-budget.test.ts test/timers-named.test.ts test/crew-review-budget.test.ts.

🤖 Generated with Claude Code

Sign in to join this conversation.

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

Keyboard shortcuts

Docs