Repository navigation
✨ feat(review): carry an approve across the hive's own base-sync merge - #15046
Merged
hivecommons-hive[bot] merged 1 commit intoOct 28, 2026
Merged
hivecommons-hive[bot] merged 1 commit into
hivecommons-hive[bot] merged 1 commit into
Conversation
The review gate keys a verdict to the exact head SHA, so when the hive itself merged the base into an approved PR (update-branch for auto_merge.require_current_base / a behind sweep / the hold guard, or merge-forward) the merge head had no verdict and the PR dropped back to review-gate:no-review-bundle until a reviewer "delta reviewed" base code that was already reviewed and merged upstream (projectbluefin/fsdk-containers#482, projectbluefin/finpilot#599). ReviewDeltaDiff now recognises such a delta from the compare's commits: every commit is a two-parent merge chained from the reviewed head (holdguard.IsHygieneMerge), authored by the App and committed by GitHub (web-flow). For those heads only it makes two more compares: base...head (the PR's own files, and proof the merged parent is the base's merge base with the head) and prevHead...mergedParent (the base's side). The planner re-stamps a prior approve at any delta size when the delta's files are exactly the base's and none is a PR file, so every file at the new head is the reviewed head's or the base's. Anything else, a prior changes_requested/requires_human, or a negative delta_trivial_lines keeps today's delta review. CI still re-runs on the merge head. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BQYnPGFJx81c8JXR3o1sg1 Signed-off-by: Danathar <Danathar@users.noreply.github.com>
Contributor
|
[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 |
Contributor
Contributor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
When the hive merges the base into a PR itself (update-branch from
currentBaseGate/updateBranchAndSkip, reasonsbase-movedorbehind), the new head has no review verdict.reviewGateOutcomekeys the verdict to the exact head, so the PR drops back toreview-gate:no-review-bundleand waits for another review of a diff it already passed.projectbluefin/fsdk-containers#482 on 2026-10-28:
841476c;mainat 16:01:49Z (90b3f5f, two parents, parent[0] =841476c, authored byhivecommons-hive[bot], committed byweb-flow);060 → 050 review-gate:no-review-bundleat 16:08:33Z, still waiting about 2h later.projectbluefin/finpilot#599 had three resets the same way; a separate PR, #15038, stops that one at its source. In every case the files the base changed were disjoint from the PR's own files.
The delta re-review (#14621 / #14622) re-stamps a verdict without a model call only for a delta under 20 lines that touches no flagged file. A larger base merge gets a model "delta review" of base code that was already merged upstream.
Change
ReviewDeltaDiff(pkg/github/review_delta.go) now takesbaseRef. A delta counts as a hive base-sync only when every commit in it meets all of these:holdguard.IsHygieneMerge: two parents, chained from the reviewed head);web-flow, meaning GitHub's own update-branch merge;base...head, which proves it is on the base;prevHead...parent[1].For such a delta it fills
BaseSync,PRFilesandBaseFiles.DeltaDiff.BaseSyncOnly()(pkg/review/delta.go) requires the delta's files to equal the base's changed files and to share none with the PR's files. Every file at the new head is then either the reviewed version or the base's version. That also rules out a conflict resolution or an invented tree. App authorship alone is not trusted for this: agents commit under the App-linked identity (crux/agent/manager_env.go:534, 🐛 agent: hive commits carry whichever agent identity was last written to shared git config (mostly "sec-check"), not the lane that did the work #9478).planDeltare-stamps the prior verdict at any size when it is an approve and the delta isBaseSyncOnly. Achanges_requestedorrequires_humanis never carried, so an open ask is not settled by a base merge. The re-stamp recordsdelta.base_syncwith a note, and the planner's log line gets abase_syncfield.Fallback. If the files intersect, or anything above does not hold, today's delta review runs unchanged.
Docs:
review-swarm.md(the delta section) andhive-merge.md.Changelog:
changelog.d/added-review-verdict-survives-base-sync.md.Owner call needed. This carries an approve past the 20-line limit #14621 set for a re-stamp without a model call. The bodies of #14621 and #14622 define only the trivial re-stamp; neither says every head needs a full re-review. #13643 spares the label-queued lane only because of human per-SHA approvals. The carry is limited to the shape above, where the new head contains nothing beyond the reviewed version and the base's own files. It reuses the existing opt-out: a negative
delta_trivial_linesturns it off. A separate config key would also work.Testing
From
src/,TZ=UTC,-count=1:go test ./pkg/review/... ./pkg/github/ ./cmd/hive/passes.gofmtandgo vetare clean.New tests:
pkg/review/delta_base_sync_test.go: the planner carries an approve at any size, does not carry when files intersect, and does not carry a non-approve verdict.pkg/github/review_delta_test.go(httptest), 11 negative cases:web-flow;It also covers a two-merge chain and abbreviated SHAs.
A wiring test in
cmd/hive.Mutation checks: 17 mutants, each restored from a backup copy, and every one fails a test. One survived the first round, so a test was strengthened.
API cost per new head:
web-flowmerges: unchanged, one compare.per_page=1(the file list is complete on page 1), going up to 300 only with several merges. An intersecting candidate pays them again on each planning cycle, about 3 calls instead of 1.Not verified, or still open
base...headcompare fails falls back to a normal delta review.Contributor checklist
changelog.d/added-review-verdict-survives-base-sync.md.v6.src/docs/review-swarm.md,src/docs/hive-merge.md).🤖 Generated with Claude Code
https://claude.ai/code/session_01BQYnPGFJx81c8JXR3o1sg1