Skip to content

fix(pr-pipeline): stop counting stale verifier notes as untaken threads - #10727

Merged
kyle-sexton merged 2 commits into
mainfrom
fix/stale-note-not-untaken
Oct 28, 2026
Merged

kyle-sexton merged 2 commits into
mainfrom
fix/stale-note-not-untaken

Conversation

@kyle-sexton

Copy link
Copy Markdown
Member

No related issue: lane deadlock found on PR 10583

Summary

The pr-unblock address-feedback lane could deadlock a pull request. When the only unresolved threads were pr-verify fail notes from an older head, its select step stopped on feedback-untaken-threads and set a failing pr-unblock/address-feedback status. That status fails ci-status, so pr-require-checks concludes failure, and pr-verify, which runs only after that workflow succeeds (.github/workflows/pr-verify.yml), never runs. The pass that would resolve the stale notes (the pass-only round in address-feedback.mjs main) could therefore never arrive. Seen on #10583.

Fix

  • In select, the untaken-thread check now leaves out the threads staleVerifyNotes(threads, headSha) returns. Everything else is unchanged: keepThreads, the pass-only round, and how other threads are judged.
  • With only stale notes open, select skips not-applicable with resolved: true. Basis: report-stop-status clears a failing status only when stop-resolved is true (.github/workflows/pr-unblock.yml, the report-stop-status job condition), and ci-status fails while the newest pr-unblock/* status on the head is failure (pr-require-checks.yml). Returning resolved: false would leave the existing failure on a head that already has one, so the deadlock would continue.
  • The notes stay unresolved, so the merge still waits for them: the main ruleset sets required_review_thread_resolution: true.
  • A stale note next to any other untaken thread still escalates. So does an untaken fail note on the current head.

Verification

  • New tests in address-feedback.test.mjs. "stale verifier notes alone are no untaken thread" failed before the fix (escalate where skip/not-applicable/true was expected) and passes after it. The two guard tests passed before and after, and each one fails against a mutant that over-widens the exclusion (every thread excluded when any note is stale; every fail note treated as stale).
  • node --test passes on every .github/scripts/pr-unblock/*.test.mjs and on .github/scripts/pr-merge/merge-holds.test.mjs (address-feedback: 140 pass, 0 fail).
  • Left out: an end-to-end lane run. That needs a live PR with stale notes.

Related

N/A

🤖 Generated with Claude Code

kyle-sexton and others added 2 commits October 28, 2026 15:47
The address-feedback select step escalated feedback-untaken-threads when
the only unresolved threads were pr-verify fail notes from an older head.
Its failing status failed ci-status, so pr-verify never ran, and no pass
could arrive to resolve those notes through the pass-only round.

Leave the notes that staleVerifyNotes returns out of the untaken-thread
check, and report the stop resolved when nothing else is open, so
report-stop-status clears the status. The notes stay unresolved, so the
merge still waits on them.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@kyle-sexton
kyle-sexton marked this pull request as ready for review October 28, 2026 19:55
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 28, 2026 •

Copy link
Copy Markdown

Codex Review Summary

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-28T19:57:04.304738Z 10260bb 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

Copy link
Copy Markdown
Contributor

claude-review reviewed 10260bb20ae83715e64bb210dbcbc1a3ce1ce7bb: 0 finding(s), 0 as inline comments.

No findings. I read the full diff, the PR context, and the surrounding code in .github/scripts/pr-unblock/address-feedback.mjs. I did not run the tests, so the PR's pass counts are author-claimed and unverified.

  • The change: in select, the feedback-untaken-threads escalation now skips the ids that staleVerifyNotes(threads, headSha) returns. It uses thread.id, isResolved and the root shape from the same listThreads listing that staleVerifyNotes reads, so the exclusion matches the real data. That listing is also what the pass-only round in main uses (address-feedback.mjs:1068), so the notes cleared here are the same ones the pass later resolves.
  • Scope of the exclusion: staleVerifyNotes only returns open threads whose root is a github-actions[bot] comment with the fail-note marker and an original commit other than the current head. An untaken reviewer thread next to a stale note still escalates. So does a fail note on the current head. Both cases have tests.
  • Gating order: the gated check still runs before this branch, so a PR with the human-gated label still returns awaiting-human.
  • Returned values: the skip/not-applicable/resolved: true result is what stop-resolved reads to clear the failing status, which is the deadlock fix the PR describes.
  • Tests and changelog: the new tests cover stale-only, stale beside an untaken thread, and an untaken note on the current head. The patch fragment under .changes/pr-pipeline/ matches the change.
  • Merge hold: the stale notes stay unresolved, so the required-thread-resolution rule still holds the merge until a pass resolves them, as the PR says.

No hold: the change has no billing effect and no security impact.

@github-actions

Copy link
Copy Markdown
Contributor

claude-security-review reviewed 10260bb20ae83715e64bb210dbcbc1a3ce1ce7bb: 0 finding(s), 0 as inline comments.

No security issues found.

critical-findings: 0

I read the whole diff and the code it depends on. address-feedback.mjs is a trusted path and gates the pr-unblock lane's stop statuses.

What changed. In select, the "unresolved thread the lane did not take" check now ignores the ids staleVerifyNotes(threads, headSha) returns. When only those stale notes are open, the lane now returns skip/not-applicable with resolved: true instead of escalate/feedback-untaken-threads.

Checks against the trust-control and merge-hold lenses

  • Who can create a note that gets excluded. staleVerifyNotes (address-feedback.mjs:79-87) matches only unresolved threads whose root comment meets all of these:

    • its author's databaseId is MARKER_AUTHOR_ID (github-actions[bot], 41898282);
    • its first line is exactly ``;
    • its original commit is a valid 40-hex SHA that differs from the current head.

    Only a workflow using GITHUB_TOKEN can author as that bot. A PR author or a reviewer cannot forge such a thread, so no new untrusted input is admitted.

  • Scope of the exclusion. It applies only to those ids. A stale note next to any other unresolved thread still escalates, and a fail note opened on the current head still escalates. The new tests cover both cases.

  • What the cleared status was holding. The feedback-untaken-threads stop was a lane status. The stale notes stay unresolved, and the PR description says the main ruleset (required_review_thread_resolution: true) still blocks the merge until they are resolved. I did not read the ruleset itself. I found no unresolved-thread logic in pr-merge/merge-holds.mjs, so that merge hold rests on the ruleset. The notes are resolved only by the pass-only round (address-feedback.mjs:1052-1076), which runs only when VERIFY_PASS_HEAD equals the PR head. That round requires DISPATCHER_RUN_ID and a pr-verify pass at the current head.

  • No path to a merge. A stale note therefore cannot reach a merge without a pr-verify pass at this head. The change removes a lane stop that kept pr-verify from ever running; it does not weaken a verifier or a merge hold.

  • Manifests. The diff changes no plugin manifests, and the .changes entry is documentation only.

@kyle-sexton
kyle-sexton added this pull request to the merge queue Oct 28, 2026
Merged via the queue into main with commit 2d7836d Oct 28, 2026
75 checks passed
@kyle-sexton
kyle-sexton deleted the fix/stale-note-not-untaken branch October 28, 2026 20:17
@github-actions

Copy link
Copy Markdown
Contributor

Post-merge mutation testing

Killed 0, survived 0, timeout 0, no coverage 0, invalid 0, not run 7.
Covered-code score n/a; mutation score n/a.

File Killed Survived Timeout No coverage Invalid Not run
.github/scripts/pr-unblock/address-feedback.mjs 0 0 0 0 0 3
.github/scripts/work-resolve-issue/report-outcome.mjs 0 0 0 0 0 4

The run's summary has the full report.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant