pub struct RefineSession {
pub id: String,
pub name: String,
pub target_quality: f64,
pub convergence_threshold: f64,
pub max_iterations: u32,
pub converged: bool,
pub iterations: Vec<RefineIteration>,
pub created_at: u64,
}Expand description
A named Refine session — tracks iterative improvement of content.
The session starts with an initial content and progresses through iterations, each guided by feedback. Convergence is detected when quality delta falls below a threshold.
ΛD alignment: ψ = ⟨T=“refinement”, V=content, E=⟨c≤0.99, τ, ρ, δ=derived⟩⟩ All iterations are derived per Theorem 5.1 — refinement is transformation.
Fields§
§id: StringSession identifier.
name: StringSession name/label.
target_quality: f64Target quality threshold (0.0–1.0). Session converges when reached.
convergence_threshold: f64Convergence delta threshold. Session converges when |delta| < this value.
max_iterations: u32Maximum iterations allowed.
converged: boolWhether the session has converged.
iterations: Vec<RefineIteration>History of all iterations.
created_at: u64Unix timestamp of creation.
Implementations§
Source§impl RefineSession
impl RefineSession
Sourcepub fn current_quality(&self) -> f64
pub fn current_quality(&self) -> f64
Get current quality (last iteration’s quality, or 0.0 if no iterations).
Sourcepub fn iteration_count(&self) -> u32
pub fn iteration_count(&self) -> u32
Get current iteration count.
Sourcepub fn check_convergence(&self) -> bool
pub fn check_convergence(&self) -> bool
Check if the session has converged based on quality target or delta threshold.
Sourcepub fn add_iteration(
&mut self,
content: String,
quality: f64,
feedback: String,
) -> Result<&RefineIteration, String>
pub fn add_iteration( &mut self, content: String, quality: f64, feedback: String, ) -> Result<&RefineIteration, String>
Add an iteration. Returns Err if session is converged or max iterations reached.
Trait Implementations§
Source§impl Clone for RefineSession
impl Clone for RefineSession
Source§fn clone(&self) -> RefineSession
fn clone(&self) -> RefineSession
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for RefineSession
impl Debug for RefineSession
Source§impl<'de> Deserialize<'de> for RefineSession
impl<'de> Deserialize<'de> for RefineSession
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>,
Auto Trait Implementations§
impl Freeze for RefineSession
impl RefUnwindSafe for RefineSession
impl Send for RefineSession
impl Sync for RefineSession
impl Unpin for RefineSession
impl UnsafeUnpin for RefineSession
impl UnwindSafe for RefineSession
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more