huskies: merge 1143 story Decouple LLM environmental awareness from chat transport — persona-keyed sessions and a real-time event subscription

This commit is contained in:
dave
2026-05-18 16:47:31 +00:00
parent e58ff4465a
commit fb4e52dd09
15 changed files with 281 additions and 77 deletions
+10
View File
@@ -66,6 +66,15 @@ pub fn log_transition_event(fired: &crate::pipeline_state::TransitionFired) {
to_stage,
pipeline_event,
);
// Real-time push to per-persona WebSocket subscribers.
crate::pipeline_event_bus::broadcast(crate::pipeline_event_bus::BusEvent {
sled_id,
story_id: fired.story_id.0.clone(),
from_stage: crate::pipeline_state::stage_label(&fired.before).to_string(),
to_stage: crate::pipeline_state::stage_label(&fired.after).to_string(),
pipeline_event: crate::pipeline_state::event_label(&fired.event).to_string(),
});
}
/// Read all persisted events from the CRDT event log.
@@ -121,6 +130,7 @@ pub fn spawn_event_log_subscriber() {
loop {
match rx.recv().await {
Ok(fired) => {
// log_transition_event also broadcasts to the pipeline_event_bus.
log_transition_event(&fired);
next_logical_seq += 1;
}