pub struct CognitiveState {
pub total_tokens_used: u64,
pub tokens_remaining: u64,
pub context_pressure: f32,
pub turns_completed: u32,
pub tool_density: f64,
pub turns_since_compact: u32,
pub dilation_gate: HysteresisGate,
}Expand description
Cognitive health state — tracks context and token usage.
Fields§
§total_tokens_used: u64Total tokens consumed in the session.
tokens_remaining: u64Tokens remaining from budget.
context_pressure: f32Context pressure (0.0 = empty, 1.0 = full).
turns_completed: u32Number of model turns completed.
tool_density: f64Average tool calls per turn (rolling window). High = active implementation.
turns_since_compact: u32Turns elapsed since last compaction. High = stale old context.
dilation_gate: HysteresisGateHysteresis gate for context dilation — prevents flapping between Dilate and Compress decisions in the soft zone.
Trait Implementations§
Source§impl Clone for CognitiveState
impl Clone for CognitiveState
Source§fn clone(&self) -> CognitiveState
fn clone(&self) -> CognitiveState
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for CognitiveState
impl Debug for CognitiveState
Source§impl Default for CognitiveState
impl Default for CognitiveState
Source§impl<'de> Deserialize<'de> for CognitiveState
impl<'de> Deserialize<'de> for CognitiveState
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for CognitiveState
impl RefUnwindSafe for CognitiveState
impl Send for CognitiveState
impl Sync for CognitiveState
impl Unpin for CognitiveState
impl UnsafeUnpin for CognitiveState
impl UnwindSafe for CognitiveState
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more