open-standards/joule-code/joule-code-rs/crates/joule-moq-remote
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Transaction Science bb3797e337
All checks were successful
repository checks / lockfiles, advisories, tests in CI, workflow hygiene, spec and section references, public text (pull_request) Successful in 3m12s
standards workspaces build + test / which workspaces this change touches (pull_request) Successful in 8s
wai-audit collector and player integration / does this change touch it (pull_request) Successful in 7s
WAI breaking changes and the conformance runner / WAI breaking · does this change touch WAI (pull_request) Successful in 7s
WAI operation catalogue / does this change touch it (pull_request) Successful in 6s
joule-code conformance gate / joule-moq-relay, every target (pull_request) Successful in 4m14s
WAI conformance / does this change touch it (pull_request) Successful in 10s
WAI energy receipts / does this change touch it (pull_request) Successful in 8s
WAI examples / WAI examples · does this change touch them (pull_request) Successful in 6s
wai-fleet service / does this change touch it (pull_request) Successful in 8s
WAI JPEG-AI whole decode (pinned inputs, required) / does this change touch it (pull_request) Successful in 7s
wai-key-proxy / does this change touch it (pull_request) Successful in 13s
WAI neural sink gates / does this change touch it (pull_request) Successful in 13s
wai-ledger service / does this change touch it (pull_request) Successful in 13s
wai-ops-gpu integer operators on GPUs / does this change touch it (pull_request) Successful in 10s
wai-pack / wai-pack · does this change touch it (pull_request) Successful in 7s
wai-quantum studio and desktop / does this change touch it (pull_request) Successful in 7s
wai-quantum WebGPU member / does this change touch it (pull_request) Successful in 6s
wai-sink-android native sink library / does this change touch it (pull_request) Successful in 7s
wai-sink-swift native sink package / does this change touch it (pull_request) Successful in 6s
WAI mbt2018_mean integer decode (regenerated vectors) / does this change touch it (pull_request) Successful in 6s
WAI Studio / does this change touch it (pull_request) Successful in 7s
wai-web wasm32 / does this change touch it (pull_request) Successful in 6s
wai-quantum WebGPU member / member · DX12 and Vulkan (cbio-windows) (pull_request) Successful in 13m19s
joule-code conformance gate / joule-moq-ingest, every target (pull_request) Successful in 6m10s
WAI conformance / v2 vocabulary · manifests validate as stated (pull_request) Successful in 23s
WAI conformance / fast integer kernels, every x86_64 kernel set (AVX-512 silicon) (pull_request) Successful in 3m7s
joule-moq-remote host agent / joule-moq-remote · does this change touch it (pull_request) Successful in 6s
joule-moq-room room service / joule-moq-room · does this change touch it (pull_request) Successful in 1m6s
joule-moq-web browser client / joule-moq-web · does this change touch it (pull_request) Successful in 5s
wai-app and Create / wai-app · does this change touch it (pull_request) Successful in 5s
wai-web reach builds / wai-web reach · does this change touch it (pull_request) Successful in 5s
joule-code conformance gate / Build + round-trip C1-C4 vectors (pull_request) Successful in 3m30s
standards workspaces build + test / joule-code-rs (joule-code/joule-code-rs, joule-code-rs, linux-arm64, true) (pull_request) Successful in 7m32s
WAI conformance / delivery telemetry · CMCD and CMSD against an independent library (pull_request) Successful in 15s
wai-audit collector and player integration / collector · linux (pull_request) Successful in 1m10s
WAI conformance / cross-arch byte-equality · linux-arm64 (pull_request) Successful in 1m1s
WAI breaking changes and the conformance runner / WAI breaking · wire, record and API against main · linux (pull_request) Successful in 1m29s
wai-quantum WebGPU member / member · integrated GPU, Vulkan (framework-128gb) (pull_request) Successful in 8m12s
WAI breaking changes and the conformance runner / WAI breaking and conform · their tests, and the independent verifiers through wai conform · linux (pull_request) Successful in 2m40s
WAI operation catalogue / the catalogue and every door · linux (pull_request) Successful in 3m7s
WAI conformance / C2PA manifest emission · signed, read back, validated (pull_request) Successful in 3m24s
WAI conformance / cross-arch byte-equality · linux (pull_request) Successful in 47s
WAI conformance / quantum core and corpus under wasm32-wasip2 (wasmtime) (pull_request) Successful in 2m59s
WAI conformance / faces from keypoints under wasm32-wasip2 (wasmtime) (pull_request) Successful in 1m39s
wai-fleet service / service · linux (pull_request) Successful in 2m22s
wai-key-proxy / proxy · linux (pull_request) Successful in 1m7s
wai-ledger service / service · linux (pull_request) Successful in 1m26s
WAI conformance / each feature of the independent verifiers' steps compiles alone (pull_request) Successful in 14m59s
WAI neural sink gates / model-free refusals of the neural sink (pull_request) Successful in 1m39s
WAI JPEG-AI whole decode (pinned inputs, required) / fetch pinned JPEG-AI inputs → whole decode + pixel hash, required (pull_request) Successful in 6m56s
wai-pack / wai-pack · linux (pull_request) Successful in 1m48s
wai-ops-gpu integer operators on GPUs / builds · no adapter is not a pass (linux) (pull_request) Successful in 3m28s
joule-code conformance gate / joule-moq-relay, its own energy on a counter (macos) (pull_request) Successful in 1m2s
WAI examples / WAI examples · portable · linux (pull_request) Successful in 10m3s
wai-quantum WebGPU member / member · software Vulkan (linux) (pull_request) Successful in 2m1s
wai-quantum studio and desktop / studio · browser (pull_request) Successful in 3m29s
WAI energy receipts / energy receipts · linux (pull_request) Successful in 11m17s
wai-quantum WebGPU member / shader checks · browser build · wasip2 inertness · MSRV (pull_request) Successful in 3m16s
WAI energy receipts / energy receipts · linux-arm64 (pull_request) Successful in 12m35s
WAI Studio / the catalogue's actions, the unit tests and the core · linux (pull_request) Successful in 1m11s
wai-quantum WebGPU member / member · discrete GPU, Vulkan (jetson-hub) (pull_request) Successful in 25m50s
wai-app and Create / wai-app · tests, clippy, the line language's verifier (linux) (pull_request) Successful in 52s
WAI examples / WAI examples · android-app · linux-arm64 (pull_request) Successful in 7m58s
WAI conformance / cargo-class corpora · linux-arm64 (pull_request) Successful in 27m23s
wai-pack / wai-pack · the floor through a media prober (pull_request) Successful in 24s
wai-pack / wai-pack · linux-arm64 (pull_request) Successful in 2m21s
wai-web reach builds / wai-web reach builds · the package of record, every output as recorded (pull_request) Successful in 2m25s
wai-pack / wai-pack · dependency licences (pull_request) Successful in 1m28s
WAI mbt2018_mean integer decode (regenerated vectors) / regenerate mbt2018_mean integer vectors → Rust decode, required (pull_request) Successful in 6m11s
WAI conformance / cargo-class corpora · linux (pull_request) Successful in 20m37s
wai-web wasm32 / wai-web wasm32 build · corpus, menu and writers (pull_request) Successful in 6m11s
wai-sink-android native sink library / the JNI layer and the platform-free half on the host JVM · linux-arm64 (pull_request) Successful in 3m6s
wai-web reach builds / wai-web reach builds · this tree's wai-web, every rung on its engine line (pull_request) Successful in 4m34s
joule-moq-remote host agent / joule-moq-remote, every target (linux-arm64) (pull_request) Successful in 2m0s
wai-pack / wai-pack · independent verifier (Python) (pull_request) Successful in 7m20s
WAI Studio / Studio in WebKit · linux (pull_request) Successful in 10m34s
joule-moq-room room service / joule-moq-room, every target (pull_request) Successful in 4m9s
wai-audit collector and player integration / collector, player integration and the browser end to end · macos (pull_request) Successful in 1m39s
standards workspaces build + test / macOS energy backends (pull_request) Successful in 10m10s
WAI conformance / cross-arch byte-equality · macos (pull_request) Successful in 33s
WAI conformance / codec wrappers · fuzz smoke, text decode limits, C entry points, provenance, the semantic path (pull_request) Successful in 1m46s
WAI energy receipts / energy receipts · macos (pull_request) Successful in 7m9s
wai-fleet service / service · macos (pull_request) Successful in 46s
wai-ledger service / service · macos (pull_request) Successful in 50s
WAI examples / WAI examples · the archive, the readiness check, the browser and Apple · macos (pull_request) Successful in 15m46s
WAI conformance / cargo-class corpora · macos (pull_request) Successful in 21m31s
wai-pack / wai-pack · macos (pull_request) Successful in 3m9s
WAI conformance / independent verifiers · claims, JWP, key discovery and integer payloads (Python) (pull_request) Successful in 1h4m59s
wai-ops-gpu integer operators on GPUs / Metal GPU and browser WebGPU (macos) (pull_request) Successful in 12m27s
wai-quantum studio and desktop / desktop app · macos (pull_request) Successful in 3m42s
wai-quantum WebGPU member / member · browser WebGPU (macos) (pull_request) Successful in 1m48s
wai-quantum WebGPU member / member · Metal (macos) (pull_request) Successful in 2m37s
wai-sink-android native sink library / every ABI, the AAR, and the instrumented tests in a headless emulator · macos (pull_request) Successful in 6m58s
WAI Studio / Studio in Chromium and Firefox · macos (pull_request) Successful in 9m52s
wai-sink-swift native sink package / libwai slices, desktop tests, simulator tests · macos (pull_request) Successful in 16m11s
joule-moq-remote host agent / joule-moq-remote, every target (macos) (pull_request) Successful in 1m4s
wai-app and Create / wai-app · Create, browser end-to-end (macos) (pull_request) Successful in 7m39s
joule-moq-web browser client / joule-moq-web · browser end-to-end (macos) (pull_request) Successful in 16m22s
wai 0.4.0
The crate's version for the release wai-v0.4.0: wai/wai-rs/Cargo.toml and
the `wai` entry of the sixteen lockfiles that hold it, each validated with
`cargo metadata --locked --offline`; the catalogue export, whose
`toolchain` is the crate's version, and WAI Studio's actions generated from
it. The changelog's current section becomes v0.4.0, under an Unreleased
heading for what comes next. Recorded measurements (sink-energy's
procedure.txt) keep the version they were taken with.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-28 11:20:02 -04:00
..
src joule-moq-relay, joule-moq-remote: build on Windows 2026-10-27 09:38:14 -04:00
tests joule-moq-remote: the opening key in a type no Debug writes out 2026-10-26 10:56:55 -04:00
Cargo.lock wai 0.4.0 2026-10-28 11:20:02 -04:00
Cargo.toml joule-moq-remote: a sealing key a session, sealed inputs opened before they are injected; TLS to the room service and the relay 2026-10-26 10:43:13 -04:00
README.md The service binaries are wai-relay, wai-room and wai-ingest; the crates keep their names 2026-10-27 04:52:31 -04:00

joule-moq-remote

A host agent for WAI remote desktop rooms (wai.live.remote, wai/extensions/remote-desktop.md) over joule-moq-relay, and a viewer with no display.

The host captures its screen, encodes it with the platform's encoder, and publishes it as the room's screen track, one frame a group, each with its receipts (WAI moq-streaming-format §4.1, jwp-receipts). It signs a screen statement (WDS1) naming what it captures, the frame size every input's coordinates are in, the actions it injects and the encoder that made the frames. It reads every participant's events, decides each input statement (WDI1) by the rules of §5.3 at its place in the room's order, with wai-rs's own remote_desktop::decide, injects what the rules accept, and signs an outcome (WDO1) for every input: applied, anchored on the first frame it captured after the injection, or refused with the rule's number. A room that keeps a floor passes it by floor statements (WDF1): the host gives it on request, or when told.

The host makes a sealing key for each session (an X25519 key pair) and states its public half in its screen statement (§5.5): controllers seal their key, text and clipboard actions to it, so the relay, the room service and every viewer hold only ciphertext and commitments, and the host opens each sealed input before it injects it (wai-rs's decide_opened, all nine rules of §5.3). The opening key never leaves the session unless the host is asked for it: --opening-key <file> writes it (mode 0600, never over a file) for a verifier the host chooses, which checks the session at the opened level (remote_desktop_verify.py --room <session> --opening-key <hex>).

A room a room service keeps

A room service (joule-moq-room with [remote]) keeps the room: it grants the host, each controller and each viewer for a key the visitor makes, and its clock records who is present and takes every principal's records in order. The host makes a key once, and runs in the room:

wai-remote-host key ./host.key                       # mode 0600; prints the public key
wai-remote-host run --room https://room.example/room-api --key ./host.key \
    [--invitation <hex from wai-room invite>] --relay wss://relay.example/moq \
    [--ca ./private-ca.pem] --floor floor --give-on-request

The service names the host's key in its configuration, or takes the first key that presents an invitation its authority signed. The host asks for its grant, publishes its screen, and states it once the service's clock has recorded it joining; it learns each participant from the clock's join, reads the room's grants again for one it does not hold, and stamps its records on the service's clock, by the skew the service's answer states. It hands control over by asking the service for a grant exchange (agent::Command::Control), its grant and a proof of its key over the service's challenge. The service is reached over https:// (or http:// on loopback) and the relay over wss:// (or ws://). Over TLS every certificate is verified: its chain against the system's roots and any certificate a PEM file names (--ca, a private deployment's authority), and its name against the host the URL names; nothing turns that off (tls). A host on another machine than the service needs no front of its own. tls::front is the other end, a TLS front for a plain backend, which the tests put before the service and the relay. A page enters such a room through the room page of joule-moq-web, under a key it makes; viewer::Viewer::join_service is the headless one.

Either way the host takes each participant's records in its chain's order, as the service's clock does: under the policy of its grant in effect (live-events §6), after its join, each statement read and held to who may sign it; a floor statement §7.2 refuses is taken and changes nothing, as a verifier has it. A participant whose record is out of that order is cut there: the host takes nothing more of it, and decides none of its inputs, so the host and the clock hold the same records. In a service's room the host also reads the service's bound per principal (GET /room's remote.max_records_per_principal) and cuts a participant whose records pass it at the bound, the record at which the service's clock cuts and removes it.

A room the host keeps

wai-remote-host room <dir> makes a desk, a room the host keeps itself: its descriptor and grants, signed by an authority whose key is derived from a seed, the host's grant marked remote_host, and a grant for each participant with its control classes in remote_control (1 pointer, 2 keys, 4 touch, 8 clipboard; 0 for a viewer). It writes room.json (public), host-keys.json (the host's and the clock's keys, mode 0600), participant-<name>.json for each participant (the room and that participant's key, mode 0600, for the headless viewer), and relay.toml: the lines the relay's configuration takes, the authority's key and the clock's token by its SHA-256. The host is its room's clock: a participant joins when its events track appears on the relay, and leaves when it ends.

wai-remote-host room ./desk --size 1280x720 --fps 30 --participant alice:3 --participant bob:0
# append ./desk/relay.toml to the relay's configuration, then
wai-remote-host run ./desk --relay wss://relay.example/moq --floor floor --give-on-request

run takes --source display|pattern, --encoder platform|platform-hevc|ipcm, --input platform|record, --floor open|floor, --max-age-ms, --redact x,y,w,h (any number) and --seconds. wai-remote-host check says what the machine offers: the platform encoder and whether it runs on the media engine, and whether the operating system lets the process capture the screen and inject input. Both need the user's permission once, in the system's privacy settings; until then run --source display refuses to start, and states why.

What each platform gives

capture encode input
macOS the display stream of the window server, BGRA (adapter_macos_capture) the media framework's encoder on the hardware media engine, AVC High 4.0 or HEVC Main, real time, no reordering (adapter_macos_encode) the window server's event services: pointer, buttons and drags, wheel in pixels, keys by HID usage, composed text; clipboard through the system's pasteboard tool (adapter_macos_inject)
Linux the X Window System's root window through its client library, loaded at run time (adapter_linux_x11) the pure-function encoder; a platform encoder adapter plugs in behind the same trait the kernel's user-level input device: an absolute pointer, buttons, wheels and keys; clipboard through the display's clipboard tool when one is installed (adapter_linux_uinput)
anywhere a pattern source that draws what was injected (capture::Pattern) encode::Ipcm: H.264 with every macroblock I_PCM, every picture an IDR picture, a pure function of its input that every conforming decoder decodes inject::Recorder, which draws on the pattern

A screen statement's accepts states what the injector injects, so a controller sees, before it sends, that touch is not taken on a desktop and text not on the kernel's input device. The encoder sits behind encode::Encoder: an adapter of the platform-encode interfaces plugs in as another implementation.

The viewer

viewer::Viewer joins a room under its participant file, fetches what the clock and the host said before it arrived, verifies every frame against its receipt, sends input and floor statements, its key, text and clipboard actions sealed to the host's sealing key, and signs latency records of source 3 (no display: the instant it held the frame verified). It keeps the records it receives, and follows another principal's events when told to. The browser viewer is the room page of joule-moq-web (web/room/remote.js).

Tests

  • cargo test --locked --all-targets -- --test-threads=1: the units (the bit writer's Exp-Golomb codes, emulation prevention, an I_PCM unit's parameter sets, redactions, the pattern and the recorder, the room's grants, the envelope, timestamps, a service's URL, and the gate's order: a record that arrives before the one it follows waits, one stamped before it cuts its author, one of a principal not yet joined waits for its join and is out of order once the clock's chain is held past it), and tests/loopback.rs: a session over a relay on loopback that requires grants with their proofs. Alice's click under the floor is applied, bob (no control power) is refused input_not_permitted, carol off the floor input_no_floor; alice types a string and composes a text, sealed, and the host injects them as typed while bob, following her events, receives no trace of them, and her text in the clear is refused input_unsealed; the floor is handed to carol, and alice is refused while carol's move is applied; the host pauses and carol is refused input_screen_paused. Every viewer verifies every frame; alice and carol sign latency records; and the session's chains, as the host holds them, verify whole by wai-rs, at the commitment level and at the opened level under the host's opening key, every outcome the rules', each latency with its legs. tests/tls.rs: the service over https:// and the relay over wss:// through a TLS front, trusted by a PEM file; refused when only the system's roots are trusted, and refused for a certificate that names another host. On macOS the session runs a second time with the platform's hardware encoder, and a third test holds its units to the Annex B form wai.video.avc carries.
  • The same host in a room the room service keeps is joule-moq-room's tests/remote_room.rs.