Objective
Replace process-local realtime behavior with a durable, authenticated event stream that can recover deterministically after disconnects and restarts.
Source-grounded findings
- Current
/ws uses a raw socket list in process memory and broadcasts telemetry every 2 seconds.
- WebSocket upgrade occurs before normal API auth handling.
- Current
/api/jarvis/stream is a compatibility-style word stream, not a durable run/event stream.
- Rate limits, event/log history, and active socket state are process-local.
Scope
- Implement append-only tenant-scoped event store with monotonic sequence/cursor semantics.
- Add transactional outbox tied atomically to state/audit mutations.
- Make SSE the primary durable server→client event channel; keep WebSocket only where bidirectional behavior is required.
- Add authenticated cursor replay, retention-gap detection,
resync.required, authoritative snapshot and reconnect flow.
- Define typed event envelopes for intent, plan, approval, action, tool, verification, evidence, briefing and run lifecycle.
- Add bounded queues/backpressure and explicit low-priority telemetry dropping rules.
Acceptance criteria
Depends on
#10 #11
Priority
P3 / required before live autonomous task views.
Objective
Replace process-local realtime behavior with a durable, authenticated event stream that can recover deterministically after disconnects and restarts.
Source-grounded findings
/wsuses a raw socket list in process memory and broadcasts telemetry every 2 seconds./api/jarvis/streamis a compatibility-style word stream, not a durable run/event stream.Scope
resync.required, authoritative snapshot and reconnect flow.Acceptance criteria
Depends on
#10 #11
Priority
P3 / required before live autonomous task views.