Skip to content

Promote Develop: Exit pr_review.py wait When Unresolved Threads Land on an Attested Head - #3681

Merged
ptr727 merged 2 commits into
mainfrom
develop
Oct 31, 2026
Merged

ptr727 merged 2 commits into
mainfrom
develop

Conversation

@ptr727

@ptr727 ptr727 commented Oct 31, 2026 •

Copy link
Copy Markdown
Owner

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

  • #3680 Ends pr_review.py wait's held poll on an attested head when an unresolved review thread is open, with a new exit 46 and a status=THREADS_UNRESOLVED line naming the threads' authors. The poll's read now carries each thread's state and author, and a thread read cut at 100 is walked to its end first.
  • #3682 Walks a cut thread page once per poll read, keeping the answer on the payload it judged, which answers this promotion's first Copilot round.

Closes #3671

🤖 Generated with Claude Code

…ad (#3680)

## Summary

Fixes #3671. On a pull request into `develop` whose head carries an
attestation, `pr_review.py wait` polls the checks rather than requesting
a Copilot round. That poll never read review threads. So when Qodo or
CodeRabbit opened threads while the checks ran, `wait` kept polling
while the merge read `BLOCKED`, and the driver was never told there was
work to dispose of.

- `Q_HELD`, the poll's read, now selects each thread's `isResolved` and
opening author, and nothing else, so each poll read stays thin.
- A new `open_on_head` helper reads the open threads from that page.
Where the page was cut at 100, it walks every page through the existing
`unresolved_threads()` instead.
- An open thread ends the held poll on any read. On an open pull request
`wait` then exits `46` with `status=THREADS_UNRESOLVED`, naming the
threads' authors. `46` outranks `30`, `44`, and `45`, since no check
clears a thread.
- A merged or closed pull request with a thread left open still exits
`0`, since no rerun clears it.
- Documented in the `pr_review.py` docstring, the `scripts/README.md`
exit-code table and held-poll paragraph, and `drive-pr` step 3, with the
generated skill copies regenerated.
- Tests cover: an open thread over a running check, a thread landing
mid-poll, `46` over `44` and `45`, a cut page walked to its end with and
without an open thread past it, the unnamed-author fallback,
`MERGED`/`CLOSED` reaching `0`, and resolved threads only reaching `0`.
The poll-query contract test now pins the thin thread selection in place
of "no threads".

Each new poll test fails with the code path it pins removed. The full
suite passes, 3140 tests, and so do ruff, mypy, the prose gate, and the
eol gate.

## Local review

Five `local-strict-review` passes ran at the `frontier` tier, over two
pushes.
- Push 1, three passes. Pass 1 raised four `introduced` findings, fixed
in 509e677: two README drifts, `46` firing on a pull request no longer
open, and missing precedence tests. It also raised an over-hardening
finding, which was taken. A suggestion to reuse the digest's thread
count was declined as `style`. Pass 2 raised one wording finding, fixed
in 9a54b23, and pass 3 raised nothing.
- Push 2, after Copilot's round. Pass 4 found that d7413e6's
fail-closed on a cut page looped forever on a pull request with more
than 100 resolved threads, and two wording drifts. All three were fixed
in 9ed6b04 by walking the cut page instead.
- **Remaining `introduced` finding, with this push's edit budget
spent:** on a pull request whose thread read is cut, the full walk runs
twice per poll read, since `backoff` re-runs `still_held` on the value
`held_read` already judged. It also runs once more at the exit-46
branch. Correctness is unaffected. Its cost is a few GraphQL points per
iteration, only past 100 threads. This gets its outcome in this pull
request's review loop.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
Copilot AI lite review requested due to automatic review settings October 31, 2026 01:26
@coderabbitai

coderabbitai Bot commented Oct 31, 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

Comment @coderabbitai help to get the list of available commands.

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.

🟡 Changes recommended

A moderate issue remains because paginated review threads are traversed repeatedly within each polling iteration, causing unnecessary GraphQL requests for pull requests with more than 100 threads.

1 open issue
What changed in this PR

This pull request promotes the develop changes that make pr_review.py wait stop on an attested head when unresolved review threads are present, returning exit code 46 and identifying thread authors.

Changes:

  • Adds thread state and author data to held-poll reads.
  • Handles paginated thread lists and reports THREADS_UNRESOLVED.
  • Adds tests for thread detection, pagination, precedence, author fallback, and terminal pull-request states.
  • Updates documentation, distributed drive-pr skills, and the source digest.
  • Review findings include repeated pagination during a poll read, verdict precedence on truncated pages, and a docstring sentence-length violation.
File Summary
tests/​test_pr_review.py Adds coverage for thread detection, pagination, precedence, author fallback, and terminal pull-request states.
scripts/​README.md Documents exit code 46 and thread-aware held-poll behavior.
scripts/​pr_review.py Detects unresolved threads during held polling, reports authors, and returns exit code 46.
.github/​skills/​drive-pr/​SKILL.md Updates the generated GitHub Copilot skill instructions for exit code 46.
.claude-plugin/​fleet-skills/​skills/​drive-pr/​SKILL.md Updates the generated Claude skill instructions for exit code 46.
.claude-plugin/​fleet-skills/​.source-digests/​drive-pr Updates the generated skill source digest.
.agents/​skills/​drive-pr/​SKILL.md Updates the canonical drive-pr instructions for handling exit code 46.

Review effort: Lite

Comment thread scripts/pr_review.py Resolved
@codecov

codecov Bot commented Oct 31, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 81.74%. Comparing base (90813a0) to head (96475c1).
⚠️ Report is 451 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3681      +/-   ##
==========================================
+ Coverage   81.72%   81.74%   +0.02%     
==========================================
  Files          27       27              
  Lines        9128     9139      +11     
==========================================
+ Hits         7460     7471      +11     
  Misses       1668     1668              
Flag Coverage Δ
python-3.13 81.74% <100.00%> (+0.02%) ⬆️

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.

## Summary

Answers Copilot's finding on promotion
[#3681](#3681), [Cache
paginated thread results within each
poll](#3681 (comment)).
It follows #3680, for #3671.

The held poll in `pr_review.py wait` judges one read more than once. It
judges it in `held_read`, again in `backoff`'s `keep`, and once more at
the exit-46 branch. On a pull request whose thread read is cut at 100,
each judgment walked every thread page again. `open_on_head` now keeps
its answer on the payload it judged, as `_open`, so each read's walk is
paid for once. Each GitHub read is a fresh dict, so the kept answer
never outlives the read it describes.

- Test: `test_a_cut_thread_page_is_walked_once_per_read` pins one walk
where the poll and the exit judge the same read. It fails with the cache
removed.
- The full suite passes, 3141 tests, and so do ruff, mypy, the prose
gate, and the eol gate.

## Local review

One `local-strict-review` pass at the `frontier` tier raised nothing. It
checked every call site for staleness, `full_read`'s reuse of the polled
object, the test mock's repeated object, and whether the extra key leaks
into anything that iterates or serializes a payload.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Opus 5.5 <[email protected]>

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, so the change can proceed through approval.

No open issues 🎉

1 resolved since last review

Review effort: Lite

@ptr727
ptr727 merged commit 5540e38 into main Oct 31, 2026
14 checks passed
ptr727 added a commit that referenced this pull request Oct 31, 2026
…de, Read Compose and Renamed Paths, and Exempt a Delete-Only Push (#3693)

Promotes the changes merged into `develop` since promotion #3681 to
`main`, the first round of a backlog burndown.

- [#3683](#3683) Carries a
newly declared verbatim section in `carry.py` instead of refusing. The
missing section is inserted in hub order: after the nearest preceding
held section, else before the nearest following one, else at the end of
the file. A rename is refused only for an unchanged body under a target
H2 the hub does not carry, and the plans apply in two phases.
- [#3689](#3689) Reads a
null GraphQL node in `pr_review.py` as unread, re-reading and then
exiting 1 naming the path. Names a closed pull request's state in the
digest, and ends `wait` on a pull request that is no longer open the way
`status` does. `merge-and-release` step 2 stops on `state=MERGED`.
- [#3685](#3685) Skips the
container side of a compose volume entry in the prose gate's home-path
rule. Pins `--find-renames` in the gate's diff, and reads a renamed file
whole only when it came from a generated tree or an excluded path.
- [#3691](#3691) Exempts a
delete-only push from the write guard's primary-checkout rule: a named
remote, every refspec a delete of a branch other than `main`, `master`
or `develop`, and only the delete, dry-run, quiet and verbose options.
The branch's live protection rules still apply. Adds regression cases
for #1628.

Deferred review findings: #3694 (a YAML block scalar in a Compose file's
volume scan) and #3690 (the `scripts/README.md` apply-time refusal
sentence). #3695 records a pre-existing write-guard question raised
while verifying them.

Fixes #3614
Fixes #3392
Fixes #3677
Fixes #3220
Fixes #1586
Fixes #1642
Fixes #1628

🤖 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.

Exit pr_review.py wait When Unresolved Threads Land on an Attested Head

2 participants