clm-kernel 0.0.15

Cubical Logic Model (CLM) sovereign execution engine, CPN-VM, and Cordis spatiotemporal substrate
Documentation
//! CLM Layer 5: Continuous Learning Stratum & Meta-Circular Reflection ($L_5$).
//! Canonical Path: kernel/clm_rust_core/src/layer5/mod.rs
//!
//! Provides:
//! - Autonomous 7-step refinement cycle coordination:
//!   Observe -> Reflect -> Hypothesize -> Synthesize -> Test -> Audit -> Integrate.
//! - Epistemic Fitness Scoring (ΔE = S_candidate - S_baseline).
//! - Karpathy Write-Scope Quarantine Gate (INV-14).
//! - Stratified Universe Level verification ($U_0$–$U_5$).

pub mod learning;
#[cfg(feature = "native")]
pub mod petri_learning;
pub mod telemetry_hook;
pub mod type_lattice;

pub use learning::{
    advance_boundary, close_gamma_loop, compute_delta_e, evaluate_epistemic_fitness, seal_epoch,
    ContinuousLearningEngine, EpochState, EpistemicFitnessReport, LearningHypothesis,
};
#[cfg(feature = "native")]
pub use petri_learning::{
    EpistemicPlaceMCard, Layer5EpistemicLearningNet, LearningCycleResult, LearningTransitionPCard,
};
pub use telemetry_hook::LoopGammaTelemetryHook;
pub use type_lattice::{
    get_universe_coordinates, is_stratified, validate_universe_level, LatticeCoordinate,
    UniverseLevel,
};

/// 7-Step Autonomous Refinement Cycle phase representation.
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum RefinementPhase {
    Observe,
    Reflect,
    Hypothesize,
    Synthesize,
    Test,
    Audit,
    Integrate,
    Quarantine,
}

impl RefinementPhase {
    pub fn as_str(&self) -> &'static str {
        match self {
            Self::Observe => "observe",
            Self::Reflect => "reflect",
            Self::Hypothesize => "hypothesize",
            Self::Synthesize => "synthesize",
            Self::Test => "test",
            Self::Audit => "audit",
            Self::Integrate => "integrate",
            Self::Quarantine => "quarantine",
        }
    }
}