open-standards/.github/workflows/joule-moq-remote.yml
Transaction Science d4810f32ee joule-moq-remote: a host agent for WAI remote desktop rooms, and a viewer with no display
The host is its room's clock and its screen's publisher: it makes a room (descriptor and grants,
the host marked remote_host, each participant's control classes in remote_control) and the lines
a relay's configuration takes for it; signs each participant's join when its events track
appears; publishes the screen as the room's screen track, one frame a group with its receipts,
and a screen statement naming the encoder; decides every input by wai-rs's rules at its place in
room-clock order (gate.rs) and injects what they accept on a thread that captures after it
injects, so the outcome it signs names the first frame that can show the input; and passes the
floor on request or when told.

Behind small traits: capture (a pattern source; the macOS display stream; X11 on Linux), encode
(an H.264 encoder with every macroblock I_PCM, a pure function every decoder decodes; the macOS
media framework's hardware encoder, AVC or HEVC, read back as Annex B), and input (a recorder;
the macOS event services; the Linux kernel's input device). Platform API names are in the
adapter files, each line marked for the public-name check.

tests/loopback.rs: a session over a relay that requires grants with their proofs, three viewers,
floor handover, refusals for no control power, no floor and a paused screen, latency records,
and the session's chains verified whole by wai-rs; run with the pure-function encoder, and on
macOS again with the hardware encoder. A workflow runs it on linux-arm64 and macos.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-26 02:32:02 -04:00

88 lines
3.7 KiB
YAML

name: joule-moq-remote host agent
# The remote desktop host agent (joule-code/joule-code-rs/crates/joule-moq-remote), a workspace
# of its own with its own lock file (WAI extensions/remote-desktop.md): its room files, the
# pure-function H.264 encoder (every macroblock I_PCM), the pattern source and the recorder, and
# tests/loopback.rs, a session over a relay on loopback: three viewers verify every frame against
# its receipt, a click under the floor applied, a viewer with no control power and a controller
# off the floor refused, the floor handed over, a paused screen refused, latency records signed,
# and the session's chains verified whole by wai-rs. On Linux arm64 the Linux adapters (X11
# capture, the kernel's input device) compile and the session runs with the pure-function
# encoder; on macOS it runs again with the platform's hardware encoder, whose units are checked
# for the Annex B the capability carries.
#
# It builds on wai-rs's room and remote desktop records, on the relay and on joule-moq, so a
# change to any of them runs it. Push filters match the push's delta, so every path the job
# reads is listed.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
on:
pull_request:
paths:
- 'joule-code/joule-code-rs/crates/joule-moq-remote/**'
- 'joule-code/joule-code-rs/crates/joule-moq/**'
- 'joule-code/joule-code-rs/crates/joule-moq-relay/**'
- 'joule-code/joule-code-rs/crates/jwp/**'
- 'joule-code/joule-code-rs/vendor/**'
- 'wai/wai-rs/**'
- 'wai/wai-ops/**'
- '.github/workflows/joule-moq-remote.yml'
jobs:
# Forgejo matches `paths:` against the push delta, so a rebase fires this workflow
# whatever the pull request changes. This job reads the pull request's own diff against
# the paths above (scripts/pr-touches-paths.py, which fails open).
relevant:
name: joule-moq-remote · does this change touch it
runs-on: linux
outputs:
run: ${{ steps.gate.outputs.run }}
steps:
- uses: actions/checkout@v5
with:
fetch-depth: 0
- id: gate
run: |
set -euo pipefail
r=$(python3 scripts/pr-touches-paths.py .github/workflows/joule-moq-remote.yml \
"${{ github.event.pull_request.base.sha }}" \
"${{ github.event.pull_request.head.sha }}")
echo "this change touches the host agent: $r"
echo "run=$r" >> "$GITHUB_OUTPUT"
test:
name: joule-moq-remote, every target (${{ matrix.os }})
needs: relevant
if: needs.relevant.outputs.run == 'true'
strategy:
fail-fast: false
matrix:
os: [linux-arm64, macos]
runs-on: ${{ matrix.os }}
timeout-minutes: 45
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Rust 1.98.0
shell: bash
run: |
export PATH="$HOME/.cargo/bin:$PATH"
command -v rustup >/dev/null 2>&1 || \
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile minimal --default-toolchain 1.98.0
rustup toolchain install 1.98.0 --profile minimal --component clippy
rustup default 1.98.0
echo "$HOME/.cargo/bin" >> "$GITHUB_PATH"
# One test at a time: the sessions share the host with other jobs, and each takes a lock.
- name: joule-moq-remote, every target, and clippy
working-directory: joule-code/joule-code-rs/crates/joule-moq-remote
shell: bash
run: |
set -euo pipefail
export PATH="$HOME/.cargo/bin:$PATH"
cargo test --locked --all-targets -- --test-threads=1
cargo clippy --locked --all-targets --no-deps -- -D warnings