feat(elections): audit log and election lifecycle state machine
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 初心者へのやさしさ
- 35/100
- issue の種類
- 機能追加
- 明瞭さ
- おおむね明確
- 活発さ
- 静か
- 領域
- backend, database, documentation, frontend
調査の方向性
Start by reviewing the dependent schema and admin UI issues, then read docs/elections/lifecycle.md. Map the requested lifecycle, guardrails, scheduled close, audit viewer, CSV export, and admin mutation coverage before implementation. Done means all listed transitions and audit requirements are covered, with lifecycle documentation updated.
索引モデルが issue の本文から書いたものです。
説明
Summary
Formalize the election lifecycle (draft → open → closed → published) as an explicit state machine, and make every admin-originated state change visible in an immutable audit log.
Part of #1933.
Requirements
- State transitions: `draft → open`, `open → closed`, `closed → published`; enforce in Convex mutations — no back-transitions
- Guardrails on opening: no open if races are empty, if voter roll is empty, or if opensAt/closesAt are missing
- Auto-transition `open → closed` via scheduled Convex job at `closesAt`
- Audit-log viewer in admin UI: filter by election, actor, action type
- Audit entries are append-only; no delete or edit mutation exists for `auditLog`
- Every admin mutation (election create/edit, race edit, voter import, token regen, email send, status change) writes an audit row with actor email, action, metadata, timestamp
- Export audit log to CSV for post-election records
- Document the state machine in `docs/elections/lifecycle.md`
Context
- Epic: #1933
- Depends on schema issue and admin UI issue
- This is the last piece of the trust story — with ballot secrecy on one side and a full audit trail on the other, the election is both private to voters and accountable to observers.
Implementation notes
- Model state transitions with a small XState machine or a typed discriminated union of transitions — either is fine; prefer whichever is simpler to read
- Scheduled close job: Convex cron or scheduled action; idempotent so it can safely re-run
- 主要言語
- HTML
- スター
- 33
- フォーク
- 107
- 平均マージ
- 14時間 6分
- マージ済み PR(30日)
- 19
環境構築
- Dockerfile または Docker Compose ファイルあり
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
USRSE/usrse.github.io のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
USRSE/usrse.github.io#2117 ·
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 63/100
USRSE/usrse.github.io#2115 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
broken-links
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
USRSE/usrse.github.io#2099 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
USRSE/usrse.github.io#2085 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 85/100
USRSE/usrse.github.io#2001 ·
メンテナーはふだん 1 日以内に返信
USRSE/usrse.github.io の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
rubenarslan/formr#63 ·
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
qoretechnologies/qore#8159 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信