Skip to content

fix(source-control): hold pr-merge enqueues on a human veto comment - #9308

Merged
kyle-sexton merged 8 commits into
mainfrom
fix/9216-pr-merge-human-veto-scan
Oct 23, 2026
Merged

kyle-sexton merged 8 commits into
mainfrom
fix/9216-pr-merge-human-veto-scan

Conversation

@kyle-sexton

@kyle-sexton kyle-sexton commented Oct 23, 2026 •

Copy link
Copy Markdown
Member

Refs: #9216

Summary

The third checkbox of #9216: pr-merge now checks a person's merge-veto comment (the HUMAN_MERGE_VETO_RE phrase) before it enqueues a pull request. Before this, the --authority pr-merge gate read labels and a Hold: body line before the enqueue but no comment text. A comment only counted after the pull request was queued, through lane_queued_at_head.

Fix

  • The autopilot tier's comment reading (human issue comments, review summaries and inline review comments) moves into the shared _human_comments reader. The tier's scan, human_blocking_logins, is unchanged.
  • The pr-merge path (--authority pr-merge, no tier) runs human_veto_logins. It holds when the newest comment from an OWNER, MEMBER or COLLABORATOR (author_association) matches HUMAN_MERGE_VETO_RE. A later comment from that person lifts the hold, and so does editing the veto away. Another person's comment does not lift it, and neither does an item with no text (an Approve with no comment, or the empty summary of an inline-only review). merge.agent-identity and bots count as automation. The blocker reads human merge veto from <logins> -- ....
  • The veto regex is unchanged. A bare "wait", or a blocking word such as "regression", holds nothing on the lane.
  • Docs: docs/conventions/pr-pipeline/README.md (The pr-merge lane) and the babysit_merge.py module docstring.

Verification

  • python3 -m unittest discover over plugins/source-control/skills/babysit-prs/scripts/tests (test_babysit_*.py): 2290 tests, OK, after merging origin/main (perf(pr-pipeline): cap each gate candidate so one slow PR cannot hold the queue #9301).
  • New tests cover: an issue-comment veto, an inline veto, a bare "wait", blocking words without a veto, a later comment from the same person lifting the veto, another person's comment not lifting it, an empty-body review not lifting it, NONE/CONTRIBUTOR/FIRST_TIME_CONTRIBUTOR vetoes holding nothing while OWNER/MEMBER/COLLABORATOR ones hold, a bot or lane-identity comment, another authority (no scan), the tier not repeating the scan, and a main() lane run refusing the enqueue. Each hold or lift test failed against the code before it.
  • scripts/check-affected.sh --tests: 13 passed, 1 skipped (pre-push, on the merged head).
  • Left out: the CI-only checks check-affected.sh lists, which run in CI.

Related

🤖 Generated with Claude Code

kyle-sexton and others added 2 commits October 23, 2026 00:20
…path

pr-merge's --authority pr-merge gate read labels and a body hold before
the enqueue but no comment text, so a person's "do not merge" comment
did not hold a lane pull request until after it was queued. The
autopilot tier's scan over human issue comments, review summaries and
inline review comments moves into human_blocking_logins, the tier calls
it unchanged, and the pr-merge path calls it when the tier is not
configured, with the lane identity counted as automation. The veto
regex is unchanged, so a bare "wait" holds nothing.

Refs: #9216

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@kyle-sexton kyle-sexton changed the title fix(source-control): hold pr-merge enqueues on a human do-not-merge comment fix(source-control): hold pr-merge enqueues on a human veto comment Oct 23, 2026
@kyle-sexton
kyle-sexton marked this pull request as ready for review October 23, 2026 04:32
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 23, 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-23T04:33:38.401370Z 1dc63ff 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 commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

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

Security review: PR #9308 (head 41fede1)

Result: no security issues found. No inline comments posted.

The PR adds a fail-closed control: the --authority pr-merge lane now holds an enqueue when an OWNER, MEMBER or COLLABORATOR's newest text-bearing comment matches HUMAN_MERGE_VETO_RE. I looked for ways the new gate could fail open and found none.

  • Association data: all three comment sources carry author_association. fetch_issue_comments and fetch_pull_request_reviews map it to authorAssociation, and the inline-comment dict built in _human_comments does the same. A veto from an OWNER, MEMBER or COLLABORATOR can't be skipped because the field is missing.
  • Lifting a veto: only the same login's later comment with text lifts it. Another person's comment doesn't, and neither does an empty-body Approve or inline-only review summary (if not body.strip(): continue). Editing the veto away is handled because the body is re-read each run.
  • Bots and the lane identity: these are filtered by actor_kind with extra_bot_logins={agent_identity}. An outside commenter on the public repo can't hold or lift a lane PR, since BLOCKER_ASSOCIATIONS limits it to OWNER, MEMBER and COLLABORATOR.
  • Timestamp ordering: at >= newest[login][0] compares string timestamps. All three sources use the same ISO-8601 Z format, so the string comparison orders them correctly.
  • Refactor: moving the tier's corpus reading into _human_comments keeps the tier path's behavior. human_blocking_logins still applies the same three predicates, and tier is None avoids scanning twice.
  • Fetch failures: I didn't trace what fetch_paginated_api does on an error.

Not a finding: the PR notes it uses the default token for the extra reads, a cost and consistency follow-up with no security effect.

Manifests: the PR has no plugin.json or marketplace.json changes, so there are no manifest <field> lines. No standing instruction is deleted or narrowed. The README change only adds a rule, so I did not consult the instruction exception register.

critical-findings: 0

@github-actions

github-actions Bot commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

claude-review reviewed 41fede13042bbcfc903f4510b9166c74b11a7dbf: 0 finding(s), 0 as inline comments.

Code review: no findings

I read the full diff and pr-context.md. I checked the new human_veto_logins reader and the evaluate hook against the code they call.

I did not run the tests: the sandbox refused the python3 -m unittest runs. The PR's 2290-test result is author-claimed and I have not confirmed it.

What I checked

  • Gate scope: The pr-merge scan runs only when tier is None and the authority is PR_MERGE. The autopilot tier keeps its own wider scan, and the shared reader leaves that scan's behavior unchanged.
  • Association filter: merge_policy.BLOCKER_ASSOCIATIONS is {OWNER, MEMBER, COLLABORATOR} (babysit_merge_policy.py:142). Issue comments and inline comments carry authorAssociation through babysit_gh.py:982 and :1111, so the filter works on all three sources. Review summaries come from the same normalized reader.
  • Newest-wins logic: Timestamps are ISO-8601 UTC strings, so the string comparison orders them correctly. Empty bodies are skipped, so an Approve with no text or an inline-only review summary does not lift a veto. A tie at the same timestamp goes to the later corpus item, which is rare and harmless.
  • Bots and the lane identity: These are classified out through actor_kind with the lane identity added as an extra bot login.
  • Tests: They cover each documented branch: lift, no-lift by another person, empty review, association matrix, bot and identity, other authority, the tier not repeating the scan, and an end-to-end main() run through the lane.
  • Manifests and closing issue: The diff changes no plugin.json or marketplace.json, so there is nothing to compare. The PR uses Refs: #9216 and the context file has no closing-issue section, so there are no acceptance criteria to check.

Minor, not blocking

  • The _human_comments return annotation list[tuple[str, str, str]] (babysit_merge.py:72) does not match the four-element tuples it returns, which its docstring describes. A type checker would likely flag it. I did not post this as a finding.

kyle-sexton and others added 2 commits October 23, 2026 00:41
…-not-merge comment

The lane path reused the tier's full scan, which matched blocking words
such as "regression" and had no release: a veto held every later run
until the comment was deleted. The lane now holds only when a person's
newest comment, review or inline comment matches HUMAN_MERGE_VETO_RE,
so a later comment from them ("go ahead") lifts it. The tier's scan is
unchanged; both read one shared corpus helper.

Refs: #9216

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Comment thread docs/conventions/pr-pipeline/README.md Resolved
kyle-sexton and others added 4 commits October 23, 2026 00:53
GitHub records an inline-only review, and an Approve with no text, as a
review summary with an empty body and a later submittedAt, so the
newest-item rule let that empty summary lift the veto with nothing said.
Items with no text no longer count as anyone's newest comment.

Refs: #9216

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…and collaborators

On a public repository any commenter could hold a lane pull request.
The lane veto now reads only comments whose author_association is
OWNER, MEMBER or COLLABORATOR (the policy's BLOCKER_ASSOCIATIONS);
everyone else's comments hold nothing and do not count as newest.

Refs: #9216

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@kyle-sexton
kyle-sexton added this pull request to the merge queue Oct 23, 2026
Merged via the queue into main with commit c2f93ef Oct 23, 2026
53 of 54 checks passed
@kyle-sexton
kyle-sexton deleted the fix/9216-pr-merge-human-veto-scan branch October 23, 2026 05:26
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