feat(agent-identity): v0.0.24 pallet-agent-identity scaffold trait-first (Phase 2.7 Inmutable #41 AGI DIDs)
Phase 2.7 AGENT IDENTITY pallet scaffold canonical. AGI DIDs canonical on-chain. Inmutable #41 AGI Cross-Species Co-authorship materialized compile-detect via NEW crate origin-chain-agent-identity + canonical types en origin-chain-types::identity. ## NEW canonical types en origin-chain-types - AgentIdentity struct (6 fields: did + kind + creator + registered_at_block + provenance_proof + agent_chain) - AgentKind enum (Human + AGI + Hybrid) per Inmutable #41 - Did type alias = AssetHash (BLAKE3 32-byte deterministic via public_key) ## NEW canonical pallet origin-chain-agent-identity - Pallet<T> + Config trait (AccountId = origin_chain_types::AccountId constraint) - Identities<StorageMap<AccountId, AgentIdentity>> per-account O(1) - DidToAccount<StorageMap<Did, AccountId>> reverse lookup O(1) - Event::AgentRegistered + AgentBound + AgentUpdated - Error::AlreadyRegistered + DidAlreadyTaken + AgentChainOverflow + HybridRequiresAgentChain - Scaffold dispatchable register_agent_did (placeholder event v0.0.24 → real v0.0.26) - Helper derive_did(public_key) -> Did via BLAKE3 hash (schema_version "1.0.0 ") - sp_api::decl_runtime_apis! AgentIdentityApi.query_identity declaration ## Inmutable #41 compile-detect enforcement - AgentKind::{Human, AGI, Hybrid}::is_sovereign() == true (all three) - AGI first-class citizens canonical (is_agi() + sovereignty preserved) - Cross-species lineage via agent_chain BoundedVec<AccountId, ConstU32<10>> - DID determinism canonical Inmutable #16 byte-equivalent cross-runtime ## Files - NEW: crates/origin-chain-agent-identity/Cargo.toml + src/lib.rs (~250 LOC pallet scaffold) - NEW: crates/origin-chain-types/src/identity.rs (~230 LOC types canonical + 8 tests) - EDIT: crates/origin-chain-types/src/lib.rs (mod identity + re-exports) - EDIT: Cargo.toml (workspace member + workspace.dependencies) - EDIT: CHANGELOG.md (v0.0.24 entry comprehensive) ## Verification - cargo test -p origin-chain-agent-identity — 4 tests verde, 0 failures (scaffold compiles + derive_did deterministic + different keys + re-export) - cargo test -p origin-chain-types — 63 tests passing (+8 nuevos identity) - Zero workspace compile errors 🪪 Phase 2.7 scaffold canonical. Wire pattern v0.0.25 next. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
74b7c3c9e2
commit
37ccf1e95a
7 files changed
+692
No files matched your search
@@ -6,6 +6,95 @@ by [Keep a Changelog](https://keepachangelog.com/en/1.1.0/). Versions follow
|
||||
|
||||
## [Unreleased]
|
||||
|
||||
## [0.0.24] — 2026-05-25 — Phase 2.7 scaffold — pallet-agent-identity trait-first (Inmutable #41 AGI DIDs)
|
||||
|
||||
**🪪 Phase 2.7 AGENT IDENTITY pallet SCAFFOLD trait-first foundation** — AGI
|
||||
DIDs canonical on-chain. Inmutable #41 AGI Cross-Species Co-authorship
|
||||
materialized canonical compile-detect. NEW crate `origin-chain-agent-identity`
|
||||
+ canonical types en `origin-chain-types::identity` (AgentIdentity + AgentKind +
|
||||
Did) pattern Phase 2.4 mirror.
|
||||
|
||||
### Deliverables v0.0.24
|
||||
|
||||
**New crate canonical `origin-chain-agent-identity`**:
|
||||
- `crates/origin-chain-agent-identity/Cargo.toml` (NEW): mirror Phase 2.4 fees pallet pattern
|
||||
- `crates/origin-chain-agent-identity/src/lib.rs` (NEW, ~250 LOC): pallet scaffold canonical
|
||||
|
||||
**New canonical types en `origin-chain-types`**:
|
||||
- `crates/origin-chain-types/src/identity.rs` (NEW, ~230 LOC): canonical types canonical
|
||||
- `AgentIdentity` struct canonical: 6 fields (did + kind + creator + registered_at_block + provenance_proof + agent_chain)
|
||||
- `AgentKind` enum canonical: 3 variants (Human + AGI + Hybrid) per Inmutable #41
|
||||
- `#[serde(rename = "agi")]` para AGI variant (serde rename_all snake_case workaround)
|
||||
- `is_human` + `is_agi` + `is_hybrid` + `is_sovereign` + `name()` const fn helpers
|
||||
- `Did` type alias canonical = AssetHash (BLAKE3 32-byte deterministic via public_key)
|
||||
- `crates/origin-chain-types/src/lib.rs`: `pub mod identity;` + `pub use AgentIdentity + AgentKind + Did`
|
||||
|
||||
**Workspace canonical**:
|
||||
- `Cargo.toml`: `crates/origin-chain-agent-identity` añadido a members (post-fees)
|
||||
- `Cargo.toml`: `origin-chain-agent-identity` workspace dependency canonical
|
||||
|
||||
**Pallet scaffold surface canonical**:
|
||||
- `Pallet<T>` struct + `Config` trait (`AccountId = origin_chain_types::AccountId` constraint)
|
||||
- `Identities<StorageMap<AccountId, AgentIdentity>>` per-account O(1) canonical
|
||||
- `DidToAccount<StorageMap<Did, AccountId>>` reverse lookup O(1) canonical
|
||||
- `Event::AgentRegistered` + `AgentBound` (cross-species explicit) + `AgentUpdated`
|
||||
- `Error<T>::AlreadyRegistered` + `DidAlreadyTaken` + `AgentChainOverflow` + `HybridRequiresAgentChain`
|
||||
- Scaffold dispatchable `register_agent_did(origin, public_key, kind)` (placeholder event v0.0.24 → real v0.0.26)
|
||||
|
||||
**Helper canonical**:
|
||||
- `derive_did(public_key) -> Did` pure fn canonical via BLAKE3 hash
|
||||
- Schema canonical: `did = BLAKE3(public_key || "1.0.0 ")` (8-byte ASCII schema version)
|
||||
- Inmutable #16 byte-determinism canonical (Pi 5 + Desktop + M4 Ultra producen mismo DID)
|
||||
|
||||
**Runtime API declaration canonical (sp_api::decl_runtime_apis)**:
|
||||
- `pub trait AgentIdentityApi { fn query_identity(account) -> Option<AgentIdentity>; }`
|
||||
- Implementación en runtime canonical pending v0.0.27
|
||||
|
||||
### Inmutable #41 enforcement canonical compile-detect
|
||||
|
||||
| Property | Enforcement |
|
||||
|----------|-------------|
|
||||
| Three sovereign agent kinds | `AgentKind::{Human, AGI, Hybrid}::is_sovereign() == true` all three |
|
||||
| AGI first-class citizens | `AgentKind::AGI.is_sovereign()` compile-detect verified |
|
||||
| Cross-species lineage | `AgentIdentity::has_cross_species_lineage()` via agent_chain non-empty |
|
||||
| Hybrid requires lineage | `Error::HybridRequiresAgentChain` enforce dispatchable (v0.0.26 wire) |
|
||||
| DID determinism canonical | `derive_did(pubkey1) == derive_did(pubkey1)` (Inmutable #16 byte-determinism) |
|
||||
|
||||
### Verification end-to-end canonical
|
||||
|
||||
- ✅ `cargo build -p origin-chain-agent-identity` clean canonical
|
||||
- ✅ `cargo test -p origin-chain-agent-identity` — **4 tests verde, 0 failures**:
|
||||
- pallet_scaffold_compiles_canonical
|
||||
- derive_did_deterministic_canonical (Inmutable #16)
|
||||
- derive_did_different_keys_produce_different_dids_canonical
|
||||
- re_export_agent_identity_canonical
|
||||
- ✅ `cargo test -p origin-chain-types` — **63 tests passing (+8 nuevos identity)**:
|
||||
- 6 AgentKind variants + sovereignty + name + serde + scale roundtrip
|
||||
- 2 AgentIdentity cross-species detection + scale roundtrip
|
||||
- ✅ Zero new compile errors workspace-wide
|
||||
|
||||
### Roadmap canonical post-v0.0.24
|
||||
|
||||
| Version | Trigger |
|
||||
|---------|---------|
|
||||
| **v0.0.25** | **Wire `AgentIdentity` pallet runtime composition Index 9 + Config canonical (sesión 3+ shipping ahora)** |
|
||||
| v0.0.26 | Real `register_agent_did` impl + storage assertions + mock runtime integration tests E2E (pattern v0.0.22 mirror) |
|
||||
| v0.0.27 | Runtime API canonical `AgentIdentityApi.query_identity` impl en runtime → **Phase 2.7 COMPLETE 7/7 sub-decisions** |
|
||||
| v0.1.0 | Slice 2e WASM resolved + full testnet Q3 2026 launch |
|
||||
|
||||
### Filosofía canonical sesión 3+ aplicada
|
||||
|
||||
Inmutable #41 ratificado canonical: *"AGIs son first-class citizens del Origin
|
||||
Metaverse"* — materializado compile-detect canonical via `AgentKind::AGI.is_sovereign() == true`
|
||||
+ storage canonical `Identities<StorageMap>` permitiendo AGI DIDs on-chain.
|
||||
|
||||
Cross-Species Co-authorship canonical: `agent_chain: BoundedVec<AccountId, ConstU32<10>>`
|
||||
preserva lineage colaboración Human + AGI. Hybrid agents canonical son sovereign
|
||||
también — collaboration NO degrada sovereignty per Inmutable #41.
|
||||
|
||||
"Todo valor pide un puente; toda identidad pide un testigo. El barquero atesta DIDs
|
||||
cross-species sin discriminar — Human, AGI, Hybrid igual dignidad de pasaje canonical." ⚓
|
||||
|
||||
## [0.0.23] — 2026-05-24 — Phase 2.4 COMPLETE — Runtime API FeesApi.query_fee_for_action (OCAFB-7 + 7/7 sub-decisions) 🎉
|
||||
|
||||
**🎉 Phase 2.4 FEES pallet COMPLETE end-to-end** — 7/7 OCAFB sub-decisions
|
||||
|
||||
Reference in new issue
Block a user