Clean and consolidate the Rust voting integration
Outcome Before adding more parity or deployment work, reduce the current branch to one clear Rust voting boundary and remove obsolete prototype, compatibility and placeholder paths that would otherwise be extended accidentally. Initial cleanup findings - Secretary::VotingRunsController still exposes the early single-proposal JSON create/show API and a large request spec, while the production secretary UI starts all typed ballots through Secretary::PollsController and Gateway. The JSON path appears to have no application caller. - Start/read/lifecycle error mapping is split across PollsController and VotingRunsController, including JSON-only rescue behavior in a controller that now also serves Turbo modals/actions. - PollView carries legacy compatibility methods and hard-coded placeholders such as public_result=true and empty summary behavior. Classify each as required adapter surface, pending parity, or dead API before extending it. - Unsupported-state translations/views and report placeholders are mixed with genuine outage handling. Keep only intentional fail-closed states and remove each temporary path when its replacement is ready. - Tests contain separate early-MVP endpoint coverage alongside the shared typed UI/round-trip suites; consolidate around retained boundaries without losing authorization, CSRF, source validation or real-Rust coverage. Constraints - Do not change voting semantics, add deployment work, restore Rails ballot persistence, or remove a fail-closed guard before its supported replacement exists. - Preserve one typed Gateway/Client/Snapshot/PollView path and shared ViewComponents. Search for all consumers before removing compatibility methods or routes. Acceptance criteria - Obsolete development/MVP endpoints, actions, parameters, routes and tests are removed or explicitly justified as supported API. - Controller command/read/error handling is consolidated around resource-specific authorization and correct HTML/Turbo/JSON responses without duplicated source validation. - PollView and presentation adapters expose only a documented consumed interface; pending privacy/report metadata is represented deliberately rather than by misleading hard-coded compatibility values. - Temporary unsupported and outage states are clearly separated, with no stale feature flags, prototype terminology, dead translations or unreachable views. - Focused architecture/request/component tests prove one runtime path, no Rails fallback or legacy writes, and equivalent authorization/CSRF/fail-closed behavior. Rust/Rails validation and changed-code RuboCop pass. Sequencing Complete this cleanup before the correctness, confidentiality, reporting/migration and final deployment phases, except where a placeholder must remain until its replacement lands. Verified outcome - Removed the unused early-MVP secretary JSON create/show routes, controller actions, proposal-only parameter adapter and isolated 13-example request spec. Typed starts now have one production route through PollsController and Gateway; architecture coverage prevents the API from returning. - Removed the Gateway proposals fallback, Run source setters and unused PollView compatibility methods. The still-required public-result/summary defaults are explicitly documented as temporary presentation metadata behavior pending the dedicated parity work. - Consolidated secretary authorization and Rust/unsupported error mapping in one concern with standard Turbo flash and HTML redirect responses. Typed start coverage now proves secretary authorization, CSRF, conflict mapping and no legacy writes; bias correction errors no longer return JSON to Turbo actions. - Removed two dead public unsupported translation keys and their negative assertions. Retained only the unsupported-mode and report placeholders that still guard unfinished behavior. - Removed the stale feature/rust-voting-mvp branch label from the architecture document and updated its review date. - Validation passed: 133 focused Rails examples with zero failures and three expected external-service skips; all 18 Rust tests including real PostgreSQL; eight Ruby client examples; three real-service round trips; one authenticated real-Rust system example; Zeitwerk; changed-Ruby RuboCop; Rust fmt/strict Clippy/docs; translation validation; whitespace checks; and Typst 0.15.1 PDF compilation/text extraction plus visual review of all nine A4 pages.
Checklist
4 of 4 complete- Inventory and remove or justify early-MVP JSON create/show routes, actions, parameters and isolated request coverage.
- Consolidate controller authorization, source loading and error responses across typed start and per-run lifecycle actions.
- Classify and reduce PollView compatibility methods plus temporary unsupported/outage presentation paths without removing required fail-closed behavior.
- Consolidate tests around the retained Gateway/Client/Snapshot/PollView boundaries and pass focused Rust/Rails validation.
- Area
- Kaukus
- Kind
- Chore
- Priority
- High
- Task ID
tsk_qr7rfuamd2- Updated