Add draft review gate and freeze snapshot at vote-open (issues #10/#11) #26

Merged
PlasticDigits merged 2 commits from feat/11-draft-lifecycle into main 2026-08-30 06:17:55 +00:00
PlasticDigits commented 2026-08-30 05:55:08 +00:00 (Migrated from gitlab.com)

Summary

  • Proposals start as drafts with a structured template (problem, context, solution, pros/cons, TL;DR, success criteria). Votes are rejected until a committee wallet opens the poll.
  • Snapshot freeze { terra_height, bsc_block } is taken from indexer tips at open, not draft create. Client-supplied heights are ignored. A wallet that registers during draft and holds CL8Y is in the electorate; register-after-open is not.
  • Signed comments (any registered wallet), proposer-only amends (409 on stale prev_body_hash), and committee independent analysis. UI hides vote CTAs until status=open. Copy is “register before votes open.”

Issue #11 depends on the #10 template. This MR implements both so comments are not attached to freeform HTML. If !23 (feat/10-proposal-template) merges first, this branch will need a migration rebase.

Closes #11. Related #10.

Skill for 3rd-party agents: skills/AGENTS_DRAFT_REVIEW.md. Invariants: OV-S1–S6 in docs/OPERATOR_VOTING.md.

Test plan

  • cargo test --workspace --lib
  • LEDGER_TEST_DATABASE_URL=… cargo test --workspace --tests (draft/open/vote, freeze-at-open, privilege + grants.sql)
  • cd frontend && npm test && npm run test:e2e (5 workers; draft → comment → open → vote)
  • Staging: set VOTING_COMMITTEE_ADDRESSES; Legal → Terra and BSC register → draft → second wallet comments → committee open → both chains vote
  • Confirm register-during-draft can vote after open; register-after-open cannot
  • gitleaks detect (no new secrets; committee/AI keys only as server env placeholders)
## Summary - Proposals start as **drafts** with a structured template (problem, context, solution, pros/cons, TL;DR, success criteria). Votes are rejected until a committee wallet opens the poll. - Snapshot freeze `{ terra_height, bsc_block }` is taken from indexer tips at **open**, not draft create. Client-supplied heights are ignored. A wallet that registers during draft and holds CL8Y is in the electorate; register-after-open is not. - Signed comments (any registered wallet), proposer-only amends (`409` on stale `prev_body_hash`), and committee independent analysis. UI hides vote CTAs until `status=open`. Copy is “register before votes open.” Issue [#11](https://gitlab.com/PlasticDigits/voting/-/issues/11) depends on the [#10](https://gitlab.com/PlasticDigits/voting/-/issues/10) template. This MR implements both so comments are not attached to freeform HTML. If !23 (`feat/10-proposal-template`) merges first, this branch will need a migration rebase. Closes [#11](https://gitlab.com/PlasticDigits/voting/-/issues/11). Related [#10](https://gitlab.com/PlasticDigits/voting/-/issues/10). Skill for 3rd-party agents: [`skills/AGENTS_DRAFT_REVIEW.md`](https://gitlab.com/PlasticDigits/voting/-/blob/feat/11-draft-lifecycle/skills/AGENTS_DRAFT_REVIEW.md). Invariants: OV-S1–S6 in `docs/OPERATOR_VOTING.md`. ## Test plan - [ ] `cargo test --workspace --lib` - [ ] `LEDGER_TEST_DATABASE_URL=… cargo test --workspace --tests` (draft/open/vote, freeze-at-open, privilege + `grants.sql`) - [ ] `cd frontend && npm test && npm run test:e2e` (5 workers; draft → comment → open → vote) - [ ] Staging: set `VOTING_COMMITTEE_ADDRESSES`; Legal → Terra **and** BSC register → draft → second wallet comments → committee open → both chains vote - [ ] Confirm register-during-draft can vote after open; register-after-open cannot - [ ] `gitleaks detect` (no new secrets; committee/AI keys only as server env placeholders)
PlasticDigits commented 2026-08-30 05:55:17 +00:00 (Migrated from gitlab.com)

mentioned in issue #11

mentioned in issue #11
PlasticDigits commented 2026-08-30 06:17:36 +00:00 (Migrated from gitlab.com)

added 14 commits

  • b06bb01f...ea426406 - 13 commits from branch main
  • 83b8b26f - Merge origin/main into feat/11-draft-lifecycle after !21, !23, and !25.

Compare with previous version

added 14 commits <ul><li>b06bb01f...ea426406 - 13 commits from branch <code>main</code></li><li>83b8b26f - Merge origin/main into feat/11-draft-lifecycle after !21, !23, and !25.</li></ul> [Compare with previous version](/PlasticDigits/voting/-/merge_requests/9/diffs?diff_id=1992516655&start_sha=b06bb01f6855490ac6cb0e935d5e841bc8579c2d)
PlasticDigits commented 2026-08-30 06:17:56 +00:00 (Migrated from gitlab.com)

mentioned in commit 842ee1137c

mentioned in commit 842ee1137c778257daa768c6daea4203fd58e2db
PlasticDigits (Migrated from gitlab.com) merged commit 842ee1137c into main 2026-08-30 06:17:56 +00:00
PlasticDigits commented 2026-08-30 06:21:55 +00:00 (Migrated from gitlab.com)

mentioned in issue #15

mentioned in issue #15
PlasticDigits commented 2026-08-30 06:21:57 +00:00 (Migrated from gitlab.com)

mentioned in issue #10

mentioned in issue #10
PlasticDigits commented 2026-08-30 06:22:07 +00:00 (Migrated from gitlab.com)

mentioned in issue #7

mentioned in issue #7
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
code/voting!26
No description provided.