Expand description
The observation channel’s emission buffer. When an observation statement (Note/Warn/Record) executes, it
emits a structured ObsEvent to a per-run thread-local buffer, drained by
sinks (the in-memory test sink today; console and wire in Wave 16). This is
the SEPARATE observation channel (D0.1) — it never touches program output.
Emission is wait-free from the program’s perspective (a buffer push) and
never draws from the scheduler’s entropy, so a run’s SchedTrace is
identical with observation on or off.
Structs§
- ObsEvent
- One emitted observation event.
Enums§
- Event
Kind - What an emitted event IS: a speech-act message, or a trace-span boundary.
Spans are lexical (
During), so everySpanEnteris matched by exactly oneSpanExit. - ObsCat
- The speech-act category of a message event (mirrors the language AST’s
ObsCategory, kept local so sinks need no AST dependency).
Functions§
- capturing
- True when a capture buffer is installed (lets emitters skip work otherwise).
- drain
- Take the captured events and stop capturing.
- emit
- Emit an event. Honors per-site sampling: with
sample = Some(n)and a stablesiteid, only 1 in everynreaching this site is buffered (the first, then every nth). Sampling is a rendering decision — replay with capture-everything regenerates the full stream. - enter_
span - Emit a
SpanEnterfor aDuringblock (Wave 8). - exit_
span - Emit a
SpanExit— always paired with itsenter_span(theDuringarm emits it on every exit path, so spans stay balanced). - from_
logosobs - Parse a
.logosobsstream back to events (thelargo tracereader). - install
- Begin capturing events for a run (the
largo testrunner, per test). - to_
logosobs - Serialize an event stream to the
.logosobswire form — one JSON object per line, so it appends cheaply and greps line-by-line (columnar batching deferred).