pub struct AdvisorEmissionGuard { /* private fields */ }Expand description
Thread-safe (&self + internal lock) because accept is driven from the
advisor agent’s tool execution while begin_update/reset are driven from
the host’s turn boundaries — they can overlap.
Implementations§
Source§impl AdvisorEmissionGuard
impl AdvisorEmissionGuard
Sourcepub fn new() -> AdvisorEmissionGuard
pub fn new() -> AdvisorEmissionGuard
Construct with the default dedupe history capacity (4096).
Sourcepub fn with_capacity(capacity: usize) -> AdvisorEmissionGuard
pub fn with_capacity(capacity: usize) -> AdvisorEmissionGuard
Construct with an explicit dedupe history capacity.
Sourcepub fn reset(&self)
pub fn reset(&self)
Drop all dedupe and per-update state. Called whenever the advisor
runtime is reset (compaction, session switch, /new) so a re-primed
advisor can re-raise old issues — the primary transcript was rewritten.
omp reset().
Sourcepub fn begin_update(&self)
pub fn begin_update(&self)
Clear the per-update rate-limit gate. Called right before each advisor
prompt(batch) cycle so the next advisor model cycle starts with a
fresh budget of one advise. omp beginUpdate().
Sourcepub fn accept(&self, note: &str) -> bool
pub fn accept(&self, note: &str) -> bool
Whether the proposed note should reach the primary. On true the gate
has already recorded the note (consumed the per-update budget and added
it to the dedupe history) — the caller delivers the note. On false the
caller drops it. omp accept().
Empty/whitespace-only notes are suppressed (defense-in-depth; the
tool-args contract requires a non-empty string). Content-free filler
(per SUPPRESSED_NORMALIZED_PHRASES) and exact normalized duplicates
are suppressed. Over-budget calls (a second accept in the same update)
are suppressed.
Trait Implementations§
Source§impl Default for AdvisorEmissionGuard
impl Default for AdvisorEmissionGuard
Source§fn default() -> AdvisorEmissionGuard
fn default() -> AdvisorEmissionGuard
Auto Trait Implementations§
impl !Freeze for AdvisorEmissionGuard
impl !RefUnwindSafe for AdvisorEmissionGuard
impl Send for AdvisorEmissionGuard
impl Sync for AdvisorEmissionGuard
impl Unpin for AdvisorEmissionGuard
impl UnsafeUnpin for AdvisorEmissionGuard
impl UnwindSafe for AdvisorEmissionGuard
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
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.