Skip to content

Pair Overview Findings With Threads by File and Read Every Cleanup Head Page - #3022

Merged
ptr727 merged 3 commits into
developfrom
feature/2985-3003-pr-review-readers
Oct 14, 2026
Merged

ptr727 merged 3 commits into
developfrom
feature/2985-3003-pr-review-readers

Conversation

@ptr727

@ptr727 ptr727 commented Oct 14, 2026 •

Copy link
Copy Markdown
Owner

Summary

Two scripts/pr_review.py readers, fixed together.

cleanup reads every open head pull request (#3003)

  • Q_CLEANUP_USERS is split. The heads read, Q_CLEANUP_HEADS, takes 100 per page and is paged through shared.walk(..., strict_page=True) in a new local_heads. Each page is filtered to headRepository == owner/repo before anything is decided, so forks sharing the branch name are never counted, on any page.
  • A page that does not answer, a page with no pageInfo, a malformed node list, or a cursor that does not advance raises CleanupUnread, so cleanup stops at exit 2.
  • Bases keep their single first:20 read with the overflow counted, since every base pull request is this repository's own.
  • New tests: forks filling three pages are not users and the delete goes ahead; a local pull request on the second page is refused and named; an unread second page stops at exit 2. The README's cleanup paragraph now says every head is read and named.

Overview table, Review findings:, and headline readers (#2985)

The issue asked whether matching by thread file path should replace word overlap. It does, and the word-overlap code is deleted rather than patched (title_key, entry_text, reworded, open_entry_texts, and the title-capturing TABLE_FINDING).

  • File table. A row names a finding by its vote count, (N vote(s)), whatever severity spelling surrounds it. Each finding is paired with a thread of the round on a file the row's first cell names. This closes gaps 1-3 of Tighten the Overview Table and Headline Finding Readers in pr_review.py #2985, since no title is read. The new unpaired does a maximum one-to-one pairing, one thread per finding, which closes gap 6.
  • Review findings: list. It uses the same pairing, so a second entry on a file that has one thread is now counted. Both readers also pair with an earlier round's thread when the head round's open entry links it.
  • Headline. The count is compared against everything the pull request accounts for: the larger of the open sections and the stated total, plus suppressed and previously-missed findings, plus the reviewer's threads from other rounds (resolved or not) that no open entry links. This closes gap 4. The per-sentence settled-word filter (SETTLED) is deleted rather than extended, which closes gap 5. Earlier threads are read by the thread's own author and round, not through the reviews(last:100) window.

Measurement

Before choosing the design I measured it read-only against roughly 400 second-format Copilot rounds on recent pull requests in this repository. Only aggregate shapes are reported here.

  • Path pairing. It reproduces the one shortfall word overlap caught. Reading the vote count also catches table-only findings in four more rounds that the old <Severity> finding (N votes) pattern did not read: nits and moderates named only in a table row.
  • Headline, false positives. 12 rounds printed a pre-change headline shortfall. Every one with earlier-round threads was carryover, and each of those is now accounted for.
  • Headline, true positives. Every one with no earlier-round threads was a real finding with no thread, and each is still reported. Dropping the settled-word filter added no new report across the corpus.

The cost, stated in headline_shortfall's docstring, is this: a headline naming no more findings than earlier rounds opened threads goes unreported by that reading. The table and prose readers still see such a finding.

Verification

  • The full local gate set from OPERATIONS.md passed: ruff check and format, mypy, the coverage-run unittest suite plus the selftests, build_dist --check, repo_gate, both prose_lint invocations, jq, spec/validate.py, and docker_lint. The diff-scoped prose_lint --diff against the merge base is clean.
  • Each new test was proven by reverting its fix and watching it fail:
    • first-page-only head read
    • any-match instead of one-to-one pairing
    • greedy instead of maximum pairing
    • headline against the open sections alone
    • earlier threads double counted with open entries
    • earlier threads through the review window
    • round-only thread paths, for both table and prose
    • previously-missed findings left out
  • Test data is constructed throughout.

Closes on promotion: #2985, #3003

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Improvements
    • Review summaries now match findings to review threads by file, account for earlier-round threads, and report unthreaded table findings and updated headline-count shortfalls.
    • Cleanup checks all pages of open pull requests using the branch as their head, counting only pull requests from the target repository; fork-based pull requests do not block cleanup.
    • Pull requests using the branch as their base remain subject to a limit of twenty, with additional matches counted.
  • Documentation
    • Clarified that cleanup exits with status 2 if it cannot read a page of head pull requests.

ptr727 and others added 3 commits October 14, 2026 15:35
…ad Page

The file table and `Review findings:` readers now pair each finding with a
thread of the round on a file it names, one thread per finding, replacing the
word-overlap match between a table annotation and an open entry. A table row
names a finding by its vote count, whatever severity spelling surrounds it.

The headline count is compared against everything the pull request accounts
for: the open sections or the stated total, the round's suppressed and
previously missed findings, and the threads the reviewer's earlier rounds
opened that no open entry links. The per-sentence settled-word filter is gone.

`cleanup` pages the open head pull request read and filters each page to this
repository before deciding, so forks sharing a branch name are never counted
as users, and an unread page stops at exit 2.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
A file table or `Review findings:` finding now also pairs with an earlier
round's thread that the head round's open entries link, since that entry is a
finding the round still names. The headline comparison reads the reviewer's
earlier threads by each thread's own author and round rather than through the
review window, which holds the newest reviews while the thread window holds the
oldest threads.

The scripts README now states that every head pull request is read and named.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…se Carry

`earlier_round_threads` reads a thread's login through the existing
`thread_author` helper, which also survives a deleted account's null author. A
`Review findings:` case now covers an entry paired with an earlier round's
thread that an open entry links, and three added lines are wrapped to the
configured line length.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Copilot AI lite review requested due to automatic review settings October 14, 2026 23:04
@ptr727

ptr727 commented Oct 14, 2026

Copy link
Copy Markdown
Owner Author

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

@coderabbitai

coderabbitai Bot commented Oct 14, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository: ptr727/ProjectTemplate/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 70b8960b-b111-48ec-b0a1-2192b5894e58
📥 Commits

Reviewing files that changed from the base of the PR and between 4049058 and fdff923.

📒 Files selected for processing: 3
  • scripts/README.md
  • scripts/pr_review.py
  • tests/test_pr_review.py

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

📝 Walkthrough

The PR changes review-finding shortfall accounting to match table and prose findings against review threads by file, and updates headline accounting. It also paginates cleanup head-branch queries, filters fork heads, and keeps base-branch results bounded with excess counts.

Changes: Review finding accounting

Layer / File(s) Summary
Match findings to review threads
scripts/pr_review.py, tests/test_pr_review.py
Table and prose findings are matched to threads by file. Maximum matching prevents one thread from accounting for multiple findings.
Headline counts and digest reporting
scripts/pr_review.py, tests/test_pr_review.py
Headline shortfalls account for stated and open counts, suppressed and previously missed findings, and unlinked earlier-round threads. Digest diagnostics report unpaired findings by file.

Branch cleanup checks

Layer / File(s) Summary
Read and validate branch pull requests
scripts/pr_review.py, tests/test_pr_review.py, scripts/README.md
Cleanup reads head-branch pull requests across pages and excludes fork heads. Base-branch results remain limited to twenty named entries, with excess matches counted. Tests cover malformed and unread responses, later pages, and fork heads. The documentation describes the query behavior.

Priority: ⬇️ Low

Estimated code review effort: 3 (Moderate) | ~25 minutes

Merge Risk: ⚪ Minimal · up to fdff9

No unresolved issue identified here prevents merging after normal checks.

Pre-merge checks: Passed 5
Passed Passed checks: 5 passed
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly summarizes both primary changes: pairing findings with review threads by file and reading every cleanup head page.
Docstring Coverage Passed Docstring coverage is 87.50% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 16 functions across 1 files. (2 skipped: 1 …
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • 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.

@codecov

codecov Bot commented Oct 14, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
⚠️ Please upload report for BASE (develop@dff6804). Learn more about missing BASE report.

Additional details and impacted files
@@            Coverage Diff             @@
##             develop    #3022   +/-   ##
==========================================
  Coverage           ?   60.98%           
==========================================
  Files              ?       17           
  Lines              ?     9010           
  Branches           ?        0           
==========================================
  Hits               ?     5495           
  Misses             ?     3515           
  Partials           ?        0           
Flag Coverage Δ
python-3.13 60.98% <100.00%> (?)

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.

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

Review-thread pagination remains incomplete, so findings beyond the first 100 threads may be missed.

1 open finding
What changed in this PR

Improves review-finding accounting and safely paginates cleanup head pull requests.

Changes:

  • Pairs findings with review threads by file path.
  • Expands headline accounting across historical and suppressed findings.
  • Adds cleanup pagination, filtering, tests, and documentation.
File Reviewed changes
tests/​test_pr_review.py Adds coverage for pairing, historical threads, headlines, and cleanup pagination.
scripts/​README.md Documents the updated cleanup behavior.
scripts/​pr_review.py Implements pairing, headline accounting, and paginated cleanup reads.

🧠 Review effort: Lite


💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread scripts/pr_review.py Resolved
@ptr727

ptr727 commented Oct 14, 2026

Copy link
Copy Markdown
Owner Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Oct 14, 2026 •

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@ptr727
ptr727 merged commit 0ba42aa into develop Oct 14, 2026
14 checks passed
@ptr727
ptr727 deleted the feature/2985-3003-pr-review-readers branch October 14, 2026 23:14
ptr727 added a commit that referenced this pull request Oct 15, 2026
…ng, and backlog-burndown Re-Dispatch Rules to Main (#3030)

- #2997 adds an updater that keeps the coding-agent tools already
installed on a host current, without installing a tool the maintainer
has not chosen
- #3017 brings the agent-safety READMEs up to the write guard's #3011
readings: `--admin` read inside a quoted `eval` argument, clustered and
cut-short push options, `--branches` as `--all`, `refs/` pattern
destinations, and a double-quoted list expansion as a directory or
commit value failing closed
- #3022 pairs a Copilot overview-table or `Review findings:` entry with
a review thread by the file it names, replacing word overlap, compares
the headline count against everything the round and the pull request
account for, and makes `pr_review.py cleanup` read every page of the
head pull requests, counting only this repository's own
- #3018 has `backlog-burndown` name a new branch when an issue is
dispatched again, name the open pull request a pushed branch still heads
when cleanup reports it, and splits the long cleanup sentence
- #3028 keeps an abandoned group's issue out of the `backlog-burndown`
ranking while that group is stopped for the maintainer, and records the
release on the claim comment
- #3023 makes `gh-write-guard` read a `heads/` push destination as the
branch git completes it to, read `--prune` beside a pattern, `:`,
`--all`, or bare push as a delete of each branch matched, read
`--mirror` as a force and a delete, and read the `@{push}` target
against the configured remote names. A differential against the previous
guard found no deny-to-allow flip
- #3032 subtracts every thread id an open entry links, back-references
included, from the earlier threads `pr_review.py`'s headline shortfall
counts, so a back-referenced thread is no longer counted twice
- #3035 covers the bootstrap upgrade handoff on Linux and Windows, the
root and elevated skips included, and has `bootstrap.ps1` say when the
agent tools report fails
- #3037 makes `gh-write-guard` fail closed when a push target resolves
but the remote names cannot be read

After this merges, the host-safety installer payload changes, so the
maintainer runs the installer after promotion.

Fixes #3009
Fixes #2985
Fixes #3003
Fixes #2993
Fixes #3016
Fixes #3005
Fixes #3007
Fixes #2973

🤖 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