Skip to content

🐛 bug: contributor adoption takes over a repository maintainer's own PR (admin author adopted as contributor-offline, then re-homed) #14301

Closed as not planned

Description

@Danathar

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 any authorkind.Clanker author. Kind comes from labels and relay registration, not from repository permission.
  • src/pkg/github/automerge/automerge_contributor_adopt.go:552 (adoptContributorPR): gates on adoptionDue, 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) and AdoptReasonDCORehome at :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 with GET /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 admin or maintain, 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 admin or maintain on 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 ApplyStageLabels test, in the style of automerge_contributor_adopt_test.go, where an admin-authored clanker PR past the adoption grace stays at 072 and posts no hive:adopted comment.
  • 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

https://claude.ai/code/session_01BQYnPGFJx81c8JXR3o1sg1

Activity

  1. added
    bugSomething isn't working
    kind/bugCategorizes issue or PR as related to a bug.
    priority/important-soonMust be staffed and worked on either currently, or very soon, ideally in time for the next release.
    on Oct 25, 2026
  2. added
    help wantedDenotes an issue that needs help from a contributor. Must meet "help wanted" guidelines.
    on Oct 25, 2026
  3. hivecommons-hive commented on Oct 25, 2026

    @hivecommons-hive
    Contributor

    🔒 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 /unclaim to release, or /claim to take it over if you outrank the holder.

  4. hivecommons-hive commented on Oct 25, 2026

    @hivecommons-hive
    Contributor

    🔓 Claim by @arteeh released (lease revoked).

  5. Danathar commented on Oct 25, 2026

    @Danathar
    ContributorAuthor

    Superseded by a PR that implements the fix directly: #14305

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinghelp wantedDenotes an issue that needs help from a contributor. Must meet "help wanted" guidelines.kind/bugCategorizes issue or PR as related to a bug.priority/important-soonMust be staffed and worked on either currently, or very soon, ideally in time for the next release.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions