Skip to content

πŸ› fix(stage): retry a failed 085 escalation note, once per head and reason - #15043

Merged
hivecommons-hive[bot] merged 1 commit into
hivecommons:v6from
Danathar:fix/085-escalation-note-retry
Oct 28, 2026
Merged

hivecommons-hive[bot] merged 1 commit into
hivecommons:v6from
Danathar:fix/085-escalation-note-retry

Conversation

@Danathar

Copy link
Copy Markdown
Contributor

Summary

PRs moved to stage/085-needs-decision with no explaining comment, ever.

#650 and #652. projectbluefin/utah-packages on 2026-10-26: in one sweep #646, #654 and #658 each got their <!-- hive:adoption-stalled … hive-signoff-attribution --> note, and #650 and #652 got nothing. The hive's own log shows why:

14:28:56Z WARN stage labels: adoption escalation note failed  pr=650  POST …/issues/650/comments: 500
14:29:01Z WARN stage labels: adoption escalation note failed  pr=652  POST …/issues/652/comments: 500

The note was never retried. escapeStalledAdoption called MarkAdoptionEscalated (which also set AdoptEscalationNotedHead) before CreateComment, so a failed post left the head marked as explained. The same mark-before-post order was in the three workflow-path refusal paths and in escalateUnadoptableFork (#15018).

Two related defects:

The 080 flip on projectbluefin/utah#919. It went 085 β†’ 080 β†’ 085 within two minutes on an unchanged head: 10-26 14:13 to 14:15 (check-failure) and 10-28 09:25 to 09:27 (fork-rehome-refused). An errored lane observation whose approved head looks done on the author's side reads 080 at role rank. 080 does not yield to adoption, so the escalation hold was skipped for that pass and the active 085 was dropped.

Change

  • Store (pkg/stagelabels/store.go):
    • MarkAdoptionEscalated records the escalation (head and reason) only.
    • The new MarkAdoptionEscalationNoted is called after CreateComment succeeds.
    • AdoptionEscalationNoted(head, reason) checks the new AdoptEscalationNotedReasons (JSON adopt_escalation_noted_reasons, omitempty).
    • A new head starts the list over, and yield or clear resets it.
  • All five note sites (automerge_contributor_adopt.go) go through postAdoptionEscalationNote, which marks the note only after it posts. In the hold branch:
    • a missing workflow-refusal note is retried;
    • a changed or never-posted stall reason falls through to the stall path, which updates the reason and posts.
  • A weak opinion does not drop an escalation. stageengine.HoldsEscalation is used in both ApplyStageLabels and the engine's passDecision, so enforce mode derives the same stage. A non-terminal opinion below owned rank that is not 085 and does not yield to adoption keeps an active escalation on the current head at 085 with its recorded reason. The next owned opinion re-evaluates it.
  • Legacy records. A record with a noted head and no reasons counts as noted for every reason on that head, the rule EntryCommentExplains uses. An upgrade therefore causes no repost, at the cost that a PR whose post already failed before this ships (fix: CONNECT proxy ECONNRESET β€” write 200 on hijacked connΒ #650, fix: revert VTScreen, fix CLI chrome detection for agent summariesΒ #652) gets its note only when its head moves.
  • Docs: labels-and-control-signals.md and hive-merge.md now say "once per (head, reason), retried until it posts".
  • Changelog: changelog.d/fixed-085-escalation-note-retry.md.

Testing

From src/, TZ=UTC, -count=1:

  • go test ./pkg/github/automerge/ ./pkg/stagelabels/ ./pkg/stageengine/... passes.
  • go build ./..., go vet and gofmt are clean.
  • The changelog, docs-links and docs-citations checks pass.

New tests:

  • A failed post is retried. A 500 on the stall note, the fork note and the workflow-refusal note is retried on the next sweep, once.
  • Reason changes. A changed reason on the same head posts a second note; flapping back to an already-noted reason posts nothing.
  • Legacy records repost nothing.
  • An errored, approved lane keeps an escalated adoption and an escalated fork PR at 085 with no label churn.
  • Engine parity: an owned 095 and a weak 085 are not overridden.

The fake API gained failComments / failCommentsOn. Four existing fixtures now seed the note explicitly, because "escalated" no longer implies "noted".

Mutation checks: 13 mutants, each restored from a backup copy, and every one fails a test. They cover:

  • marking the note before the post;
  • per-head-only dedupe and legacy dedupe;
  • the hold branch's reason and noted logic;
  • the workflow-refusal retry;
  • the fork-site dedupe;
  • the live and engine holds removed;
  • the rank and 085 guards;
  • reasons carried across heads.

Not verified, or still open

  • A workflow-path refusal whose lane later says 085 itself (for example no-reviewer) never reaches the escape branch, so that note is not retried. The lane's 085 entry comment still explains the PR.
  • Records escalated before πŸ› automerge: adoption escalation ignores optional checks, releases when the reason clearsΒ #13044 (2026-10-19) that have no noted head and are still on the same head get one stall note after the upgrade. Nothing on disk tells them apart from a failed post.
  • The hold covers any weak opinion. It keeps 085 against any weak opinion at or past the merge gate, not only the errored-lane 080. A head whose lane only ever gives a weak opinion stays at 085 until an owned one arrives.
  • Not run on a live hive.

Contributor checklist

  • Changelog: changelog.d/fixed-085-escalation-note-retry.md.
  • Targets v6.
  • The title uses the emoji convention.
  • Commits include DCO sign-off.
  • Docs updated (src/docs/labels-and-control-signals.md, src/docs/hive-merge.md).
  • No secrets, credentials or local runtime state are committed.

πŸ€– Generated with Claude Code

https://claude.ai/code/session_01BQYnPGFJx81c8JXR3o1sg1

…eason

The adoption escalation marked the head noted before posting its note, so
when GitHub answered the adoption-stalled note with a 500 the PR sat at
stage/085-needs-decision with no comment on that head ever
(projectbluefin/utah-packages#650 and hivecommons#652, 2026-10-26). The same
mark-before-post pattern was in the three workflow-path refusal paths and
in escalateUnadoptableFork.

- stagelabels: MarkAdoptionEscalated records the escalation only; the new
  MarkAdoptionEscalationNoted records (head, reason) after the post
  succeeds. AdoptionEscalationNoted(head, reason) checks both, so a new
  blocker on the same head gets its own note (mirrors EntryCommentExplains,
  hivecommons#13139). A record from before reasons were kept (noted
  head, no reasons) reads as noted for every reason on that head, so the
  upgrade reposts nothing.
- automerge: all five call sites post through postAdoptionEscalationNote.
  The held-escalation branch of escapeStalledAdoption retries an unposted
  workflow-path refusal note, and hands an unposted or changed stall reason
  to the stall path instead of holding silently.
- Hold an active escalation against a weak opinion: an errored lane on an
  approved head reads 080 at role rank, which the adoption pin does not
  claim, so the pass dropped the escalation for a sweep and
  projectbluefin/utah#919 flipped 085 -> 080 -> 085 on one head (10-26,
  10-28). stageengine.HoldsEscalation is shared by the live pass and
  passDecision so enforce mode derives the same stage.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BQYnPGFJx81c8JXR3o1sg1
Signed-off-by: Danathar <Danathar@users.noreply.github.com>
@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 clubanderson 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
@github-actions

Copy link
Copy Markdown
Contributor

Open PR overlap check

Base branch: v6

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

PR Title Relation Files
#15029 ✨ feat(contribute): record the blocker a relay's blocked verdict names same files src/docs/labels-and-control-signals.md
#15035 πŸ› fix(automerge): hold merges whose closing keywords would close the wrong thing same files src/docs/labels-and-control-signals.md
#14945 πŸ› fix: release label-blocked serialized lane fronts during sweeps same files src/docs/labels-and-control-signals.md
#15038 πŸ› fix(automerge): do not merge the base into a PR on a merge-queue-only base same files src/docs/labels-and-control-signals.md

@hivecommons-hive hivecommons-hive Bot added author/clanker A contributor's own hive authored this PR under their login 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 merged commit 839bd57 into hivecommons:v6 Oct 28, 2026
66 of 69 checks passed
@hivecommons-hive

Copy link
Copy Markdown
Contributor
Evidence bundle `#15043e20290d` sha256:fd640175c94ee921afe208c8ce0f886c10ae93880487b1518497fa2967a767ac β€” download from the dashboard or `hivectl review evidence #15043`.

@hivecommons-hive

Copy link
Copy Markdown
Contributor

merged by Hive trusted-author auto-merge: author @Danathar holds role owner and GitHub permission maintain on repo; CI green at e20290d.

@hivecommons-hive hivecommons-hive Bot removed 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author/clanker A contributor's own hive authored this PR under their login 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.

1 participant