From d9c0c9e22c165dd5b7932eb5213cc5641a156542 Mon Sep 17 00:00:00 2001 From: Danathar <6772335+Danathar@users.noreply.github.com> Date: Tue, 17 Nov 2026 17:27:06 -0500 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20adoption:=20a=20red=20optional?= =?UTF-8?q?=20check=20escalates=20where=20auto-merge=20is=20off?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The stall escape never counted a red optional check (#13040: the lane merges past it, so nothing is a person's to decide). On a repo whose auto-merge is off the lane only observes and a person merges, so an adopted PR red only on an optional check sat at 074 with nothing for the hive to push and nobody asked (projectbluefin/actions#752, 35h). Count it there like any other red check: past the 074 dwell with CI idle it escalates to 085 adoption-stalled:optional-check-failing:, and the note says the check is optional and a person may merge past it. Where the hive merges, the #13040 exclusion is unchanged. Signed-off-by: Danathar <6772335+Danathar@users.noreply.github.com> Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01BQYnPGFJx81c8JXR3o1sg1 --- ...d-adopted-optional-check-auto-merge-off.md | 1 + src/docs/hive-merge.md | 5 ++-- .../stage-labels.md | 13 ++++---- .../automerge_adoption_escape_test.go | 30 +++++++++++++++++++ .../automerge/automerge_contributor_adopt.go | 21 +++++++++++-- 5 files changed, 60 insertions(+), 10 deletions(-) create mode 100644 changelog.d/fixed-adopted-optional-check-auto-merge-off.md diff --git a/changelog.d/fixed-adopted-optional-check-auto-merge-off.md b/changelog.d/fixed-adopted-optional-check-auto-merge-off.md new file mode 100644 index 0000000000..b43edf84a3 --- /dev/null +++ b/changelog.d/fixed-adopted-optional-check-auto-merge-off.md @@ -0,0 +1 @@ +- An adopted PR whose only blocker is a red optional check no longer sits at `stage/074-adopted-by-hive` forever on a repo whose auto-merge is off. There the hive only observes and a person merges, so once the head sits unchanged past the 074 dwell with CI idle it moves to `stage/085-needs-decision` (`adoption-stalled:optional-check-failing:`), and the note says the check is optional and a person may re-run it, fix it or merge past it. Where the hive merges, a red optional check alone still never escalates ([#13040](https://github.com/hivecommons/hive/issues/13040)); seen on projectbluefin/actions#752. diff --git a/src/docs/hive-merge.md b/src/docs/hive-merge.md index 18185fca26..6f06646952 100644 --- a/src/docs/hive-merge.md +++ b/src/docs/hive-merge.md @@ -1661,8 +1661,9 @@ red — goes to `stage/085-needs-decision` as per head and reason, retried until GitHub accepts it), so the dashboard shows a person's item, not a silent 074; "waiting on maintainer lgtm" is only ever the state at 080+ (hivecommons/hive#12858). The dwell runs -from the head's last hive push, a red optional check alone is not a blocker, -and the escalation releases back to 074 when its reason clears +from the head's last hive push, a red optional check alone is not a blocker +unless the repo's auto-merge is off (a person merges there, +projectbluefin/actions#752), and the escalation releases back to 074 when its reason clears (hivecommons/hive#13040). The issues a PR covers follow it: once the sweep stages a PR at 050 or later, the enumeration cycle writes the same stage on each linked issue (`stage/040-covered-by-pr` until diff --git a/src/docs/labels-and-control-signals/stage-labels.md b/src/docs/labels-and-control-signals/stage-labels.md index 47746e17b5..ee4c99115f 100644 --- a/src/docs/labels-and-control-signals/stage-labels.md +++ b/src/docs/labels-and-control-signals/stage-labels.md @@ -113,7 +113,7 @@ referenced it) a lone `stage/050-review-pending` | `stage/070-fixing` | PR | hive-owned repair: App/taken-over PR red, changes requested (by the swarm, or by a trusted human's **changes requested** review / `/hive decision ` on the current head — reason `human-changes-requested`, which also kicks the author agent with the text verbatim, [#13041](https://github.com/hivecommons/hive/issues/13041)) or needs-rebase, **or** a non-App PR whose red head was caused by a hive-pushed commit that must be removed/re-homed; a hive agent is reworking it | 2h | | `stage/071-needs-author` | PR | human-authored PR (`author/human`): CI red / changes requested / conflicting; the hive posted its diagnosis, the author must act. No nudge, no adoption — the person pushes or comments | 24h | | `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, including when every commit pushed to it after the copy was taken is the hive's own; a later commit by anyone else leaves it open with a note). The review fixer never pushes to a superseded original's branch: fixes go to the copy. 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 a 085 whose only cause is the review swarm's `requires_human` / decision request — the hive answers that on the superseding PR, so the original leaves the merge gate for the CI/Review column with an "Adopted → #N" pill in the adopting pass, never "Needs human decision" (hivecommons/hive#14975 → #14980, #14947 → #14977); a hold, sentinel alert, `needs-human` a person applied, fork-guard or manual-merge lane rule keeps 085) — 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, the dwell waits while the fixer queue lists the head and no fixer kick has carried it yet (capped at four dwells; not applied when the fixer is unavailable), 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). So a fork PR is adopted only in place, when the hive can push to the fork's branch; one it cannot push to is not adopted at all. It stays at `072` with its author's nudge and queued `fix-pr` task, and parks at `085` as `adoption-stalled:fork-rehome-refused` only after the `072` dwell (24h) since the nudge on that head. An in-place fork adoption that can no longer be finished on the fork's branch parks there at once. | 3h | +| `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, including when every commit pushed to it after the copy was taken is the hive's own; a later commit by anyone else leaves it open with a note). The review fixer never pushes to a superseded original's branch: fixes go to the copy. 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 a 085 whose only cause is the review swarm's `requires_human` / decision request — the hive answers that on the superseding PR, so the original leaves the merge gate for the CI/Review column with an "Adopted → #N" pill in the adopting pass, never "Needs human decision" (hivecommons/hive#14975 → #14980, #14947 → #14977); a hold, sentinel alert, `needs-human` a person applied, fork-guard or manual-merge lane rule keeps 085) — 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 unless the repo's auto-merge is off (a person merges there), the dwell waits while the fixer queue lists the head and no fixer kick has carried it yet (capped at four dwells; not applied when the fixer is unavailable), 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). So a fork PR is adopted only in place, when the hive can push to the fork's branch; one it cannot push to is not adopted at all. It stays at `072` with its author's nudge and queued `fix-pr` task, and parks at `085` as `adoption-stalled:fork-rehome-refused` only after the `072` dwell (24h) since the nudge on that head. An in-place fork adoption that can no longer be finished on the fork's branch parks there at once. | 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`), 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: