Skip to content

Show ASF IDs on STV ballots#103

Open
tisonkun wants to merge 3 commits into
trunkfrom
issue-93
Open

Show ASF IDs on STV ballots#103
tisonkun wants to merge 3 commits into
trunkfrom
issue-93

Conversation

@tisonkun

Copy link
Copy Markdown
Member

This resolves #93.

This patch is driven by Codex while I do an overall review that it generally looks good.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR implements “STV KV v2” candidate metadata to carry ASF IDs alongside display names, and updates the voting UI to show ASF IDs on STV ballots.

Changes:

  • Add version: 2 STV KV support where labelmap values are [asfid, name] pairs, with normalization via get_candidates().
  • Render ASF IDs in the STV ballot UI and embed {label, asfid, name} candidate objects into the page.
  • Update tests/coverage scaffolding and sample election YAML to exercise and document the v2 format.

Reviewed changes

Copilot reviewed 5 out of 9 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
v3/tests/test_stv.py Adds unit tests for get_candidates() and verifies tally behavior across kv versions.
v3/tests/check_coverage.py Updates coverage test election to use STV kv v2 labelmap pairs.
v3/steve/vtypes/stv.py Introduces get_candidates() and updates STV tally logic to consume versioned candidate metadata.
v3/steve/election.py Comment formatting only (no behavior change).
v3/server/templates/vote-on.ezt Embeds ASF IDs into client-side STV candidate data and displays them in the ballot UI.
v3/server/pages.py Uses get_candidates() to populate normalized STV candidates for the vote-on page.
v3/server/bin/tally.py Formatting-only changes.
v3/server/bin/election.yaml.sample Updates sample STV configuration to kv v2 [ASF ID, name] pairs.
v3/server/bin/create-election.py Validates STV candidate kv structure via get_candidates().

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread v3/steve/vtypes/stv.py
Comment on lines +87 to +89
candidates = get_candidates(kv)
labelmap = {label: candidate['name'] for label, candidate in candidates.items()}
revmap = {name: label for label, name in labelmap.items()}

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems a new feature that we may handle in a follow-up PR.

Comment thread v3/steve/vtypes/stv.py Outdated
Comment thread v3/server/templates/vote-on.ezt Outdated
tisonkun added 2 commits July 23, 2026 02:26
Signed-off-by: tison <wander4096@gmail.com>
Signed-off-by: tison <wander4096@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Show asfid on the ballot

2 participants