Expand description
Streaming event iterator over the SubLinear orchestrator.
ADR-001’s primitives (closure, single-entry Neumann, contrastive orchestrator, coherence gate, witness, budget) compose into a per-event call pattern. Real callers — RuView agents watching sensor / log / metric streams, Cognitum reflex loops over a learning system, Ruflo inner-loop planners — process an iterator of events, not a single one.
This module lifts the single-event call into a stdlib Iterator
adapter: feed it an event stream, get back an iterator of
(event_idx, Vec<AnomalyRow>, latency_us) tuples. Native
composition with .filter(), .take(), .collect(), etc.
Each yielded event:
- Probes the
crate::coherence::delta_below_solve_thresholdskip gate first. If the gate trips, yields an emptyVecand a near-zero latency — the “no event, no work” path. - Otherwise calls
crate::contrastive_solve_on_change_sublinear_autoto compute the SubLinear top-k anomalies for the event. - Optionally consumes a slot from a caller-supplied
crate::PlanBudget; if the budget refuses, the iterator ends.
The whole pipeline stays SubLinear per event, with the gate + budget short-circuits letting callers cap end-to-end cost.
Structs§
- Event
Stream Config - Configuration for the event-stream iterator.
- Event
Stream Iter - Iterator returned by
event_stream_iter. - Event
Stream Op - Op marker for
event_stream_iter. Per-event class is the orchestrator’s — SubLinear on a strict-DD matrix. - Processed
Event - One processed event: the original index in the input stream, the top-k anomalies (empty if the gate skipped or budget refused), the wall-time spent on this event, and a status flag.
Enums§
- Event
Status - What the orchestrator did with a single event.
Functions§
- event_
stream_ iter - Process an iterator of
(SparseDelta, b_new)events through the SubLinear orchestrator, yieldingProcessedEvents. The optionalbudgetargument tracks cumulative consumption across the stream; when it refuses, the iterator yields one finalBudgetRefusedevent and ends.