Repository navigation
π fix(automerge): a carried approval needs the hive's own first sighting of the commit - #16839
Conversation
β¦ing of the commit, not just its date Doug's decision on the adjudicator's HUMAN DECISION on hivecommons#16817 (pullrequestreview-5792808876): keep the carry-over, but close the backdating gap. The date fallback (merge head, walked ancestor) now also requires that the hive first listed the commit as the PR head no later than the review. HeadSightings persists repo#pr@sha -> first listing (pr-head-sightings.json in the stage state dir), written by openPullRequests, the listing every lane sweeps; no sighting on record means nothing carries by date (fail closed). A non-merge head's review and the base-merge walk to the reviewed commit are unchanged. 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>
|
[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
|
There was a problem hiding this comment.
Read the diff against merge-base 91ba1dde together with the walk it changes. This looks correct to me, and it does close the gap the #16817 decision named.
What I verified:
automerge_review_head_binding.go:143-149(contentPredates) now requires bothcommitDate β€ submitted_atand a recorded first sightingβ€ submitted_at; a sha with no record returns false. Both call sites (:106for a merge head,:128for each walked ancestor) use it; the non-merge-head short-circuit at:106is unchanged, as the body says.- The scenario I was worried about β approver clicks Update branch and approves within seconds, before the next sweep lists the new merge head
Mβ is rescued:contentPredates(M)fails on the sighting, but the loop at:116-133walks to the prior headB, which was sighted long before, and returnscarried. So no regression for the common human flow. - Memoisation in
reviewReachesHead(:86-93) remains sound: sightings are recorded inopenPullRequests(automerge_forgestate.go:265-267) before the review gate runs in the same sweep, andFirstSeenis write-once, so a memoised answer cannot later flip. head_sightings.go: write-once per key undermu, tmp+rename save, 180-day prune only on change;TestMainredirects the shared record to a temp dir so tests do not touch/data.go build ./pkg/github/automerge/passes ate5bddfd; CI green apart fromtidepending.
One residual window, by design per your table ("no listing on record β refused"), worth knowing operationally: if content commit B and the base merge M arrive in the same push and the approval lands before the next sweep, B is never sighted as a head, so that approval is refused for good (memoised); the approver's second approval counts once a sweep has listed M. Not a defect β just the cost of fail-closed β and hive-merge.md already says so in substance.
β 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. Review findings from Test review (quality lane) β read at head e5bddfd. The fix is pinned: "backdated content push under a later base merge" (date 11-03, review 11-04, first sighting 11-05) passes the old One branch has no test: the |
Executive summary
Follow-up to #16817, which merged before this change. It applies Doug's decision on the adjudicator's HUMAN DECISION (review 5792808876): keep the base-merge carry-over, but close the backdating gap.
Before this, a carried approval's date fallback trusted the commit's committer date, which the pusher chooses. It now also requires that the hive had listed that commit as the PR's head at or before the review's
submitted_at. Each head's first listing is persisted. A commit with no listing on record is unknown, so nothing carries by date for it (fail closed).What
How
head_sightings.go(new):HeadSightingspersistsrepo#pr@sha β first listingaspr-head-sightings.jsonin the stage state directory. It writes once per new head and keeps entries for 180 days.TestMainpoints the shared record at a temp dir.openPullRequests, the listing every lane sweeps, records each listed head (sightHeads).contentPredatesinautomerge_review_head_binding.go: the date fallback for a merge head and for each walked ancestor requires both the commit date and the first listing to be at or beforesubmitted_at.Tests
TestApprovalBindsToApprovedContent(12 rows)TestHeadSightingsPersistFirstSeenopenPullRequestsrecords listed headsgo test ./pkg/github/automerge/...,go build ./...check-docs-citations.py src/docsNotes
hive-merge.md) and a new changelog fragment describe the rule. π fix(automerge): an approving review counts only for the content it approvedΒ #16817's fragment is unchanged.π€ Generated with Claude Code
https://claude.ai/code/session_01BQYnPGFJx81c8JXR3o1sg1