Repository navigation
fix(watch): release each issue from inFlight when its own dispatch ends - #56
Merged
Merged
Conversation
pollOnce kept every issue of a batch in inFlight until the whole batch finished. An issue that parked mid-batch (a plan awaiting approval, a question) stayed invisible to later polls, so a human's /factory approve went unread until the batch's slowest issue finished its build and verify. Seen on kaas-suite cards 34 and 36: approved at 07:47 and 07:48, they started building only after card 35, from the same batch, parked. Releasing per issue widens a race that already existed at batch end: a poll that listed issues before an issue's release holds a stale copy of it (still "ready", say) and would dispatch it again. Each release now records a sequence number, and a poll skips any issue released after it started listing. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
pollOncekept every issue of a batch ininFlightuntil the whole batch finished. An issue that parked mid-batch (plan awaiting approval, open question) stayed invisible to later polls, so a human's/factory approvesat unread until the batch's slowest issue finished its build and verify.Seen on kaas-suite: cards 34 and 36 were approved at 07:47 and 07:48 and did not start building until card 35, from the same batch, parked at needs-human about twenty minutes later.
Fix
inFlightwhen its own dispatch ends (src/watch.ts).ready, say) and would dispatch it a second time. Each release now records a sequence number, and a poll skips any issue released after it started listing. A background security review of the first commit flagged this; the second test reproduces it.Evidence
tests/continuous-dispatch.test.ts: two new tests. Both fail without their half of the fix (an issue still ininFlightafter it parked;startsof[1, 1]from a stale poll).tests/mutations.json: one entry per half; bothbitesinmake check-mutations.make check: 1726 pass, 0 fail.make check-mutations: 332 of 334 bite, including both new ones. The other two failed before mutation onguard-hook.test.tstimeouts while three other gates were loading the machine. That file passes 3/3 run alone, and this change does not touch it.Not in this PR
🤖 Generated with Claude Code