Skip to content

fix(pr-merge): mark the unarmed refusal comment superseded once armed - #18807

Merged
kyle-sexton merged 3 commits into
mainfrom
fix/supersede-unarmed-comment-on-arm
Nov 24, 2026
Merged

kyle-sexton merged 3 commits into
mainfrom
fix/supersede-unarmed-comment-on-arm

Conversation

@kyle-sexton

@kyle-sexton kyle-sexton commented Nov 24, 2026 •

Copy link
Copy Markdown
Member

Closes #18876

Summary

enable-auto-merge leaves its <!-- babysit-merge-risk --> refusal comment ("native auto-merge leaves this pull request unarmed at head ...") in place after a later run pins the head and arms native auto-merge. A merged pull request then still says it is unarmed, as on #18737.

Fix

  • After a successful arm, enable-auto-merge.mjs edits each of the lanes App's own refusal comments on that pull request to say the arm at that head superseded it. A new pure helper, supersededRefusals, selects them by the same author and first-two-lines marker test priorRefusal uses.
  • A stack's bottom layer is never armed: its merge goes through the async merge. Once GitHub accepts that request, or answers 409 because one is already pending, the same rewrite runs, saying the lane requested the async merge of this stack layer at that head. A failed result or a refused request rewrites nothing. Both paths share one supersede helper.
  • The rewrite carries no marker, so priorRefusal, clear-escalations and the CI Status human-gated reason reader no longer take it for a standing refusal, and a later refusal starts afresh.
  • Edit, not delete: the comment keeps its place on the timeline and GitHub keeps its edit history, so the reasons it gave stay readable.
  • A failed edit logs a warning and leaves the arm or merge request standing. A failed arm, a report-only run, or a person's comment edits nothing.
  • docs/conventions/pr-pipeline/README.md states the new behavior, with a patch fragment for the pr-pipeline convention.

Verification

  • node --test --test-concurrency=4 over every .github/scripts/pr-merge/*.test.mjs: all pass at the earlier head. node --test --test-concurrency=4 .github/scripts/pr-merge/enable-auto-merge.test.mjs at d307301 (the review-feedback round plus the const supersede = async spacing fix): 251 pass, 0 fail.
  • Three tests cover the edit at the armed head with no marker left, the no-edit cases, and the failed edit. Six existing arm-after-escalation tests now expect the edit as well. A new test covers a stack bottom layer's accepted and already-pending async merge, and checks that a refused one leaves the note.
  • With the hook given an empty comment list, the presence tests fail (checked by hand).
  • markdownlint-cli2 on the README: 0 issues. scripts/check-changelog-fragments.sh --check-required origin/main: passes.

Related

  • #18737 and #18763: both showed the stale unarmed comment after merging.

🤖 Generated with Claude Code

enable-auto-merge left its "unarmed at head" refusal comment in place
after a later run pinned the head and armed native auto-merge, so a
merged pull request still said it was unarmed. After a successful arm it
now edits each of its own refusal comments to say the arm at that head
superseded it. The rewrite carries no marker, so refusal readers no
longer take it for a standing refusal; the edit history keeps the
reasons. A failed edit warns and leaves the arm standing.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@kyle-sexton
kyle-sexton marked this pull request as ready for review November 24, 2026 15:31
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-24T15:34:30.629139Z 3679d84 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@github-actions github-actions 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.

claude-review: 1 inline finding(s) on 3679d84c0407f77568be29a3ad30d6dea915593a; the summary is in this lane's pull request comment.

claude-lane: claude-review

@github-actions

github-actions Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

claude-review reviewed d307301f497a3c2388eab79e57410c9ba438b0f6: read 1 of 1 changed file(s); 0 finding(s), 0 as inline comments.

Code review (incremental, blocking only): PR #18807, 4f46e4f → d307301

No findings in this push. This lane already reviewed an earlier head (blocking only: yes), so this review looks for blocking findings only.

I read the whole incremental diff for the one file in scope, .github/scripts/pr-merge/enable-auto-merge.mjs. The push changes one line: const supersede =async (...) becomes const supersede = async (...) (enable-auto-merge.mjs#L1743). It only adds a space, so behaviour does not change and nothing new is reachable.

Prior findings. The one earlier inline finding was the stale "unarmed" note on a stack's bottom layer. It was resolved at 4f46e4fc, and this push does not touch that code.

Closing issue: none (the PR body says "No related issue").

Loosened checks: the wrapper gave no loosened_check_verdict: or loosened_check_patterns: lines, so I used verdict fail with no consumer entries. No decision-record line was given, so the citation requirement was not checked. No changed line loosens a check. Loosened checks would be marked: n/a, no loosened check found.

Not verified by me: I ran nothing. Any test or lint results in the PR are the author's claims.

Verifier dropped 0 of 0 candidates.

@github-actions

github-actions Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

claude-security-review reviewed d307301f497a3c2388eab79e57410c9ba438b0f6: read 1 of 1 changed file(s); 0 finding(s), 0 as inline comments.

Security review (incremental since 4f46e4f, blocking only): no findings

I read the one hunk this push changes in the one file in scope, .github/scripts/pr-merge/enable-auto-merge.mjs. The change is whitespace only: const supersede =async becomes const supersede = async (enable-auto-merge.mjs#L1743). The helper's parameters and body are unchanged, so it still behaves as the last review described.

This file is a merge-hold control and a trusted path, so I checked it as one. The push weakens no hold. It also changes nothing about token scope, trusted actors, the kill switch, what untrusted text reaches a lane, or plugin manifests.

This review was blocking only, because this lane already reviewed an earlier head.

critical-findings: 0

Lane-Activity: pr-unblock/address-feedback
Lane-Thread: PRRT_kwDOTCGFQM67ce5N
@melodic-automation-lanes

Copy link
Copy Markdown
Contributor

pr-unblock / address-feedback finished round 1 of max 4 on 4f46e4f.

@github-actions

Copy link
Copy Markdown
Contributor

The pr-verify verifier failed head 4f46e4fc5ea13f114f3cee6f0d93acabf406894d. What it wrote, as data:

Summary: PR #18807 (fix(pr-merge): mark the unarmed refusal comment superseded once armed) has no
  spec. spec-text.json is empty: the body says "No related issue: hub daily-pass finding
  L1103/L1108", links no issue, and there is no trusted pull-request entry. With no spec to judge
  against, the verdict has to be fail. Read on its own merits, the diff looks coherent. A new
  `supersede` helper in `.github/scripts/pr-merge/enable-auto-merge.mjs` edits the lanes App's own
  refusal comments after a successful arm, and also after the stack bottom layer's async merge is
  accepted or answers 409. It matches comments the same way `priorRefusal` does: Bot author, App
  login, and the marker in the first two lines. A failed edit only logs a warning and leaves the arm
  standing. The rewritten text carries no marker. New tests cover the arm path, the async-merge path
  (accepted, already pending, refused), failed arm, report-only, a person's comment, and a failed
  edit. The README and a changelog fragment were updated. Nothing in the diff touches the takeover
  set, secrets or holds. The CI evidence settles nothing: in upstream-jobs.json, Select Tests is
  skipped, so this was a re-run that ran no suite and neither proves nor rules out a pass.
- PR body: add a trusted spec. Either file an issue for the stale 'unarmed at head' refusal comment
  and add `Closes #<n>` to the body, or have a trusted person write the title and body.
  spec-text.json has no entry right now, and 'No related issue: hub daily-pass finding' gives the
  verifier nothing to judge the diff against.
- .github/scripts/pr-merge/enable-auto-merge.mjs:1743: add the missing space in `const supersede
  =async` (make it `const supersede = async`) so it matches the file's formatting and passes lint.

This pull request leaves the merge queue, and ci-status holds it out while it carries pr-verify-failed. A pr-verify pass removes the label, at a new commit or at this same head: once a trusted person edits the body, and only trusted people have edited it since the fail, this head is judged again, so a fail on the body or the issues it links needs only the body fixed, no new commit.

@github-actions github-actions Bot added the pr-verify-failed pr-verify failed this head; a pass at a new commit, or after a trusted body edit, removes it. label Nov 24, 2026
`const supersede =async` becomes `const supersede = async`, matching
the file's formatting, as the pr-verify fail note asked.

Refs: #18876

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@github-actions github-actions Bot removed the pr-verify-failed pr-verify failed this head; a pass at a new commit, or after a trusted body edit, removes it. label Nov 24, 2026
@kyle-sexton
kyle-sexton added this pull request to the merge queue Nov 24, 2026
Merged via the queue into main with commit 7939a08 Nov 24, 2026
100 of 103 checks passed
@kyle-sexton
kyle-sexton deleted the fix/supersede-unarmed-comment-on-arm branch November 24, 2026 20:44
@github-actions github-actions Bot added the merge-path: owner-agent Post-merge accounting record (README.md, Merge paths) label Nov 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge-path: owner-agent Post-merge accounting record (README.md, Merge paths)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Mark the stale unarmed refusal comment superseded once enable-auto-merge arms the pull request

1 participant