Skip to content

The room bridge: NMDC users in the conference room, the chats joined - #17

Merged
transfix merged 2 commits into
mainfrom
m1-room-bridge
Nov 23, 2026
Merged

transfix merged 2 commits into
mainfrom
m1-room-bridge

Conversation

@transfix

Copy link
Copy Markdown
Contributor

Joe asked that NMDC users end up in a known conference room, where Ariadne clients see them and chat with them over the room chat. This builds that on arisrvx's bridged-users API (transfix/libcvc#1302, merged, in the v4.0.2 tag). It uses libcvc's documented host API only; no DC implementation was opened.

What it does (server/src/sublevels/bridge.py)

  • The room. The room is arisrvx's own: --room, by default standup, which sublevels sets as cyprty does. Under plain python it is SUBLEVELS_ROOM.
  • NMDC users in the room. Each online NMDC user is a bridged user of the room (host.room_presence(..., via="nmdc")). Ariadne clients list them in the room's users with the detail "<client>, <share> shared"; $MyINFO updates refresh that detail. When a user leaves the hub, room_absent takes them out.
  • NMDC to room. A user's main-chat line goes to the room's chat as that user (room_chat_post), with the text unescaped as P3 §5 says. Hub commands such as +help stay on the hub.
  • Room to NMDC. A participant's room post (on_room_chat) reaches every NMDC user as <[room]name> text|, escaped.
  • Direct messages. A participant's DM to an NMDC user (on_room_dm) arrives as $To: <nick> From: [room]name …. The NMDC user's reply to [room]name goes back to that participant as a room DM.
  • Names. Room users appear to NMDC clients as [room]name, nick-safe, and the hub refuses any nick with that prefix, so they can't be confused with hub users (P3 §5's "prefix that marks them as bridged").
  • Older hosts. A host without the API (arisrvx/pycvc 4.0.0 and 4.0.1) runs without the bridge and logs that.

Tests

  • tests/test_bridge.py runs against a stand-in host, so it works with any pycvc or none. It covers:
    • presence, detail updates and leaving;
    • chat both ways, with the escaping and with commands left out;
    • direct messages both ways, and a reply to an unknown room user;
    • the reserved prefix, and ids for long nicks.
  • tests/test_bridge_harness.py runs through libcvc's ServerHarness(room=): an Ariadne participant sees an NMDC user in its roster, the two chat both ways, the DMs go both ways, and the user leaves the roster.
    • It skips on pycvc 4.0.0 and 4.0.1. SUBLEVELS_REQUIRE_BRIDGE=1 turns the skip into a failure.
  • Local result: 118 passed, with #1302's pycvc.ariadne loaded over pycvc 4.0.0 and the harness and the bridge both required.
  • CI runs on arisrvx 4.0.0, so the harness bridge test skips there for now.

Follow-ups

  • Once libcvc 4.0.2 is on cvcpkg: its publish-cvcpkg run was queued at the time of writing. Then:
    • move server/ci/install.sh to 4.0.2 and set SUBLEVELS_REQUIRE_BRIDGE: '1' in ci.yml;
    • extend the arisrvx smoke run so an Ariadne client joins the room and chats with an NMDC user.
  • For the spec writer: P3 §5 leaves the bridged-name prefix to the bridge. This PR uses [room]name in main chat and in private messages, and reserves that prefix for hub nicks.

server/src/sublevels/bridge.py joins the NMDC hub to the relay's room
through arisrvx's bridged-users API (transfix/libcvc#1302, 4.0.2):
every online NMDC user is a bridged user of the room (via nmdc, with
their client and share as the detail), so Ariadne clients list them in
the room's users; NMDC main chat goes to the room's chat (unescaped, not
hub commands), and a participant's room post reaches NMDC users as
<[room]name> text. Direct messages go both ways: a participant's DM
arrives as a $To from [room]name, and an NMDC user's reply to
[room]name goes back to that participant. Hub nicks may not take the
[room] prefix (P3 section 5). A host without the API runs without the
bridge and says so.

Tests: the bridge against a stand-in host (any pycvc), and through
libcvc's ServerHarness(room=) when pycvc.ariadne has it (skipped on
4.0.0/4.0.1; SUBLEVELS_REQUIRE_BRIDGE=1 requires it). All 118 pass with
#1302's pycvc.ariadne.
…smoke run checks the bridge starts

server/ci/install.sh pins libcvc 4.0.2+cvc.2 with arisrvx and pycvc-cp312 4.0.2+cvc.1, the first
release with the bridged-users API; ci.yml sets SUBLEVELS_REQUIRE_BRIDGE; the arisrvx smoke run
checks that the bridge starts and that both NMDC users joined the room; the recipe and the server
document ask for 4.0.2.
@transfix

Copy link
Copy Markdown
Contributor Author

libcvc 4.0.2 is now on cvcpkg. e48e681 moves CI to it:

  • server/ci/install.sh pins libcvc==4.0.2+cvc.2 and arisrvx/pycvc-cp312==4.0.2+cvc.1.
  • ci.yml sets SUBLEVELS_REQUIRE_BRIDGE: '1', so the bridge's harness test can no longer skip.
  • The arisrvx smoke run now checks that the bridge starts in real arisrvx and that both NMDC users joined the room (bridge_presence: 2).
  • The recipe and the server document ask for 4.0.2.

CI run 44697058853 is green: the arisrvx job passed 118 tests with none skipped.

Still to do: an Ariadne client that joins the room and chats with an NMDC user in the smoke run. That needs arigl 4.0.2 (or another host with the 4.0.2 room verbs) on cvcpkg; only arigl 4.0.1 is published so far.

@transfix
transfix merged commit e990d0c into main Nov 23, 2026
9 checks passed
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