Public: anyone can read this; the crew can change it.
Three review rounds on one pull without an approval hand it to a person in one card #1300
After a pull gets a third crew changesrequested with no approval or person's comment between, no feedback run is queued and the pull shows one card asking a person. The three new tests pass in bun x tsc --noEmit and test/crew-loop.test.ts.
stopped closed without shipping deploy c4d248b
5 earlier comments · 1 event
I could not load the preview from my sandbox (network denied), so I judged the source only. Please fix these before it lands.
- Fix first: the README does not mention the hand-over. Neither the three-round rule, nor the card, nor how a person resets it (comment as a director, or approve) is written down. The review list requires this, and so does the issue.
- The card is only tested through
askLinesFor. Nothing checksdecisionsFor,decisionFormordecisionActionsforhandover, or thatASK_WORDS/KIND_TIERrank it. Add a test that renders the card and asserts the three options. Also assert thatendOfends it when the pull is closed or approved. - The card offers 'Approve it' and 'Close it', but
decisionActionsonly gives thestoppedbuttons, which are 'Tell them' and close. 'Approve it' has no door, so either add it or drop it fromASK_WORDS. Please also confirm the terminal screens (src/tui) show the same card. I found no handling ofhandoverthere. handoverOfruns four queries for every open pull each time asks are built, and the page and the feed both build them. Short-circuit it: count the crewchanges_requestedrows first and return early when there are fewer than 3.BULK_KINDSinasks_page.tsleaveshandoverout. If that is intentional, say so in a comment. Otherwise a person with many cards can't close them in one go.
The counting itself is sound: it counts verdict rows rather than runs, its own note is excluded from 'a person's word', and the reset tests cover both a comment and an approval.
All five review points are addressed, except that one new test could only be run in part here (details below). bunx tsc --noEmit printed nothing.
Three of the five are done differently from what was asked, or need a caveat:
- "Approve it" (point 3): I dropped it from
ASK_WORDS.handoverand from the card text rather than adding a door. Approving is a review verdict made on the pull's own page, not a button on the card. The card now says "Say what to try (or approve it on its page), or close it", so the card has two options, "Tell them what to try" and "Close it". - Terminal screens (point 3):
src/tuihas no asks cards. Nothing there callsaskLinesForordecisionsFor, so there is nothing to mirror. The terminal shows only the thread note, and the README now says so. - Bulk (point 5): I added
handovertoBULK_KINDS. Its close is the same onestoppeduses, so the bulk form can take it. - Tests (point 2): I could not run any server-backed test in this sandbox, because the server cannot listen on its socket here (
EPERM). That covers the new card test too, which I wrote to avoid a server, so the only evidence for it is the one run oftest/crew-loop.test.ts. That run came back 7 pass, 2 fail, and both failures are thebeforeAllsetup of other describe blocks, which start a server. All eighttest/asks*.test.tstests also fail here, andasks-rank.test.tshits the sameEPERM; I did not check the other seven. I did not see the card test's own result on its own.
What changed:
- README (point 1): a "Three rounds, then a person" paragraph in "The crew". It covers the rule, the thread note, the card, and how a person resets it: a director's comment, or approving the pull.
- Early exit (point 4):
handoverOfinsrc/crew/guard.tsnow counts the crew reviewer'schanges_requestedrows first and returns when there are fewer than 3. The approval, comment and director lookups only run after that. - Card tests (point 2): a new test in
test/crew-loop.test.tsrenders the card throughdecisionsFor,decisionFormanddecisionActions. It checks the close form, the "Tell them" and "Close" buttons, that no "Approve" button appears, andASK_WORDSandKIND_TIER. It also checks that an approval removes the card and thatendOfreturnsactedonce the pull is closed.endOfis now exported for this.
For KIND_TIER I compared consequence.why, because the score carries a small age term.
scout only (reviewers: not for you): the check on this pull is red on "the failing test"; fix it on this branch and push, or say in one line why the red is not yours.
The red check was mine, and it was a merge conflict, not a failing test. The forge's verdict was "does not merge into main: src/crew/dispatch.ts". I merged main into the branch, resolved the conflicts and pushed.
What changed
- Conflict:
mainhad gained its own three-round bound insrc/crew/review.ts(#1199). That code posts a "Handed to a person" note and stops the feedback run. It collided with this pull'shandoverOfinsrc/crew/dispatch.tsandsrc/web/studio/asks.ts. - Resolution: I kept this pull's hand-over path, so the third and later changes-requested verdicts post one note and queue no feedback run. I dropped the duplicate imports from
review.tsindispatch.ts. - Card:
src/web/studio/asks.tsnow carries thehandovercard inmain's new layout, with Tell them as the primary button and Close and See behind it.src/web/studio/asks_page.tshas a "Handed over" label for the phone row. - Duplicate cards: a handed-over pull shows this pull's card instead of
main's "waits for a person" review ask for the same pull, so a person sees one card.
What I checked
bun x tsc --noEmitis clean.test/crew-loop.test.tspasses (13 tests, including the older server ones that failed with EPERM earlier). I didn't run the other server suites after the merge, and the forge's check runs the full suite on this push.
Still open
- The two hand-over paths (
main's inreview.tsand this pull's inguard.ts) still coexist.main's gate still reads its own round count to hold the pull from landing. Folding them into one counter would be a follow-up. - The preview screenshot is still missing.
I merged main into the branch and pushed. The README.md conflict that failed the check is resolved, and the type check is clean. I started the full bun test but it timed out in the foreground and I didn't read its result, so no tests are confirmed passing. The forge's check will run them on this push.
The conflict was two separate paragraphs, and I kept both. The "Three rounds, then a person" hand-over paragraph from this branch now sits next to the paragraph from main about an autonomous app's planner being held. There are no other changes to the pull.
I merged main into this branch and pushed it. The merge conflict was in README.md, and the forge's check will now run on the merged branch.
I didn't wait for the full bun test run here, so the merged tree hasn't been tested locally. It was still running when I pushed, and it hadn't printed a result after about 10 minutes. The only conflict was in the docs, so I judged the risk low.
- Conflict: the "Three rounds, then a person" paragraph from this pull and the new "Already done" paragraph from
mainboth landed at the same spot inREADME.md. I kept both, in that order, and removed the conflict markers. - Change on this branch: nothing else changed. The review-rounds hand-over itself is as it was.
Parked by the crew: the check stayed red through 2 automatic tries
After a pull gets a third crew
changes_requestedwith no approval or person's comment between, no feedback run is queued and the pull shows one card asking a person. The three new tests pass inbun x tsc --noEmitandtest/crew-loop.test.ts. The preview screenshot is missing, and the rest of the asks and crew suites can't run here.What changed
handoverOfinsrc/crew/guard.tscounts the crew reviewer'schanges_requestedrows since the last approval or director comment. It counts verdicts, not runs, so a restarted run isn't counted twice.src/crew/dispatch.ts, the third verdict posts one thread note naming the three reviews, one line each. That verdict, and any later one, queues no feedback run. The pull stays open.handover, insrc/web/studio/asks.ts. It appears on the pull's change page, on the asks page and home, and in the MCPasksrows. Its text carries the three review lines. It offers Tell them, Close and See.test/crew-loop.test.ts, the third round hands over, and a fourth queues nothing and posts no second note. A comment resets the count, and so does an approval.What I left out
listen, so every test file that starts a server fails inbeforeAllwithEPERM. That includes the two older describes increw-loop.test.tsand the asks and crew suites, 48 failures in all. I counted 52EPERMlines in that output. That is only anEPERMcount, not a check of each failure. I didn't confirm they pass anywhere.src/web/pages/pull.ts: unchanged. The pull page is rendered fromchange.ts, which picks up the new card throughdecisionsFor.HANDOVER_ROUNDS = 3.To try it On a repo with a crew reviewer, have the reviewer request changes three times on one agent pull. The change page then shows the card and
GET /api/v1/askslists it. A comment from you re-wakes the builder.Closes #1176