feat(elections): STV tabulation engine with test fixtures
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 35/100
- Loại issue
- Tính năng
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Ít trao đổi
- Lĩnh vực
- backend, documentation, testing-qa
Hướng nghiên cứu
Start in the packages/tabulation/ package and read the IRV sibling issue and the schema issue first. Define the server-side STV API, then add hand-calculated golden fixtures and compare at least three cases with OpenSTV. Done means deterministic quota, transfers, eliminations, exhaustion, auto-election, and documented WIG behavior in code and docs/elections/tabulation.md.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Summary
Implement a Single Transferable Vote tabulation engine that elects multiple winners using the Droop quota and surplus transfer.
Part of #1933.
Requirements
- Pure function: `tabulateSTV(ballots, candidates, seats) → { rounds[], winners[], exhaustedBallots }`
- Compute Droop quota: `floor(validBallots / (seats + 1)) + 1`
- Elect any candidate reaching quota; transfer surplus using a documented method (Meek, Gregory, or Weighted Inclusive Gregory — pick and document one)
- When no candidate reaches quota, eliminate lowest and redistribute
- Handle tie-breaks deterministically (same rule as IRV)
- Handle exhausted ballots explicitly
- Stop when all seats filled, or when remaining candidates ≤ remaining seats (auto-elect)
- Document the chosen surplus-transfer method in code comments AND in `docs/elections/tabulation.md`
- Golden fixture tests with hand-calculated multi-seat elections
- Tabulation runs server-side only
Context
- Epic: #1933
- Depends on schema issue
- STV handles multi-seat races (board elections)
- IRV issue: see sibling issue
Implementation notes
- Start with Weighted Inclusive Gregory (WIG) — simpler to explain publicly than Meek, widely used (e.g., Scottish local elections)
- Same `packages/tabulation/` package as IRV
- Compare against a reference (e.g., OpenSTV) for at least 3 test cases
- Ngôn ngữ chính
- HTML
- Star
- 33
- Fork
- 107
- Merge trung bình
- 14 giờ 6 phút
- Pull request đã merge (30 ngày)
- 19
Chuẩn bị môi trường
- Có Dockerfile hoặc tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của USRSE/usrse.github.io
-
update community awardsĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
USRSE/usrse.github.io#2117 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 63/100
USRSE/usrse.github.io#2115 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Broken URLs on the websiteĐang mởbroken-links
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
USRSE/usrse.github.io#2099 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
USRSE/usrse.github.io#2085 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 85/100
USRSE/usrse.github.io#2001 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của USRSE/usrse.github.io
Issue tương tự
-
Calc 1.1: inconsistent duplicate facts with equal `decimals` don't stop the calculation checkĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
rubenarslan/formr#63 ·
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
Maintainer thường phản hồi trong vòng 1 ngày
-
StreamPipe input stream: readWithTimeout(n, 0) blocks forever instead of returning immediatelyĐang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
qoretechnologies/qore#8159 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày