From 92b1521880ea67122c8531a26d8e544d88dcb951 Mon Sep 17 00:00:00 2001 From: Danathar Date: Wed, 28 Oct 2026 13:34:00 -0400 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20fix(stage):=20make=20085=20asks?= =?UTF-8?q?=20agree=20on=20the=20workflow-path=20fence?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit One PR got two contradicting 085 notes (projectbluefin/testsuite#1037): the entry comment said no approval overrides the manual-merge rule, while the sign-off attribution / adoption-stalled note asked for an Approve review. Since hivecommons/hive#14664 a trusted merger's Approve review on the head releases the contributor-lane workflow-path fence when the owner-approval toggle is on and the App can merge workflow files. - Evidence/Route carry ApprovalReleasesFence (set in humanEvidence from the lane reason or the head's diff fence). DecisionActions then asks for the Approve review (not `/hive approve`), notes it also settles a requires_human verdict, and keeps the sentinel/hold steps; the header reads "Needs a decision, not a merge". Absolute rules keep today's text. - The diff-fence fallback's cause text now uses the head's fence standing instead of always saying "never merges unattended". - mergeCommitRefusalText drops the approve route when the head is under a rule no approval overrides (Detail.ManualMergeRule), names the rule, and names an open sentinel alert (Detail.SentinelAlert). The facts are filled only right before the once-per-head note, reusing the cached per-head diff fence read. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01BQYnPGFJx81c8JXR3o1sg1 Signed-off-by: Danathar --- .../fixed-085-ask-matches-workflow-fence.md | 1 + src/docs/hive-merge.md | 5 +- src/docs/labels-and-control-signals.md | 15 ++- .../automerge_adoption_escape_test.go | 54 ++++++++++ .../automerge/automerge_contributor_adopt.go | 74 ++++++++++++-- .../automerge/automerge_merge_commit.go | 1 + .../automerge_signoff_attribution_085_test.go | 99 ++++++++++++++++++- .../github/automerge/automerge_stage_human.go | 8 +- ...automerge_stage_human_manual_merge_test.go | 96 ++++++++++++++++++ src/pkg/stageengine/prstage/types.go | 9 ++ src/pkg/stagelabels/human.go | 33 ++++++- src/pkg/stagelabels/human_test.go | 68 +++++++++++++ 12 files changed, 444 insertions(+), 19 deletions(-) create mode 100644 changelog.d/fixed-085-ask-matches-workflow-fence.md diff --git a/changelog.d/fixed-085-ask-matches-workflow-fence.md b/changelog.d/fixed-085-ask-matches-workflow-fence.md new file mode 100644 index 0000000000..ee259d8991 --- /dev/null +++ b/changelog.d/fixed-085-ask-matches-workflow-fence.md @@ -0,0 +1 @@ +- `stage/085-needs-decision` notes no longer contradict each other on a PR that edits CI workflow files (projectbluefin/testsuite#1037): when a trusted merger's approval releases the `contributor-lane:workflow-path` fence ([#14664](https://github.com/hivecommons/hive/issues/14664)), the entry comment's **What to do** asks for that GitHub **Approve** review instead of saying no approval helps, and still lists the sentinel alert and hold labels to clear; when the lane never merges the head unattended (tests removed, human-merge path, or a workflow fence the approval cannot release), the sign-off attribution and adoption-stalled notes offer only the by-hand merge with a merge commit and name the rule, and an open sentinel alert is named in them too. diff --git a/src/docs/hive-merge.md b/src/docs/hive-merge.md index 1b7c6ad769..2248e13a9d 100644 --- a/src/docs/hive-merge.md +++ b/src/docs/hive-merge.md @@ -556,7 +556,10 @@ A PR merges through this tier only when all of the following hold: attributed to the maintainer and bound to the head) or a trusted merger's own `/hive decision approve` comment posted after the head. Approval on an earlier head never counts: a new push re-arms the fence and the 085 note - reads "awaiting owner approval … re-approve after a push". When released + reads "awaiting owner approval … re-approve after a push"; its **What to + do** asks for that review (a `/hive approve` reply does not release the + fence) and still lists a sentinel alert or hold label a person must clear + (projectbluefin/testsuite#1037). When released the lane logs `workflow-path fence released by owner approval login=… head=…`, leaves one `` audit comment per head, and the PR goes through every other gate below like any diff --git a/src/docs/labels-and-control-signals.md b/src/docs/labels-and-control-signals.md index fb2dcbc2ad..8235e0e874 100644 --- a/src/docs/labels-and-control-signals.md +++ b/src/docs/labels-and-control-signals.md @@ -230,7 +230,7 @@ referenced it) a lone `stage/050-review-pending` | `stage/072-returned-to-contributor` | PR | clanker PR (`author/clanker`, relay or external hive): CI red / changes requested / conflicting; the hive posted its diagnosis, the ball is in the contributor hive's court. (Briefly spelled `stage/072-needs-author` by [#12713](https://github.com/hivecommons/hive/pull/12713); the engine renames that label back in place) | 24h | | `stage/074-adopted-by-hive` | PR | the author (a clanker) was unavailable — relay offline, never registered, or silent past the grace (see below); the hive took the PR over: in place on the PR's own branch when it may push there (the scanner's red-PR fix kick rebases and fixes it), otherwise via `hive/adopt-` and a superseding App PR that keeps the author's commits (the original closes automatically when the superseder merges). Adoption is an **ownership** state, not a CI state: the PR reads 074 for as long as the hive owns it — through its fixes going pending, green, reviewed or red again (074 outranks 050/060/070/071/072) — and leaves 074 only at the merge gate (080/085/090/100), when the adoption is released, or to 085 `adoption-stalled:` when the head sat unchanged past the dwell with CI idle and a real blocker the hive cannot push past — a red optional check alone never counts, and the escalation releases back to 074 as soon as the reason clears (an in-place adoption with a blocking review finding re-homes to `hive/adopt-` first instead; one with a squash-unsafe hive commit elects a merge commit on a `role/trusted` PR — `merge-method/merge` label, lane continues — and otherwise immediately re-homes to an App-authored superseder (`signoff-rehome`), preserving commits and sign-offs while changing squash attribution; loss of push access re-homes immediately, and idle rebase work re-homes after the dwell). For in-place adoption, a changed head must be linked to the App bot by GitHub commit metadata (the stage store only remembers heads that already passed that check); otherwise the hive treats it as a contributor push and hands the PR back (072 if red, else the normal path). Forgeable git author/committer names and emails never keep 074. A PR whose author holds **admin** or **maintain** on the repository is never adopted or re-homed (one cached permission read per repo and author per 10 minutes; a failed read is not cached and defers: no adoption, and an existing adoption is neither released nor re-homed until the read succeeds), and an adoption of such an author is released on the next pass, closing a still-open hive superseder with a note first. A fork PR is never superseded or re-homed into the base repository (that would run unreviewed fork code with the repository's trusted CI); it parks at `085` as `adoption-stalled:fork-rehome-refused` instead. | 3h | | `stage/080-awaiting-merge-admission` | PR | nothing left for the author: CI green (no red check on the head, required or not), verdict approve, no modifiers — and the automerge lane has not admitted it yet (prefilter not evaluated for this head, labels not synced, lane tripped). A stall here means a lane problem, so the hive also posts one `` comment with the lane's last skip reason | 30m | -| `stage/085-needs-decision` | PR | **PR-only** since the owner decision of 2026-10-17 (issues park at `stage/045-needs-decision`; before that this stage carried both, [#12683](https://github.com/hivecommons/hive/issues/12683)). A person owes a **decision**, not a merge: a `requires_human` swarm verdict (reason `reviewer-verdict:requires_human`), `sentinel-alert`, `hold` / `do-not-merge*` / `needs-decision` modifier, no reviewer configured, GitHub workflow approval is required for a trusted same-repo bot/App/clanker PR (`workflow-approval-required:`); Hive has posted `/ok-to-test` and is waiting for the repo-local `hive-ok-to-test` workflow or a maintainer, or a human-only lane rule unrelated to trust (workflow-path edits, tests removed, human-merge path, reporter-trust hold), or an open issue the PR closes is held or parked (`linked-issue:hold:#N: