Skip to content

🐛 Stage: keep an approved head at 090 on auto-merge-off repos when a drain loses its verdict - #19380

Merged
hivecommons-hive[bot] merged 1 commit into
hivecommons:v6from
Danathar:danathar/automerge-off-verdict-stage-flap
Nov 20, 2026
Merged

hivecommons-hive[bot] merged 1 commit into
hivecommons:v6from
Danathar:danathar/automerge-off-verdict-stage-flap

Conversation

@Danathar

Copy link
Copy Markdown
Contributor

Summary

On a repository whose auto-merge is off, an approved, green PR could flip between stage/090-ready-for-human-merge and stage/050-review-pending, with the same repo-auto-merge-disabled reason both ways. projectbluefin/server#699 did this every ~25 minutes overnight (050→090 4:22 AM, →050 4:49, →090 4:51, →050 5:14, →090 5:20 EST).

Cause

  • The engine ticker and the queued automerge sweep drain one shared stage tracker (#12573).
  • A lane notes the head's reviewer verdict (noteStageVerdict) before its merge decision, but records its observe-only observation only after the evaluation returns.
  • If the other driver drains in between, the note is gone. Unless a later lane in the same pass notes the verdict again, the observation has no verdict, and repo-auto-merge-disabled with no verdict classifies as 050 (derive_pr_classify.go).
  • The 090 route reads the verdict itself (humanEvidence), so the next pass put it back at 090.
  • In the hive's log, the pass that wrote 050 resolved fix: persist ACMM level to hive.yaml on change #699 with no verdict, while the passes on either side logged raw_verdict approve.

The contributor lane re-notes the verdict for a trusted author, unless it stops first (repo not in the lane, a prefilter or sentinel park, mergeable-unknown, a closing or adoption-intent gate, an admission error). Nothing re-notes it for the hive's own PRs.

Fix

ApplyStageLabels folds the head's verdict into a repo-auto-merge-disabled observation whose drain carried none (foldObserveOnlyVerdict). It reads the same review-verdicts record the lanes read, for the observation's own head, the way #18669 fixed the sibling mismatch.

  • Applies to the trusted-author, contributor and self-authored lanes. A trusted bot's verdict is advisory in its lane, so that lane is left alone.
  • A verdict the drain did carry is never replaced.
  • An unreviewed head still reads 050, and a new push waits for its own review.
  • Other repos are unaffected: only the observe-only path produces repo-auto-merge-disabled.
  • It runs before foldRecordedDecision, so a recorded human decision still applies on top.

A deeper fix in the tracker itself (observations carrying their verdict atomically) would also cover non-observe-only paths. It is left as a possible follow-up.

Tests

TestFoldObserveOnlyVerdictSurvivesSplitDrain reproduces the split on a real StageTracker (note → other driver drains → record → drain) and checks:

  • per lane (trusted-author, contributor, self-authored): an approved head goes from 050 to 090 through both resolveStage and stageengine.DerivePR; an unreviewed head stays 050; a new head doesn't inherit the old head's verdict;
  • a verdict the drain carried is left alone;
  • a trusted bot's observation is left alone;
  • other lane reasons are left alone.

Nothing was run locally (AGENTS.md); gofmt -l is clean, and CI is the first build.

🤖 Generated with Claude Code

https://claude.ai/code/session_01BQYnPGFJx81c8JXR3o1sg1

…drain loses its verdict

The engine ticker and the queued sweep drain one shared stage tracker
(hivecommons#12573). A lane notes the reviewer verdict before its merge decision but
records its observe-only observation after it, so a drain by the other
driver in between left a repo-auto-merge-disabled observation with no
verdict, which classifies as 050. projectbluefin/server#699 flipped
090 <-> 050 every ~25 minutes under the same reason.

The stage pass now folds the head's verdict from the review-verdicts
record into such observations (trusted-author, contributor and
self-authored lanes; a trusted bot's advisory verdict is left to its
lane). An unreviewed or new head still reads 050.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BQYnPGFJx81c8JXR3o1sg1
Signed-off-by: Danathar <6772335+Danathar@users.noreply.github.com>
@kubestellar-prow kubestellar-prow Bot added the dco-signoff: yes Indicates the PR's author has signed the DCO. label Nov 20, 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 kellyaa 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 Nov 20, 2026
@hivecommons-hive
hivecommons-hive Bot merged commit 4343c26 into hivecommons:v6 Nov 20, 2026
81 of 82 checks passed
@hivecommons-hive

hivecommons-hive Bot commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

Hive status — updated in place; edits do not notify. Full history is in the Activity Monitor.

Evidence bundle `#19380a95451d` sha256:f7c37443e00d807486128e4d1ff11c2e0a86f63da58c2ae6be509ff90329ee7d — download from the dashboard or `hivectl review evidence #19380`.

merged by Hive trusted-author auto-merge: author Danathar holds role owner and GitHub permission maintain on repo; CI green at a95451d.

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

Labels

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.

1 participant