Skip to content

ariadne: room verbs (§4b) — control plane + cross-node media (audio), cvc::ariadne::conference - #701

Merged
transfix merged 5 commits into
feat/ariadne-conference-hostfrom
feat/ariadne-room-verbs
Oct 19, 2026
Merged

transfix merged 5 commits into
feat/ariadne-conference-hostfrom
feat/ariadne-room-verbs

Conversation

@transfix

@transfix transfix commented Oct 18, 2026 •

Copy link
Copy Markdown
Owner

Room verbs (§4b) — conference control plane + cross-node media

Stacked on #699 (conference host). Base auto-retargets to master once #699 merges.
Namespace cvc::ariadne::conference: the conference is a layer on the general streaming substrate (cvc::ariadne::stream / cvc::gl::ariadne stay task-neutral); conference code lives in inc|src/cvc/ariadne/conference/.

Slice 1 — control plane: room-join / room-roster / room-leave

Reusable core free functions (room_join/room_roster/room_leave) wrapped by DSL verbs (document-scoped handle, mirroring stream_intrinsics). Pure replicated state — no gRPC/GL/Runtime — on the shared §5a tree conf.rooms.<room>.participants.<pid>.{profile.name,presence.joined} off app.root(); converges via whatever state_cluster_shard the host installs.

  • Trust-all self-insert (roadmap-blessed "mesh works first; auth hardens later") — pid = local cluster node id. Server-mediated writes/admission are Phase 2 (§5d).
  • touch()-before-write — a freshly-created node's first value is otherwise lost to the lazy distributed-observer attach (the stream-descriptor idiom; cf. the "set twice" replication test).
  • Soft leave — a hard subtree delete is resurrected by a peer that still holds the participant, so leave flips presence.joined=0 (a converging value update) and the roster is present-only.

Slice 2 — media plane: room-publish / room-subscribe (audio proven)

Mesh P2P over the merged gRPC stream_bridge (grpc-gated). room-publish serve_port()s an open stream on the host's bridge and advertises its descriptor (endpoint + token + id + scope + format) under the publisher's participant subtree; room-subscribe reads a peer's descriptor from the replicated room tree, opens a local proxy sized to the format and sharing the token (so the pull routes), and pull_from()s the endpoint. Reusable free functions + DSL verbs.

General streaming additions this needed (not conference-specific): stream::format() / stream::scope() accessors + own_document_stream() (hand a pulled proxy to the document so stream-play-audio / a stream_view consume it).

Tests (all green)

  • room_intrinsics_test (no gRPC): local join/roster/leave + two-node join convergence + two-node soft-leave convergence.
  • room_media_test (gRPC): an f32 audio stream published on node A crosses to node B's proxy byte-identical, routed entirely by the replicated descriptor — no manual endpoint wiring. State plane on an inproc transport, media plane on a real gRPC transport on loopback (the two-process split).

Deferred

SFU-via-relay (server-selected serve/pull through stream_relay); per-proxy retirement (room-unpublish/leave teardown — the §7 gap; the host must stop its bridge before document teardown); the live two-instance host demo (host clustering plumbing — ties into the ariadne / ariadne-server binary split); §5d server-mediated writes + admission + roster authority + presence reaping.

…lice

The first room verbs for the conference app, as reusable core free functions (room_join / room_roster / room_leave) wrapped by DSL verbs (room-join / room-roster / room-leave), mirroring stream_intrinsics' document-scoped-handle pattern. Pure replicated state: participants live on the SHARED tree conf.rooms.<room>.participants.<pid>.{profile.name, presence.joined} off app.root(), so every node converges via whatever state_cluster_shard the host installs — no gRPC, no GL, no Runtime.

Trust-all self-insert (roadmap-blessed 'mesh works first; auth hardens later'): a client writes its own participant subtree and the pid is the local cluster node id. Writes use the stream.cpp touch()-before-write idiom so a fresh node's first value is not lost to the lazy distributed-observer attach. Leave is SOFT (presence.joined=0, a replicating value update) because a hard subtree delete is resurrected by any peer that still holds the participant; room_roster returns present-only. Server-mediated writes, admission/pid-allocation, roster authority and presence reaping are Phase 2 (§5d); media wiring (room-publish/-subscribe over the gRPC bridge/relay) is a later slice.

Test room_intrinsics_test (3 cases, no gRPC): local join/roster/leave; two-node join convergence (both see both, names intact); two-node soft-leave convergence (a leave replicates, both drop the leaver). Mirrors state_transport_inproc_test's two-shard + pump_all harness.
ariadne_conference now calls register_room_intrinsics(app) alongside the stream/media registrations, so a conference .ari can call (room-join/roster/leave). No demo uses them yet (a room demo needs two instances + the §5 control plane); this makes the §8 bundle complete.
The conference is a LAYER on top of the general streaming substrate — cvc::ariadne::stream and cvc::gl::ariadne stay task-neutral (streaming serves many uses, not just conferencing), so only the room/authority control plane is conference-specific. Move it into a cvc::ariadne::conference namespace + inc/cvc/ariadne/conference/ + src/cvc/ariadne/conference/, mirroring ariadne/stream/. No behaviour change; streaming is untouched.
General streaming additions (not conference-specific). stream::format()/scope() expose what a stream was opened with — the frame format and the root_path — which a consumer needs to advertise a stream or open a matching proxy for it (the stream already stores both; they just weren't exposed). own_document_stream() hands an already-open stream to a document's owning table (the same one (stream-open) fills), so a module that opens a stream itself — e.g. a pulled proxy — can make it a first-class document stream reachable by document_stream() and the (stream-info/-close/-capture/-play) verbs.
…§4b), audio proven

The conference MEDIA plane, mesh P2P over the merged gRPC stream_bridge. room-publish serve_port()s an open stream on the host's bridge and advertises its descriptor (endpoint + token + id + scope + format) under the publisher's participant subtree; room-subscribe reads a remote participant's descriptor from the REPLICATED room tree, opens a local proxy sized to the format and sharing the token (so the pull routes), and pull_from()s the publisher's endpoint. Reusable free functions (room_publish/room_subscribe) + DSL verbs (room-publish/room-subscribe), in cvc::ariadne::conference; grpc-gated (new src/cvc/ariadne/conference/room_media_intrinsics.{h,cpp}).

Test room_media_test (grpc): an f32 audio stream published on node A crosses to node B's proxy BYTE-IDENTICAL, routed entirely by the replicated descriptor — no manual endpoint wiring. State plane (room tree) on an inproc transport, media plane on a real gRPC transport on loopback, the split a two-process conference uses. Deferred: SFU-via-relay (server-selected serve/pull through stream_relay), per-proxy retirement (room-unpublish/leave teardown — the §7 gap), and the live two-instance host demo (needs host clustering plumbing).
@transfix transfix changed the title ariadne: room verbs (§4b) — join/roster/leave, cross-node convergent ariadne: room verbs (§4b) — control plane + cross-node media (audio), cvc::ariadne::conference Oct 19, 2026
@transfix
transfix merged commit 6a4436c into feat/ariadne-conference-host Oct 19, 2026
7 checks passed
@transfix
transfix deleted the feat/ariadne-room-verbs branch October 29, 2026 20:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant