Skip to content

🐛 fix(review): decision verdicts no longer bind as advisory - #15567

Merged
hivecommons-hive[bot] merged 8 commits into
v5from
scanner/fix-15559
Oct 30, 2026
Merged

hivecommons-hive[bot] merged 8 commits into
v5from
scanner/fix-15559

Conversation

@hivecommons-hive

@hivecommons-hive hivecommons-hive Bot commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

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.json on disk, but each onReviewDelivered persist ran ConfirmDelivered with 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:

  • Durability: new review.ConfirmDeliveredInProgress and persistReviewDispatchStateInProgress used from onReviewDelivered record delivered kicks without pruning ones still delivering. Only the end-of-pass persistReviewDispatchState (unchanged) releases kicks known undelivered.
  • Diagnostics: when verdictDispatchAuthorized falls 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).
  • Tests for both, next to the existing ConfirmDelivered, persistReviewDispatchState and relay tests.

Part 3 (defensive binding of a [review-decision:…] verdict as decided when no row matches) is not included. The relay's ReviewRequest does 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 a reviewKickByMessage miss).

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

Signed-off-by: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com>
Co-authored-by: gregoryhunt <31053269+gregoryhunt@users.noreply.github.com>
@kubestellar-prow kubestellar-prow Bot added the dco-signoff: yes Indicates the PR's author has signed the DCO. label Oct 29, 2026
@kubestellar-prow

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign danathar for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@kubestellar-prow kubestellar-prow Bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Oct 29, 2026
@hivecommons-hive

Copy link
Copy Markdown
Contributor Author

hive/awaiting-ci: CI pending — sweep will merge when green.


🐝 Hive Agent: scanner | Instance: hosted-available-oke-11-placeholder-r05x | SHA: unknown

— hive: agent=scanner backend=copilot model=claude-fable-5.1 copilot=1.0.88

@github-actions

github-actions Bot commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

Open PR overlap check

Base branch: v5

Conflicts are checked with every PR merged onto the current tip of v5, so a PR that only needs a rebase is not reported as conflicting with its siblings.

PR Title Relation Files
#15584 🐛 Close the hive's own empty-diff PRs as superseded instead of asking a person same files src/cmd/hive/main.go
src/pkg/github/review_verdict_relay.go
src/pkg/review/dispatch.go
#15582 🐛 fix: warn once per PR on review dispatch promotion same files src/cmd/hive/main.go

@github-actions github-actions Bot added the conflicts-with-open-pr Open PR has a merge conflict with another open PR label Oct 29, 2026
@hivecommons-hive hivecommons-hive Bot added author/hive This repository's own hive (the App or one of its agent lanes) authored this PR dco All commits are DCO signed-off role/trusted Author is trusted for unattended merge (trusted-author role or registry/claim tier in require_tiers) stage/050-review-pending Review swarm requested; awaiting a verdict for the current head labels Oct 29, 2026

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mechanism checks out against the tree; looks correct to me.

  • ConfirmDeliveredInProgress (src/pkg/review/dispatch.go) calls ConfirmDelivered(state, delivered, delivered). In ConfirmDelivered the undelivered set at dispatch.go:1663-1677 is built only from planned kicks absent from deliveredSet, so with planned == delivered it is empty and the loop at dispatch.go:1678-1681 retains 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) at main.go:7903 is 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.State with the cumulative delivered slice, and upsertRecentReview makes the repeated Recent writes idempotent, so calling it N times per pass is safe.
  • logAdvisoryFallbackCandidates only 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

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@github-actions github-actions Bot removed the conflicts-with-open-pr Open PR has a merge conflict with another open PR label Oct 30, 2026

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

clubanderson added a commit that referenced this pull request Oct 30, 2026
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>
clubanderson added a commit that referenced this pull request Oct 30, 2026
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>

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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) is ConfirmDelivered(state, delivered, delivered), so planned == delivered, the undelivered set at :1671-1683 stays empty, and every pending row survives (:1685-1691) while Recent still 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:7844 uses the in-progress variant from onReviewDelivered; the end-of-pass persistReviewDispatchState at :7903 is 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 from reviewPlan.State, same as v5.
  • review_verdict_relay.go: logAdvisoryFallbackCandidates is 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/hive passes on d2a27a5; 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

@hivecommons-hive
hivecommons-hive Bot merged commit 0885efe into v5 Oct 30, 2026
74 of 75 checks passed
@kubestellar-prow
kubestellar-prow Bot deleted the scanner/fix-15559 branch October 30, 2026 01:17
@hivecommons-hive

Copy link
Copy Markdown
Contributor Author
Evidence bundle `#15567d2a27a5` sha256:fdbeea201d2526a3fb2232f583e26f0b7f44cf2b2f87f6750680de5b0366a24b — download from the dashboard or `hivectl review evidence #15567`.

@github-actions

Copy link
Copy Markdown
Contributor

Thank you for your contribution! Your PR has been merged.

We'd love to hear how your experience was: share feedback

@hivecommons-hive hivecommons-hive Bot removed role/trusted Author is trusted for unattended merge (trusted-author role or registry/claim tier in require_tiers) stage/050-review-pending Review swarm requested; awaiting a verdict for the current head labels Oct 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author/hive This repository's own hive (the App or one of its agent lanes) authored this PR copilot dco All commits are DCO signed-off dco-signoff: yes Indicates the PR's author has signed the DCO. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

review: a decision verdict can bind as advisory (no -decided report), so the decision expires and re-runs

0 participants