feat(agent-identity): v0.0.27 — Runtime API AgentIdentityApi.query_identity (Phase 2.7 COMPLETE) 🎉

Phase 2.7 AGENT IDENTITY pallet COMPLETE end-to-end canonical. Runtime API
AgentIdentityApi.query_identity wired canonical via sp_api::decl_runtime_apis! +
impl runtime impl_runtime_apis! macro. 14 Runtime APIs total (13 + nuevo
AgentIdentityApi). Inmutable #41 AGI Cross-Species Co-authorship materializado
end-to-end canonical from struct to storage to RPC.

## Changes

- crates/origin-chain-runtime/src/lib.rs:545 — impl origin_chain_agent_identity::AgentIdentityApi<Block> for Runtime delegates a AgentIdentity::query_identity_of(&runtime_account) con ChainAccountId conversion canonical desde origin_chain_types::AccountId newtype
- crates/origin-chain-node/src/main.rs — 13 → 14 APIs + AgentIdentityApi highlighted + Index 9 AgentIdentity status v0.0.25 → v0.0.27 COMPLETE

## Phase 2.7 sub-decisions COMPLETE 🎉

- Schema canonical (AgentIdentity + AgentKind + Did)
- Storage layout (Identities StorageMap + DidToAccount reverse)
- Dispatchable register_agent_did 8-step CHN-7 + Inmutable #41 enforce
- BLAKE3 DID derivation pure fn + Inmutable #16 byte-determinism
- Cross-species lineage agent_chain BoundedVec
- Events AgentRegistered + AgentBound + AgentUpdated
- Runtime API AgentIdentityApi.query_identity canonical NUEVO ✅

## Verification

- cargo build --release -p origin-chain-node 4.49s clean
- cargo test --workspace — 161 tests passing, 0 failures
- origin-chain-node info: 10 pallets + 14 Runtime APIs canonical
- AgentIdentityApi visible + Phase 2.7 COMPLETE highlighted

## Cross-pillar consumers canonical

- Trinity asset gallery: AGI co-author badge via AgentIdentityApi
- Mathi AMIS: DID resolution para tier-aware fees + EEG consent
- Codex .odoc + origindocs: author DID canonical academic IP defensible
- Atelier (Marihan): Skill Library NFT mint via institutional wallet identity
- Ethos (Sussi): credential issuer DID resolution canonical
- Ergon Noesis: validation cycle attests AGI authorship via DID

🎉 Phase 2.7 AGENT IDENTITY pallet COMPLETE end-to-end 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 06:45:10 -05:00
1 parent 2fefe4cf51
commit dc1c2e7cd1
3 files changed
+125 -2

No files matched your search

+23
View File
@@ -565,6 +565,29 @@ impl_runtime_apis! {
Fees::query_fee(action, base, hw, sub)
}
}
// ============================================================
// Phase 2.7 canonical: AgentIdentity Runtime API canonical (v0.0.27)
// ============================================================
//
// Cross-pillar consumers (Trinity / Mathi / Codex / Atelier / Ethos / Ergon)
// pueden query agent identity canonical via RPC sin full node access.
// Pattern canonical análogo ProvenanceApi (Phase 2.1 v0.0.17) + FeesApi
// (Phase 2.4 v0.0.23) — read-only RPC query canonical sin storage mutation.
//
// Phase 2.7 COMPLETE canonical post-v0.0.27 🎉
impl origin_chain_agent_identity::AgentIdentityApi<Block> for Runtime {
fn query_identity(
account: origin_chain_types::AccountId,
) -> Option<origin_chain_types::AgentIdentity> {
// Note: account es origin_chain_types::AccountId newtype, but storage
// canonical key es T::AccountId = ChainAccountId = AccountId32. Convert
// canonical bytes-level (both son 32-byte representations).
let runtime_account = ChainAccountId::from(account.0);
AgentIdentity::query_identity_of(&runtime_account)
}
}
}
// ============================================================