Repository navigation
Render pr_review's Digest From a Pure Leaf Module - #3493
Conversation
Move the digest's rendering into scripts/pr_review_digest.py, whose render takes the payload, the normalized checks, and the run log's rate-limit sentence as arguments and makes no call. digest stays in pr_review.py as the shell that does those reads. The header is now an ordered list of key and value pairs, so a new field is one entry, and the window and truncation advisories are an ordered table. Output is byte-identical over every existing case, and two new cases pin a crowded and a quiet digest whole. Closes #3457 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
pr_review_rounds already exports a refusal_of that reads one review node, so the digest's payload-level reader now carries its own name. The pinned cases' docstring now claims only the fields and lines those cases print, and the new docstring sentences fit the length rule. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars.
|
|
A recorded local strict-review pass covers head |
There was a problem hiding this comment.
🟡 Changes recommended
Address the moderate refusal-recomputation finding and the two documentation/ownership clarification nits.
1 open issue
What changed in this PR
This pull request extracts digest rendering into a pure pr_review_digest.py module while keeping data reads in pr_review.py and preserving existing output behavior.
Changes:
- Adds ordered digest header and advisory rendering.
- Keeps
digestas the read-and-delegate shell and consolidates quota-log reads. - Expands source guards, size limits, documentation, and byte-for-byte output tests.
| File | Summary |
|---|---|
tests/test_pr_review.py |
Updates reader guards, adapter references, and pinned digest output tests. |
tests/test_pr_review_size.py |
Adds a size ceiling for the new digest module. |
scripts/README.md |
Documents the new reader module; remove the incidental reader count to avoid stale documentation. |
scripts/pr_review.py |
Retains digest input acquisition and delegates rendering to the pure module. |
scripts/pr_review_digest.py |
Provides pure digest rendering; clarify read-shell ownership and avoid recomputing the derived refusal during rendering. |
Review effort: Lite
The docstring's "Its `digest`" read as a function in the leaf module, which has none. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
A recorded local strict-review pass covers head |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #3493 +/- ##
===========================================
+ Coverage 81.04% 81.07% +0.02%
===========================================
Files 25 26 +1
Lines 8922 8934 +12
===========================================
+ Hits 7231 7243 +12
Misses 1691 1691
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
…3494) ## Summary Promotes the pull requests merged into develop since release 2.0.1189. - [#3493](#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](#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](#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](#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](#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](#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](https://claude.com/claude-code)

Summary
Implements #3457 (the closing keyword goes on the promotion pull request).
scripts/pr_review_digest.pyis a new pure reader module. Itsrendertakes 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.digeststays inpr_review.pyas the shell that does the reads (full_read,check_nodes, andconfirmed_quotawhen a refusal is present), so the tests that patch it there keep working.statusheader is an ordered list of(key, value)pairs joined by one space, aNonevalue leaving the field out, so a new field is one entry.(value, template)table, in the order they printed before.confirmed_quotais now read once per digest rather than up to twice, sorefusal=QUOTAand theRATE LIMITline can no longer disagree across two run-log reads.scripts/README.mdnames it.Verification
digestoutput the existing suite produces, 256 renderings acrosstests/test_pr_review.py, was recorded before and after the move and compared byte for byte, identical.TestDigestRenderIsPinnedpins a crowded and a quiet digest whole, with text captured from the pre-move code.python -m unittest discover -s tests, 2963 tests, 7 skipped. Ruff, mypy, and the pre-commit hook are clean.introducedfindings, the new helper's name colliding withpr_review_rounds.refusal_ofand 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
commentslabel is applied because four comment lines moved verbatim frompr_review.pyinto the new module.🤖 Generated with Claude Code