Skip to main content

spawn_reducer_plumbing

Function spawn_reducer_plumbing 

Source
pub async fn spawn_reducer_plumbing(
    mstore: &Arc<Store>,
    event_bus: &Arc<EventBus>,
    subagent_watcher: &Arc<SubagentWatcher>,
) -> ReducerPlumbing
Expand description

Phase E.2 / E.2c.2 — srv reducer plumbing, hoisted out of the (conditional) pipe-IPC bind block so HTTP/WS RPC handlers in dispatch_service can route through the reducer. State, event bus, event log, and persist subscriber all live unconditionally; the pipe IPC server is still conditional on AGENTMUX_SRV_PIPE_PATH being set (absent in task dev mode).

Bootstraps reducer state from SQLite, spawns the disk writer (forensic log of every reducer event), the persist subscriber (idempotent SQLite write-back), the MuxObjUpdate bridge, and the subagent-watcher block-delete cascade backstop.