Skip to content

runtime(ws): derive hello envelope from daemon runtime summary#216

Merged
ToadAid merged 1 commit into
mainfrom
mirror/runtime-ws-hello-from-daemon-summary
Mar 23, 2026
Merged

runtime(ws): derive hello envelope from daemon runtime summary#216
ToadAid merged 1 commit into
mainfrom
mirror/runtime-ws-hello-from-daemon-summary

Conversation

@ToadAid
Copy link
Copy Markdown
Owner

@ToadAid ToadAid commented Mar 23, 2026

Summary

  • derive websocket hello envelope fields from the daemon-backed runtime summary
  • stop reading node_id and runtime_started_at directly from the boot snapshot
  • preserve websocket hello shape, backlog replay, and live event flow

Why

This tightens the websocket runtime truth seam by removing a direct boot-snapshot dependency for fields already present in the daemon-backed runtime summary.

Scope

Changed:

  • src/mirror-service/runtime_events_ws.ts

Not changed:

  • routing
  • websocket protocol shape
  • event ordering
  • sync/status/daemon internals
  • compat code
  • adapter-boundary files
  • tests, except verification only

Details

This patch:

  • imports getMirrordaemonRuntimeState(...)
  • derives:
    • node_id from runtime.node_id
    • runtime_started_at from runtime.runtime_started_at
  • keeps the hello envelope shape unchanged

Verification

  • pnpm vitest run src/mirror-service/mirror_service.test.ts -t "surfaces runtime websocket connect and disconnect events to live subscribers"
  • pnpm vitest run src/mirror-service/mirror_service.test.ts -t "streams /mirror/runtime/ws with backlog, live events, and protocol messages"

@ToadAid ToadAid merged commit 6762b4d into main Mar 23, 2026
27 of 28 checks passed
@ToadAid ToadAid deleted the mirror/runtime-ws-hello-from-daemon-summary branch March 23, 2026 23:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant