Reset Production Submissions
This is a destructive production operation. Use the connection procedure and
firewall cleanup rules from query-prod-db.
- Resolve the GitHub username through
users; do not use remembered IDs. - Resolve any requested requirement slug to its UUID from the current curriculum artifact.
- Preview matching rows from
verification_attempts, includingid,requirement_uuid,outcome, and timestamps. Scope byuser_idand, unless resetting everything was explicit,requirement_uuid. - Show the exact count and scope, then obtain explicit user confirmation.
- Delete only the previewed scope in one transaction using the same predicates.
Use
RETURNING idand verify the remaining count before commit. - Re-query after commit and report the deleted and remaining counts.
Progress is derived from verification_attempts; no counter requires updating.
Do not use the retired submissions or verification_jobs tables. Do not
broaden a requirement-scoped reset to all attempts. If the schema, username, or
slug cannot be resolved unambiguously, stop without deleting.