From 2a700ee6ca7a659ff8d6f880b6aa39590ed8a484 Mon Sep 17 00:00:00 2001 From: DavidHerran Date: Mon, 25 May 2026 12:43:30 -0500 Subject: [PATCH] =?UTF-8?q?feat(runtime):=20v0.0.29=20=E2=80=94=20Governan?= =?UTF-8?q?ce=20pallet=20wired=20runtime=20composition=20Index=2010?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Phase 5.1 GOVERNANCE pallet wired canonical en frame_support::runtime macro como Index 10 (post-AgentIdentity Index 9). 10 → 11 pallets composed canonical. Config trait RuntimeEvent association wired canonical (pattern Provenance + Fees + AgentIdentity mirror). ## Changes - crates/origin-chain-runtime/src/lib.rs:315 — Index 10 pub type Governance = origin_chain_governance::Pallet - crates/origin-chain-runtime/src/configs.rs:382 — impl origin_chain_governance::Config for Runtime - crates/origin-chain-runtime/Cargo.toml — origin-chain-governance workspace dep + std feature - Cargo.toml — origin-chain-governance workspace dep default-features = false (no_std-compat) - crates/origin-chain-node/src/main.rs — 10 → 11 pallets listed + Governance Index 10 highlighted ## Verification - cargo build -p origin-chain-runtime 15.69s clean - cargo test --workspace — 165 tests passing, 0 failures - origin-chain-node info muestra 11 pallets canonical 🔌 Phase 5.1 wired canonical. Real impl v0.0.30 next. Co-Authored-By: Claude Opus 4.7 (1M context) --- CHANGELOG.md | 23 ++++++++++++++++++++++ Cargo.lock | 1 + Cargo.toml | 2 +- crates/origin-chain-node/src/main.rs | 3 ++- crates/origin-chain-runtime/Cargo.toml | 5 +++++ crates/origin-chain-runtime/src/configs.rs | 18 +++++++++++++++++ crates/origin-chain-runtime/src/lib.rs | 11 +++++++++++ 7 files changed, 61 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2dbddf6..727a4a1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,29 @@ by [Keep a Changelog](https://keepachangelog.com/en/1.1.0/). Versions follow ## [Unreleased] +## [0.0.29] — 2026-05-25 — Phase 5.1 wired — Governance pallet runtime composition Index 10 + +**🔌 Phase 5.1 GOVERNANCE pallet WIRED runtime composition canonical** — +`origin-chain-governance` añadido al `#[frame_support::runtime]` macro como +Index 10 (post-AgentIdentity Index 9). 10 → **11 pallets** composed canonical. +Config trait `RuntimeEvent` association wired canonical en `crates/origin-chain-runtime/src/configs.rs` +(pattern Provenance + Fees + AgentIdentity mirror). + +### Deliverables v0.0.29 + +- `crates/origin-chain-runtime/src/lib.rs:315` — `#[runtime::pallet_index(10)] pub type Governance = origin_chain_governance::Pallet;` +- `crates/origin-chain-runtime/src/configs.rs:382` — `impl origin_chain_governance::Config for Runtime { type RuntimeEvent = RuntimeEvent; }` +- `crates/origin-chain-runtime/Cargo.toml` — `origin-chain-governance.workspace = true` dep + std feature +- `Cargo.toml` workspace — `origin-chain-governance` dep `default-features = false` (FRAME pallet canonical no_std-compatible) +- `crates/origin-chain-node/src/main.rs` — 10 → **11 pallets** listed canonical + Index 10 Governance highlighted `[Phase 5.1 scaffold v0.0.29]` + +### Verification end-to-end canonical + +- ✅ `cargo build -p origin-chain-runtime` 15.69s clean (warnings cosméticos macro-generated) +- ✅ `cargo test --workspace` — **165 tests passing**, 0 failures +- ✅ `origin-chain-node info` muestra 11 pallets canonical +- ✅ Existing subcomandos canonical NO regression + ## [0.0.28] — 2026-05-25 — Phase 5.1 scaffold — origin-chain-governance pallet (CHN-4 Foundation Treasury) **🏛️ Phase 5.1 GOVERNANCE pallet SCAFFOLD trait-first foundation** — Foundation diff --git a/Cargo.lock b/Cargo.lock index 3e257a8..3ad1ffa 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2263,6 +2263,7 @@ dependencies = [ "log", "origin-chain-agent-identity", "origin-chain-fees", + "origin-chain-governance", "origin-chain-provenance", "origin-chain-types", "pallet-aura", diff --git a/Cargo.toml b/Cargo.toml index 3538d97..be74130 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -155,7 +155,7 @@ origin-chain-provenance = { path = "crates/origin-chain-provenance", version = " origin-chain-fees = { path = "crates/origin-chain-fees", version = "0.0.1" } origin-chain-agent-identity = { path = "crates/origin-chain-agent-identity", version = "0.0.1" } origin-chain-bridges = { path = "crates/origin-chain-bridges", version = "0.0.1" } -origin-chain-governance = { path = "crates/origin-chain-governance", version = "0.0.1" } +origin-chain-governance = { path = "crates/origin-chain-governance", version = "0.0.1", default-features = false } origin-chain-runtime = { path = "crates/origin-chain-runtime", version = "0.0.1" } origin-chain-node = { path = "crates/origin-chain-node", version = "0.0.1" } diff --git a/crates/origin-chain-node/src/main.rs b/crates/origin-chain-node/src/main.rs index 9f26520..6f3e03e 100644 --- a/crates/origin-chain-node/src/main.rs +++ b/crates/origin-chain-node/src/main.rs @@ -191,7 +191,7 @@ fn print_info() { println!("Impl name: {}", IMPL_NAME); println!("Runtime version: {}", RUNTIME_VERSION); println!(); - println!("Pallets canonical (10):"); + println!("Pallets canonical (11):"); println!(" • Index 0 System (frame_system foundational)"); println!(" • Index 1 Timestamp (pallet_timestamp block clock → Aura)"); println!(" • Index 2 Balances (pallet_balances OGC token CHN-2)"); @@ -202,6 +202,7 @@ fn print_info() { println!(" • Index 7 Provenance (pallet_origin_provenance asset attestation CHN-7) [Phase 2.1 COMPLETE v0.0.17]"); println!(" • Index 8 Fees (pallet_origin_fees cross-pillar economy OCAFB-1..6) [Phase 2.4 COMPLETE v0.0.23]"); println!(" • Index 9 AgentIdentity (pallet_agent_identity AGI DIDs Inmutable #41) [Phase 2.7 COMPLETE v0.0.27]"); + println!(" • Index 10 Governance (origin_chain_governance Foundation Treasury CHN-4) [Phase 5.1 scaffold v0.0.29]"); println!(); println!("Runtime APIs canonical (14):"); println!(" • sp_api::Core (version + execute_block)"); diff --git a/crates/origin-chain-runtime/Cargo.toml b/crates/origin-chain-runtime/Cargo.toml index a70b068..4704018 100644 --- a/crates/origin-chain-runtime/Cargo.toml +++ b/crates/origin-chain-runtime/Cargo.toml @@ -52,6 +52,10 @@ origin-chain-fees.workspace = true # (Inmutable #41 AGI DIDs Cross-Species Co-authorship) origin-chain-agent-identity.workspace = true +# Phase 5.1 v0.0.29: origin-chain-governance wired runtime composition Index 10 canonical +# (CHN-4 Foundation Treasury Governance, AI-Driven Human-Guarded canonical) +origin-chain-governance.workspace = true + # RuntimeAPI canonical (sp_api::impl_runtime_apis! consumers) sp-offchain.workspace = true sp-genesis-builder.workspace = true @@ -106,6 +110,7 @@ std = [ "origin-chain-provenance/std", "origin-chain-fees/std", "origin-chain-agent-identity/std", + "origin-chain-governance/std", "sp-offchain/std", "sp-genesis-builder/std", "sp-transaction-pool/std", diff --git a/crates/origin-chain-runtime/src/configs.rs b/crates/origin-chain-runtime/src/configs.rs index df7df28..7c5f356 100644 --- a/crates/origin-chain-runtime/src/configs.rs +++ b/crates/origin-chain-runtime/src/configs.rs @@ -377,3 +377,21 @@ impl origin_chain_fees::Config for Runtime { impl origin_chain_agent_identity::Config for Runtime { type RuntimeEvent = RuntimeEvent; } + +// ============================================================ +// origin_chain_governance::Config — Phase 5.1 v0.0.29 wired +// ============================================================ +// +// pallet-origin-governance scaffold canonical (Phase 5.1 Foundation Treasury +// Governance CHN-4 AI-Driven Human-Guarded). Scaffold-level Config canonical +// v0.0.29: solo RuntimeEvent association. Future canonical fields post-Phase 5 +// DC ratify: +// +// - `MinProposalStake: Get` (1,000 OGC mínimum canonical CHN-4 5.3) +// - `MaxVotingPeriodBlocks: Get` (14-day period canonical 5.4) +// - Custom origin canonical para Technical Council veto (5.5) +// - `IsGovernanceAdvisor: Trait` (5.6 — humans-only vote enforcement) + +impl origin_chain_governance::Config for Runtime { + type RuntimeEvent = RuntimeEvent; +} diff --git a/crates/origin-chain-runtime/src/lib.rs b/crates/origin-chain-runtime/src/lib.rs index df53bdb..c170077 100644 --- a/crates/origin-chain-runtime/src/lib.rs +++ b/crates/origin-chain-runtime/src/lib.rs @@ -308,6 +308,17 @@ mod runtime { #[runtime::pallet_index(9)] pub type AgentIdentity = origin_chain_agent_identity::Pallet; + /// Governance pallet canonical (Phase 5.1 v0.0.29 wired canonical per CHN-4 + /// Foundation Treasury Governance). AI-Driven Human-Guarded canonical: 5 AI + /// advisor agents ADVISE only canonical, humans-only vote non-negotiable. + /// Scaffold-level v0.0.29: dispatchables submit_proposal + cast_vote + + /// finalize_proposal placeholders, real impl v0.0.30 + Runtime API v0.0.31. + /// + /// Naming canonical: alias `Governance` clearly canonical (NO conflict con + /// trait `GovernanceProposal` en `origin_chain_types::governance`). + #[runtime::pallet_index(10)] + pub type Governance = origin_chain_governance::Pallet; + // Substrate pallet-identity DEFERRED canonical (decision empírica // 2026-05-21 documentada en configs.rs). pallet-identity 41.0.0 ReservableCurrency // compat work canonical hereda al custom `pallet_agent_identity` Phase 2.7