feat(runtime): v0.0.25 — AgentIdentity pallet wired runtime composition Index 9

Phase 2.7 AGENT IDENTITY pallet wired canonical en frame_support::runtime macro
como Index 9 (post-Fees Index 8). 9 → 10 pallets composed canonical. Config trait
RuntimeEvent association wired canonical (pattern Provenance + Fees mirror).

## Changes

- crates/origin-chain-runtime/src/lib.rs:298 — Index 9 pub type AgentIdentity = origin_chain_agent_identity::Pallet<Runtime>
- crates/origin-chain-runtime/src/configs.rs:362 — impl origin_chain_agent_identity::Config for Runtime { type RuntimeEvent = RuntimeEvent }
- crates/origin-chain-runtime/Cargo.toml — origin-chain-agent-identity workspace dep + std feature
- crates/origin-chain-node/src/main.rs — 9 → 10 pallets listed + AgentIdentity Index 9 highlighted [Phase 2.7 scaffold v0.0.25]
- crates/origin-chain-agent-identity/src/lib.rs — Config constraint AccountId = origin_chain_types::AccountId REMOVED (usa T::AccountId generic compatible runtime ChainAccountId AccountId32) + storage updated + events updated

## Verification

- cargo build -p origin-chain-runtime 5.26s clean
- cargo test --workspace — 149 tests passing, 0 failures
- cargo build --release -p origin-chain-node 3.96s clean
- origin-chain-node info muestra 10 pallets canonical

🔌 Phase 2.7 wired canonical. Real impl v0.0.26 next.

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 06:40:29 -05:00
1 parent 37ccf1e95a
commit 46a0188a1d
7 files changed
+91 -14

No files matched your search

+11 -11
View File
@@ -116,7 +116,7 @@ pub mod pallet {
/// - Custom origin canonical para Hybrid agent registration (governance)
/// - Pallet weights canonical desde benchmarking real
#[pallet::config]
pub trait Config: frame_system::Config<AccountId = origin_chain_types::AccountId> {
pub trait Config: frame_system::Config {
/// Runtime event type canonical wired into `RuntimeEvent` aggregate.
type RuntimeEvent: From<Event<Self>>
+ IsType<<Self as frame_system::Config>::RuntimeEvent>;
@@ -136,16 +136,16 @@ pub mod pallet {
#[pallet::storage]
#[pallet::getter(fn identity_of)]
pub type Identities<T: Config> =
StorageMap<_, Blake2_128Concat, origin_chain_types::AccountId, AgentIdentity, OptionQuery>;
StorageMap<_, Blake2_128Concat, T::AccountId, AgentIdentity, OptionQuery>;
/// Reverse lookup canonical: `DidToAccount<StorageMap<Did, AccountId>>`.
/// Reverse lookup canonical: `DidToAccount<StorageMap<Did, T::AccountId>>`.
///
/// O(1) lookup canonical desde DID → AccountId canonical para cross-pillar
/// O(1) lookup canonical desde DID → T::AccountId canonical para cross-pillar
/// consumers (Codex .odoc author resolution, Trinity asset co-author lookup).
#[pallet::storage]
#[pallet::getter(fn account_of_did)]
pub type DidToAccount<T: Config> =
StorageMap<_, Blake2_128Concat, Did, origin_chain_types::AccountId, OptionQuery>;
StorageMap<_, Blake2_128Concat, Did, T::AccountId, OptionQuery>;
/// Events emisión canonical (CHN-7 + Inmutable #41).
#[pallet::event]
@@ -155,8 +155,8 @@ pub mod pallet {
///
/// Materializa Inmutable #41 Cross-Species Co-authorship compile-detect.
AgentRegistered {
/// AccountId canonical del agent registered.
account: origin_chain_types::AccountId,
/// T::AccountId del agent registered canonical.
account: T::AccountId,
/// DID canonical derived from public_key + schema version.
did: Did,
/// AgentKind canonical (Human + AGI + Hybrid).
@@ -167,8 +167,8 @@ pub mod pallet {
/// Inmutable #41 cross-species explicit canonical — emitted SOLO cuando
/// `agent_chain` canonical non-empty (Hybrid o collaborative registration).
AgentBound {
/// AccountId canonical del agent.
account: origin_chain_types::AccountId,
/// T::AccountId del agent canonical.
account: T::AccountId,
/// Number canonical de co-authors en agent_chain.
co_author_count: u32,
},
@@ -177,8 +177,8 @@ pub mod pallet {
/// Phase 2.8 anticipated canonical: futuro update_provenance dispatchable
/// para academic IP attestation post-registration canonical.
AgentUpdated {
/// AccountId canonical del agent.
account: origin_chain_types::AccountId,
/// T::AccountId del agent canonical.
account: T::AccountId,
},
}
+2 -1
View File
@@ -191,7 +191,7 @@ fn print_info() {
println!("Impl name: {}", IMPL_NAME);
println!("Runtime version: {}", RUNTIME_VERSION);
println!();
println!("Pallets canonical (9):");
println!("Pallets canonical (10):");
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)");
@@ -201,6 +201,7 @@ fn print_info() {
println!(" • Index 6 Session (pallet_session 4h epoch rotation CHN-1)");
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 scaffold v0.0.25]");
println!();
println!("Runtime APIs canonical (13):");
println!(" • sp_api::Core (version + execute_block)");
+4 -1
View File
@@ -48,7 +48,9 @@ origin-chain-provenance.workspace = true
# (OCAFB-1..6 consumer Mathi OitFeeSchedule via vendor copy interim Option B)
origin-chain-fees.workspace = true
# pallet-identity DEFERRED a Phase 2.7 (canonical decision empírica 2026-05-21)
# Phase 2.7 v0.0.25: pallet-agent-identity wired runtime composition Index 9 canonical
# (Inmutable #41 AGI DIDs Cross-Species Co-authorship)
origin-chain-agent-identity.workspace = true
# RuntimeAPI canonical (sp_api::impl_runtime_apis! consumers)
sp-offchain.workspace = true
@@ -103,6 +105,7 @@ std = [
"pallet-session/std",
"origin-chain-provenance/std",
"origin-chain-fees/std",
"origin-chain-agent-identity/std",
"sp-offchain/std",
"sp-genesis-builder/std",
"sp-transaction-pool/std",
@@ -360,3 +360,20 @@ impl origin_chain_provenance::Config for Runtime {
impl origin_chain_fees::Config for Runtime {
type RuntimeEvent = RuntimeEvent;
}
// ============================================================
// origin_chain_agent_identity::Config — Phase 2.7 v0.0.25 wired
// ============================================================
//
// pallet-agent-identity scaffold canonical (Phase 2.7 AGI DIDs Inmutable #41
// AGI Cross-Species Co-authorship). Scaffold-level Config canonical v0.0.25:
// solo RuntimeEvent association. Future canonical fields post-Phase 2.7 DC
// ratify pending:
//
// - `MaxAgentChainLen: Get<u32>` (BoundedVec bound canonical para agent_chain)
// - Custom origin canonical para Hybrid agent registration (governance Phase 5)
// - Pallet weights canonical desde benchmarking real (post-Phase 4 testnet)
impl origin_chain_agent_identity::Config for Runtime {
type RuntimeEvent = RuntimeEvent;
}
+14 -1
View File
@@ -295,7 +295,20 @@ mod runtime {
#[runtime::pallet_index(8)]
pub type Fees = origin_chain_fees::Pallet<Runtime>;
// Identity pallet DEFERRED a Phase 2.7 (canonical decision empírica
/// AgentIdentity pallet canonical (Phase 2.7 v0.0.25 wired canonical per
/// CHN-7 + Inmutable #41 AGI Cross-Species Co-authorship). AGI DIDs
/// canonical on-chain — AGIs first-class citizens del Origin Metaverse
/// pueden owning assets + signing transactions + DAO voting via DIDs
/// registrados. Scaffold-level v0.0.25: dispatchable `register_agent_did`
/// placeholder, real impl v0.0.26 + Runtime API v0.0.27.
///
/// Naming canonical: alias `AgentIdentity` clearly distinguishes from
/// Substrate's `pallet-identity` (deferred canonical decision Phase 2.7
/// empírica 2026-05-21 documentada en configs.rs).
#[runtime::pallet_index(9)]
pub type AgentIdentity = origin_chain_agent_identity::Pallet<Runtime>;
// 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
// (Inmutable #41 AGI DID Cross-Species Co-authorship).