State Store: add a live event-subscribe RPC so the dashboard feed survives cutover #1690

Closed
opened 2026-10-27 13:41:24 +00:00 by sam · 0 comments
Owner

At the 5.4 cutover the dashboard's activity feed breaks: /events catch-up reads
over the State Store contract and works, but live delivery is a Server.Broadcast
call made only from internal/app/archied/main.go:491, and no gRPC service
subscribes to events. After cutover the feed shows history at page load and then
goes quiet, which violates the extraction's SSE replay semantics and the Phase 3
parent's end-to-end criterion.

Neither proto has a live event-subscribe RPC. State Store has EventsSince
(catch-up, works), StreamCaptures and StreamUndispatchedCaptures (capture
streams, not the activity feed). Gateway has ChatContract.Stream (per-chat
streams, not the operator activity feed).

This is a contract amendment, not a 5.4 implementation detail. Per
docs/prds/ui-service-boundary.md the UI Service may only consume what a service
contract exposes, and a new capability that needs a wider State Store surface
must amend that service's contract before implementation.

Status: prerequisite of archie-core-8cda.5.4.

Close reason

Resolved by deciding against the push RPC the bead assumed. SetMaxOpenConns(1) makes the EventsSince id cursor gapless; sseStream.drain already treats a broadcast as a wakeup and re-reads the gap, so a poller is semantically identical to the bus with no change to sse.go; and the events table is the only fan-out point that catches ArchiveTask's in-transaction audit write and daemon.go's direct binding-dispatch insert. Implemented as internal/webui/event_pump.go (prime past history, then tick EventsSince into Broadcast), wired into archieui.Run with -event-poll-interval (default 1s). No proto change, no new auth surface. Decision recorded in migration-decisions.md section 6; ui-service-boundary.md's /events row is RESOLVED and /api/logs split out as still host-local. Three tests over a real staterpc client and gRPC listener. task check green, committed 74ff830.


Imported from beads archie-core-za9f · GitHub #817 · type task · priority P2 · created 2026-09-08 · closed 2026-09-08

At the 5.4 cutover the dashboard's activity feed breaks: /events catch-up reads over the State Store contract and works, but live delivery is a Server.Broadcast call made only from internal/app/archied/main.go:491, and no gRPC service subscribes to events. After cutover the feed shows history at page load and then goes quiet, which violates the extraction's SSE replay semantics and the Phase 3 parent's end-to-end criterion. Neither proto has a live event-subscribe RPC. State Store has EventsSince (catch-up, works), StreamCaptures and StreamUndispatchedCaptures (capture streams, not the activity feed). Gateway has ChatContract.Stream (per-chat streams, not the operator activity feed). This is a contract amendment, not a 5.4 implementation detail. Per docs/prds/ui-service-boundary.md the UI Service may only consume what a service contract exposes, and a new capability that needs a wider State Store surface must amend that service's contract before implementation. Status: prerequisite of archie-core-8cda.5.4. ### Close reason Resolved by deciding against the push RPC the bead assumed. SetMaxOpenConns(1) makes the EventsSince id cursor gapless; sseStream.drain already treats a broadcast as a wakeup and re-reads the gap, so a poller is semantically identical to the bus with no change to sse.go; and the events table is the only fan-out point that catches ArchiveTask's in-transaction audit write and daemon.go's direct binding-dispatch insert. Implemented as internal/webui/event_pump.go (prime past history, then tick EventsSince into Broadcast), wired into archieui.Run with -event-poll-interval (default 1s). No proto change, no new auth surface. Decision recorded in migration-decisions.md section 6; ui-service-boundary.md's /events row is RESOLVED and /api/logs split out as still host-local. Three tests over a real staterpc client and gRPC listener. task check green, committed 74ff830. --- _Imported from beads `archie-core-za9f` · GitHub #817 · type task · priority P2 · created 2026-09-08 · closed 2026-09-08_
sam added the taskmedium labels 2026-10-27 13:41:24 +00:00
sam self-assigned this 2026-10-27 13:41:24 +00:00
sam closed this issue 2026-10-27 13:41:24 +00:00
sam added a new dependency 2026-10-27 13:42:17 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Reference: sam/archie#1690