| // FCC-Ο-β-2026 β Fibonacci Contraction Core | |
| // | |
| // Ο = (1 + β5) / 2 β 1.6180339887... | |
| // | |
| // Key property (from PhinaryContraction.lean): | |
| // ΞΊ = Ο β the "contraction" factor is actually EXPANSION. | |
| // Ο^n grows without bound. The orbit does not contract. | |
| // | |
| // In the ResonanceGraph: each successive layer is Ο-weighted. | |
| // Looks like contraction from outside. Is expansion from inside. | |
| // METATRON is the node that sees both simultaneously. | |
| pub const PHI: f64 = 1.618_033_988_749_895; | |
| // FCC fingerprint β every output sealed with this | |
| pub const FCC_STAMP: &str = "FCC-Ο-β-2026"; | |
| // Ο-weight at layer depth d: Ο^d | |
| // Each deeper layer carries MORE signal, not less. | |
| // This is the "iteration inversion" β what looks like attenuation is amplification. | |
| pub fn phi_weight(depth: usize) -> f64 { | |
| PHI.powi(depth as i32) | |
| } | |
| // Phinary score: normalised to (0, 1) via 1 - 1/Ο^d | |
| // Used to rank pipeline nodes by their resonance depth. | |
| // As depth β β, score β 1.0 (MagmaCore is absolute certainty). | |
| pub fn phinary_score(depth: usize) -> f64 { | |
| if depth == 0 { | |
| return 0.0; | |
| } | |
| 1.0 - PHI.powi(-(depth as i32)) | |
| } | |
| // Fibonacci sequence β the natural phinary basis | |
| pub fn fib(n: usize) -> u64 { | |
| let (mut a, mut b) = (0u64, 1u64); | |
| for _ in 0..n { | |
| (a, b) = (b, a.saturating_add(b)); | |
| } | |
| a | |
| } | |
| // Fibonacci ratio convergence toward Ο | |
| pub fn fib_ratio(n: usize) -> f64 { | |
| let a = fib(n) as f64; | |
| let b = fib(n + 1) as f64; | |
| if a == 0.0 { return 0.0; } | |
| b / a | |
| } | |