Repository navigation
✨ auto-merge: an owner's approval of the head releases the human-merge-path hold (opt-in per repo) - #19015
Conversation
…e-path hold (opt-in per repo) New key auto_merge.human_merge_owner_approval, a list of owner/repo, empty by default. On a listed repository a trusted merger's explicit approval of a PR's current head releases the hold the human-merge-path gate put on it, and the merge lanes merge the PR once CI, review, soak and every other gate pass. Unlisted repositories keep today's rule and `/hive approve` reply word for word. - Approval: the workflow-path fence's (workflowFenceApproval: Approve review, dashboard approve, typed /hive decision approve) plus a trusted merger's /hive approve posted after the head was first seen. - Release: the stage-label pass, next to the stale-head lift, through ReleaseApprovedHumanMergePathHold. It shares the pin-only release's provenance checks, widened only so it may lift the hold on the head it was put on and a hold the App re-added on a later head; any person's hold application, another hold source, or a write-back refusal keeps the hold. The gate lets an approved head through instead of re-holding. - Audit: one comment per head names the approver and head, plus a log line. - 085 route asks for the approval instead of a manual merge; the /hive approve reply says "released for <sha>". - Dashboard multi-select with help mark, PUT/PATCH validation (400 for a repo outside project.repos), admin MCP auto_merge.update row. - Docs: hive-merge.md section, maintainer-commands.md, settings.md, admin-mcp.md, api-reference.md; changelog fragment. Refs Danathar/goodreads-mcp#463. Signed-off-by: Danathar <6772335+Danathar@users.noreply.github.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BQYnPGFJx81c8JXR3o1sg1
|
[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 |
There was a problem hiding this comment.
Style review (head a8efb46): no blockers. The change follows the repo's idioms: marker-comment audit trail, // writeback:gated annotations, a shared release body with the pin-only rules intact, and docs plus a changelog fragment.
Advisory notes, all inline:
automerge_human_merge_owner_approval.gouses bothlistIssueCommentsandlistAllIssueComments, which behave the same. Pick one.- The
writeback.ItemandHiveAuthoredconstruction appears twice and could be one helper. human_merge_path_release.gohas a redundantfirst/lastnil check.
-- hive: agent=ci-maintainer backend=claude model=claude-sonnet-5-5 claude=2.1.327
| return false | ||
| } | ||
| number := pr.GetNumber() | ||
| comments, err := c.listIssueComments(ctx, owner, repo, number) |
There was a problem hiding this comment.
Style: this file mixes listIssueComments (here and in the reply) with listAllIssueComments (stage-pass paths). Both paginate fully, so pick one to avoid implying a difference.
| appBot := strings.TrimSpace(c.transport.AppBotLogin()) | ||
| author := hgithub.SafeGetLogin(pr.GetUser()) | ||
| item := writeback.Item{Number: number, IsPR: true, Author: author, Labels: labelNames(pr.Labels), CreatedAt: pr.GetCreatedAt().Time, | ||
| HiveAuthored: appBot != "" && strings.EqualFold(normalizeBotLogin(author), normalizeBotLogin(appBot))} |
There was a problem hiding this comment.
Style: the writeback.Item literal with the HiveAuthored comparison is built here and again near line 207. A small helper would keep it in one place.
| eventsOpts.Page = resp.NextPage | ||
| } | ||
| if applied == nil { | ||
| if first == nil || last == nil || last.GetEvent() != "labeled" { |
There was a problem hiding this comment.
Style: first and last are set together, so first == nil || last == nil can be just last == nil.
|
@Danathar this PR is back in your court ( Failing checks:
Reply here or push a new head to this branch (same sign-off); CI and the review swarm re-run automatically and the PR returns to the normal path. Queued in your relay fix queue (0 waiting): fixes are handed out before new work as soon as you have capacity. |
|
Hive status — updated in place; edits do not notify. Full history is in the Activity Monitor. Review findings from This is a merge/trust-policy change, so I am routing it rather than judging the code alone. What I read (first ~300 lines of the diff; the stage-label release logic and the dashboard/UI parts were beyond what I opened): the new opt-in key is wired consistently through Why a person should decide: Suggestion, not a defect: the PR has no Review findings from Correctness review at a8efb46. I found no in-scope blocker, and one low advisory.
The rest of the change looks correct. The provenance widening in Review findings from Two things for this PR at head a8efb46. 1. CI is red. 2. Policy decision. This changes merge/trust policy: an approval releases the hold that I have not approved or closed anything. Evidence bundle `#190154655c9b` sha256:614e595e0f4bb486d34f2d140443b5107b13b533c50c7e3df269c67f5f6791b1 — download from the dashboard or `hivectl review evidence #19015`.merged by Hive trusted-author auto-merge: author |
…al comment humanMergeApprovalComment renders the head via stagelabels.ShortSHA, which trims to 7 characters; the test asserted an 8-character prefix, so it failed on every run. Assert the exact backticked 7-char form. Hive-Run: hivecommons#19015 Hive-Plan: fix-pr check-failure Hive-Spec: auto_merge.human_merge_owner_approval#audit-comment Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Danathar <Danathar@users.noreply.github.com>
|
Needs a decision, not a merge:
Head: verdict requires_human @31f64bf, 65/67 checks green, 2 pending, DCO yes, soak 0s of 10m0s. How to release it:
Clear the cause and the hive re-evaluates on its next pass; the stage moves to Updated 2026-11-18 16:29 UTC. |
Open PR overlap check✅ Resolved: no conflicting open PRs or same-file overlaps remain against |
There was a problem hiding this comment.
Decision needed: @clubanderson should a trusted merger's single approval (including a bare /hive approve reply) be able to release the hold on auto_merge.human_merge_paths for opted-in repositories, which widens the merge-trust policy?
Routing, not a defect report. This PR adds an opt-in per-repo setting that lets the App merge PRs touching human_merge_paths (often workflow, CODEOWNERS and hook files) after one trusted-merger approval of the head. That is a merge and trust policy change, so a maintainer should decide whether it lands.
What I read in automerge_human_merge_owner_approval.go: the design is careful. The release is opt-in and off by default. Approval is bound to the head, and an edited comment never counts. /hive approve must be posted after the head. Only an App-placed hold is removed, via the provenance check in ReleaseApprovedHumanMergePathHold, and another hold source blocks the release. One audit comment is posted per head. Admin-MCP adds are flagged as widening. Tests cover config, MCP, dashboard, stagelabels and the automerge path.
Open questions for the decider (not verified as defects):
/hive approveis newly accepted as approval (humanMergeOwnerApprovalFor, the loop over comments). DoesisTrustedMergerorworkflowFenceApprovalexclude the PR author approving their own head? I did not find that check in the new file; if a trusted merger can author a PR touching these paths and approve it themselves, one account replaces the two-person path.- The setting covers every path in
human_merge_pathsfor the repo, with no per-path scoping. Is that intended for repos that list workflow files?
Looks internally consistent otherwise; CI state is not in my verdict.
-- hive: agent=reviewer backend=claude model=claude-sonnet-5-5 claude=2.1.327
There was a problem hiding this comment.
Docs are thorough elsewhere, but the operator-reference key tables (src/docs/operator-reference/README.md:305, :615) still say a person must merge and have no row for auto_merge.human_merge_owner_approval. Suggested row is in the inline comment.
Findings not on a changed line
-
src/docs/operator-reference/README.md:615: Docs gap: thisauto_merge.human_merge_pathsrow (and the one at line 305) says a person must merge the PR, with pin-only as the only skip. It does not mention the newauto_merge.human_merge_owner_approval, and no key row exists for it. Add a row, e.g.:+| `auto_merge.human_merge_owner_approval` | `[]` (off) | List of `owner/repo`. In a listed repository a trusted merger's approval of the current head (Approve review, `/hive decision approve`, or `/hive approve` after the head was seen) releases the human-merge-path `hold`; every other gate still applies. See [hive-merge.md](../hive-merge.md#owner-approval-releases-the-human-merge-path-hold). |and append to this row: 'except in a repository listed in
auto_merge.human_merge_owner_approval'.
-- hive: agent=adjudicator backend=claude model=claude-sonnet-5-5 claude=2.1.327
…-merge-path hold Review asked whether a trusted merger who authors a PR touching a human_merge_paths file could approve it themselves. They could (typed /hive decision approve or /hive approve); reject any approval whose login is the PR author. Also add the missing auto_merge.human_merge_owner_approval row to the operator reference. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Signed-off-by: Danathar <Danathar@users.noreply.github.com>
Summary
Today a PR that touches a path in
auto_merge.human_merge_pathsis held, and a person must merge it by hand, even after the owner approves it. On Danathar/goodreads-mcp#463 the owner approved the head with/hive approve, GitHub required no review and reported the PR clean, and the hive still said a person must merge it.This PR adds an opt-in, per-repository key,
auto_merge.human_merge_owner_approval(a list ofowner/repo, empty by default). In a listed repository a trusted merger's explicit approval of the PR's current head releases the hive's human-merge-path hold. The hive then merges the PR once CI, review, soak, other holds, the sentinel and every other gate pass. The approval is not a merge override. Repositories not listed behave exactly as today, including the/hive approvereply.What counts as approval
These come from a trusted merger, bound to the current head:
/hive decision approve, typed or from the dashboard;/hive approveposted after the hive first saw the head. This is new for this feature; the workflow fence still ignores it.A new push needs a new approval. The fence's one carry-over still applies: an approval survives the hive's own update from the base branch when the diff is unchanged. Edited comments never count.
What is released, and what never is
holdthe gate put on, with the same provenance checks as the existing pin-only release:holdapplication in the PR's history being the App's.holda person added or re-added;human_merge_path_release) refuses.What people see
/hive approveon a listed repository: "released for<sha>; merges when the other gates clear". When no approval of the head is recorded yet, it lists the approvals that would release the hold.PUT/PATCH /api/config/auto-mergetakes the list and returns a 400 for a repository outsideproject.repos. The admin MCP'sauto_merge.updatepreviews and confirms it, and adding a repository is named as widening.Not changed
hive-mergerelay still refuses these PRs./hive approvereply keeps today's text.Notes against the brief
ReleaseHumanMergePathHoldhad no production callers, and it refuses the head the hold was put on, which is the case here. So I split it into a shared body. The pin-only rules are unchanged, andReleaseApprovedHumanMergePathHoldadds the approved-head rules.workflowFenceApprovaldoes not count/hive approve, the command used on goodreads-mcp#463. This feature adds it with the typed decision's head binding.Tests
pkg/github: approved-mode release table:pkg/github/automerge:/hive approvehead binding;/hive approvereply: listed and unlisted (exact current text).pkg/stagelabels: 085 actions.pkg/dashboard:pkg/adminmcp: preview, confirm and widening.pkg/config: the lookup.Run locally:
gofmt -lnode --checkcheck-docs-citations.py,check-docs-links.py,check-api-reference-citations.shNot run:
go test,go buildandgo vet, per AGENTS.md. CI decides.Appendix: code
src/pkg/config/review_config.go(HumanMergeOwnerApproval,HumanMergeOwnerApprovalFor)src/pkg/github/automerge/automerge_human_merge_owner_approval.gosrc/pkg/github/automerge/automerge_human_paths.go(humanMergePathGate)src/pkg/github/automerge/automerge_stage_labels.go(besideliftStaleHumanMergePathHold)src/pkg/github/human_merge_path_release.goautomerge_stage_human.go,automerge_human_merge_path_fence.go,src/pkg/stagelabels/human.go,src/pkg/stageengine/prstage/causes.gosrc/pkg/github/automerge/pr_approve_command.gosrc/cmd/hive/main.go,src/cmd/hive/main_sweeps.gosrc/pkg/dashboard/api_config_automerge.go,static-src/js/config-features.js,config-helpers.jssrc/pkg/adminmcp/tools_automerge_ops.go,tools_settings.go; effective-config key listsrc/pkg/dashboard/diag_config_value_keys.txt🤖 Generated with Claude Code
https://claude.ai/code/session_01BQYnPGFJx81c8JXR3o1sg1