Repository navigation
ariadne: room verbs (§4b) — control plane + cross-node media (audio), cvc::ariadne::conference - #701
Merged
Conversation
…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).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Room verbs (§4b) — conference control plane + cross-node media
Slice 1 — control plane:
room-join/room-roster/room-leaveReusable core free functions (
room_join/room_roster/room_leave) wrapped by DSL verbs (document-scoped handle, mirroringstream_intrinsics). Pure replicated state — no gRPC/GL/Runtime — on the shared §5a treeconf.rooms.<room>.participants.<pid>.{profile.name,presence.joined}offapp.root(); converges via whateverstate_cluster_shardthe host installs.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).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-publishserve_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-subscribereads 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), andpull_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 sostream-play-audio/ astream_viewconsume 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 theariadne/ariadne-serverbinary split); §5d server-mediated writes + admission + roster authority + presence reaping.