Skip to main content

maple_runtime/types/
profile.rs

1//! Resonator profile types
2
3use serde::{Deserialize, Serialize};
4
5/// Resonator profile determines constraints and behaviors
6///
7/// Different profiles enable different use cases:
8/// - Human: Agency-first, consent required, safety priority
9/// - World/Finalverse: Experience-focused, reversible consequences
10/// - Coordination/Mapleverse: Explicit commitments, strong accountability
11/// - IBank: AI-only, strict auditability, risk-bounded
12#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
13pub enum ResonatorProfile {
14    /// Human Resonator - maximum agency protection
15    Human,
16
17    /// World/Finalverse Resonator - experiential environments
18    World,
19
20    /// Coordination/Mapleverse Resonator - pure AI agents
21    Coordination,
22
23    /// IBank Resonator - autonomous financial operations
24    IBank,
25}
26
27impl ResonatorProfile {
28    /// Does this profile require human agency protection?
29    pub fn requires_agency_protection(&self) -> bool {
30        matches!(self, ResonatorProfile::Human)
31    }
32
33    /// Does this profile require strict audit trails?
34    pub fn requires_audit_trail(&self) -> bool {
35        matches!(self, ResonatorProfile::IBank)
36    }
37
38    /// Does this profile prefer reversible consequences?
39    pub fn prefers_reversibility(&self) -> bool {
40        matches!(self, ResonatorProfile::World | ResonatorProfile::IBank)
41    }
42
43    /// Can this profile form couplings with other profiles?
44    pub fn can_couple_with(&self, other: &ResonatorProfile) -> bool {
45        match (self, other) {
46            // Humans can couple with World and Coordination, but not IBank
47            (ResonatorProfile::Human, ResonatorProfile::IBank) => false,
48            (ResonatorProfile::IBank, ResonatorProfile::Human) => false,
49
50            // IBank only couples with IBank
51            (ResonatorProfile::IBank, ResonatorProfile::IBank) => true,
52            (ResonatorProfile::IBank, _) => false,
53            (_, ResonatorProfile::IBank) => false,
54
55            // All other combinations allowed
56            _ => true,
57        }
58    }
59}
60
61impl Default for ResonatorProfile {
62    fn default() -> Self {
63        ResonatorProfile::Coordination
64    }
65}