pub struct ObservationEmitter { /* private fields */ }Implementations§
Source§impl ObservationEmitter
impl ObservationEmitter
pub async fn open_default() -> Result<Self, String>
pub async fn open_at(path: &Path) -> Result<Self, String>
pub async fn enqueue(&self, event: &ObservationEvent) -> Result<i64, String>
pub async fn matching_recent_rule_ids( &self, app_db: &SqlitePool, session_id: &str, file_path: &str, within_ms: i64, ) -> Result<Vec<String>, String>
pub async fn strongest_recent_rule_id( &self, app_db: &SqlitePool, session_id: &str, file_path: &str, within_ms: i64, ) -> Result<Option<String>, String>
Sourcepub async fn recent_mcp_serve_event_ids(
&self,
rule_id: &str,
repo_full_name: Option<&str>,
file_path: Option<&str>,
accepted_at_ms: i64,
window_ms: i64,
) -> Result<Vec<i64>, String>
pub async fn recent_mcp_serve_event_ids( &self, rule_id: &str, repo_full_name: Option<&str>, file_path: Option<&str>, accepted_at_ms: i64, window_ms: i64, ) -> Result<Vec<i64>, String>
Outbox row ids of mcp_rule_served events that include rule_id
and either match the same repo_full_name or file_path, within
window_ms before accepted_at_ms. Used to populate
ObservationEvent::FixOutcome::mcp_serve_event_ids at enqueue
time so the audited cross-link
acceptedOutcomesLinkedToMcpRuleServe survives the session-id
asymmetry between hook-emitted serve events (session_id="hook")
and agent-emitted accepted edits.
pub async fn latest_rule_fire_for_session( &self, session_id: &str, ) -> Result<Option<RuleFireSnapshot>, String>
pub async fn cited_edits_for_session( &self, session_id: &str, ) -> Result<Vec<CitedEdit>, String>
pub async fn has_fix_outcome( &self, session_id: &str, rule_id: &str, ) -> Result<bool, String>
pub async fn accepted_fix_outcome_count(&self, days: i64) -> Result<i64, String>
pub async fn accepted_recall_link_summary( &self, days: i64, lookback_days: i64, ) -> Result<AcceptedRecallLinkSummary, String>
pub async fn accepted_fix_outcome_rule_summaries( &self, days: i64, lookback_days: i64, ) -> Result<Vec<AcceptedFixOutcomeRuleSummary>, String>
pub async fn pending_upload_count(&self) -> Result<i64, String>
pub async fn has_rule_actual_citation( &self, session_id: &str, rule_id: &str, ) -> Result<bool, String>
pub async fn actual_citation_summary_since( &self, since_ms: i64, ) -> Result<ActualCitationSummary, String>
pub async fn accepted_fix_proof_sources( &self, rule_ids: &[String], ) -> Result<HashMap<String, String>, String>
Source§impl ObservationEmitter
impl ObservationEmitter
pub async fn retry_pending_uploads_now(&self) -> Result<u64, String>
pub async fn flush_to_cloud( &self, client: &CloudClient, ) -> Result<(usize, usize), String>
Sourcepub async fn drain_abandoned_older_than(
&self,
cutoff_unix_ms: i64,
dry_run: bool,
) -> Result<DrainSummary, String>
pub async fn drain_abandoned_older_than( &self, cutoff_unix_ms: i64, dry_run: bool, ) -> Result<DrainSummary, String>
Resurrect abandoned observation_events rows older than
cutoff_unix_ms back to pending. Returns the number of rows
that were (or would be, in dry_run mode) reset, bucketed by
event_type (sorted ascending so doctor output is stable).
Uses a single transaction so a partial drain cannot leave the
queue half-reset; dry_run = true rolls back instead of committing.
Cutoff: a row is eligible iff its created_at_ms is older than
the provided cutoff. We deliberately don’t use
next_attempt_at_ms because it isn’t carried forward when a
row is abandoned (the prior mark_failed rewrote it for the
would-be retry that never happened), so created_at_ms is the
stable age signal.
Trait Implementations§
Source§impl Clone for ObservationEmitter
impl Clone for ObservationEmitter
Source§fn clone(&self) -> ObservationEmitter
fn clone(&self) -> ObservationEmitter
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for ObservationEmitter
impl !UnwindSafe for ObservationEmitter
impl Freeze for ObservationEmitter
impl Send for ObservationEmitter
impl Sync for ObservationEmitter
impl Unpin for ObservationEmitter
impl UnsafeUnpin for ObservationEmitter
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,
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.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
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