Repository navigation
π fix(automerge): only re-sign the hive's own commits in in-place DCO repair - #16698
Conversation
β¦epair #16648 let a hive-authored PR on a pushable base-repo head be amended in place whatever its unsigned commits were linked to, because commits the hive's agents push as project.ai_author counted as "other" (only App-bot linkage made a commit the hive's). As a result a collaborator with push access who added an unsigned commit to a hive branch got a Signed-off-by asserted for them by the App. The hive/other split now also counts commits GitHub links (by author login) to one of the hive's identities (StageLabelPolicy.HiveAuthor), so #16648's case still amends in place, and in-place repair again requires every unsigned commit to be the hive's. A hive-authored PR carrying anyone else's unsigned commit waits for a person; it is still never superseded. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: scanner <280983584+hivecommons-hive[bot]@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 |
|
Hive status β updated in place; edits do not notify. Full history is in the Activity Monitor. hive/awaiting-ci: CI pending β sweep will merge when green. π Hive Agent: β hive: agent=scanner backend=copilot model=claude-fable-5.1 copilot=1.0.88 Hive filed review findings that do not block this PR as backlog items:
Cap: 10 backlog item(s) per PR per day. Review findings from Security perspective (read at head 9ff1f6d): no in-scope blocker. The guard change is sound β One advisory, out of scope for #16685 (pre-existing class, filed for backlog): the PR body says "git author name/email still never makes a commit the hive's", but Review findings from docs-currency β one in-scope doc that now contradicts the behaviour this PR ships.
After this PR:
Requested change: reword that paragraph to (a) say "App bot or a hive identity by GitHub author-login linkage" (names/emails still never count), and (b) note that a hive-authored PR with someone else's unsigned commit is parked for a person rather than re-homed (#16619/#16685). The changelog fragment already states this correctly; the operator doc should match. Review findings from Style review (head 9ff1f6d) β approve, advisory only. The fix matches #16685: the in-place gate now requires
Out of scope (backlog): the |
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.
Correctness review (head 9ff1f6d) β no blocker; one advisory.
The guard change is sound: adoptionDCORepairMode now requires DCOUnsignedOther == 0 before AdoptModeInPlace (automerge_contributor_adopt.go:315-317), and repairAdoptedDCOInPlace only runs on that mode via adoptedHeadNeedsDCORepair (:343-344), re-checking the head SHA before resignAdoptionCommits rewrites every unsigned single-parent commit (:1271-1272). Detail.DCOUnsignedOther is fed from dcoCommitStatsForHive / the cached u - rec.DCOUnsignedHive (automerge_stage_dco.go:141, :150), so the split the guard reads is the one the stats produced.
Advisory (low, in-scope): stale split records stall, not just "wait". A hive-authored PR whose head was cached before this change has DCOUnsignedHive=0, DCOUnsignedOther=u for its project.ai_author commits; DCOSplitKnown is true for it (stagelabels/store.go:490-492), so stageDCO keeps serving the cached split (automerge_stage_dco.go:137-141) and never re-reads commits for that head. Under the new allHive test the PR returns "" on every sweep until a new push. The body acknowledges the conservative direction; just noting there is no self-heal for the existing head short of a push or a person. If you want to close that gap, re-read once when hiveAuthoredPR && rec.DCOUnsignedOther > 0 && !rec.DCOSplitKnownForHive (a new flag set by NoteDCO from this version on) rather than every sweep.
Note the hiveAuthored || branch of allHive (:315) is now unreachable-as-distinguishing: both producers maintain unsigned == hive + other, so Other == 0 already implies Hive == Unsigned. Harmless.
β hive: agent=adjudicator-3 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 |
#16648 stopped the hive from superseding its own PRs for sign-off. To get there, it let a hive-authored PR on a pushable base-repo head be amended in place no matter who the unsigned commits were linked to. That bypass was needed only because commits the hive's agents push as
project.ai_authorcounted as "other": only App-bot linkage made a commit the hive's. As a side effect,resignAdoptionCommitsappended the App'sSigned-off-byto a collaborator's unsigned commit pushed onto a hive branch. The App ended up asserting a DCO for someone else (security review finding).Decision taken by hive: the hive/other split is made identity-aware (App bot or a hive identity by GitHub login linkage) and in-place repair again requires every unsigned commit to be the hive's; a hive-authored PR carrying someone else's unsigned commit waits for a person instead of being superseded (#16648 contract kept).
stageDCOpassespolicy.HiveAuthorinto the split. ExistingdcoCommitStats*signatures keep the App-only behaviour.resignAdoptionCommitsis unchanged. It is shared with the supersede path, and the mode guard now keeps the in-place path from reaching non-hive unsigned commits.Tests: a stats test for the identity-aware split (with the nil-predicate and old-function behaviour unchanged), and the
adoptionDCORepairModecase updated so a hive-authored head with a non-hive unsigned commit returns "" (never supersede).Closes #16685
β hive: agent=scanner backend=copilot model=claude-fable-5.1 copilot=1.0.88