Skip to content

Promote the Digest Render Leaf and the Flag-Ownership Table to Main - #3494

Merged
ptr727 merged 3 commits into
mainfrom
develop
Oct 26, 2026
Merged

ptr727 merged 3 commits into
mainfrom
develop

Conversation

@ptr727

@ptr727 ptr727 commented Oct 26, 2026 •

Copy link
Copy Markdown
Owner

Summary

Promotes the pull requests merged into develop since release 2.0.1189.

  • #3493: the digest's rendering moves out of scripts/pr_review.py into a new pure reader module, scripts/pr_review_digest.py. digest stays as the shell that does the reads. The status header is an ordered field list and the window and truncation advisories an ordered table. Output is byte-identical over every existing case, and two new cases pin a crowded and a quiet digest whole.
  • #3495: scripts/README.md drops its incidental count of the reader modules and names pr_review.py as what imports them, which this promotion's first review found.
  • #3497: wait's body moves out of main into run_wait, and the per-subcommand flag checks are read from a FLAG_OWNERS table in two passes, so a new owned flag is one row. The first error printed over 1904 bad command lines is unchanged, and a case pins the multi-flag order.

Closes #3457
Closes #3458

Constituent coverage

Each change this promotion carries had coverage on its own pull request into develop:

Pull request Merged head Coverage
#3493 3eb58d60 attested local pass at the merged head, base develop. A Copilot round on the earlier head 023589f8 opened one finding, fixed in 3eb58d60 and resolved, so no Copilot round covers the merged head
#3495 aab59769 attested local pass at the merged head, base develop, and a Copilot table on the merged head naming exactly its 1 changed file, no open findings
#3497 2ca2e75d attested local pass at the merged head, base develop. A Copilot round on the earlier head d145242d opened one finding, already fixed in 2ca2e75d and resolved, so no Copilot round covers the merged head

🤖 Generated with Claude Code

## Summary

Implements #3457 (the closing keyword goes on the promotion pull
request).

- `scripts/pr_review_digest.py` is a new pure reader module. Its
`render` takes the payload, the normalized checks, the run log's
rate-limit sentence, and the seen set as arguments, and makes no call.
It imports only the other readers and the reviewer adapter, never the
gate.
- `digest` stays in `pr_review.py` as the shell that does the reads
(`full_read`, `check_nodes`, and `confirmed_quota` when a refusal is
present), so the tests that patch it there keep working.
- The `status` header is an ordered list of `(key, value)` pairs joined
by one space, a `None` value leaving the field out, so a new field is
one entry.
- The window, threads-truncated, and reviews-truncated advisory lines
print from an ordered `(value, template)` table, in the order they
printed before.
- `confirmed_quota` is now read once per digest rather than up to twice,
so `refusal=QUOTA` and the `RATE LIMIT` line can no longer disagree
across two run-log reads.
- The new module joins the readers' import guard, the whole-source
guards, and the size ceilings, and `scripts/README.md` names it.

## Verification

- Every `digest` output the existing suite produces, 256 renderings
across `tests/test_pr_review.py`, was recorded before and after the move
and compared byte for byte, identical.
- `TestDigestRenderIsPinned` pins a crowded and a quiet digest whole,
with text captured from the pre-move code.
- The full suite passes, `python -m unittest discover -s tests`, 2963
tests, 7 skipped. Ruff, mypy, and the pre-commit hook are clean.
- A local strict review ran two rounds. Round 1 raised two `introduced`
findings, the new helper's name colliding with
`pr_review_rounds.refusal_of` and the pin test's docstring claiming more
than it pins, both fixed in 023589f. Round 2 raised none.

## Pre-existing findings, not filed

- `scripts/README.md:9`, `scripts/README.md:190`,
`scripts/pr_review.py:16`: `pre-existing`, each an older sentence over
the opt-in sentence-length check's 25 words, flagged only because its
line is in this diff.

The `comments` label is applied because four comment lines moved
verbatim from `pr_review.py` into the new module.

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

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Copilot AI lite review requested due to automatic review settings October 26, 2026 01:12
@coderabbitai

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

🟢 Approval recommended

The final comments are minor documentation nits and no approval-blocking issues were identified.

1 open issue
What changed in this PR

This pull request promotes the digest-rendering refactor to main, extracting pure rendering into a new leaf module while keeping pr_review.py responsible for reading data and orchestration.

Changes:

  • Adds scripts/pr_review_digest.py for ordered digest rendering and refusal classification.
  • Updates scripts/pr_review.py to delegate rendering while retaining payload and quota reads.
  • Adds whole-output digest regression cases and a size ceiling for the new module.
  • Updates documentation and reader guard coverage.
File Summary Review notes
tests/​test_pr_review.py Adds pinned crowded and quiet digest cases and updates reader guard coverage. Nit: avoid hard-coding “these two cases” in the docstring.
tests/​test_pr_review_size.py Adds the new digest module’s size ceiling. No final comments.
scripts/​README.md Documents the expanded reader structure and ordered digest layout. Nit: remove the incidental “three reader modules” count.
scripts/​pr_review.py Retains data reads and delegates digest rendering to the new module. No final comments.
scripts/​pr_review_digest.py Provides pure digest rendering with ordered output structures. No final comments.

Review effort: Lite

Comment thread scripts/README.md Outdated
@codecov

codecov Bot commented Oct 26, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 99.44444% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 81.07%. Comparing base (f87bf62) to head (162d1aa).
⚠️ Report is 423 commits behind head on main.

Files with missing lines Patch % Lines
scripts/pr_review.py 98.73% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3494      +/-   ##
==========================================
+ Coverage   81.04%   81.07%   +0.02%     
==========================================
  Files          25       26       +1     
  Lines        8922     8928       +6     
==========================================
+ Hits         7231     7238       +7     
+ Misses       1691     1690       -1     
Flag Coverage Δ
python-3.13 81.07% <99.44%> (+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.

ptr727 and others added 2 commits October 25, 2026 18:33
## Summary

Answers the finding on promotion
[#3494](#3494) that
`scripts/README.md:9` counted the reader modules ("three"), a second
copy of the list just before it that goes stale when a reader is added.
The sentence now reads "The reader modules `pr_review.py` imports are
tested through `test_pr_review.py`.", which also stops it leaning on
"the gate", since the same paragraph defines a gate as a `_lint` or
`_gate` script and lists `pr_review.py` as a utility.

## Verification

A local strict review ran two rounds. Round 1 raised the "the gate's"
antecedent, fixed in `aab59769`, and round 2 raised none. The prose gate
is clean.

## Pre-existing findings, not filed

- `scripts/README.md:9`: `pre-existing`, the older "Where a case covers
a table" sentence runs 43 words against the opt-in sentence-length
check's 25.

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

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
…a Table (#3497)

## Summary

Implements #3458 (the closing keyword goes on the promotion pull
request).

- The whole `wait` body moves out of `main` into `run_wait(owner, repo,
a)`, unchanged, so `main` is parsing and dispatch.
- Flag ownership is read from `FLAG_OWNERS`, one row of `(flag, owners,
late)` per flag, checked in two passes around the `cleanup` and `number`
checks so a command line with several bad flags names the same one
first. Listing `cleanup` among `--checkout`'s owners lets the error text
be the owners joined, and the `cleanup` check right after it still
refuses that command.
- The four negative-value checks are one loop.
- `COMMANDS` is the parser's choices, and the owner test reads it.

## Verification

- The first error line and the exit of 1904 bad command lines, every
subcommand crossed with pairs of misplaced, negative, and malformed
flags, were recorded before and after with every subprocess stubbed out,
and are identical.
- `test_a_command_line_with_two_bad_flags_names_the_same_one_first` pins
six multi-flag orderings, and passes against the pre-change code as
well.
- The full suite passes, `python -m unittest discover -s tests`, 2965
tests, 7 skipped. Ruff, mypy, and the pre-commit hook are clean.
- A local strict review ran two rounds on the first push. Round 1 raised
three `introduced` findings, each fixed in `d145242d`. Round 2 raised
one, `COMMANDS` landing between the `FLAG_OWNERS` comment and the table,
which the second push fixed in `2ca2e75d`. Its own pass raised none.

## Pre-existing findings, filed

- `--timeout`, `--min-rounds`, and `--ignore-quota-signal` are still
accepted silently on subcommands other than `wait`: #3496.

The `comments` label is applied for the new table and loop comments.

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

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
@ptr727 ptr727 changed the title Promote the Digest Render Leaf Module to Main Promote the Digest Render Leaf and the Flag-Ownership Table to Main Oct 26, 2026
@ptr727
ptr727 requested a lite review from Copilot October 26, 2026 02:11

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.

🔵 Needs a closer look

Two nit findings remain, and the final approval-readiness assessments are mixed, so conservative automated approval is not warranted.

No open issues 🎉

1 resolved since last review

Review effort: Lite

@ptr727

ptr727 commented Oct 26, 2026

Copy link
Copy Markdown
Owner Author

Answering the headline of the round on 162d1aa ("Two nit findings remain"): the round names no finding and its body lists no open issue. The one finding raised on this promotion, the reader-module count at scripts/README.md:9, was fixed by #3495 (41d5138) and resolved. The findings raised on the constituent pull requests, #3493's module docstring and #3497's COMMANDS placement, were each fixed before merge, in 3eb58d6 and 2ca2e75. With no named item there is nothing to change on this head.

@ptr727
ptr727 merged commit d7041d8 into main Oct 26, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants