Repository navigation
Description
Problem
The hive's contributor adoption (stage 074 and supersession) takes over a PR whose author has admin or maintain permission on the repository. It treated a repo admin as an "offline contributor" 16 minutes after nudging them, then closed their PR and re-opened it on a hive-owned branch.
Adoption exists to stand in for a contributor relay that went quiet. A maintainer of the repository is not that: they own the branch, can merge it themselves, and closing their PR adds a duplicate and a confusing close/merge sequence.
Evidence
projectbluefin/utah-packages#619 by hanthor. GET /repos/projectbluefin/utah-packages/collaborators/hanthor/permission returns admin. The PR came from an in-repo branch, feat/canary-fork-pr. All times below are 2026-10-25 UTC.
| Time | Event |
|---|---|
| 17:15Z | Labelled author/clanker, role/trusted |
| 17:37Z | 072 nudge to @hanthor (failing pass3 / rebuild0 … check) |
| 17:53Z | <!-- hive:adopted … reason=contributor-offline mode=in-place … -->: "your hive has been offline since the nudge" |
| 18:10Z | <!-- hive:adopted … reason=dco-rehome mode=supersede superseded_by=621 … -->: projectbluefin/utah-packages#619 closed by the hive, re-opened as projectbluefin/utah-packages#621 on hive/adopt-619 |
| 19:11Z | @hanthor merged projectbluefin/utah-packages#619 themselves |
| 19:15Z | projectbluefin/utah-packages#621 closed |
Where
At v6 becce0a8c:
src/pkg/github/automerge/automerge_stage_labels.go:1007: the 07x interrupt runs nudge and adoption for anyauthorkind.Clankerauthor. Kind comes from labels and relay registration, not from repository permission.src/pkg/github/automerge/automerge_contributor_adopt.go:552(adoptContributorPR): gates onadoptionDue,adoptionBlocked(labels)and the diff fence. Nothing reads the author's permission on the repository.src/pkg/github/automerge/automerge_contributor_adopt.go:610(supersedeAdoptedPR) andAdoptReasonDCORehomeat:100: the second takeover, which shut ci(canary): let a maintainer run Canary on a reviewed fork pull request (#369) projectbluefin/utah-packages#619 and opened a replacement.
Proposed change
- Before adopting (
adoptContributorPR) and before any supersession or DCO re-home of an adopted PR, read the author's permission once withGET /repos/{owner}/{repo}/collaborators/{author}/permission. Cache the result per (repo, author) for a sweep window, so this is not a call per PR per sweep. - If the permission is
adminormaintain, do not adopt. Leave the PR at 071/072 and post one note per head saying the hive will not take over a maintainer's PR. - An already-live adoption of such an author should be released on the next pass and never re-homed.
- If the read fails, fail closed: do not adopt.
Acceptance criteria
- A PR whose author has
adminormaintainon the repo is never moved to 074, superseded or DCO re-homed, whatever its author kind or presence. - A
write-or-lower clanker author is adopted exactly as today. - The permission read is cached, and a failed read does not adopt.
Test plan
In src/pkg/github/automerge:
- Table tests for the gate:
admin,maintain,write,read, and an API error. - An
ApplyStageLabelstest, in the style ofautomerge_contributor_adopt_test.go, where an admin-authored clanker PR past the adoption grace stays at 072 and posts nohive:adoptedcomment. - A test that a live in-place adoption of an admin author is released and not re-homed.
Out of scope
- Changing how author kind (
author/clanker) is derived. - The fork-trust problem in DCO re-home, filed separately.
🤖 Generated with Claude Code
Activity
hivecommons-hive commentedon Oct 25, 2026
🔒 Claimed by @arteeh (contributor on hive hosted-available-oke-11-placeholder-r05x). The claim lasts 30m0s without activity and renews while the work continues. Reply
/unclaimto release, or/claimto take it over if you outrank the holder.hivecommons-hive commentedon Oct 25, 2026
🔓 Claim by @arteeh released (lease revoked).
Danathar commentedon Oct 25, 2026
Superseded by a PR that implements the fix directly: #14305
🐛 fix: prevent contributor adoption of maintainer PRs (#14320)