feat(elections): STV tabulation engine with test fixtures
Maintainer antworten meist innerhalb von 1 Tag
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 5/5
- Geschätzter Aufwand
- Über eine Woche
- Anfängerfreundlichkeit
- 35/100
- Issue-Typ
- Feature
- Klarheit
- Größtenteils klar
- Aktivitätsstatus
- Ruhig
- Bereich
- backend, documentation, testing-qa
Rechercherichtung
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.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
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
- Vorherrschende Sprache
- HTML
- Sterne
- 33
- Forks
- 107
- Ø Merge
- 14 Std. 6 Min.
- Gemergte PRs (30 T.)
- 19
Entwicklungsumgebung
- Enthält ein Dockerfile oder eine Docker-Compose-Datei
- Hat eine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus USRSE/usrse.github.io
-
update community awardsOffen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 68/100
USRSE/usrse.github.io#2117 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Update conference link from USRSE'26 to USRSE'27.Evtl. vergeben Ein verknüpfter Pull Request ist offen oder bereits gemergt. Offen
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 63/100
USRSE/usrse.github.io#2115 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
broken-links
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 88/100
USRSE/usrse.github.io#2099 · 2 Kommentare ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 75/100
USRSE/usrse.github.io#2085 · 2 Kommentare ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 85/100
USRSE/usrse.github.io#2001 ·
Maintainer antworten meist innerhalb von 1 Tag
Alle Issues in USRSE/usrse.github.io
Ähnliche Issues
-
bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 82/100
genfeedai/genfeed.ai#11828 ·
Maintainer antworten meist innerhalb von 1 Tag
-
enhancement good first issue help wanted
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 83/100
NOAA-OWP/ngen#1110 · 2 Kommentare ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 76/100
ExpressionEngine/ExpressionEngine#5493 ·
Maintainer antworten meist innerhalb von 5 Tagen
-
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 95/100
-
integration: llama_cpp
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
home-assistant/core#195670 · 2 Kommentare ·
Maintainer antworten meist innerhalb von 1 Tag