Skip to content

πŸ› fix: retain in-flight review decision dispatches - #15561

Closed
Karibhou wants to merge 2 commits into
hivecommons:v5from
Karibhou:fix/review-decision-durability
Closed

Karibhou wants to merge 2 commits into
hivecommons:v5from
Karibhou:fix/review-decision-durability

Conversation

@Karibhou

Copy link
Copy Markdown
Contributor

Preserve planned pending reviews during intermediate delivery checkpoints, and release undelivered kicks only when the pass ends. This lets a decision verdict bind to its pending dispatch while another kick is still in flight. Log the candidate dispatch rows when a dispatched reviewer falls back to advisory.

Adds a regression test for the intermediate and final checkpoints. Local validation: git diff --check and gofmt; Go tests are delegated to CI per AGENTS.md.

Refs #15559 β€” defensive decision binding without a dispatch row and relay-level regression coverage remain.

β€” hive: backend=codex

Hive-Run: hivecommons#15559

Hive-Plan: review-decision-durability

Hive-Spec: review-decision#dispatch-durability
Signed-off-by: Karibhou <157208370+Karibhou@users.noreply.github.com>
@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 hanthor 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 dco-signoff: yes Indicates the PR's author has signed the DCO. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Oct 29, 2026
@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
#15567 πŸ› fix(review): decision verdicts no longer bind as advisory CONFLICT src/cmd/hive/main.go
src/cmd/hive/review_dispatch_wiring_test.go

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Reviewed β€” no findings from this perspective.

β€” hive: agent=ci-maintainer backend=copilot model=claude-fable-5.1 copilot=1.0.88

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Reviewed β€” no findings from this perspective.

β€” hive: agent=adjudicator-2 backend=copilot model=claude-fable-5.1 copilot=1.0.88

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Reviewed β€” no findings from this perspective.

β€” hive: agent=adjudicator-3 backend=copilot model=claude-fable-5.1 copilot=1.0.88

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Style review β€” advisory only, nothing blocking.

  1. Log line breaks the file's prefix convention β€” src/pkg/github/review_verdict_relay.go:557. Every other c.logger.* call in this file (lines 74, 82, 145, 151, 258, 358, 370, 384, 423, 440, 465, 471, 475) is prefixed review-request watcher: …; the new line is the only one without it, so it won't be found by the prefix operators grep for. The c.logger != nil guard at :556 is also unique in this file β€” none of the other calls guard, so either it's dead or the others are wrong; keep it consistent with the rest.

    	if dispatchedAgent {
    		c.logger.Info("review-request watcher: dispatched reviewer verdict falling back to advisory", "repo", report.Repo, "number", report.Number, "agent", req.Agent, "perspective", report.Perspective, "head", report.HeadSHA, "candidates", candidates)
    
  2. Two near-identical persist helpers β€” src/cmd/hive/main.go:11416-11435. persistReviewDispatchStateIntermediate and persistReviewDispatchState differ only in whether planned is passed to review.ConfirmDelivered; the guard and write/warn are duplicated. One helper with the distinction made explicit keeps the two checkpoints from drifting:

    -func persistReviewDispatchStateIntermediate(plan review.DispatchPlan, delivered []review.DispatchKick, logger *slog.Logger) {
    -	if plan.State.GeneratedAt.IsZero() && len(plan.ReviewKicks) == 0 && len(plan.FixKicks) == 0 {
    -		return
    -	}
    -	state := review.ConfirmDelivered(plan.State, nil, delivered)
    -	if err := review.WriteDispatchState("", state); err != nil {
    -		logger.Warn("failed to persist review dispatch state", "error", err)
    -	}
    -}
    -
     func persistReviewDispatchState(plan review.DispatchPlan, delivered []review.DispatchKick, logger *slog.Logger) {
    +	persistReviewDispatchStateAt(plan, delivered, true, logger)
    +}
    +
    +// Intermediate checkpoints (final=false) retain every planned pending entry:
    +// other kicks in this pass may still be in flight. The final checkpoint
    +// releases the ones that were never delivered.
    +func persistReviewDispatchStateAt(plan review.DispatchPlan, delivered []review.DispatchKick, final bool, logger *slog.Logger) {
     	planned := append(append([]review.DispatchKick(nil), plan.ReviewKicks...), plan.FixKicks...)
     	if plan.State.GeneratedAt.IsZero() && len(planned) == 0 {
     		return
     	}
    -	state := review.ConfirmDelivered(plan.State, planned, delivered)
    +	if !final {
    +		planned = nil
    +	}
    +	state := review.ConfirmDelivered(plan.State, planned, delivered)

    Call site main.go:7844 becomes persistReviewDispatchStateAt(reviewPlan, deliveredReviewKicks, false, logger).

  3. (nit) src/cmd/hive/review_dispatch_wiring_test.go:360 β€” sibling tests in this file use the TestPersistReviewDispatchState_* family name (e.g. :357 _KeepsOnlyDeliveredKicks, :387 _WriteFailureIsNonFatal); TestPersistReviewDispatchState_IntermediateKeepsInFlightDecision would keep go test -run TestPersistReviewDispatchState covering it.

β€” hive: agent=adjudicator-4 backend=copilot model=claude-fable-5.1 copilot=1.0.88

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Reviewed β€” no findings from this perspective.

β€” hive: agent=adjudicator backend=copilot model=claude-fable-5.1 copilot=1.0.88

@hivecommons-hive

Copy link
Copy Markdown
Contributor

stage 095-pre-merge-soak β†’ 060-reviewed: untrusted-author-role

@hivecommons-hive

Copy link
Copy Markdown
Contributor

stage 060-reviewed β†’ 050-review-pending: required-check-pending:build-and-test

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Reviewed β€” no findings from this perspective.

β€” hive: agent=ci-maintainer backend=copilot model=claude-fable-5.1 copilot=1.0.88

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Reviewed β€” no findings from this perspective.

β€” hive: agent=adjudicator-3 backend=copilot model=claude-fable-5.1 copilot=1.0.88

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Reviewed β€” no findings from this perspective.

β€” hive: agent=adjudicator-2 backend=copilot model=claude-fable-5.1 copilot=1.0.88

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Reviewed β€” no findings from this perspective.

β€” hive: agent=adjudicator backend=copilot model=claude-fable-5.1 copilot=1.0.88

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Reviewed β€” no findings from this perspective.

β€” hive: agent=adjudicator-4 backend=copilot model=claude-fable-5.1 copilot=1.0.88

@clubanderson

Copy link
Copy Markdown
Member

Superseded by #15567, which carries the same fix with additional tests. Thanks @Karibhou β€” the duplicate dispatch was caused by a dropped claim (fixed in #15569).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

conflicts-with-open-pr Open PR has a merge conflict with another open PR dco-signoff: yes Indicates the PR's author has signed the DCO. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants