Skip to content

🐛 [reviewer] operator decision is lost when the hive refreshes the PR's base; PR re-parks at 085 #15751

Closed

Description

@clubanderson

What happened

On hive-authored #15649 (adopted from #15433, fixes #15432) the operator recorded an approve decision via POST /api/repos/{o}/{r}/items/15649/decision at ~04:00 ET on head A (status approval-commented, released [approval-recorded, admitted]).

Later the hive itself merged v5 into the branch — the require_current_base refresh, a merge commit authored by the App with no change to the PR's diff vs base. New head B = 72246f98. The reviewer swarm re-reviewed B, returned requires_human (finding: "the reviewer marked this change high-risk" — security-sensitive path, proxy private-address bypass) and the stage engine logged:

stage labels: reviewer verdict route … lane=self-authored raw_verdict=requires_human decision_requested=true decision_answered=false … stage=085-needs-decision reason=contributor-lane:decision-requested
automerge sweep review gate holding merge … outcome=requires-human

The PR went back to stage/085-needs-decision and the operator had to approve the same diff a second time.

Why

review-human-change-requests.json is head-scoped by design: a new head supersedes every decision on the old one (#14679). That is right for any push a person or agent makes. It is wrong for the one head change the hive makes itself without touching the PR's content: the base refresh.

Relation to #15722

#15722 makes the hold guard reject carried GitHub review approvals across heads (adoption carry). That stays as is — a GitHub review names one commit. This issue is the narrow exception for the operator's recorded decision when, and only when, the new head is a merge commit authored by the App whose parents are the decided head and a base-branch commit, and whose base...head diff is identical (file set, blobs, patches) to the decided head's. Any other head change still invalidates the decision.

Fix

  • pkg/github: BaseRefreshChecker.HeadIsBaseRefreshOf (memoised per PR/head; one commit read + two compares) and DecisionCarrier that re-records the decision on the new head with carried_from_head, logging one INFO decision carried over base refresh.
  • Applied in the reviewer-verdict stage route (decision_answered stays true), the automerge review gate / operator admission, and the hold guard's operator-admission path.
  • Tests: carried on a pure base refresh; not carried when a content commit was pushed (even with a base merge), when the merge was not by the App, when the diff changed, or for GitHub review approvals; logged once.

Activity

  1. added
    help wantedDenotes an issue that needs help from a contributor. Must meet "help wanted" guidelines.
    on Oct 30, 2026
  2. added a commit that references this issue on Oct 30, 2026
    c87e657
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedDenotes an issue that needs help from a contributor. Must meet "help wanted" guidelines.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions