Support explicit blank votes across ballot review, tallying, and results#2599
Support explicit blank votes across ballot review, tallying, and results#2599
Conversation
Agent-Logs-Url: https://github.com/sequentech/step/sessions/bc3b039f-d605-44d1-9588-6f8fd0a0386e Co-authored-by: edulix <81968+edulix@users.noreply.github.com>
Agent-Logs-Url: https://github.com/sequentech/step/sessions/bc3b039f-d605-44d1-9588-6f8fd0a0386e Co-authored-by: edulix <81968+edulix@users.noreply.github.com>
|
Thank you for your contribution! Before we can merge this PR, we need you to sign our Contributor License Agreement (CLA). You can retrigger this bot by commenting recheck in this Pull Request. Posted by the CLA Assistant Lite bot. |
edulix
left a comment
There was a problem hiding this comment.
Please review:
- you didn't modify the ballot codec in step/packages/sequent-core/src/ballot_codec/ for adding support for separating how we encode/decode the blank votes between explicit and implicit
- Ensure you have documented the ballot codec in the reference doc section of docs/docusaurus, similar to https://sequentech.github.io/documentation/docs/general/reference/ballot-encoding but more professional
- Ensure all tests pass and changes are unit tested
Agent-Logs-Url: https://github.com/sequentech/step/sessions/d4eb38a6-d797-464c-9db5-b58be95688b1 Co-authored-by: edulix <81968+edulix@users.noreply.github.com>
Addressed in a4cb2fe. I added explicit-vs-implicit blank handling to the single-contest ballot codec, added focused raw-ballot unit coverage for the new encoding/decoding path, and added the Docusaurus reference doc at Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
|
| is_encrypted: true, | ||
| candidates, | ||
| presentation: None, | ||
| tie_breaking_policy: None, |
There was a problem hiding this comment.
That line is only there to keep the existing multi_ballot test helper compiling after the contest struct gained tie_breaking_policy; it does not change runtime behavior. I left it in place while addressing the configuration-validation follow-up in ec51375. Screenshot: /tmp/ballot-config-preview.png.
| let mut choices: Vec<u64> = vec![]; | ||
|
|
||
| let char_map = self.get_char_map(); | ||
| let explicit_blank_candidate = get_explicit_blank_candidate(self)?; |
There was a problem hiding this comment.
modify step/packages/sequent-core/src/ballot_codec/checker.rs to check that there's not more than one explicit blank vote, and also same for explicit invalid, and ensure this goes all up to the voting portal. no vote should be cast if something like this is configured. have proper i18n messages for voting portal in that case.
There was a problem hiding this comment.
Addressed in ec51375. I added duplicate explicit-marker validation in checker.rs, wired the codec paths to reject malformed contests, and blocked the voting portal from proceeding when a ballot style defines more than one explicit blank or explicit invalid marker. The portal now shows translated user-facing errors for both cases. Screenshot: /tmp/ballot-config-preview.png.
| @@ -0,0 +1,146 @@ | |||
| --- | |||
There was a problem hiding this comment.
be much more detailed on all cases and do not mention any files or implementation details this file should be like an RFC or blueprint for anyone trying to implement fully the codec. take your time do it right.
There was a problem hiding this comment.
Reworked in ec51375. The reference doc is now a much more detailed, implementation-neutral specification covering candidate classes, mixed-radix layout, explicit blank vs implicit blank semantics, explicit invalid markers, write-ins, decoding, validation, error conditions, canonical examples, and the multi-contest codec without referring to source files. Screenshot: /tmp/ballot-config-preview.png.
Agent-Logs-Url: https://github.com/sequentech/step/sessions/cac1aabd-3433-42b7-9872-e5d932727dab Co-authored-by: edulix <81968+edulix@users.noreply.github.com>
Agent-Logs-Url: https://github.com/sequentech/step/sessions/cac1aabd-3433-42b7-9872-e5d932727dab Co-authored-by: edulix <81968+edulix@users.noreply.github.com>
|
Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details. Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
This change keeps explicit blank votes distinct from implicit blank votes instead of collapsing both into a generic blank ballot. Explicit blank selections now remain visible in review/verifier flows, while results continue to expose consolidated blank totals alongside the explicit/implicit split.
Changes Made
Ballot state and review rendering
Ballot codec and validation
Tally model and aggregation
total_blank_votesas the consolidated count used by existing consumers.Results export and admin presentation
Documentation
Regression coverage
Testing
cargo test -p sequent-core --features default_features checker -- --nocapturecargo test -p sequent-core --features default_features test_explicit_blank_uses_dedicated_raw_ballot_flag -- --nocapturecargo test -p sequent-core --features default_features test_explicit_blank_round_trip_preserves_candidate_selection -- --nocapturecargo test -p velvet blank_votes -- --nocaptureyarn --cwd ./ui-core lint ...yarn --cwd ./voting-portal lint ...yarn build:ui-core && yarn build:ui-essentials && yarn build:voting-portal