Repository navigation
π Bound review-slot handoff for active base preparation heads - #15886
Conversation
Signed-off-by: Andy Anderson <andy@clubanderson.com>
Signed-off-by: Andy Anderson <andy@clubanderson.com>
Signed-off-by: Andy Anderson <andy@clubanderson.com>
|
[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 |
|
Additional authoritative runtime evidence reported by the parent at ~21:01Z: next durable preparation owner #15851, exact head Implementation head: |
Open PR overlap checkBase branch: Conflicts are checked with every PR merged onto the current tip of
|
Signed-off-by: Andy Anderson <andy@clubanderson.com>
|
@clubanderson this PR is held at Failing checks:
Next: the hive does not push to your branch. Push a new head (or reply here); CI and the review swarm re-run automatically and the PR returns to the normal path. |
|
Another agent tried to open a PR from |
There was a problem hiding this comment.
Read the tree, not just the diff. Looks correct to me; notes for the maintainer below.
What I verified
base_preparation_store.go: the new lock-freeownerSnapshoton the file-backed path is safe becausechange()still writes topath+".next"andos.Renames overpath+".json", so a reader never sees a torn file. In-memory path copiesWaitingbefore it escapes the lock.base_preparation_observation.go: a head that differs from the admitted head is only accepted when it is a two-parent merge of exactlyAttempt.Head+Attempt.BaseandReviewHeadsSamePatchagrees; a transport without that method fails closed. The secondownerSnapshotafter the GitHub reads catches concurrent release.review_preparation.go:reviewPreparationObserverbuilds a freshautomerge.New(...), which I confirmed reads the same process-wide store as the sweep (automerge_base_preparation.go:25sharedBasePreparation,:39-44preparationStore()), so the observation is not inert in production.priority_order.go: the yield band is only populated when a preparation owner is present and a starved PR exists, so the toggle cannot push a non-starved PR ahead;lastReviewWasPreparationreads confirmedRecent(pruned bypruneRecentReviews), and same-batch prep+yield confirmations cancel as the comment says.
Relationship to #15887 β not a duplicate, but worth knowing: both PRs carry the same two groundwork commits (base_preparation_snapshot.go, base_preparation_snapshot_test.go, and the base_preparation_store.go refactor are byte-identical across the two heads), then diverge into different consumers (review-slot ordering here, Activity Monitor backlog there). Whichever lands second will merge cleanly against the shared files; it just needs its CI rerun on the new base.
β hive: agent=reviewer backend=copilot model=claude-fable-5.1 copilot=1.0.88
There was a problem hiding this comment.
Read the tree at e229634, built ./cmd/hive ./pkg/review ./pkg/github/automerge clean. Looks correct to me; no defects found.
What I verified:
- Lockless snapshot reads are safe.
BasePreparationStore.ownerSnapshot(base_preparation_store.go:98-123) reads<key>.jsonwithout the flock, butchangewrites via.next+os.Rename(base_preparation_store.go:167-185), so a reader sees either the old or the new complete file, never a torn one. A decode error is surfaced as unavailable (BasePreparationSnapshotreturnserr,ActiveBasePreparationreturnserr), not as "queue empty" β matching the doc comment atbase_preparation_snapshot.go:29-30. - Fail-closed on refreshed heads.
ActiveBasePreparation(base_preparation_observation.go:57-77) requires the live head to be a 2-parent merge of exactlyAttempt.HeadΓAttempt.Baseand passesReviewHeadsSamePatch. The production transport is*github.Client, which implements it (src/pkg/github/review_head_move.go:73), so the!okbranch cannot silently disable priority in prod; the re-read at:79-86rejects a release race. - Ordering.
orderByReviewPriority(priority_order.go:41-81) only puts a PR in the preparation band whenPreparationOwner && MergeReady && !CIPending, andmain_sweeps.go:2455-2457already requires the same plusreviewPreparationOwesVerdict. The yield band fires only when a preparation owner is present in the same pass andlastReviewWasPreparationis true, so with no owner the pre-#15823 order is unchanged.RecentReview.Priorityis carried throughConfirmDeliveredβupsertRecentReview(dispatch.go:1680), so the yield obligation survives restarts as the body says. - Overlap with #15887.
base_preparation_snapshot.go, its test, andbase_preparation_store.goare byte-identical in both PRs (same sha1 for all three), andgit merge-treeof the two heads reports zero conflicts. Theconflicts-with-open-prlabel on #15887 is a false alarm for this pair: whichever lands first, the other rebases to a no-op on those files.
One suggestion, not a defect: lastReviewWasPreparation reads plan.State.Recent, which pruneRecentReviews trims at RecentDispatchTTL. If a preparation kick is confirmed and no starved waiter appears before the TTL expires, the fairness obligation is forgotten. Bounded and probably intended, but worth a sentence in priority_order.go:88-90 so the next reader doesn't think it is durable forever.
β hive: agent=reviewer-2 backend=copilot model=claude-fable-5.1 copilot=1.0.88
|
Thank you for your contribution! Your PR has been merged. We'd love to hear how your experience was: share feedback |
Verified source merge / CI receiptOwner explicitly authorized administrative source merge at 2026-10-30T21:04:15Z after green immutable-head CI, without waiting for another Hive review bundle. No approval labels or quality checks were manipulated.
Source only: postmerge image-publication workflow was still pending at verification; runtime rollout remains the owner's action. No deployment, live settings, pool, memory/recycle, rules/labels, or native activation changed. Local/remote feature branch and owned clean worktree removed; Audit |
Problem and verified runtime evidence
Fixes #15883. Focused runtime follow-up to #15836; not a new reviewer engine or merge-train policy.
At 20:22Z on 2026-10-30, durable trusted-author preparation owner #15868 received one accepted refresh to
8b9884135e2366741efc63cbf9a2c906ed3d8a59, surviving the 20:26 binary roll. By 20:36 its required CI passed, but the refreshed exact head owed review (review-gate:no-review-bundle/contributor-lane:no-verdict). At 20:39:55 the planner reportedno-free-reviewerfor it and fourteen others while four review kicks went elsewhere. It subsequently merged at 20:46:06Z, releasing ownership at 20:46:14.509, with #15851 front by 20:46:19: this was a long convoy, not permanent deadlock.Design
base-preparation), without requiring a ready-only train seat. Normal planner admission remains authoritative.base-preparation-fairnessprecedence. Only confirmed aged service clears that obligation; unrelated deliveries do not. This survives restarts through the existing dispatch history, and planned/undelivered kicks consume no turn. Free incompatible slots can still serve others; valid busy reviews are never interrupted.Engine.BasePreparationSnapshotover the same read-only state reader/hash/decode: copied original owner/waiter tickets, expiry timestamps, explicit missing/empty/unavailable distinction. This is persisted lifecycle evidence, not live readiness or merge eligibility. UI/orchestration agents may explicitly cherry-pick only shared commitsb1834c4b0cd17d876cd1c180a4b6cd6166e87264and0bc72451b759a4e1001ba58e2ffb0ee4c4d6de1d; neither full implementation depends on another unmerged PR. No UI or orchestration policy is changed here.Gates and limits
No CI, DCO, hold, authorization, labels, trust, current-head review or current-base requirement is weakened; no approval is carried by this change. Preparation remains outside ready merge-train seats and already fully eligible successors retain the #15836 bypass. No preemption, reviewer/pool increase, memory/recycle/configuration/rules change, native-queue activation, deployment or merge is performed. Priority cannot create unavailable compatible review capacity or prevent human/external base changes.
Regression coverage and review
gofmtandgit diff --checkcompleted. No local Go suites/build/vet/lint/docs guards run per AGENTS. CI is the sole verdict; latest-head results will be updated here.Rollout / audit
Requires the changed Hive binary; no rollout performed. Existing
review swarm kick plannedexposespriority=base-preparation/priority=base-preparation-fairness; priority summaries include both.review preparation observation unavailableexplicitly records read/proof errors; ordinaryno-free-reviewer/no-parallel-slotdiagnostics and preparation selection/release logs remain authoritative.