|
1 | 1 | use hdi::prelude::*; |
2 | 2 | use std::{fmt::Display, str::FromStr}; |
3 | 3 |
|
| 4 | +// TODO (G1 — AgentEntityType): Add an `agent_entity_type` field (or a companion `AgentContext` |
| 5 | +// entry) to distinguish Individual, Collective, Project, Network, Bot, and ExternalOrganisation |
| 6 | +// agents. Currently all agents are implicitly modelled as individual humans. The post-MVP |
| 7 | +// design proposes: |
| 8 | +// |
| 9 | +// pub enum AgentEntityType { |
| 10 | +// Individual, |
| 11 | +// Collective(String), |
| 12 | +// Project(ActionHash), // references an organisational NondominiumIdentity hash |
| 13 | +// Network(ActionHash), // references a network NondominiumIdentity hash |
| 14 | +// Bot { capabilities: Vec<String>, operator: AgentPubKey }, |
| 15 | +// ExternalOrganisation(String), |
| 16 | +// } |
| 17 | +// |
| 18 | +// pub struct AgentContext { |
| 19 | +// pub agent_type: AgentEntityType, |
| 20 | +// pub person_hash: Option<ActionHash>, // None for bots / external orgs |
| 21 | +// pub created_at: Timestamp, |
| 22 | +// pub network_seed: String, |
| 23 | +// } |
| 24 | +// |
| 25 | +// See `documentation/archives/agent.md` §6.1, `REQ-AGENT-01` in requirements.md, and |
| 26 | +// `documentation/requirements/ndo_prima_materia.md` §8.7. |
| 27 | +// |
| 28 | +// TODO (G15 — CapabilitySlot on Agent): The `Person` entry hash should serve as a stigmergic |
| 29 | +// attachment surface for external capabilities — analogous to the NondominiumIdentity |
| 30 | +// CapabilitySlot in ndo_prima_materia.md §6. Add a `PersonCapabilitySlot` link type: |
| 31 | +// PersonCapabilitySlot: Person hash → capability target (DID document, credential wallet, |
| 32 | +// reputation oracle, external registry) |
| 33 | +// Implement `attach_agent_capability_slot` and `get_agent_capability_slots` coordinator |
| 34 | +// functions. See `REQ-AGENT-11` and `ndo_prima_materia.md` §6.5. |
| 35 | + |
4 | 36 | /// Represents a person's public profile with basic information |
5 | 37 | #[hdk_entry_helper] |
6 | 38 | #[derive(Clone, PartialEq)] |
@@ -54,7 +86,31 @@ pub struct PersonRole { |
54 | 86 | pub assigned_at: Timestamp, |
55 | 87 | } |
56 | 88 |
|
| 89 | +// TODO (G14 — Configurable Role Taxonomy): This enum is closed — communities cannot define |
| 90 | +// their own role types. The OVN model requires roles to emerge from community needs, not |
| 91 | +// from infrastructure decisions. Post-MVP, this should become a configurable role registry: |
| 92 | +// |
| 93 | +// // In integrity: remove `RoleType` enum entirely, or keep as default-role constants. |
| 94 | +// // Add a `RoleDefinition` entry type: |
| 95 | +// pub struct RoleDefinition { |
| 96 | +// pub role_name: String, |
| 97 | +// pub capability_level: String, // "member" | "stewardship" | "coordination" | "governance" |
| 98 | +// pub description: Option<String>, |
| 99 | +// pub validation_requirements: Option<String>, |
| 100 | +// pub network_id: String, // Which network defined this role |
| 101 | +// pub created_at: Timestamp, |
| 102 | +// } |
| 103 | +// |
| 104 | +// // In coordinator: `assign_person_role` accepts any role name present in the network's |
| 105 | +// // RoleDefinition registry. The six predefined roles below become genesis entries. |
| 106 | +// // The validate_person_role function must stop hard-rejecting unknown role names and |
| 107 | +// // instead look up the RoleDefinition registry. |
| 108 | +// |
| 109 | +// See `documentation/archives/agent.md` §5.3 (G14), `REQ-AGENT-06` in requirements.md, and |
| 110 | +// `documentation/zomes/person_zome.md` Future Enhancements. |
| 111 | + |
57 | 112 | /// Allowed role types in the system |
| 113 | +// NOTE: These are the MVP defaults. Post-MVP they become configurable registry entries. |
58 | 114 | #[derive(Debug, Clone, PartialEq)] |
59 | 115 | pub enum RoleType { |
60 | 116 | SimpleAgent, // Simple Agent capabilities |
|
0 commit comments