Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add vertical streak detection controls #5549

Merged
merged 6 commits into from
Oct 24, 2024

Conversation

eventualbuddha
Copy link
Collaborator

Overview

Closes #5538

Adds a system setting that disables streak detection for an election. We might want this in case of a ballot design that triggers false positives when looking for streaks. Because we support taking someone else's AccuVote-style ballot, we may not be able to ensure no streaks are naturally present in the original image. This is unlikely, but this gives us an escape hatch.

Demo Video or Screenshot

image

Testing Plan

Automated testing and manual testing of VxCentralScan via MOCK_SCANNER_FILES.

@eventualbuddha eventualbuddha linked an issue Oct 23, 2024 that may be closed by this pull request
@eventualbuddha eventualbuddha changed the title 5538 vertical streak detection controls Add vertical streak detection controls Oct 23, 2024
apps/scan/backend/src/scanners/pdi/state_machine.ts Outdated Show resolved Hide resolved
apps/central-scan/backend/src/app.scanning.test.ts Outdated Show resolved Hide resolved
@eventualbuddha eventualbuddha force-pushed the 5538-vertical-streak-detection-controls branch from 4af4c79 to 44f45a2 Compare October 24, 2024 17:44
@eventualbuddha eventualbuddha enabled auto-merge (squash) October 24, 2024 17:45
If `options` was given as `{ scoreWriteIns: undefined }`, the interpreter would fail to coerce the value as a `bool` but would ignore the error until some point in the future when interacting with the JavaScript context. This is because the `get::<JsBoolean>` call would put the context into a throwing state, but would not then bubble that `Throw` up to the caller. As a result, subsequent calls to the context would also yield `Throw` for operations that should have succeeded. In this case the error would be "failed to downcast any to boolean".

To fix this we need to not trigger throws when we don't intend to bubble them up. In particular, instead of `get::<JsBoolean>` we now `get_value()?.downcast::<JsBoolean>` so that we can bubble possible errors from the getter but then handle a mismatched type in Rust appopriately.
Closes #5538

Adds a system setting that disables streak detection for an election. We might want this in case of a ballot design that triggers false positives when looking for streaks. Because we support taking someone else's AccuVote-style ballot, we may not be able to ensure no streaks are naturally present in the original image. This is unlikely, but this gives us an escape hatch.
Ensures that the `disableVerticalStreakDetection` system setting is passed through from the CLI. Also adds a CLI option to disable streak detection.
@eventualbuddha eventualbuddha force-pushed the 5538-vertical-streak-detection-controls branch from 44f45a2 to bfc6348 Compare October 24, 2024 20:28
@eventualbuddha eventualbuddha merged commit 9801fad into main Oct 24, 2024
62 checks passed
@eventualbuddha eventualbuddha deleted the 5538-vertical-streak-detection-controls branch October 24, 2024 20:35
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.

Vertical Streak Detection Controls
2 participants