bridge
diapason.analytics.bridge
¶
Bridge between the internal event bus and the analytics client.
The internal bus (:mod:diapason.core.events) carries dozens of
event types — most are too granular or too internal to ship as
analytics. The bridge:
- Subscribes to a focused subset of EventTypes.
- Aggregates high-frequency events (INFERENCE_END, TOOL_CALL_END)
via :class:
SessionAggregatorso we only ship one event per chat session, not one per inference. - Forwards user-meaningful low-frequency events directly (FEEDBACK_RECEIVED, SECURITY_ALERT).
- Tracks first-uses in-process so
tool_first_usedfires once per (anon_id, tool) per process. (First-use across processes is not promised — that would require disk state and isn't worth the complexity for v1.)