pub struct NoteNudge { /* private fields */ }Expand description
Turn-counted in-band memory nudge, mirroring the loop’s read-only-rounds
nudge (counter, threshold, reset-on-organic-use) but across user turns
instead of tool rounds, so the state lives with the caller (the TUI owns
one NoteNudge per session and lends it to each chat_complete call).
After interval user turns with zero organic save_note use, one
reminder line is appended to the next user message; the counter then
restarts, giving a 1-in-N cadence for sessions that never save. Any
organic save_note call resets the counter, so active curators are
never nagged. interval == 0 disables the nudge entirely.
Implementations§
Source§impl NoteNudge
impl NoteNudge
Sourcepub fn new(interval: usize) -> Self
pub fn new(interval: usize) -> Self
interval is [memory] note_nudge_interval (default 10, 0 = off).
Sourcepub fn begin_turn(&mut self) -> Option<String>
pub fn begin_turn(&mut self) -> Option<String>
Called by the loop once at the start of each user turn (only when a
NoteSink is present). Returns the reminder line to append to this
turn’s user message when the previous interval turns saw no organic
save_note use; advances the turn counter either way.
Sourcepub fn note_saved(&mut self)
pub fn note_saved(&mut self)
The model called save_note organically — reset the counter (the
read-only-rounds reset pattern). Only quiet sessions ever see a nudge.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for NoteNudge
impl RefUnwindSafe for NoteNudge
impl Send for NoteNudge
impl Sync for NoteNudge
impl Unpin for NoteNudge
impl UnsafeUnpin for NoteNudge
impl UnwindSafe for NoteNudge
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
impl<T> ErasedDestructor for Twhere
T: 'static,
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