feat(elections): STV tabulation engine with test fixtures
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 35/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Tranquilla
- Ambito
- backend, documentation, testing-qa
Direzione di ricerca
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.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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
- Lingua principale
- HTML
- Stelle
- 33
- Fork
- 107
- Merge medio
- 14h 6m
- PR unite (30g)
- 19
Preparare l'ambiente
- Include un Dockerfile o un file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di USRSE/usrse.github.io
-
update community awardsAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
USRSE/usrse.github.io#2117 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 63/100
USRSE/usrse.github.io#2115 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Broken URLs on the websiteApertabroken-links
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
USRSE/usrse.github.io#2099 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
USRSE/usrse.github.io#2085 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 85/100
USRSE/usrse.github.io#2001 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di USRSE/usrse.github.io
Issue simili
-
Calc 1.1: inconsistent duplicate facts with equal `decimals` don't stop the calculation checkAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
rubenarslan/formr#63 ·
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
I maintainer di solito rispondono entro 1 giorno
-
StreamPipe input stream: readWithTimeout(n, 0) blocks forever instead of returning immediatelyApertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
qoretechnologies/qore#8159 ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno