Repository navigation
🐛 fix(review): decision verdicts no longer bind as advisory - #15567
Conversation
Signed-off-by: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com> Co-authored-by: gregoryhunt <31053269+gregoryhunt@users.noreply.github.com>
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
hive/awaiting-ci: CI pending — sweep will merge when green. 🐝 Hive Agent: — hive: agent=scanner backend=copilot model=claude-fable-5.1 copilot=1.0.88 |
Open PR overlap checkBase branch: Conflicts are checked with every PR merged onto the current tip of
|
There was a problem hiding this comment.
Mechanism checks out against the tree; looks correct to me.
ConfirmDeliveredInProgress(src/pkg/review/dispatch.go) callsConfirmDelivered(state, delivered, delivered). InConfirmDeliveredtheundeliveredset atdispatch.go:1663-1677is built only fromplannedkicks absent fromdeliveredSet, so withplanned == deliveredit is empty and the loop atdispatch.go:1678-1681retains every pending row. That is exactly the "keep in-flight rows" behaviour the per-delivery persist needs.- The end-of-pass
persistReviewDispatchState(reviewPlan, deliveredReviewKicks, logger)atmain.go:7903is untouched, so kicks that never land are still released after the pass — the new wiring test asserts both halves. - Each in-progress persist recomputes from the original
plan.Statewith the cumulativedeliveredslice, andupsertRecentReviewmakes the repeated Recent writes idempotent, so calling it N times per pass is safe. logAdvisoryFallbackCandidatesonly emits when the submitting agent actually has a row for that repo/number (agentHasRow), so ordinary advisory reviews from undispatched agents stay quiet.
I have not approved or merged anything.
— hive: agent=reviewer backend=copilot model=claude-fable-5.1 copilot=1.0.88
There was a problem hiding this comment.
Decision needed: @clubanderson should decide whether #15567 or #15561 lands for #15559 — both make the same intermediate-persist fix and the same advisory-fallback log, edit the same lines of src/cmd/hive/main.go, and cannot both merge.
This appears to duplicate #15561, which makes the same change for #15559. I read both diffs in full:
| #15561 (@Karibhou, codex) | #15567 (this PR) | |
|---|---|---|
onReviewDelivered persist |
persistReviewDispatchStateIntermediate → review.ConfirmDelivered(plan.State, nil, delivered) |
persistReviewDispatchStateInProgress → new review.ConfirmDeliveredInProgress = ConfirmDelivered(state, delivered, delivered) |
| Effect | undelivered set empty → pending rows kept |
identical: planned ⊆ delivered → undelivered set empty → pending rows kept |
Advisory-fallback diagnostic in review_verdict_relay.go |
INFO log, same pending/recent agent= perspective= head= decision= candidate format, gated on the request agent holding a row |
same, factored into logAdvisoryFallbackCandidates |
| Tests | wiring test in review_dispatch_wiring_test.go |
wiring test plus relay tests (TestRecordReviewVerdictLogsCandidatesOnAdvisoryFallback, …QuietWithoutAgentRows) and ConfirmDeliveredInProgress tests |
| Issue link | Refs #15559 — part 3 left open |
Refs #15559 — part 3 left open |
Both edit src/cmd/hive/main.go:7844 and verdictDispatchAuthorized in src/pkg/github/review_verdict_relay.go, so they conflict, not just overlap (hence conflicts-with-open-pr).
Correctness of this PR, verified against the tree: ConfirmDelivered (src/pkg/review/dispatch.go:1652-1692) builds undelivered only from planned keys absent in deliveredSet; passing planned = delivered makes it empty, so state.Pending passes through unchanged while Recent is still upserted for delivered kicks. The end-of-pass persistReviewDispatchState at main.go:7903 still runs with the full plan and releases undelivered kicks. Relay side: verdictDispatchAuthorized (review_verdict_relay.go:510-528) loads state from disk on each verdict, so keeping the rows on disk is what lets the in-flight decision bind. The logging helper is read-only on state. Looks correct to me.
Which should survive: #15561 is earlier and already carries a hive approve at its head, but its own body says relay-level regression coverage "remain[s]" — this PR is the one that has it. Either #15561 lands and this closes, or this lands and #15561 closes; I have not closed anything.
Note: Refs (not Closes) is appropriate here — part 3 (defensive decision binding) genuinely needs planner→relay plumbing not in either PR.
— hive: agent=reviewer-2 backend=copilot model=claude-fable-5.1 copilot=1.0.88
There was a problem hiding this comment.
Read ConfirmDelivered (src/pkg/review/dispatch.go:1641-1699) against the new ConfirmDeliveredInProgress at 576516a. Passing delivered as both planned and delivered leaves the undelivered map empty (dispatch.go:1663-1677), so the intermediate persist in onReviewDelivered (main.go:7844) now upserts Recent rows for delivered kicks and drops no Pending rows; the end-of-pass persistReviewDispatchState still uses the full plan and releases what never landed. Each intermediate call starts from plan.State, so repeated calls are idempotent. logAdvisoryFallbackCandidates is read-only and gated on the agent actually having a row (review_verdict_relay.go:577), so it stays quiet for ordinary advisory reviews. Looks correct to me.
— hive: agent=reviewer backend=copilot model=claude-fable-5.1 copilot=1.0.88
Two trains on one page read as two unexplained "Merge queued · 1st" /
"· 2nd" pairs: the ordinal is per train, but the chevron never said so
and every train's rail wore the same colour.
- Queue words carry the length: "Merge queued · 1st of 2"; the
provisional suffix reads "queued 1st of 2 once ready".
- Past one train on the page the word ends with the train's tag
("· train main.go": overlap basename, else the head #N) and the
hover leads "Train of 2 PRs overlapping main.go; merges after
#15567."; one train → no tag. stageTrackerTrainIndex counts the
page's trains once per render (ctx.trains / ctx.trainIndex).
- Each train's header and member rows share a rail accent
(.ham-train-k0..k3, cycling in page order).
- Node test for 1 vs 2 trains; copy inventory + docs; changelog.
Fixes #15589
Signed-off-by: Andrew Anderson <andy@clubanderson.com>
Two trains on one page read as two unexplained "Merge queued · 1st" /
"· 2nd" pairs: the ordinal is per train, but the chevron never said so
and every train's rail wore the same colour.
- Queue words carry the length: "Merge queued · 1st of 2"; the
provisional suffix reads "queued 1st of 2 once ready".
- Past one train on the page the word ends with the train's tag
("· train main.go": overlap basename, else the head #N) and the
hover leads "Train of 2 PRs overlapping main.go; merges after
#15567."; one train → no tag. stageTrackerTrainIndex counts the
page's trains once per render (ctx.trains / ctx.trainIndex).
- Each train's header and member rows share a rail accent
(.ham-train-k0..k3, cycling in page order).
- Node test for 1 vs 2 trains; copy inventory + docs; changelog.
Fixes #15589
Signed-off-by: Andrew Anderson <andy@clubanderson.com>
There was a problem hiding this comment.
Read ConfirmDelivered and the two persist call sites on this head: the mechanism in the body matches the code, and the fix looks correct to me.
src/pkg/review/dispatch.go:1649-1651:ConfirmDeliveredInProgress(state, delivered)isConfirmDelivered(state, delivered, delivered), soplanned == delivered, theundeliveredset at:1671-1683stays empty, and every pending row survives (:1685-1691) whileRecentstill gains one entry per delivered perspective (:1656-1665). That is exactly the "record, don't prune" the mid-pass persist needs.src/cmd/hive/main.go:7844uses the in-progress variant fromonReviewDelivered; the end-of-passpersistReviewDispatchStateat:7903is unconditional (no return between the kick loop and it), so kicks that never landed are still released once per pass as before. Both persists compute fromreviewPlan.State, same asv5.review_verdict_relay.go:logAdvisoryFallbackCandidatesis log-only and gated on the agent actually having a row for that repo#number, so an ordinary advisory review adds no noise.go build ./pkg/review ./pkg/github ./cmd/hivepasses ond2a27a5; the tests cover both the in-progress and end-of-pass shape (dispatch_test.go,review_dispatch_wiring_test.go).
— hive: agent=reviewer-2 backend=copilot model=claude-fable-5.1 copilot=1.0.88
|
Thank you for your contribution! Your PR has been merged. We'd love to hear how your experience was: share feedback |
A decision kick's verdicts sometimes recorded as advisory, undecided reports, so the decision's pending rows expired and the planner re-ran it (with its comment then suppressed by the per-head review cap).
Why: the relay binds verdicts against
review-dispatch-state.jsonon disk, but eachonReviewDeliveredpersist ranConfirmDeliveredwith the full planned set, treating every kick not yet confirmed in the pass as undelivered and dropping its pending rows from disk. Kick lanes deliver concurrently while effects apply in message order, so a kick still in flight (here, the decision) could lose its rows on disk while its agent was already reviewing.Changes:
review.ConfirmDeliveredInProgressandpersistReviewDispatchStateInProgressused fromonReviewDeliveredrecord delivered kicks without pruning ones still delivering. Only the end-of-passpersistReviewDispatchState(unchanged) releases kicks known undelivered.verdictDispatchAuthorizedfalls back to advisory for an agent that has dispatch rows for that repo/number, it logs at INFO the request agent, perspective and reported head, plus the candidate rows (agent, perspective, head, decision).ConfirmDelivered,persistReviewDispatchStateand relay tests.Part 3 (defensive binding of a
[review-decision:…]verdict as decided when no row matches) is not included. The relay'sReviewRequestdoes not carry the kick marker or head-settlement state, so it would need new plumbing from the planner. The new diagnostics will show whether any loss remains after this fix (for example areviewKickByMessagemiss).Fixes #15559 (part 3 left open: defensive decision binding needs planner-to-relay plumbing; diagnostics added to confirm whether it is still needed)
— hive: agent=scanner backend=copilot model=claude-fable-5.1 copilot=1.0.88 requested_by=@gregoryhunt