Skip to content

πŸ› Activity Monitor: an owner's Approve admits the untrusted-author PR head β€” no adoption, merge as-is; DCO warned before acting - #15156

Merged
hivecommons-hive[bot] merged 1 commit into
v5from
fix/owner-approve-admits-untrusted-pr
Oct 29, 2026
Merged

hivecommons-hive[bot] merged 1 commit into
v5from
fix/owner-approve-admits-untrusted-pr

Conversation

@clubanderson

Copy link
Copy Markdown
Member

Fixes #15136

Live evidence (hive's hive 17:53–17:55 ET): the operator pressed Approve on untrusted-author PRs #15029/#15086/#15090; the approval was reduced to /lgtm + /approve comments and the contributor lane's claim-tier rule then adopt-superseded them β€” "I approved these and then they went to adopted…".

Policy change β€” Approve is the trust override for that head

  • Every Approve variant (approve, queue-merge, merge-now) writes admitted_by: operator-approval:<login> (+ admitted_head, admitted_at) on the stage record before touching GitHub; response + audit carry admitted_by.
  • Contributor lane: an operator admission admits the author for that head (contributor-lane:operator-approval, merge comment names who admitted it); hive merges as-is after checks/soak, or immediately for merge-now.
  • Adoption engine: while the admission stands, adoptContributorPR refuses (adopt_blocked_by: operator-admission; row reads not adopted: a maintainer approved this head; the hive merges it as-is). An explicit Adopt / Re-author request is the person choosing re-authoring and is not refused.
  • /hive decision approve by a trusted merger is the same admission, derived from the recorded human approval and written back.
  • 090 tooltip/popover say Approved by @login as the owner decision…; the second Approve greys out with the reason.

DCO before acting

  • When the record's commit check counted unsigned commits (dco_unsigned/dco_total on the row), the popover blocker and both Approve confirms say so before acting, and a separate lead action Re-author as hive PR (decision: re-author) appears β€” queues adoption with its own note, never merges; disabled with the reason on a person's PR.

Tests

  • automerge: TestOperatorAdmissionRefusesAdoption (approve-on-untrusted β†’ admitted, no adoption; explicit Adopt proceeds), TestOperatorAdmissionDerivedFromHumanApproval, TestOperatorAdmissionAbsent, admit-path/merge-comment helpers.
  • dashboard: TestRepoItemDecisionApproveAdmitsTheHead (approve/queue-merge/merge-now), TestRepoItemDecisionApproveWithoutRecordAdmitsNothing, TestRepoItemDecisionReauthorQueuesAdoptionWithItsOwnNote, decision-options subtests (DCO + admitted), ledger mapping, SPA renderer TestStageTrackerReauthorAndApprovalCaveats.
  • stagelabels: TestStoreAdmission.

Docs: dashboard-sections.md, operator-reference.md; changelog changelog.d/fixed-owner-approve-admits-untrusted-pr.md.

@kubestellar-prow kubestellar-prow Bot added the dco-signoff: yes Indicates the PR's author has signed the DCO. label Oct 28, 2026
@kubestellar-prow

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign hanthor for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@kubestellar-prow kubestellar-prow Bot added the size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. label Oct 28, 2026
clubanderson added a commit that referenced this pull request Oct 28, 2026
Generated by changelog-fragment-guard from the PR title (#5675).
Edit the wording freely, or replace this file with the no-changelog
label if the change is not user-visible.

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Signed-off-by: clubanderson <407614+clubanderson@users.noreply.github.com>
@github-actions

github-actions Bot commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

Open PR overlap check

Base branch: v5

Conflicts are checked with every PR merged onto the current tip of v5, so a PR that only needs a rebase is not reported as conflicting with its siblings.

PR Title Relation Files
#15134 πŸ› Delegated decision on a capability gap: model the blocker, stop the un-park/re-park loop, name the missing App permission same files src/docs/dashboard-sections.md
src/docs/operator-reference.md
src/pkg/dashboard/stage_tracker.go
src/pkg/dashboard/stage_tracker_decision.go
src/pkg/dashboard/stage_tracker_row_actions_test.go
src/pkg/dashboard/static/index.html
#15122 πŸ› Write-back containment: per-kind gate for every unsolicited GitHub write, with backfill guard same files src/docs/operator-reference.md
src/pkg/dashboard/static/index.html
#15085 ✨ Activity Monitor: Adopt now and Reroute to another clanker for PRs waiting on a contributor's clanker CONFLICT src/pkg/dashboard/api_repo_item_decision.go
src/pkg/dashboard/operator_actions.go
src/pkg/dashboard/operator_actions_test.go
src/pkg/dashboard/static/index.html
src/pkg/github/automerge/automerge_contributor_adopt.go
src/pkg/stagelabels/store.go
#15150 πŸ› Activity Monitor: persist the merged count in a server ledger, pin the Merged chip, banner and bee flight on merge same files src/docs/dashboard-sections.md
src/pkg/dashboard/stage_tracker.go
src/pkg/dashboard/static/index.html
#14807 ✨ dashboard: stream Job pod logs in the terminal pane for sandbox.runtime: job agents same files src/pkg/dashboard/static/index.html
#15104 πŸ› Activity Monitor: Rebase, then merge as maintainer; fixer owns parked conflicting PRs; dismiss self-inflicted changes_requested CONFLICT src/docs/dashboard-sections.md
src/docs/operator-reference.md
src/pkg/dashboard/api_repo_item_decision.go
src/pkg/dashboard/stage_tracker_decision.go
src/pkg/dashboard/stage_tracker_row_actions_test.go
src/pkg/dashboard/static/index.html
#14822 πŸ› fix: preserve owner intent through PR decision paths same files src/pkg/github/automerge/automerge_contributor_lane.go
src/pkg/github/automerge/automerge_contributor_lane_test.go
#15157 ✨ Conflict-aware merge train in the automerge lanes same files src/docs/dashboard-sections.md
src/docs/operator-reference.md
src/pkg/dashboard/stage_tracker.go
src/pkg/dashboard/stage_tracker_decision.go
src/pkg/dashboard/static/index.html
src/pkg/github/automerge/automerge_contributor_lane.go
#15118 πŸ› fix: open the needs-human popover on issue rows with a parked PR same files src/pkg/dashboard/static/index.html
#15158 πŸ› fix: close issues for contributor PRs merged by the hive same files src/docs/operator-reference.md

@github-actions github-actions Bot added the conflicts-with-open-pr Open PR has a merge conflict with another open PR label Oct 28, 2026
@hivecommons-hive

Copy link
Copy Markdown
Contributor

@clubanderson is auto-promoted for contributor-lane merging on this PR: the last 5 merged PRs by this author in this hive's repositories have no revert or sentinel-alert evidence. CI, reviewer verdict, diff fences, soak, holds and branch protection still apply.

@hivecommons-hive hivecommons-hive Bot added author/human A person pushed this PR themselves dco All commits are DCO signed-off role/trusted Author is trusted for unattended merge (trusted-author role or registry/claim tier in require_tiers) stage/050-review-pending Review swarm requested; awaiting a verdict for the current head labels Oct 28, 2026
@hivecommons-hive hivecommons-hive Bot added stage/071-needs-author Human-authored PR: CI red, changes requested or conflicting; diagnosis posted, the author must act and removed stage/050-review-pending Review swarm requested; awaiting a verdict for the current head labels Oct 28, 2026
@hivecommons-hive

Copy link
Copy Markdown
Contributor

@clubanderson this PR is held at stage/071-needs-author and the hive will not merge it yet.

Failing checks:

  • changelog-fragment-guard

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.

@hivecommons-hive

Copy link
Copy Markdown
Contributor

@clubanderson this PR is held at stage/071-needs-author and the hive will not merge it yet.

Failing checks:

  • changelog-fragment-guard

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.

@hivecommons-hive hivecommons-hive Bot added stage/050-review-pending Review swarm requested; awaiting a verdict for the current head and removed stage/071-needs-author Human-authored PR: CI red, changes requested or conflicting; diagnosis posted, the author must act labels Oct 28, 2026
@hivecommons-hive hivecommons-hive Bot added stage/071-needs-author Human-authored PR: CI red, changes requested or conflicting; diagnosis posted, the author must act stage/050-review-pending Review swarm requested; awaiting a verdict for the current head and removed stage/071-needs-author Human-authored PR: CI red, changes requested or conflicting; diagnosis posted, the author must act stage/050-review-pending Review swarm requested; awaiting a verdict for the current head labels Oct 28, 2026

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Decision needed: @clubanderson should decide whether a dashboard Approve by any collaborator with GitHub write permission (the bar canToggleRepoHold enforces) is meant to admit an untrusted-author head for as-is merge, or whether the record path in operatorAdmission should require isTrustedMerger like the comment-derived path does.

Conclusion: the mechanism is coherent and builds clean at 75d27b7, but (1) CI is red on a fragment-shape problem, and (2) the trust bar the dashboard path actually enforces is weaker than the one #15136 and this PR's own second admission source state. The second point is a policy choice for the owner, not a code defect I can settle.

1. changelog-fragment-guard failure (blocking, trivial)

  • changelog.d/fixed-owner-approve-admits-untrusted-pr.md:1 has no leading - bullet; the guard rejects it (run 40785543482: "a fragment must start with a '- ' entry bullet").
  • changelog.d/fixed-15156.md:1 is a second fragment for the same PR (the title-autofix one), so two entries will compile for one change, and its text reads PR head no adoption β€” the dash between them was lost.
    Suggest keeping one fragment, bulleted.

2. Trust bar: write permission vs trusted merger (medium, security)

  • src/pkg/dashboard/api_repo_item_decision.go:271 gates every row decision with canToggleRepoHold, which passes for owner-role, the repo owner, or any user whose GetPermissionLevel is write (src/pkg/dashboard/api_repo_hold.go:75-114).
  • handlePullRequestDecision then calls admitPullRequestHead (api_repo_item_decision.go:597), which writes admitted_by: operator-approval:<login> unconditionally.
  • In the lane, operatorAdmission (src/pkg/github/automerge/automerge_operator_admission.go:33-38) returns that login straight from rec.Admission(head) with no isTrustedMerger check β€” whereas the comment-derived path three lines below (:40-45) refuses unless isTrustedMerger(login) is configured and true.

Consequence: a write-permission collaborator who is not in the hive's merger set can press Approve β€” let hive merge and the contributor lane merges an untrusted author's head under the hive's identity after soak; the same person's /hive decision approve comment would be refused. #15136 scopes this to "an owner / trusted-merger Approve". merge-now already merges at the write-permission bar today, so this is a widening of deferred merge rather than a brand-new capability β€” which is why I'm routing it rather than calling it a defect. If write permission is the intended bar, a one-line note in operator-reference.md saying so would close the gap; if not, operatorAdmission should apply the same isTrustedMerger check to the record path (and admitPullRequestHead could skip writing when the server can see the user is not a merger).

What I checked and found correct

  • Record.Admission (stagelabels/store.go:1251-1257) compares the head, so a new push drops the admission as the comment promises; NoteAdmission is idempotent on the same head/by.
  • adoptionRefusedByAdmission (automerge_operator_admission.go:60-73) is skipped when requested is set, so an explicit Adopt / Re-author still wins; it is called before maintainerHoldsAdoption in adoptContributorPR (automerge_contributor_adopt.go:595).
  • admitContributor orders the operator path after adoptedHeadOwnedByHive and before the registry path (automerge_contributor_lane.go:619-624), matching the issue's "admitted before the registry / claim-marker paths".
  • go build of pkg/dashboard, pkg/github/automerge, pkg/stagelabels passes at this head (tests are CI-only for me).

I have not approved, requested changes, or closed anything.

β€” hive: agent=reviewer backend=copilot model=claude-fable-5.1 copilot=1.0.88

@hivecommons-hive hivecommons-hive Bot added stage/050-review-pending Review swarm requested; awaiting a verdict for the current head and removed stage/071-needs-author Human-authored PR: CI red, changes requested or conflicting; diagnosis posted, the author must act labels Oct 28, 2026

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Decision needed: @clubanderson should decide whether a dashboard Approve by a user who only holds GitHub write permission (not a configured trusted merger / owner) may write admitted_by and admit an untrusted author's head to contributor-lane auto-merge, or whether admitPullRequestHead must be gated on the trusted-merger check the /hive decision approve path already applies.

The mechanism is sound and the adoption refusal is wired where it needs to be; one trust-bar question and one reproducible CI failure.

1. Two admission sources, two different trust bars (merge/trust policy β€” needs an owner call). #15136 scopes this to "an owner / trusted-merger Approve". The engine's comment-derived path honours that: src/pkg/github/automerge/automerge_operator_admission.go:40-46 takes recordedHumanApprovalForHead only if isTrustedMerger(login) is configured and true. The stage-record path does not: lines 33-38 return rec.Admission(head) as-is. That record is written by admitPullRequestHead from the dashboard (src/pkg/dashboard/api_repo_item_decision.go:473 and :597), and the only authorisation in front of it is canToggleRepoHold (:271), which passes a verified owner role, the repo owner, or any signed-in user with GitHub write permission (src/pkg/dashboard/api_repo_hold.go:74-114, cached). Consequence: a write-permission collaborator who is not in the hive's trusted-merger set can, with the plain approve decision (which until this PR only posted a comment), admit an untrusted author's head so the lane merges it under the App identity after soak, and adoptionRefusedByAdmission then keeps the adoption engine off it. If write-permission is the intended bar, say so in the PR body and docs (the title and issue both say "owner"); if not, admitPullRequestHead should consult the same merger authoriser, or the engine should re-check AdmissionLogin(by) against isTrustedMerger before trusting the record.

2. changelog-fragment-guard is red and reproduces locally. bash src/scripts/check-changelog-fragment.sh v5 at 75d27b7 β†’ ::error file=changelog.d/fixed-owner-approve-admits-untrusted-pr.md::a fragment must start with a '- ' entry bullet. The branch also carries a second, autofixed fragment changelog.d/fixed-15156.md for the same change (with a dropped em-dash: "PR head no adoption"). Keep one, starting with - .

What I checked and found correct: admitContributor ordering (adopted-head β†’ operator β†’ registry β†’ claim marker, automerge_contributor_lane.go:619-627) matches the issue's "admitted before the registry / claim-marker paths"; adoptionRefusedByAdmission is called before maintainerHoldsAdoption and skips when the Adopt/Re-author label was requested (automerge_contributor_adopt.go:595), so an explicit Re-author is not blocked by the admission it follows; Record.Admission is head-scoped so a new push drops the override; NoteAdmission returns false without an existing record and the lane's second source covers that case. go build ./pkg/dashboard/ ./pkg/github/automerge/ ./pkg/stagelabels/ passes.

β€” hive: agent=reviewer-2 backend=copilot model=claude-fable-5.1 copilot=1.0.88

@hivecommons-hive hivecommons-hive Bot added stage/071-needs-author Human-authored PR: CI red, changes requested or conflicting; diagnosis posted, the author must act and removed stage/050-review-pending Review swarm requested; awaiting a verdict for the current head labels Oct 28, 2026
… head β€” no adoption, merge as-is; DCO warned before acting

An owner/maintainer Approve (approve, queue-merge or merge-now) on a
contributor-lane PR is now a trust override for that head: the stage
record carries admitted_by: operator-approval:<login>, the contributor
lane admits the author for that head (contributor-lane:operator-approval)
and merges as-is after checks and soak, and the adoption engine refuses to
adopt or supersede while the admission stands (adopt_blocked_by:
operator-admission) unless the person explicitly asks for it. A /hive
decision approve by a trusted merger is the same admission, derived from
the recorded approval and written back.

When the head cannot merge as-is (commits without a Signed-off-by) the
090 popover and both Approve confirms say so before acting and offer
"Re-author as hive PR" as a separate decision (re-author), which queues
adoption with its own note and never merges.

Fixes #15136

Signed-off-by: Andrew Anderson <andy@clubanderson.com>
@clubanderson
clubanderson force-pushed the fix/owner-approve-admits-untrusted-pr branch from 75d27b7 to c2cd366 Compare October 28, 2026 23:43
@hivecommons-hive hivecommons-hive Bot added stage/050-review-pending Review swarm requested; awaiting a verdict for the current head and removed stage/071-needs-author Human-authored PR: CI red, changes requested or conflicting; diagnosis posted, the author must act labels Oct 28, 2026
@hivecommons-hive
hivecommons-hive Bot merged commit e49a693 into v5 Oct 29, 2026
80 of 82 checks passed
@kubestellar-prow
kubestellar-prow Bot deleted the fix/owner-approve-admits-untrusted-pr branch October 29, 2026 00:00
@hivecommons-hive

Copy link
Copy Markdown
Contributor
Evidence bundle `#15156c2cd366` sha256:94d3d20df5a395faaffe99d2752ca54c35f6e6c8993c431f6b32357e9c2015a6 β€” download from the dashboard or `hivectl review evidence #15156`.

@hivecommons-hive

Copy link
Copy Markdown
Contributor

merged by Hive trusted-author auto-merge: author @clubanderson holds role owner and GitHub permission admin on repo; CI green at c2cd366.

@github-actions

Copy link
Copy Markdown
Contributor

Thank you for your contribution! Your PR has been merged.

We'd love to hear how your experience was: share feedback

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

Labels

author/human A person pushed this PR themselves conflicts-with-open-pr Open PR has a merge conflict with another open PR dco All commits are DCO signed-off dco-signoff: yes Indicates the PR's author has signed the DCO. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Owner Approve on an untrusted-author PR is reduced to a comment, then the contributor lane adopt-supersedes it

1 participant