Skip to content

fix(source-control): stop the merge gate failing its force-push read on other timeline items - #15895

Merged
kyle-sexton merged 3 commits into
mainfrom
fix/merge-gate-force-push-count
Nov 13, 2026
Merged

kyle-sexton merged 3 commits into
mainfrom
fix/merge-gate-force-push-count

Conversation

@kyle-sexton

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

Copy link
Copy Markdown
Member

No related issue: lane-merge defect found on #15846 by the hub's hourly sweep 2026-11-13 (the merge gate's force-push read fails on any pull request with other timeline items)
session: GitHub Support

Summary

pr-merge held #15846 (green, reviewed, CLEAN) unarmed with "risk score (unreadable: RuntimeError: #15846 force pushes: unread or incomplete)". _force_pushed_heads in babysit_merge.py compared the force-push nodes it read with the connection's totalCount. On timelineItems(itemTypes:[HEAD_REF_FORCE_PUSHED_EVENT]), totalCount counts every timeline item on the pull request, not only force pushes. So the check raised on every pull request that reaches this read and has any timeline item that is not a force push.

Before this fix, a pull request that changes a lane source needing a main-run review could never be armed by the gate; after it, such a pull request arms when its recorded reviews bind, which is the designed behavior.

Fix

  • _FORCE_PUSHES_QUERY no longer asks for totalCount, and _force_pushed_heads no longer compares a count with the nodes.
  • The listing counts as whole only when its last page answers hasNextPage: false. A page whose hasNextPage is missing, null or not a boolean now raises. Before, the code treated that as the last page and relied on the count check to catch a short read.
  • A node that is not an object, or has no beforeCommit key, now raises "force pushes: unread". Before, the code skipped it as if its old commit were gone. A dropped replaced head loosens the gate, because _main_reviews takes the highest CRITICAL count across heads. A real {"beforeCommit": null} (the old commit is gone) is still accepted and names no head.
  • Unchanged raises: a page that is not an array, a next page with no cursor, and a listing past _FORCE_PUSH_PAGES (10).
  • The check this gives up is a cross-check of the nodes against a total. That check never held: GitHub documents no field that counts only the filtered items (see Verification).
    • The measured filteredCount matched the force-push node count in both samples (0 and 1). It is not used, because the docs describe it as applying only the before/after filters.
  • No vendored copies exist: scripts/shared-copies.txt has no entry for this file, and it is the only babysit_merge.py in the tree. No SKILL.md or agent body changed, and no eval case loads this script's text (a grep of plugins/source-control/evals finds neither babysit_merge nor the error text).

Verification

Related

🤖 Generated with Claude Code

https://claude.ai/code/session_01RMa43yD6ENjKAwDyeHp3bc

GitHub's timelineItems totalCount counts every timeline item, whatever
itemTypes names, so _force_pushed_heads raised "unread or incomplete" on
any lane-source pull request with a timeline item that is not a force
push. The listing is now whole only when its last page says
hasNextPage: false; a missing or malformed pagination answer raises.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RMa43yD6ENjKAwDyeHp3bc
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 13, 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-13T07:38:15.409181Z 832d67a PR opened
ℹ️ 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 Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

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

Security review: PR #15895, head 41d56e1 (incremental since ce41198)

I found no security issues. This was an incremental review, and I read the whole incremental diff for the one file in scope: plugins/source-control/skills/babysit-prs/scripts/tests/test_babysit_merge.py.

What changed. One two-line comment in test_a_page_with_no_pagination_answer_raises was reworded. It now says a totalCount equal to the nodes proves nothing, and only a pagination answer says the listing is whole. No code, fixture or assertion changed.

Scope checks.

  • The file does not match any trusted-path glob. It is a test, not one of the listed babysit-prs/scripts/*.py modules.
  • No token, secret, trusted actor, workflow permission, untrusted-text path, plugin manifest or merge-hold logic changed.
  • No standing instruction was deleted or softened.
  • The other changed files, including the trusted-path file babysit_merge.py, are unchanged since ce41198, which this lane reviewed with 0 findings.

Prior findings. This lane already reviewed an earlier head (blocking only: yes), so this review reports only CRITICAL and IMPORTANT findings. It found none at any severity. The one prior post is the earlier head's summary with 0 findings, so nothing carries over.

critical-findings: 0

@github-actions

github-actions Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

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

Code review: no blocking findings. This lane already reviewed an earlier head, so this pass reports blocking findings only.

What changed since ce411987. One file changed, test_babysit_merge.py, and only a comment. The comment in test_a_page_with_no_pagination_answer_raises (L2956-L2957) used to describe how the code behaved before the fix. It now states the rule: a totalCount equal to the nodes proves nothing, and only a pagination answer says the listing is whole. That is what the test checks. It feeds totalCount: 1 with one node and a missing, empty or null pageInfo, and expects a RuntimeError each time. No code or assertions changed. I read the whole incremental diff (1 of 1 listed files).

Not verified by me. I have no shell and ran nothing, so the test results are the author's claim.

Closing issue. The PR closes no issue, so there are no acceptance criteria to check.

Verifier dropped 0 of 0 candidates.

kyle-sexton and others added 2 commits November 13, 2026 02:43
A node that is not an object or has no beforeCommit key was skipped as
if its old commit were gone, dropping a replaced head whose recorded
CRITICAL count the gate must carry. It now raises; a real
beforeCommit: null still names no head.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RMa43yD6ENjKAwDyeHp3bc
The comment described what the code did before the fix; it now states
the rule the test pins.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RMa43yD6ENjKAwDyeHp3bc
@kyle-sexton
kyle-sexton added this pull request to the merge queue Nov 13, 2026
Merged via the queue into main with commit 7b9c622 Nov 13, 2026
52 checks passed
@kyle-sexton
kyle-sexton deleted the fix/merge-gate-force-push-count branch November 13, 2026 08:04
@github-actions github-actions Bot added the merge-path: owner-agent Post-merge accounting record (README.md, Merge paths) label Nov 13, 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.

1 participant