Skip to main content

Module stream_anchor

Module stream_anchor 

Source
Expand description

Stream-window chain anchor.

Subscribes to configured kernel topics via the topic router, runs a rolling BLAKE3 hash + message / byte counter over a fixed time window, and on each window close appends a stream.window_commit event to the local chain. This is the control-plane audit anchor for stream data (audio frames, sensor batches, etc.) — the data itself stays on the fast path, but the chain records a tamper-evident summary.

§Layout

One StreamWindowAnchor per anchored topic, wired to the a2a topic router via crate::topic::SubscriberSink::ExternalStream. The anchor’s consumer task pulls serialized KernelMessage JSON lines off the channel, updates its in-progress window, and fires a chain event when the configured duration elapses.

§Feature gating

Only compiled with the exochain feature — without it there is nothing to anchor to. Gracefully no-ops when the kernel lacks a ChainManager.

Structs§

StreamWindowAnchor
Stream window anchor service.
TopicAnchor
Per-topic anchor handle; dropping it cancels the consumer task.

Functions§

topic_matches
Glob-match a topic name against a configured pattern.