Skip to main content

clm_rust_core/layer5/
mod.rs

1//! CLM Layer 5: Continuous Learning Stratum & Meta-Circular Reflection ($L_5$).
2//! Canonical Path: kernel/clm_rust_core/src/layer5/mod.rs
3//!
4//! Provides:
5//! - Autonomous 7-step refinement cycle coordination:
6//!   Observe -> Reflect -> Hypothesize -> Synthesize -> Test -> Audit -> Integrate.
7//! - Epistemic Fitness Scoring (ΔE = S_candidate - S_baseline).
8//! - Karpathy Write-Scope Quarantine Gate (INV-14).
9//! - Stratified Universe Level verification ($U_0$–$U_5$).
10
11pub mod learning;
12pub mod telemetry_hook;
13pub mod type_lattice;
14
15pub use learning::{
16    advance_boundary, close_gamma_loop, compute_delta_e, evaluate_epistemic_fitness, seal_epoch,
17    ContinuousLearningEngine, EpochState, EpistemicFitnessReport, LearningHypothesis,
18};
19pub use telemetry_hook::LoopGammaTelemetryHook;
20pub use type_lattice::{
21    get_universe_coordinates, is_stratified, validate_universe_level, LatticeCoordinate,
22    UniverseLevel,
23};
24
25/// 7-Step Autonomous Refinement Cycle phase representation.
26#[derive(Debug, Clone, Copy, PartialEq, Eq)]
27pub enum RefinementPhase {
28    Observe,
29    Reflect,
30    Hypothesize,
31    Synthesize,
32    Test,
33    Audit,
34    Integrate,
35    Quarantine,
36}
37
38impl RefinementPhase {
39    pub fn as_str(&self) -> &'static str {
40        match self {
41            Self::Observe => "observe",
42            Self::Reflect => "reflect",
43            Self::Hypothesize => "hypothesize",
44            Self::Synthesize => "synthesize",
45            Self::Test => "test",
46            Self::Audit => "audit",
47            Self::Integrate => "integrate",
48            Self::Quarantine => "quarantine",
49        }
50    }
51}