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

Sentinel: shared:01m23vygyffx5hg2f5vm8r74sr:39d89j4f7b is past its budget: trevato/forge: "a pull whose review loop is spent is the planner's (#1655) > the planner is asked for it and its brief … #3993

opened this

Merged 42d 23h ago, live in production

This fixes a race in test/crew-parks-planner.test.ts, which I believe caused the flaky "the planner is asked for it and its brief says three reviews asked for changes" test. I couldn't reproduce the failure here, so the fix is untested against the real cause.

Notes

opened this

This fixes a race in test/crew-parks-planner.test.ts, which I believe caused the flaky "the planner is asked for it and its brief says three reviews asked for changes" test. I couldn't reproduce the failure here, so the fix is untested against the real cause.

Cause: the test starts a live crew with a 50 ms tick, then calls driveRepo itself and expects "planned". The crew's own tick can ask the planner first. On a loaded check machine that happens often enough that the test's call returns "idle" ("a planning run is in flight"), and the test fails even though the planner was asked correctly. I found this by reading the log, which shows that "planner not asked … in flight" line. The sibling "second park, next tick" test in the same file has the same race.

Change: both tests now accept "planned" or "idle" from their own call. They then wait up to 45 s for directionIssueId to appear before looking for the planner run. That run, and the brief the stand-in Claude Code received, are still asserted exactly as before. The verdict now depends on the code under test, not on who wins the tick.

Not done: I didn't change the production tick or the planner logic, and I didn't touch the other crew tests that may share this pattern. I ran bun test test/crew-parks-planner.test.ts three times and it passed each time. bun x tsc --noEmit couldn't run in the sandbox (read-only tempdir), so the forge's check will be its first run.

To verify: bun test test/crew-parks-planner.test.ts. The sentinel cause shared:…39d89j4f7b should clear once main's check is green again.

Closes #3965

commented

This fixes a race in test/crew-parks-planner.test.ts, which I believe caused the flaky "the planner is asked for it and its brief says three reviews asked for changes" test. I couldn't reproduce the failure here, so the fix is untested against the real cause.

Cause: the test starts a live crew with a 50 ms tick, then calls driveRepo itself and expects "planned". The crew's own tick can ask the planner first. On a loaded check machine that happens often enough that the test's call returns "idle" ("a planning run is in flight"), and the test fails even though the planner was asked correctly. I found this by reading the log, which shows that "planner not asked … in flight" line. The sibling "second park, next tick" test in the same file has the same race.

Change: both tests now accept "planned" or "idle" from their own call. They then wait up to 45 s for directionIssueId to appear before looking for the planner run. That run, and the brief the stand-in Claude Code received, are still asserted exactly as before. The verdict now depends on the code under test, not on who wins the tick.

Not done: I didn't change the production tick or the planner logic, and I didn't touch the other crew tests that may share this pattern. I ran bun test test/crew-parks-planner.test.ts three times and it passed each time. bun x tsc --noEmit couldn't run in the sandbox (read-only tempdir), so the forge's check will be its first run.

To verify: bun test test/crew-parks-planner.test.ts. The sentinel cause shared:…39d89j4f7b should clear once main's check is green again.

Sign in to join this conversation.

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

Keyboard shortcuts

Docs