plan(voting): implementation backlog for all 53 gaps in GAP_1791945837 #35

Open
opened 2026-10-14 03:10:02 +00:00 by PlasticDigits · 0 comments
Owner

Current codebase

Voting is a standalone offchain CL8Y advisory polling application: Terra Classic CW20 and BSC BEP-20 registered-wallet ledger, ADR-36/EIP-191 operator-voting API, and Legal-gated React dApp. Structured drafts, comments, author amendments, committee opening and frozen weights exist. The gap report reviewed f8dbe93df953a78b17cb3304b717dcf84c4cd517; current e476a68da09645c2308cbf47b90211fcaffcb7af only adds that report. Its local reproduction/source inspection does not establish current production exploitation, coverage, capacity or live-wallet readiness.

Why this implementation is needed

Ledger replay/registration/continuity defects can misstate voting power, and nontransactional revisions can freeze unreviewed content. CORS and timestamp defects compromise working amendments and bounded signatures. Scheduling and multi-editor drafting are requested additions; closing/results, stable wallet identity, recovery/accessibility, security, CI and operational evidence complete a trustworthy product. This tracker bundles related findings into 17 implementation issues and accounts for every GAP-001–053. Existing historical issues #1–17 describe prior functionality; these workstreams address the inspected remaining gaps rather than claiming that existing implementations are absent.

Relevant files

Feature/fix list and coverage

Numbers below are source GAP IDs; workstream keys identify dependencies, not Forgejo issue numbers. GAP-040 is shared adapter/accounting regression work and is intentionally linked twice.

Workstream Priority Implementation issue GAP IDs Depends on workstreams
01 P0 fix(ledger): validate complete Terra execution responses and BSC provider events 001, 009, 012, 040 —
02 P0 fix(ledger): make transfer accounting exactly once across registration and concurrent writers 002, 003, 013, 040 01
03 P0 fix(voting): preserve ledger continuity and require fresh canonical dual-chain snapshots 004, 008, 010 01, 02
04 P1 fix(ledger): isolate chain workers and expose supervised readiness and intent progress 011, 051 02, 03
05 P0 fix(api): make revision approval, signed action consumption and audit receipts transactional 005, 007, 016, 017, 024, 042 02, 03
06 P1 fix(api): enforce CORS, trusted rate limits, safe errors and production network boundaries 006, 018, 020, 021 05
07 P1 fix(database): secure balance definers, least-privilege grants and destructive test isolation 015, 019, 039 05
08 P1 fix(protocol): centralize safe HTML rendering and versioned cross-language API contracts 014, 048, 049 05
09 P1 feat(drafts): add revision-approved scheduled starts and bounded multi-editor collaboration 025, 026 03, 04, 05, 07, 08
10 P1 feat(voting): add bounded closing, advisory results and explicit governance policy disclosures 027, 028, 045 05, 08, 09
11 P1 fix(wallet): synchronize live identities and persist vote eligibility and action state 029, 030, 031, 033, 050 05, 06, 08, 10
12 P2 feat(frontend): preserve draft work and improve accessible discovery and recovery states 032, 034, 035, 036 08, 10, 11, 15
13 P1 fix(legal): verify the installed clickwrap SDK and document UI versus API acceptance boundaries 022, 038 06, 08, 11
14 P1 chore(frontend): triage dependencies and reduce measured wallet bundle cost safely 023, 047 08, 11, 13
15 P2 perf(voting): bound reads and intent batches and remove measured query multiplication 046 02, 04, 05, 08
16 P1 test(ci): require full-stack dual-chain release checks and measurable quality gates 037, 041, 043, 044 01, 02, 03, 05, 06, 07, 08, 09, 10, 11, 12, 13, 14, 15
17 P1 chore(ops): secure release builds and automate restore, rotation and deployment evidence 052, 053 03, 04, 06, 07, 09, 14, 16
  1. Repair adapters/accounting/continuity (01–03), then independent worker readiness (04). New snapshots must require fresh, complete canonical state on both chains.
  2. Land transactional revision approval, bounded/replay-safe signatures and receipts (05), production middleware/config (06), least-privilege DB/test isolation (07) and safe HTML/shared contracts (08). Accounting/signature/concurrency regressions belong in these changes, not only a later assurance issue.
  3. Add scheduled multi-editor drafts (09), then finite close/advisory results (10) and persistent identity/eligibility (11). Scheduled execution is disabled until ledger/approval/permission prerequisites have actual passing evidence.
  4. Bound query cost (15), then draft/discovery/accessibility/recovery UX (12), installed Legal SDK tests (13) and dependency/bundle triage (14).
  5. Require real full-stack release CI and quality budgets (16), then secure images/restore/rotation/deployed evidence (17). Per-issue security testing remains required throughout; final verification does not replace it.

Constraints and guardrails

No new contracts, archive node, executable treasury integration or identity merging; BSC remains core. Preserve raw integer CL8Y accounting, restricted API DB role, proven DEX Terra/Bridge EVM connectors, required early WalletConnect pairing hook, Legal fail-closed transactional UI and no browser BSC balance RPC/seeds/admin credentials. Snapshot is taken once at actual opening, not at draft creation or a backdated scheduled time.

Record conservative policy defaults: scheduled means as soon as approved or at/after the requested date once approved; committee feasibility approval persists, and relevant edits invalidate it. Content remains editable until actual opening. Raw public advisory tallies and immutable address ballots remain defaults; do not silently add quorum/pass labels, secret-ballot claims, roll pruning, vote changes/delegation or execution powers. Optional future decisions in GAP-045 are explicitly documented/deferred in 10. Update affected docs/skills deliberately where scheduling/editor permissions extend their old constraints. Agents own decisions, review/testing and factual acceptance, without human sign-off chores or invented evidence.

Acceptance criteria

  • All 53 GAP IDs map to at least one linked, nonduplicate implementation workstream with concrete current code, rationale, files, solution, guardrails, acceptance, functional/failure and adversarial testing, and verification criteria.
  • P0 correctness and revision/snapshot prerequisites have permanent passing regressions before automatic opening is enabled.
  • Scheduling/editing/closing/results and wallet/Legal flows have matching Terra/BSC support and documented conservative policy defaults.
  • Release contexts actually require product validation; deployed identity/readiness and restored DB/privileges have dated factual evidence.
  • Proposed policy/social additions are distinguished from inspected defects and required requested features. No closure based only on merge, mock E2E, audit counts or historical live QA.

Test plan: supported paths, failure paths and concurrency

Each child issue defines its exact unit/API/DB/browser/failure matrix. Across the backlog, exercise real HTTP adapters → ingest → isolated DB, complete ADR-36 and EIP-191 signed lifecycles, genuine production middleware on a second origin, installed Legal SDK and production-like browser builds. Include registration boundaries/replay, forks/gaps, concurrent edits/approval/quotas, duplicate delivery, scheduling restart/role revocation, close boundaries, account/route races, API/offline recovery, keyboard/mobile/CSP and fresh/upgrade/restore paths. Keep deterministic mock fixtures and real-wallet staging evidence separately labeled. Missing guarded integration DB must fail required jobs before connecting or destroying anything.

Test plan: attack, hack and abuse vectors

Use isolated fixtures to test forged/wrong-chain/provider events, replay and nonce/purpose confusion, stale revision privilege races, integer/timestamp extremes, shadow-table/definer escalation, direct immutable-table tampering, unsafe test DB URLs, XSS/entity/HTML variants, forwarded-header/CORS/rate-limit abuse, local identity/terms spoofing, scheduler floods, secret-bearing errors/build layers/caches, supply-chain/CI tampering and resource exhaustion. Verify reject/rollback/no power creation, no leaked secrets and bounded resource use; do not attack live services or use production data/keys.

Verification and completion criteria

For intake, read every created issue back and compare exact title/body, linked dependencies, 001–053 coverage and required sections against local drafts. Implementation completion requires commit/toolchain-specific green Rust unit plus guarded Postgres tests, frontend unit/production build/relevant full-stack browsers, secret/advisory scans, and relevant fuzz/concurrency/a11y/load/migration/permission/restore evidence. Explicitly report absent real-device/live checks. This tracker closes only after required workstreams' acceptance evidence is checked; optional deferred policy features need documentation rather than fabricated implementation claims.

<!-- voting-gap-1791945837:tracker --> ## Current codebase Voting is a standalone offchain CL8Y advisory polling application: Terra Classic CW20 and BSC BEP-20 registered-wallet ledger, ADR-36/EIP-191 operator-voting API, and Legal-gated React dApp. Structured drafts, comments, author amendments, committee opening and frozen weights exist. The [gap report](https://git.cl8y.com/code/voting/src/branch/main/gaps/GAP_1791945837.md) reviewed `f8dbe93df953a78b17cb3304b717dcf84c4cd517`; current `e476a68da09645c2308cbf47b90211fcaffcb7af` only adds that report. Its local reproduction/source inspection does not establish current production exploitation, coverage, capacity or live-wallet readiness. ## Why this implementation is needed Ledger replay/registration/continuity defects can misstate voting power, and nontransactional revisions can freeze unreviewed content. CORS and timestamp defects compromise working amendments and bounded signatures. Scheduling and multi-editor drafting are requested additions; closing/results, stable wallet identity, recovery/accessibility, security, CI and operational evidence complete a trustworthy product. This tracker bundles related findings into 17 implementation issues and accounts for every GAP-001–053. Existing historical issues #1–17 describe prior functionality; these workstreams address the inspected remaining gaps rather than claiming that existing implementations are absent. ## Relevant files - [Source report](https://git.cl8y.com/code/voting/src/branch/main/gaps/GAP_1791945837.md) - [Repository guidance](https://git.cl8y.com/code/voting/src/branch/main/AGENTS.md), [handoff](https://git.cl8y.com/code/voting/src/branch/main/docs/HANDOFF.md), [governance doctrine](https://git.cl8y.com/code/voting/src/branch/main/docs/GOVERNANCE_RESEARCH.md) - [Ledger invariants](https://git.cl8y.com/code/voting/src/branch/main/docs/LEDGER_INVARIANTS.md), [API contract](https://git.cl8y.com/code/voting/src/branch/main/docs/OPERATOR_VOTING.md), [frontend contract](https://git.cl8y.com/code/voting/src/branch/main/docs/FRONTEND.md), [operations](https://git.cl8y.com/code/voting/src/branch/main/docs/OPS.md) - Each linked workstream names its implementation, schema, frontend, deployment and test files. ## Feature/fix list and coverage Numbers below are source GAP IDs; workstream keys identify dependencies, not Forgejo issue numbers. GAP-040 is shared adapter/accounting regression work and is intentionally linked twice. | Workstream | Priority | Implementation issue | GAP IDs | Depends on workstreams | |---|---|---|---|---| | 01 | P0 | [fix(ledger): validate complete Terra execution responses and BSC provider events](https://git.cl8y.com/code/voting/issues/36) | 001, 009, 012, 040 | — | | 02 | P0 | [fix(ledger): make transfer accounting exactly once across registration and concurrent writers](https://git.cl8y.com/code/voting/issues/37) | 002, 003, 013, 040 | [01](https://git.cl8y.com/code/voting/issues/36) | | 03 | P0 | [fix(voting): preserve ledger continuity and require fresh canonical dual-chain snapshots](https://git.cl8y.com/code/voting/issues/38) | 004, 008, 010 | [01](https://git.cl8y.com/code/voting/issues/36), [02](https://git.cl8y.com/code/voting/issues/37) | | 04 | P1 | [fix(ledger): isolate chain workers and expose supervised readiness and intent progress](https://git.cl8y.com/code/voting/issues/39) | 011, 051 | [02](https://git.cl8y.com/code/voting/issues/37), [03](https://git.cl8y.com/code/voting/issues/38) | | 05 | P0 | [fix(api): make revision approval, signed action consumption and audit receipts transactional](https://git.cl8y.com/code/voting/issues/40) | 005, 007, 016, 017, 024, 042 | [02](https://git.cl8y.com/code/voting/issues/37), [03](https://git.cl8y.com/code/voting/issues/38) | | 06 | P1 | [fix(api): enforce CORS, trusted rate limits, safe errors and production network boundaries](https://git.cl8y.com/code/voting/issues/41) | 006, 018, 020, 021 | [05](https://git.cl8y.com/code/voting/issues/40) | | 07 | P1 | [fix(database): secure balance definers, least-privilege grants and destructive test isolation](https://git.cl8y.com/code/voting/issues/42) | 015, 019, 039 | [05](https://git.cl8y.com/code/voting/issues/40) | | 08 | P1 | [fix(protocol): centralize safe HTML rendering and versioned cross-language API contracts](https://git.cl8y.com/code/voting/issues/43) | 014, 048, 049 | [05](https://git.cl8y.com/code/voting/issues/40) | | 09 | P1 | [feat(drafts): add revision-approved scheduled starts and bounded multi-editor collaboration](https://git.cl8y.com/code/voting/issues/44) | 025, 026 | [03](https://git.cl8y.com/code/voting/issues/38), [04](https://git.cl8y.com/code/voting/issues/39), [05](https://git.cl8y.com/code/voting/issues/40), [07](https://git.cl8y.com/code/voting/issues/42), [08](https://git.cl8y.com/code/voting/issues/43) | | 10 | P1 | [feat(voting): add bounded closing, advisory results and explicit governance policy disclosures](https://git.cl8y.com/code/voting/issues/45) | 027, 028, 045 | [05](https://git.cl8y.com/code/voting/issues/40), [08](https://git.cl8y.com/code/voting/issues/43), [09](https://git.cl8y.com/code/voting/issues/44) | | 11 | P1 | [fix(wallet): synchronize live identities and persist vote eligibility and action state](https://git.cl8y.com/code/voting/issues/46) | 029, 030, 031, 033, 050 | [05](https://git.cl8y.com/code/voting/issues/40), [06](https://git.cl8y.com/code/voting/issues/41), [08](https://git.cl8y.com/code/voting/issues/43), [10](https://git.cl8y.com/code/voting/issues/45) | | 12 | P2 | [feat(frontend): preserve draft work and improve accessible discovery and recovery states](https://git.cl8y.com/code/voting/issues/48) | 032, 034, 035, 036 | [08](https://git.cl8y.com/code/voting/issues/43), [10](https://git.cl8y.com/code/voting/issues/45), [11](https://git.cl8y.com/code/voting/issues/46), [15](https://git.cl8y.com/code/voting/issues/47) | | 13 | P1 | [fix(legal): verify the installed clickwrap SDK and document UI versus API acceptance boundaries](https://git.cl8y.com/code/voting/issues/49) | 022, 038 | [06](https://git.cl8y.com/code/voting/issues/41), [08](https://git.cl8y.com/code/voting/issues/43), [11](https://git.cl8y.com/code/voting/issues/46) | | 14 | P1 | [chore(frontend): triage dependencies and reduce measured wallet bundle cost safely](https://git.cl8y.com/code/voting/issues/50) | 023, 047 | [08](https://git.cl8y.com/code/voting/issues/43), [11](https://git.cl8y.com/code/voting/issues/46), [13](https://git.cl8y.com/code/voting/issues/49) | | 15 | P2 | [perf(voting): bound reads and intent batches and remove measured query multiplication](https://git.cl8y.com/code/voting/issues/47) | 046 | [02](https://git.cl8y.com/code/voting/issues/37), [04](https://git.cl8y.com/code/voting/issues/39), [05](https://git.cl8y.com/code/voting/issues/40), [08](https://git.cl8y.com/code/voting/issues/43) | | 16 | P1 | [test(ci): require full-stack dual-chain release checks and measurable quality gates](https://git.cl8y.com/code/voting/issues/51) | 037, 041, 043, 044 | [01](https://git.cl8y.com/code/voting/issues/36), [02](https://git.cl8y.com/code/voting/issues/37), [03](https://git.cl8y.com/code/voting/issues/38), [05](https://git.cl8y.com/code/voting/issues/40), [06](https://git.cl8y.com/code/voting/issues/41), [07](https://git.cl8y.com/code/voting/issues/42), [08](https://git.cl8y.com/code/voting/issues/43), [09](https://git.cl8y.com/code/voting/issues/44), [10](https://git.cl8y.com/code/voting/issues/45), [11](https://git.cl8y.com/code/voting/issues/46), [12](https://git.cl8y.com/code/voting/issues/48), [13](https://git.cl8y.com/code/voting/issues/49), [14](https://git.cl8y.com/code/voting/issues/50), [15](https://git.cl8y.com/code/voting/issues/47) | | 17 | P1 | [chore(ops): secure release builds and automate restore, rotation and deployment evidence](https://git.cl8y.com/code/voting/issues/52) | 052, 053 | [03](https://git.cl8y.com/code/voting/issues/38), [04](https://git.cl8y.com/code/voting/issues/39), [06](https://git.cl8y.com/code/voting/issues/41), [07](https://git.cl8y.com/code/voting/issues/42), [09](https://git.cl8y.com/code/voting/issues/44), [14](https://git.cl8y.com/code/voting/issues/50), [16](https://git.cl8y.com/code/voting/issues/51) | ## Recommended direction and delivery gates 1. Repair adapters/accounting/continuity (01–03), then independent worker readiness (04). New snapshots must require fresh, complete canonical state on both chains. 2. Land transactional revision approval, bounded/replay-safe signatures and receipts (05), production middleware/config (06), least-privilege DB/test isolation (07) and safe HTML/shared contracts (08). Accounting/signature/concurrency regressions belong in these changes, not only a later assurance issue. 3. Add scheduled multi-editor drafts (09), then finite close/advisory results (10) and persistent identity/eligibility (11). Scheduled execution is disabled until ledger/approval/permission prerequisites have actual passing evidence. 4. Bound query cost (15), then draft/discovery/accessibility/recovery UX (12), installed Legal SDK tests (13) and dependency/bundle triage (14). 5. Require real full-stack release CI and quality budgets (16), then secure images/restore/rotation/deployed evidence (17). Per-issue security testing remains required throughout; final verification does not replace it. ## Constraints and guardrails No new contracts, archive node, executable treasury integration or identity merging; BSC remains core. Preserve raw integer CL8Y accounting, restricted API DB role, proven DEX Terra/Bridge EVM connectors, required early WalletConnect pairing hook, Legal fail-closed transactional UI and no browser BSC balance RPC/seeds/admin credentials. Snapshot is taken once at actual opening, not at draft creation or a backdated scheduled time. Record conservative policy defaults: scheduled means as soon as approved or at/after the requested date once approved; committee feasibility approval persists, and relevant edits invalidate it. Content remains editable until actual opening. Raw public advisory tallies and immutable address ballots remain defaults; do not silently add quorum/pass labels, secret-ballot claims, roll pruning, vote changes/delegation or execution powers. Optional future decisions in GAP-045 are explicitly documented/deferred in 10. Update affected docs/skills deliberately where scheduling/editor permissions extend their old constraints. Agents own decisions, review/testing and factual acceptance, without human sign-off chores or invented evidence. ## Acceptance criteria - All 53 GAP IDs map to at least one linked, nonduplicate implementation workstream with concrete current code, rationale, files, solution, guardrails, acceptance, functional/failure and adversarial testing, and verification criteria. - P0 correctness and revision/snapshot prerequisites have permanent passing regressions before automatic opening is enabled. - Scheduling/editing/closing/results and wallet/Legal flows have matching Terra/BSC support and documented conservative policy defaults. - Release contexts actually require product validation; deployed identity/readiness and restored DB/privileges have dated factual evidence. - Proposed policy/social additions are distinguished from inspected defects and required requested features. No closure based only on merge, mock E2E, audit counts or historical live QA. ## Test plan: supported paths, failure paths and concurrency Each child issue defines its exact unit/API/DB/browser/failure matrix. Across the backlog, exercise real HTTP adapters → ingest → isolated DB, complete ADR-36 and EIP-191 signed lifecycles, genuine production middleware on a second origin, installed Legal SDK and production-like browser builds. Include registration boundaries/replay, forks/gaps, concurrent edits/approval/quotas, duplicate delivery, scheduling restart/role revocation, close boundaries, account/route races, API/offline recovery, keyboard/mobile/CSP and fresh/upgrade/restore paths. Keep deterministic mock fixtures and real-wallet staging evidence separately labeled. Missing guarded integration DB must fail required jobs before connecting or destroying anything. ## Test plan: attack, hack and abuse vectors Use isolated fixtures to test forged/wrong-chain/provider events, replay and nonce/purpose confusion, stale revision privilege races, integer/timestamp extremes, shadow-table/definer escalation, direct immutable-table tampering, unsafe test DB URLs, XSS/entity/HTML variants, forwarded-header/CORS/rate-limit abuse, local identity/terms spoofing, scheduler floods, secret-bearing errors/build layers/caches, supply-chain/CI tampering and resource exhaustion. Verify reject/rollback/no power creation, no leaked secrets and bounded resource use; do not attack live services or use production data/keys. ## Verification and completion criteria For intake, read every created issue back and compare exact title/body, linked dependencies, 001–053 coverage and required sections against local drafts. Implementation completion requires commit/toolchain-specific green Rust unit plus guarded Postgres tests, frontend unit/production build/relevant full-stack browsers, secret/advisory scans, and relevant fuzz/concurrency/a11y/load/migration/permission/restore evidence. Explicitly report absent real-device/live checks. This tracker closes only after required workstreams' acceptance evidence is checked; optional deferred policy features need documentation rather than fabricated implementation claims.
Sign in to join this conversation.
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#35
No description provided.