votingworks / arlo

GNU Affero General Public License v3.0
141 stars 25 forks source link

Update batch inventory tool to support generating candidate-totals-by-batch files from PA and RI ES&S CVR files #1923

Closed arsalansufi closed 6 months ago

arsalansufi commented 6 months ago

Overview

Issue link: https://github.com/votingworks/arlo/issues/1866

Jurisdictions often struggle to prepare their files for batch audits. We've built a "batch inventory" tool for Georgia that helps them prepare these files from their CVR files, while also still making sure that they still physically inventory their ballots (though part of audit setup, an audit of its own, in a way).

For Pennsylvania and Rhode Island's upcoming audits, we want to try a permutation of the above model. We're going to have PA and RI jurisdictions upload their CVR files and auto-generate one of the two batch audit files, the candidate-totals-by-batch file. We'll still have them prepare ballot manifests manually.

Also of note is that PA and RI use ES&S (GA uses Dominion). So I've added a screen to the batch inventory tool to select your system type and updated the backend to support parsing ES&S CVR files, given example files we've received from both states plus our existing knowledge of ES&S CVR files. Some jurisdictions will have a single CSV with all relevant information (this is a new format that we're seeing for the first time). Others will have the multiple files that we're accustomed to (one core CVR file and one or many "ballots" files with additional metadata). For the latter, we'll expect users to bundle all their files into a single ZIP file.

As we generalize this tool, we're rebranding it the "Batch Audit File Preparation Tool". Note that we'll eventually want to replace this tool with something more seamless/integrated into the audit setup UI. It's definitely clunky, uploading files to generate new files which you then have to upload again 😅.

UI for GA after this update

The "Select System Type" screen is new. We still prepare both ballot manifests and candidate-totals-by-batch files for GA.

GA

UI for PA and RI

We'll only prepare candidate-totals-by-batch files, not ballot manifests, for PA and RI. The "Inventory Batches" step was only relevant for auto-generated ballot manifests so dropped that for PA and RI.

PA and RI

PA and RI in action

https://github.com/votingworks/arlo/assets/12616928/302117cc-e4f5-43dc-9319-0723f26ab98e

Testing

Lots of manual testing with representative files. Did the bare minimum re automated tests. Planning to add more in a follow-up PR as I'm on a bit of a time crunch (RI may audit next week).