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.