Repository navigation
Share One Bounded Backoff Loop Between pr_review.py wait's Two Polls - #2732
Conversation
Both wait polls now call one backoff helper on the POLL_DELAYS schedule, so a fix to the timeout check or the delays lands once. The held-head check poll reads a narrower Q_HELD document, the fields its readers use, and the verdict keeps its own Q_FULL read for the threads and files only the digest needs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A held poll that never sleeps grades its first Q_FULL read again, so the narrow query costs it no extra call. The Copilot poll reads through live_state, extended to return the three readings the wait stops on, rather than a nested sibling of it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A narrow read ending the held poll is now re-read in full before the poll stops, so the payload that ends the poll is the payload graded, and a merge reading UNKNOWN on that read keeps the poll going rather than returning 30 with time left. 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. ⚙️ Run configuration
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. Comment |
Only the last full read can be the poll's returned value, so one reference replaces the list. A case serving Q_HELD without threads or files pins the timeout's fresh Q_FULL read, which no case reached while the fake ignored the query. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #2732 +/- ##
==========================================
Coverage ? 59.83%
==========================================
Files ? 16
Lines ? 8367
Branches ? 0
==========================================
Hits ? 5006
Misses ? 3361
Partials ? 0
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:
|
There was a problem hiding this comment.
🟡 Changes recommended
Unresolved moderate findings affect timeout handling coverage and polling efficiency.
2 open findings
What changed in this PR
This PR centralizes bounded polling in pr_review.py wait, narrows held-head queries, and expands regression coverage.
Changes:
- Adds shared backoff and held/full query handling.
- Updates live-state and polling tests.
- Adds coverage for timing and confirmation reads.
| File | Summary | Findings |
|---|---|---|
scripts/pr_review.py |
Adds shared polling and held/full query logic. | P1 narrow-payload timeout test gap; P2 full-read retention and snapshot reuse issues. |
tests/test_pr_review.py |
Updates and expands polling coverage. | P2 test does not exercise the actual narrow payload. |
🧠 Review effort: Lite
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
Local review dispositions since this pull request opened:
|
|
A recorded local strict-review pass covers head |
… Corrections to Main (#2740) ## Summary Promotes 20 changes from `develop` to `main`: - #2737: Flag a Lone Semicolon After an Explanatory Colon in the Prose Gate - #2734: Share pr_review.py wait's Liveness Readings and Open the Held Poll on Its Snapshot - #2732: Share One Bounded Backoff Loop Between pr_review.py wait's Two Polls - #2729: Document pr_review.py wait's Immediate 44 and check_nodes's Node Keys - #2727: Narrow pr_review.py wait's Exit 44 to Required Checks - #2722: Poll an Attested Head's Checks in pr_review.py wait - #2720: Name the Command That Enumerates Open Feature Pull Requests in backlog-burndown - #2718: Point the Skills Refresh Cadence at host-setup.md - #2716: Fall Back to os.defpath for PATH in Two Test Harnesses - #2714: State the Pip Form's Root-Config Type-Check Command in python-codestyle - #2712: State the Build Profile's CI Type Check as the Validator Runs It - #2709: Bring the Fleet-Map workflow-ci-contract Entry and G9 Gap Up to the Skill Description - #2707: Bring the Line-Endings Reference and a Test Docstring to the Corrected Wording - #2705: Drop the Stale Utilities driftNote From the Registry - #2703: Remove the Inert SC2016 Directives in configure.sh and Correct the shell-codestyle Claim - #2701: Report Whether the Fleet Skills Plugin Is Installed and Enabled in the Live Channel - #2699: Align the Audit Report Template Dimensions With AUDIT.md Section 4 - #2697: Harden the Source-Pinning Assertions in test_pr_review.py - #2695: Name the Off-Grammar --branch Outcome in AUDIT.md - #2693: Count Every Unresolved Review Thread in pr_review.py Closes #1396 Closes #2731 Closes #2723 Closes #2725 Closes #2724 Closes #2685 Closes #1308 Closes #2191 Closes #1862 Closes #2711 Closes #2025 Closes #1243 Closes #1237 Closes #1115 Closes #1156 Closes #1757 Closes #1593 Closes #1732 Closes #1509 Closes #1404 🤖 Generated with [Claude Code](https://claude.com/claude-code)

Summary
scripts/pr_review.py waitnow runs both of its polls through onebackoffhelper on thePOLL_DELAYSschedule, so a fix to the timeout check or the delay schedule lands once. The Copilot poll passes in its initial(done, answer, drift)tuple, so the--ignore-quota-signalpath that forcesdonefalse still holds for the first evaluation, and re-reads throughlive_state, now extended to return those three readings rather than left as an unused sibling.Q_HELDdocument, the fields its readers use, sharing oneHELD_FIELDSfragment withQ_FULL. AQ_HELDread that would end the poll is re-read asQ_FULLfirst, so the poll stops only on the full payload the verdict then grades, and a poll that never sleeps grades its first read with no extra call. On the timeout the verdict takes a freshQ_FULL.backoffcases pin the delay schedule and the timeout bound, a case pinsQ_HELDleaving out the threads and files, and twowaitcases pin the query sequence and the full-read confirmation. The existingwaittests pass unchanged. Two other existing tests changed: the contract test that scraped a localdelayslist now readsPOLL_DELAYS, and the twolive_statetests take its new return shape.Closes on promotion: #2723
Local review
Three
local-strict-reviewpasses ran, and the edit budget is spent. Disposed of so far:def backoff[Polled]needs Python 3.12. Declined:spec/host-tools.jsonsets the interpreter floor at 3.13, and ruff's default rules undertarget-version = "py313"(UP047) refuse theTypeVarform.Q_FULLreads, are filed as Deduplicate pr_review.py wait's Liveness Triple and Its Back-to-Back Held Q_FULL Reads #2731.Still open, each
introduced:answerfake ignores the query, so everyQ_HELDread in the suite carriesreviewThreadsandfiles. Replacingfinal = polled if any(polled is f for f in fulls) else Nonewithfinal = polledpasses the suite, although on a held timeout ending on aQ_HELDread the digest would raise aKeyErroronreviewThreads.fullslist and its identity scan do more than the job needs, since only the last full read can be the returned value.🤖 Generated with Claude Code