pub struct Settle { /* private fields */ }Expand description
Three-phase model per spec §7, so Plan 2’s renderer and Plan 3’s async swap EXTEND this type instead of rewriting it:
live— the jittering partial hypothesis (not committed)committing— the most recent phrase, shown bright with deterministic-Light, still inside the decode-lag / async-swap window (may be upgraded or take a late STT revision)settled— finalized, immutable blocks (never move again)
Implementations§
Source§impl Settle
impl Settle
pub fn new() -> Self
Sourcepub fn on_partial(&mut self, partial: &str)
pub fn on_partial(&mut self, partial: &str)
A new/revised partial hypothesis for the live edge.
Sourcepub fn commit(&mut self, raw: &str, clean: &str)
pub fn commit(&mut self, raw: &str, clean: &str)
Endpoint boundary: the live edge becomes the committing block (clean is
the deterministic-Light result). Any prior committing block’s window has
closed, so it is finalized into settled first.
Sourcepub fn finalize(&mut self)
pub fn finalize(&mut self)
Promote the committing block to settled (its lag/swap window elapsed).
Sourcepub fn upgrade_committing(&mut self, clean: &str) -> bool
pub fn upgrade_committing(&mut self, clean: &str) -> bool
Plan 3 async LLM swap: replace the committing block’s clean text while still inside its window. No-op (returns false) once finalized — the settled rule wins.
Sourcepub fn revise_committing(&mut self, raw: &str, clean: &str) -> bool
pub fn revise_committing(&mut self, raw: &str, clean: &str) -> bool
Plan 5 second-pass swap: replace BOTH raw and clean of the committing
block (a better transcription of the same audio, not a reformat). No-op
once finalized — the settled rule wins, exactly like upgrade_committing.
Sourcepub fn try_late_revision_settled(
&mut self,
_index: usize,
_new_text: &str,
) -> bool
pub fn try_late_revision_settled( &mut self, _index: usize, _new_text: &str, ) -> bool
A late STT revision targeting already-settled text is DROPPED (returns false so the caller can log it to the raw layer).
pub fn settled(&self) -> &[Block]
pub fn committing(&self) -> Option<&Block>
pub fn live(&self) -> &str
Sourcepub fn committing_revised(&self) -> bool
pub fn committing_revised(&self) -> bool
True once the committing block has been revised/upgraded (its text is final-quality). Drives the bright-is-final rendering: dim until revised.