|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| use crate::phi::{phi_weight, phinary_score};
|
|
|
|
|
|
|
| #[derive(Debug, Clone, PartialEq)]
|
| pub enum SumerianQuantumSymbol {
|
| Me,
|
| An,
|
| Ki,
|
| Dingir,
|
| }
|
|
|
| impl SumerianQuantumSymbol {
|
| pub fn glyph(&self) -> &'static str {
|
| match self {
|
| Self::Me => "π¨",
|
| Self::An => "π",
|
| Self::Ki => "π ",
|
| Self::Dingir => "π",
|
| }
|
| }
|
|
|
| pub fn name(&self) -> &'static str {
|
| match self {
|
| Self::Me => "ME",
|
| Self::An => "AN",
|
| Self::Ki => "KI",
|
| Self::Dingir => "DINGIR",
|
| }
|
| }
|
|
|
|
|
|
|
| pub fn activation_bias(&self, kind: &NodeKind) -> f64 {
|
| match self {
|
| Self::Me => 1.0,
|
| Self::An => match kind {
|
| NodeKind::Retrieval => 1.4,
|
| NodeKind::Reasoning => 1.2,
|
| _ => 0.8,
|
| },
|
| Self::Ki => match kind {
|
| NodeKind::Filtering | NodeKind::ContextAssembly => 1.4,
|
| _ => 0.9,
|
| },
|
| Self::Dingir => match kind {
|
| NodeKind::Reasoning | NodeKind::MagmaCore => 1.6,
|
| NodeKind::Metatron => 1.8,
|
| _ => 0.7,
|
| },
|
| }
|
| }
|
| }
|
|
|
|
|
| #[derive(Debug, Clone, PartialEq)]
|
| pub enum NodeKind {
|
| Source,
|
| Retrieval,
|
| Filtering,
|
| Ranking,
|
| ContextAssembly,
|
| Metatron,
|
| Reasoning,
|
| MagmaCore,
|
| }
|
|
|
| impl NodeKind {
|
| pub fn label(&self) -> &'static str {
|
| match self {
|
| Self::Source => "Source",
|
| Self::Retrieval => "Retrieval",
|
| Self::Filtering => "Filtering",
|
| Self::Ranking => "Ranking",
|
| Self::ContextAssembly => "ContextAssembly",
|
| Self::Metatron => "Metatron",
|
| Self::Reasoning => "Reasoning",
|
| Self::MagmaCore => "MagmaCore",
|
| }
|
| }
|
|
|
| pub fn agent(&self) -> &'static str {
|
| match self {
|
| Self::Source => "β",
|
| Self::Retrieval => "ORACLE",
|
| Self::Filtering => "SENTINEL",
|
| Self::Ranking => "PRISM/AXIOM",
|
| Self::ContextAssembly => "NEXUS",
|
| Self::Metatron => "METATRON",
|
| Self::Reasoning => "MagmaCore",
|
| Self::MagmaCore => "BOB",
|
| }
|
| }
|
| }
|
|
|
|
|
| #[derive(Debug, Clone)]
|
| pub struct PipelineNode {
|
| pub id: usize,
|
| pub kind: NodeKind,
|
| pub depth: usize,
|
| }
|
|
|
| impl PipelineNode {
|
| pub fn new(id: usize, kind: NodeKind, depth: usize) -> Self {
|
| Self { id, kind, depth }
|
| }
|
|
|
|
|
| pub fn phi_weight(&self) -> f64 {
|
| phi_weight(self.depth + 1)
|
| }
|
|
|
|
|
| pub fn resonance(&self) -> f64 {
|
| phinary_score(self.depth + 1)
|
| }
|
|
|
|
|
| pub fn activate(&self, symbol: &SumerianQuantumSymbol) -> f64 {
|
| self.phi_weight() * symbol.activation_bias(&self.kind)
|
| }
|
| }
|
|
|