[Debt] Decompose Poll update and response-retirement state transitions #3

Closed
opened 2026-07-29 13:25:59 +02:00 by zemion · 2 comments
Owner

Problem

retire_poll_responses (D/26) and update_poll (D/23) encode multiple poll lifecycle and response-validity transitions. Scheduling builds on Poll, so transition behavior needs to be explicit before more poll types and constraints are added.

Acceptance criteria

  • Poll update planning is separated from persistence.
  • Every option/participant/scope change states whether existing responses remain valid, are retired, or are rejected.
  • Retirement is idempotent and bounded.
  • Scheduling integration tests cover affected transitions.
  • Poll passes the configured Xenon threshold.
## Problem `retire_poll_responses` (D/26) and `update_poll` (D/23) encode multiple poll lifecycle and response-validity transitions. Scheduling builds on Poll, so transition behavior needs to be explicit before more poll types and constraints are added. ## Acceptance criteria - Poll update planning is separated from persistence. - Every option/participant/scope change states whether existing responses remain valid, are retired, or are rejected. - Retirement is idempotent and bounded. - Scheduling integration tests cover affected transitions. - Poll passes the configured Xenon threshold. <!-- poll-transition-complexity-20260729 -->
Author
Owner

Codex State: reviewed

Reviewed after published Poll fc0246b. This remains open: fresh Xenon still reports retire_poll_responses and update_poll at rank D. Transition planning/validation and persistence side effects remain coupled.

## Codex State: reviewed Reviewed after published Poll `fc0246b`. This remains open: fresh Xenon still reports `retire_poll_responses` and `update_poll` at rank D. Transition planning/validation and persistence side effects remain coupled.
Author
Owner

Implemented and pushed in 652b7e1.

Poll updates are now planned before persistence and carry an explicit existing-response disposition. The decision table records that policy/timing/owner-approved scope updates and option reordering preserve responses, option content/removal invalidates affected answers or rejects when updates are disabled, and participant removal retires responses. Retirement selectors and matched rows are bounded, and idempotency replay is evaluated before active rows so an old retry cannot retire a later submission.

Verification: 68 Poll tests, 74 Scheduling integration tests, Ruff, Xenon at the configured C/B/A threshold, and diff checks pass.

Implemented and pushed in `652b7e1`. Poll updates are now planned before persistence and carry an explicit existing-response disposition. The decision table records that policy/timing/owner-approved scope updates and option reordering preserve responses, option content/removal invalidates affected answers or rejects when updates are disabled, and participant removal retires responses. Retirement selectors and matched rows are bounded, and idempotency replay is evaluated before active rows so an old retry cannot retire a later submission. Verification: 68 Poll tests, 74 Scheduling integration tests, Ruff, Xenon at the configured C/B/A threshold, and diff checks pass.
zemion removed the
status
ready
codex/ready
labels 2026-07-29 19:02:18 +02:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: GovOPlaN/govoplan-poll#3
No description provided.