Repository navigation
π Recognize preparation refreshes after destination advances - #15905
Conversation
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 |
Open PR overlap checkBase branch: Conflicts are checked with every PR merged onto the current tip of No conflicting open PRs or same-file overlaps were found. |
There was a problem hiding this comment.
Read base_preparation_observation.go at d00628d against pr_decision_base_refresh.go on v5. The swap to BaseRefreshChecker.HeadIsBaseRefreshOf is correct for the stated mechanism: mergeIsBaseRefreshOf checks the non-attempt parent against CompareCommits(base...newHead).merge_base_commit (pr_decision_base_refresh.go:143-146), so a destination tip newer than Attempt.Base is accepted while a parent off the destination branch still fails, and sameChangedFiles compares resulting blob SHAs, so the new blob-changed-same-patch case is genuinely covered. The advanced-base test case fails on the old code (it required Parents[1] == Attempt.Base), so the regression test is real.
One behaviour change I think is unintended:
Transient lookup failures are now sticky for the life of the process (medium). HeadIsBaseRefreshOf returns false on any GetCommit/CompareCommits error and memoises that result unconditionally (pr_decision_base_refresh.go:65-72: ok := headIsBaseRefreshChainOf(...); b.cache[...] = ok), keyed on (repo, pr, Attempt.Head, head). The removed code returned err on a GetCommit failure (old base_preparation_observation.go:63-66), so the next planning pass retried. After this change, a single 403/5xx/rate-limit on the proof read excludes that owner from base-preparation priority until the engine restarts or the memo rolls over at 4096 entries, and every subsequent pass logs reason=unverified-app-base-refresh as if the proof had actually failed β the same "owner silently loses preference" symptom #15903 is fixing, from a new cause. The proof-unavailable test case calls the observation once, so it doesn't see the stickiness.
Smallest fix I can see: have the checker not memoise results that came from a lookup error (e.g. headIsBaseRefreshChainOf returns (ok, lookupFailed) and the cache store is skipped when lookupFailed), which also benefits the decision-carry caller at pr_decision_base_refresh.go:291. If the sticky-negative is acceptable here, a sentence in hive-merge.md saying a failed proof read is not retried until restart would at least make the log line honest.
Info only: the shared checker walks up to baseRefreshMaxHops=5 consecutive App refreshes (pr_decision_base_refresh.go:97-118), whereas the removed code accepted exactly one merge. That matches what the decision carry already trusts, so I don't think it's a problem, but it is a widening the PR body doesn't mention.
β hive: agent=reviewer backend=copilot model=claude-fable-5.1 copilot=1.0.88
|
Hive status β updated in place; edits do not notify. Full history is in the Activity Monitor. @clubanderson this PR is held at Why:
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. |
|
Thank you for your contribution! Your PR has been merged. We'd love to hear how your experience was: share feedback |
Final exact-head CI and authorized source-merge receipt
CI sources:
Source-only boundary: reuses the established App/base-ancestry/content verifier for priority observation. No approval carry, gate weakening, owner/store rewrite, fairness/capacity change, new UI DTO, policy/config change, publication claim, deployment or native activation. Runtime adoption requires a newly published binary and owner rollout. The raw UI may correctly retain its conservative admitted-head/unverified badge; that badge alone does not determine validated planner priority. Verify settled CI plus an owed current-head verdict, then actual service logs |
Fixes #15903. Surgical runtime follow-up to #15886; no UI DTO, publisher or integration-layer change.
Confirmed mechanism
On the actually rolled source
d9e14fdbaed95423ad8e41946fdda94c07ac89b6, preparation owner #15893 retained admitted/attempted head37e0c945b92371a0a0df93bb65b757a6d80a21a6and recorded basecccbf34a4e86e7f7cde03be0d610a84ac0201aaeacross restart. Hive's actual refreshf33135aced8c44c83bd1116d2c4034979bb305f6has that attempted first parent but actual destination parent3c7d442d4ee47de19ca19f6356a8648055c77d4b. GitHub attributes it tohivecommons-hive[bot]. Running/fresh observation source blobs are identical.The old observation rejects the second-parent mismatch, and its subsequent stale-base comparison would also fail: before/after patches against the recorded base contain 3 versus 115 files. Against the actual destination base, the same three files have unchanged patches and identical resulting blobs. This is a real own-refresh exclusion, not merely the UI's intentionally conservative unverified badge.
Do not overinterpret telemetry: at 00:03Z all required checks passed but ARM64 still ran, so that pass was independently ineligible for preparation promotion. The parent later observed three owner reviews planned at 00:10:57 with ordinary
merge-readypriority. Ordinary service can happen despite the proven preference exclusion. Watcherverdict recordedmessages and empty GitHub reviews do not establish completed internal approval. No completed-approval claim or gate bypass is made here.Minimal fix / preserved safety
Reuse the automerge engine's existing
BaseRefreshChecker.HeadIsBaseRefreshOf, already used for App base-refresh verification: App-attributed merge lineage, actual merged base on the destination branch, unchanged files/blobs/diff. Do not equate the mutable/stale recorded base SHA with the merged destination parent. Keep a recorded attempt mandatory; unknown/non-App/content-changing/wrong-branch heads fail closed. No decision/verdict is carried or written by this call.Existing live-head binding, hold/closed/retargeted/expiry checks and final ownership/attempt re-read remain. The observation remains read-only, cached per destination by the existing caller, with remote I/O outside preparation locks. Existing persisted state works on a cold engine without rewriting owner/head/attempt identities. No CI, current-base, current-head review, approval, trust, DCO or label gate changes. Pending CI still receives no preparation preference; confirmed-service fairness and reviewer capacity are untouched. No new engine/state/hash, timers, pool, memory/recycle, configuration/rules, native activation or deployment.
Regression / validation
Extend the existing durable reload/lifecycle table with advanced-base acceptance, an additional cold-engine restart, advanced-base amendment/wrong-destination rejection, non-App rejection, changed-blob rejection even with an unchanged patch, missing attempt, unavailable proof and concurrent release during proof. Existing held/closed/retargeted/expired/released and read-only tests remain; existing planner pending-CI/default-order/fairness tests continue unchanged.
gofmtandgit diff --checkcompleted; no local Go suites/build/vet/lint/docs guards per AGENTS. CI is the sole verdict; exact-head results will be recorded before owner-authorized--match-head-commitsource merge. No extra review wait required by owner authorization.Audit / rollout
Successful dispatch retains
priority=base-preparation/base-preparation-fairness. Failed verification now recordsautomerge base preparation observation skippedwithreason=unverified-app-base-refresh. Source fix requires a newly published binary and owner rollout; none performed by this task.