Fix IRV results contract for strategy polling - #57
Conversation
Reviewer's GuideIRV’s public results contract is restored to return high-is-better candidate scores from rank-vector ballots, IRV-specific resultsFor/winner behavior is removed in favor of generic Method semantics, and regression coverage is added to ensure IRV polling and winner selection behave correctly for strategy use cases. Sequence diagram for updated IRV.results rank-vector handlingsequenceDiagram
participant Consumer
participant Irv
participant rankVectorToPreference
participant runIrv
participant finishOrderToResults
Consumer->>Irv: results(ballots)
Irv->>Irv: convert ballots to list
loop for each ballot
Irv->>rankVectorToPreference: rankVectorToPreference(ballot)
rankVectorToPreference-->>Irv: preference_order
end
Irv->>runIrv: runIrv(buildPreferenceSchedule(rankings), ncand)
runIrv-->>Irv: finishOrder
Irv->>finishOrderToResults: finishOrderToResults(finishOrder)
finishOrderToResults-->>Irv: results_scores
Irv-->>Consumer: results_scores
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
|
Warning Review limit reached
Next review available in: 34 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
5912a2a to
6105908
Compare
Co-authored-by: Cursor <cursoragent@cursor.com>
6105908 to
ac1a532
Compare
Summary
Tests
Made with Cursor
Summary by Sourcery
Align IRV simulator results with the generic method contract so polling and strategy use high-is-better candidate scores derived from finish order.
New Features:
Bug Fixes:
Enhancements:
Tests: