Skip to content

Read a Closed Read-Back as Unmerged in pr_review.py merge - #3737

Merged
ptr727 merged 4 commits into
developfrom
feature/merge-promotion-findings
Nov 1, 2026
Merged

ptr727 merged 4 commits into
developfrom
feature/merge-promotion-findings

Conversation

@ptr727

@ptr727 ptr727 commented Nov 1, 2026 •

Copy link
Copy Markdown
Owner

Why

Copilot's round on promotion #3736 found that pr_review.py merge reports a pull request read back CLOSED after the merge call as MERGE_NOT_CONFIRMED, exit 2, "may still land on the server". A closed pull request cannot merge later, so a driver following drive-pr step 4 was sent to read back a merge that cannot have happened.

What

  • A read-back of CLOSED is status=REFUSED, exit 1, nothing merged, whatever gh answered. The scripts/README.md contract says so.
  • It shares the branch an OPEN refusal already takes, so pr_merge.py stays under its size ceiling. The first push's separate branch tripped test_pr_review_size.py in CI. The line now names the state it read and what gh answered, or nothing where the call never finished.
  • A test covers gh exit 0, exit 1, and a call that never finished. It fails on the previous code, which returned exit 2 for each.

The same round's other two findings are answered on #3736 rather than changed here:

  • Retargeted base: ready() already re-checks the base on the read after the gate, at scripts/pr_merge.py in merge().
  • Cleanup skipped on PEER_MERGED: scripts/README.md "pr_merge.py" and drive-pr step 4 state this as the contract.

Local review

Two local-strict-review passes ran at the frontier tier.

  • The first raised 3 findings. A redundant base check I had added was dropped, together with its README claim. The closed read-back test's subtests now read only their own output.
  • The second raised nothing.
  • After the CI ceiling failure, the third raised 1: the shared branch named a gh refusal that had not happened. The fourth raised nothing.
  • The full suite of 3249 tests passes locally.

🤖 Generated with Claude Code

ptr727 and others added 2 commits October 31, 2026 22:09
…erge

The base was last checked before the gate's read, so a pull request
retargeted while the gate ran could still be squashed into its new base.
A pull request that reads back closed after the merge call cannot merge
later, so it is a refusal rather than an unconfirmed merge.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ready() already refuses a retargeted base on the read after the gate, so
the second check only narrowed a window no check can close, since the
merge call cannot pin a base. The closed read-back subtests now read
only their own output.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copilot AI lite review requested due to automatic review settings November 1, 2026 05:13
@ptr727

ptr727 commented Nov 1, 2026

Copy link
Copy Markdown
Owner Author

A recorded local strict-review pass covers head 4f0a42ce2a5ff6d31c61f4b4c7d1d8ac9c9e6306, the content this pull request carries at that commit against develop, and it recorded 0 findings.

@coderabbitai

coderabbitai Bot commented Nov 1, 2026 •

Copy link
Copy Markdown

Important

  • Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

Run configuration
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Copilot AI 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.

🟢 Approval recommended

No active review issues remain, with the refusal contract documented and regression coverage addressing both gh merge outcomes.

No open issues 🎉

What changed in this PR

Updates pr_review.py merge so a post-merge CLOSED pull request read-back is treated as a definitive refusal rather than an unconfirmed merge.

Changes:

  • Returns status=REFUSED with exit code 1 for CLOSED read-backs.
  • Documents the updated refusal and exit-code contract.
  • Adds regression coverage for both successful and failed gh merge responses.
File Summary
tests/​test_pr_merge.py Verifies closed read-backs for both gh exit codes.
scripts/​README.md Documents the closed read-back and refusal behavior.
scripts/​pr_merge.py Classifies closed pull requests as confirmed refusals after the merge call.

Review effort: Lite

ptr727 and others added 2 commits October 31, 2026 22:32
The separate branch took pr_merge.py past its size ceiling. A closed
read-back now shares the branch an open one already takes, so the line
names the state it read and the file stays under the ceiling.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The folded branch printed MERGE_REFUSED after a gh exit of 0 and "exit
None" after a call that never finished. A closed read-back now prints
REFUSED with the state it read and what gh answered, nothing included.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ptr727

ptr727 commented Nov 1, 2026

Copy link
Copy Markdown
Owner Author

A recorded local strict-review pass covers head 4c95c037fbe208739cd882a4e015391073af3d18, the content this pull request carries at that commit against develop, and it recorded 0 findings.

@codecov

codecov Bot commented Nov 1, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 82.31%. Comparing base (06e45c4) to head (4c95c03).

Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #3737   +/-   ##
========================================
  Coverage    82.31%   82.31%           
========================================
  Files           28       28           
  Lines         9437     9438    +1     
========================================
+ Hits          7768     7769    +1     
  Misses        1669     1669           
Flag Coverage Δ
python-3.13 82.31% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ptr727
ptr727 merged commit 4b7c352 into develop Nov 1, 2026
13 checks passed
@ptr727
ptr727 deleted the feature/merge-promotion-findings branch November 1, 2026 05:49
ptr727 added a commit that referenced this pull request Nov 1, 2026
…nd Add a backlog-burndown Away Mode (#3736)

Promotes the changes merged into `develop` since promotion #3715 to
`main`.

- [#3704](#3704):
squash-merges a gate-met feature pull request through `pr_review.py
merge`, and the host-safety kit now owns its `autoMode` entries.
- [#3735](#3735) adds an
away mode to `backlog-burndown`:
- Parallel file-claimed rounds with no maintainer present, run by a lean
orchestrator.
- A group meeting a question parks behind a `decision` issue instead of
asking.
- Merges go only as far as the `develop`, `main` or `release` scope
named at invocation.
  - The end report names each held-back issue's real reason.

It also adds the attended `decision-triage` skill, which researches and
asks every open question at once, and retires `unattended-handoff`.
- [#3737](#3737) reads a
pull request that reads back closed after `pr_review.py merge`'s merge
call as a refusal that merged nothing, rather than as an unconfirmed
merge. It answers this promotion's first review round.

After the release, the host-safety installer re-run that #3704 needs is
still the maintainer's, per its handoff #3734. That handoff's step 3
names an `unattended-handoff` worker. That skill is retired here, so the
verification runs from a `backlog-burndown` worker instead.

Fixes #3375

🤖 Generated with [Claude Code](https://claude.com/claude-code)
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.

2 participants