Skip to main content

Module events

Module events 

Source

Structs§

DetachedObservationStats
Counters of the detached observation writer, for doctor and health.
LeanCtxEvent

Enums§

EventKind

Functions§

detached_observation_stats
emit
Backward-compatible spelling for the explicit legacy compatibility adapter.
emit_agent_action
emit_cache_hit
emit_compatibility
Persist a legacy event as a canonical local observation.
emit_policy_violation
emit_profile_changed
emit_role_changed
emit_threshold_adapted
emit_tool_call
emit_verification_warning
enable_detached_observations
Route emit_compatibility through the detached writer for the rest of this process. Called once by a serving process before it accepts requests; one-shot CLI commands keep synchronous persistence.
events_since
flush_detached_observations
Wait until every observation queued before this call is persisted, or timeout passes. Returns whether the queue drained. Used at shutdown so a serving process does not lose its last observations.
latest_events
load_events_from_file
Compatibility reader: an unavailable canonical store returns no events, never apparently current history. Use the fallible API to inspect the error.
load_served_events
load_events_from_file for a surface that SHOWS events — paths, names, free text — to a host or a model, for a reader working in project (the project of the running request when None). Every event passes the serve-time rule of the observation store (ObservationGate): an event that names a file is shown only while that file is admitted now; one without a source on record follows the originless rule. Historical JSONL records and rows written before admission existed are asked the same way. Counts and timestamps need no gate: use load_events_from_file.
try_load_events_from_file
Merge immutable historical JSONL with validated canonical observations.