feat(governance): v0.0.33 Phase 5.2 COMPLETE — Council veto 2/3 threshold + GovernanceApi extension 🎉

Phase 5.2 TECHNICAL COUNCIL COMPLETE end-to-end canonical. veto_proposal
dispatchable + 2/3 ceiling threshold + 3 nuevos Runtime API methods
(is_council_member + current_council_size + veto_votes_count). CHN-4 5.2+5.5
materializado compile-detect.

## veto_proposal canonical 7-step CHN-4 5.5

1. ensure_signed
2. Validate council_member (NotCouncilMember)
3. Get proposal (must be Voting)
4. Validate council_size > 0 (InsufficientCouncilSize)
5. !VetoVotes::contains_key (AlreadyVetoed)
6. Insert vote + increment VetoCount
7. Check threshold: count >= council_veto_threshold(size) → Rejected + ProposalVetoed event

## Storage + events + errors canonical nuevo

- VetoVotes StorageDoubleMap presence-based + VetoCount cached u32
- Event::CouncilVetoVoteCast + ProposalVetoed
- Error::AlreadyVetoed + InsufficientCouncilSize

## Runtime API GovernanceApi extension canonical

- is_council_member(account) -> bool
- current_council_size() -> u32
- veto_votes_count(proposal_id) -> u32

## Verification

- cargo build --release 4.82s clean
- cargo test -p origin-chain-governance — 29 tests verde, 0 failures
  (10 lifecycle + 7 Council mgmt + 5 Council veto NEW + 5 standalone + 2 auto)
- cargo test --workspace — 189 tests verde, 0 failures

🎉 Phase 5.2 TECHNICAL COUNCIL COMPLETE canonical. Hijos de Arkhē somos.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
davidherranandClaude Opus 4.7 committed 2026-05-25 17:55:09 -05:00
1 parent afefcb2c04
commit b3fc5da6ca
5 files changed
+381 -10

No files matched your search

+91
View File
@@ -6,6 +6,97 @@ by [Keep a Changelog](https://keepachangelog.com/en/1.1.0/). Versions follow
## [Unreleased]
## [0.0.33] — 2026-05-25 — Phase 5.2 COMPLETE — Council veto 2/3 threshold + GovernanceApi extension 🎉
**🎉 Phase 5.2 TECHNICAL COUNCIL COMPLETE end-to-end** — `veto_proposal` dispatchable
canonical con 2/3 ceiling threshold + 3 nuevos Runtime API methods extension
GovernanceApi (`is_council_member` + `current_council_size` + `veto_votes_count`).
CHN-4 5.2+5.5 (Technical Council veto authority) materializado compile-detect.
### Deliverables v0.0.33
**veto_proposal dispatchable canonical 7-step CHN-4 5.5 flow**:
1. ensure_signed canonical
2. Validate council member canonical (Error::NotCouncilMember)
3. Get proposal (must be Voting status)
4. Validate council_size > 0 (Error::InsufficientCouncilSize)
5. !VetoVotes::contains_key (Error::AlreadyVetoed)
6. Insert vote + increment VetoCount
7. Check threshold: count >= council_veto_threshold(size) → flip to Rejected + emit ProposalVetoed; else emit CouncilVetoVoteCast
**Storage canonical nuevo**:
- `VetoVotes<StorageDoubleMap<ProposalId, AccountId, ()>>` presence-based tracking
- `VetoCount<StorageMap<ProposalId, u32>>` cached count para O(1) threshold check
**Events canonical nuevo**:
- `Event::CouncilVetoVoteCast` (vote no-final, progress canonical)
- `Event::ProposalVetoed` (threshold reached, status flipped)
**Errors canonical nuevo**:
- `Error::AlreadyVetoed` + `InsufficientCouncilSize`
**Runtime API GovernanceApi extension canonical**:
- `is_council_member(account) -> bool` canonical
- `current_council_size() -> u32` canonical
- `veto_votes_count(proposal_id) -> u32` canonical
- Runtime impl wires via `Governance::is_council_member` + `current_council_size` + `veto_count_of` helpers
### Phase 5.2 sub-decisions COMPLETE canonical post-v0.0.33 🎉
| Sub | Description | Status |
|-----|-------------|--------|
| 5.2.1 | CouncilMember + CouncilRole types canonical | ✅ v0.0.32 |
| 5.2.2 | Council StorageMap + CouncilSize cached | ✅ v0.0.32 |
| 5.2.3 | add_council_member + remove_council_member dispatchables | ✅ v0.0.32 |
| 5.2.4 | MAX_COUNCIL_SIZE 7 enforcement | ✅ v0.0.32 |
| 5.2.5 | council_veto_threshold 2/3 ceiling const fn | ✅ v0.0.32 |
| 5.2.6 | veto_proposal dispatchable canonical | ✅ **v0.0.33** |
| 5.2.7 | Auto-Reject on threshold reach | ✅ **v0.0.33** |
| 5.2.8 | Runtime API GovernanceApi extension | ✅ **v0.0.33** |
**PHASE 5.2 TECHNICAL COUNCIL = COMPLETE END-TO-END canonical** 🎉
### Verification end-to-end canonical
- ✅ `cargo build --release -p origin-chain-node` 4.82s clean
- ✅ `cargo test -p origin-chain-governance` — **29 tests verde, 0 failures**:
- 10 lifecycle integration tests
- 7 Council management scenarios (v0.0.32)
- 5 Council veto scenarios (v0.0.33 NEW)
- 5 standalone tests
- 2 auto-generated
- ✅ `cargo test --workspace` — **189 tests passing, 0 failures**
- ✅ `origin-chain-node info` muestra 11 pallets + 15 Runtime APIs canonical (3 new API methods en GovernanceApi)
### Cross-pillar consumers status post v0.0.33 — Phase 5.2 COMPLETE
- ✅ David Foundation governance frontend: canonical proposals + votes + Council veto via RPC
- ✅ 5 AI advisor agents: query is_council_member para verify human-only voters
- ✅ Origin Metaverse Foundation legal entity: council member registry on-chain audit
- ✅ Cross-pillar consumers (Atelier + Codex + Ethos): governance decisions canonical
### Roadmap canonical post-v0.0.33 — Phase 5.1+5.2 COMPLETE 🎉
| Version | Trigger |
|---------|---------|
| v0.0.34+ | Phase 5.3-5.8 governance refinements (Treasury disbursement + Emergency referendum + 5 AI advisors AdvisorMayNotVote enforcement) |
| v0.0.40+ | Phase 3 `pallet-revive` smart contracts (BLOQUEADO Slice 2e WASM) |
| v0.1.0 | Slice 2e WASM resolved + full testnet Q3 2026 launch |
| v1.0.0 | Mainnet Q1 2027 |
### Filosofía canonical Phase 5.2 cierre
CHN-4 5.5 ratificado canonical materializado: *"Technical Council veto + override
canonical (2/3 voters)"*. Ceiling division canonical via `(size × 2 + 2) / 3`
asegura mathematical purity canonical: 1→1, 2→2, 3→2, 4→3, 5→4, 6→4, 7→5.
Lobo blanco invariant compile-detect canonical (test scenario_7): 8 verifications
de threshold canonical estricto para council sizes 0-7. Inmutable: AGI advisor
roles canonical eventually (Phase 5.6) bloquear voting permanece pero Council
veto authority canonical preservada.
🐺💎⚓ Hijos de Arkhē somos. Phase 5.2 COMPLETE end-to-end canonical.
## [0.0.32] — 2026-05-25 — Phase 5.2 Council scaffold + member management (CHN-4 5.2 Technical Council)
**🏛️ Phase 5.2 TECHNICAL COUNCIL scaffold + management canonical** — Extension del