# Live interop: the one sitting with Mark Status: **prepared 2026-11-30, not run.** The probe (`tools/gs-probe`) is built and unit-tested and has never talked to a host: no Sunshine existed when it was written. This sitting settles the open UNKNOWNs of [PROTOCOL.md](PROTOCOL.md) §8 live, in one go, and answers the black-box checks of Arena `docs/PLAY-REMOTELY.md` §8 and §17 that a GameStream client can answer. The host is the pinned Sunshine `v2026.914.233613`, installed by arena-host at Turn on to `E:\Apps\Sunshine` and bound to `192.168.100.140`. The client is our probe, which runs DomiStream `stream-v0.1.0`'s state machines over real sockets from this PC. No Moonlight, no TV and no other machine take part. ## 0. Hard limits - **One address.** Every probe socket goes to `192.168.100.140`. If `sessionUrl0` names another host, the probe records it and still connects only to .140. - **No listening port on this PC.** During `launch` the probe has only three ephemeral UDP client sockets. Nothing binds a fixed port. - **Out folder:** `F:\build\play-remotely\live\\` (E: is full). It is outside git and holds: - `identity\`: the probe's test-only key and certificate, made on the first run; - `runs\-\`: one folder per command, with `log.jsonl` and the dumps. It is deleted at the end (section 7). - **Secrets:** - The probe never prints its key and never logs the stream key (`rikey`), pairing salts, challenges or secrets. - The PIN goes to the operator's terminal only, never to the log. Every log line is also scanned for the session key's hex before it is written. - Sunshine's API credentials stay in Custos: never typed, never on a command line, never in a log. - **Nothing changes on Mark's PC** during the sitting: no Sunshine config, firewall, arena-host setting or install. The only exceptions are the steps below that the run book names (pairing the probe, launching one game) and their undo in section 7. - **The stop-and-report rule** (section 6) wins over everything in this file. ## 1. What Mark sees - **Nothing on his screen except:** - Sunshine's own notifications, if any (for example when a client asks to pair, or a stream starts or ends); - at `launch`, the game starting on his PC; - at `quit`, the game closing. - The probe runs in our terminal. No UAC prompt, no Custos card (Arena Domi was approved at Turn on), and no PIN is shown to Mark. - **Two things we cannot rule out before the sitting.** If either appears, Mark answers as below and we stop and report: - A **Windows Security Alert** for `probe.exe` when its UDP sockets first receive. Mark clicks **Cancel**. - **Arena Domi's own first-stream toast** (PLAY-REMOTELY §7.4). It can appear if the Arena window is running when Sunshine's prep-cmd hook reports the probe's stream. Mark dismisses it. - **Mark's part:** be present, agree on the game for `launch` beforehand (a light one from the `apps` list), and keep hands off mouse and keyboard while the stream runs (about 30 s per launch). ## 2. Before the sitting (without Mark) | # | What | How | | :-- | :-- | :-- | | P1 | Probe built | `cd tools\gs-probe`, `CARGO_BUILD_BUILD_DIR=F:\build\play-remotely\cargo-build-probe`, `TEMP`/`TMP=F:\build\play-remotely\tmp\protocol`, load gate (CPU and RAM < 90 %, D: and F: < 95 %), then `cargo test --offline -j 2` and `cargo build --offline --release -j 2`. Binary: `tools\gs-probe\target\release\probe.exe`. | | P2 | Sunshine as arena-host left it (read-only) | `Get-NetTCPConnection -State Listen \| ? LocalPort -in 47984,47989,47990,48010` shows each on `192.168.100.140` only: nothing on `0.0.0.0` or loopback on Day 1 (PLAY-REMOTELY §4). `Get-NetUDPEndpoint \| ? LocalPort -in 47998,47999,48000` is empty while idle (PLAY-REMOTELY §9). | | P3 | **Open: a way to call Sunshine's API without seeing the credentials** | Needed for the PIN (step S2) and checks B1–B3. Agents never type passwords, and Mark should see nothing, so the build lead picks before the sitting: **(a, recommended)** a dev-only arena-host entry point `sunshine-api [json]` that takes the credentials from Custos, calls `https://192.168.100.140:47990` with arena-host's pinned client (§3, §4) and prints the answer with secrets redacted (its first call also answers §15's "does `pc` cover a self-connection to .140"); **(b)** Sunshine's own web UI in our browser pane, logged in by Mark (he would see it); **(c)** none, and the sitting ends after S1. This file writes the calls as `sunshine-api …`. | | P4 | U10 bodies | Read Moonshine's control handler (BSD-2, allowed, [M]) for what a host reads from START_A, START_B and PERIODIC_PING. Write the candidate bodies into table V (section 3) **before** the sitting. If Moonshine ignores the bodies, empty bodies (the probe's default) are the first try. Never from GPL sources. | | P5 | Game | Agree the `launch` game with Mark (a light one) and note its app id after S4. | Shell variables used below (PowerShell): ```powershell $P = "F:\Akce\DomiStream-wt-probe\tools\gs-probe\target\release\probe.exe" $O = "F:\build\play-remotely\live\2026-12-XX" # the sitting's date $H = "192.168.100.140" ``` Exit codes: 0 done, 1 error, 2 bad command line, 3 **stop and report** (a `stop` record is in the log). ## 3. The sequence Each step names the command, the UNKNOWNs it settles and what to look for. "Log" means that run's `$O\runs\-\log.jsonl` (format in section 4). ### S0. Preflight (read-only, 1 min) - Run the P2 checks again. - Sunshine's own traffic baseline (B4): `Get-NetTCPConnection -OwningProcess (Get-Process sunshine).Id` and `Get-NetUDPEndpoint -OwningProcess …`. Note every remote address. ### S1. `& $P serverinfo --host $H --out $O` - **Settles:** U25 (codec bits, from a host whose GPU we know: RTX 3090). - **Look for:** - `serverinfo.http` recv: status 200, the XML in full; - the note with `parsed` and `codec_mode_support_bits`; - `HttpsPort` (if it is not 47984, add `--https-port` to every later command); - `appversion`, `state` (…`_FREE`), `PairStatus 0`. - On the first run the probe generates its identity: log record `identity` (`generated a new …`). ### S2. `& $P pair --host $H --out $O` - **Settles:** - U1: the parameter names we send are accepted, and the order of steps 4 and 5; - U2: our RSA-2048 self-signed certificate is accepted; - U24: the TLS version and suite at step 5; - with B1 and B2, PLAY-REMOTELY §8. - **Procedure.** The probe prints `PIN for the operator: NNNN` and waits up to 120 s at step 1. Within that time: 1. **B1, the pending pairing.** - Call each documented read-only GET of the pinned API docs (at least `sunshine-api GET /api/clients/list`). - Look for an entry naming the probe's `uniqueid` (log record `identity`) or the device name `DomiStream probe`. - Read `E:\Apps\Sunshine\config\sunshine.log` (black-box: Sunshine's own log, read-only) for a line about the incoming pairing and any id it names. - Record which call or line shows the pending pairing and its `pairing_id`. 2. **Submit:** `sunshine-api POST /api/pin '{"pairing_id":"","pin":"NNNN","name":"DomiStream probe"}'`. If no `pairing_id` was found, try `{"pin":"NNNN","name":"DomiStream probe"}` once and record the answer. If that is refused too: stop and report (B1 open, and pairing cannot go on). 3. The probe goes on by itself through steps 2–5 and ends with an HTTPS `serverinfo` (`PairStatus 1`). - **Look for:** - `pair.1` … `pair.5`: send and recv of each step (values redacted, names and order kept); - `pair.1`'s `elapsed_ms` (the time until the PIN went in); - the `host certificate sha256` note; - `pair.5`'s `tls` (version, suite); - `pair.done`; - on failure, the `stop` record, with the step and the state it failed in. - **B2:** `sunshine-api GET /api/clients/list` must show exactly one new client, named `DomiStream probe`. Record the entry's fields: this is also B3's input. ### S3. `& $P apps --host $H --out $O` - **Settles:** nothing new. It confirms HTTPS with the pinned certificate (U24 again). - **Look for:** the agreed game's id (P5); `Desktop`, if listed, is the fallback. ### S4. `& $P launch --host $H --out $O --seconds 30 --nudge-mouse` - **Mark sees** the game start. - **Settles:** | Area | UNKNOWNs | | :-- | :-- | | Launch | U4 | | RTSP | U5, U6, U7, U26 | | UDP setup | U8 | | Control stream | U9, U10, U11 | | Video | U13, U14, U15, U29; U19 only if the host offers video encryption | | Audio | U17; data for U16 | | Host events | U23, only if any arrive | - **Look for**, in order: | Record | Settles | What it shows | | :-- | :-- | :-- | | `launch` send/recv | U4 | Our parameter set accepted (`uniqueid, appid, mode, rikey=, rikeyid, hdrMode, surroundAudioInfo`); `gamesession`, `sessionUrl0` | | `rtsp.*` send/recv | U5 | Every request and answer in full; `end` (`Length` / `Closed` / `Idle`), `content_length_header`, and notes about new TCP connections | | `rtsp.describe` recv | U26 | The SDP: every `surround-params` line, `encryptionSupported`, `featureFlags` | | `rtsp.setup_*` recv | U5, U7 | Every header of the three answers (`Session`, `Transport`, anything extra) | | `rtsp.announce` | U6 | 200 means our 19 attributes are accepted as they are | | `ping` + `video.first` / `audio.first` | U8 | Payload `PING`; `pings_before` and the source port of the first packet | | `control.datagram` (first 64 each way) | U9 | Decoded ENet: our connect, the host's verify connect (channel count, MTU, window, flags), anything stock 1.3 lacks (`unparsed: …` or `parse_error`) | | `control.start_a`, `control.start_b` | U10 | What we sent. Video then flowing means the host accepted it | | `control.host` | U10, U11, U23 | Every decrypted host message: type, sequence, body | | `video.frame` (first 16) | U13 | `header_raw`: Wolf's constant `0137636861727373` or Moonshine's fields | | `launch.summary` | U14 | `u14_*`: whole-packet parity matches (5.3 confirmed), or payload-only, or neither | | `launch.summary` | U15 | `multi_fec_flags_u15` histogram | | `launch.summary` | U29 | `u29_rtp_ticks_per_frame`, `u29_clock_hz_estimate` (90000 expected) | | `launch.summary` | U17 | `u17_decrypting` vs `u17_plain`: the receiver that accepts the packets says whether audio is encrypted. Compare with bit 0x04 of `negotiated.encryption` | | `launch.summary` | U19 | `decrypt_failures` is 0 when video encryption was negotiated | | `audio.u16` | U16 | Matrix solved from `audio-packets.bin` (or later: `& $P solve-audio-fec \audio-packets.bin`); `matrix_is_mds` | | `launch.summary` counters | — | Video: `frames`, `decode_ready_frames`, `frames_lost`, `fec_recovered_shards`. Audio: data and parity packets, losses | - **B3, per-device input:** - The `--nudge-mouse` input is one relative move of +1 then −1 pixel after the first decodable frame: harmless, and invisible to Mark. - If the B2 entry has a per-client input field, an extra launch with that input turned off for the probe shows whether Sunshine drops it (watch `sunshine.log`). That launch needs the build lead's OK: it changes a Sunshine setting. - If the entry has no such field, record "per-client: enable/disable only". - **B4:** during the stream, list Sunshine's sockets again (S0). The three UDP ports appear, and no remote address besides .140 shows up. - **B5:** with arena-host running, the prep-cmd hook should report `start ` with `SUNSHINE_CLIENT_NAME = DomiStream probe`, and arena-host should write its audit record "Play remotely started". Record what happened. - Then `& $P quit --host $H --out $O`: the game closes. B5 again: `end`. **Variants (table V), only when S4 stops.** Each variant is one `launch` (with `quit` before the next). There are at most 6 launches in the sitting, and the same variant is never tried twice. | Symptom (log) | Variant | | :-- | :-- | | ANNOUNCE not 200 (U6) | `--encryption 1`, then `--codec hevc`, then `--packet-size 1392`. Attribute values beyond the CLI need a code change: stop and report | | No verify connect, ENet `timed_out` (U9) | `--enet-channels 48`, then `--enet-connect-data ` | | Connected but no video within 5 s of START_B (U10) | The bodies from P4 (`--start-a`/`--start-b `), one pair per launch | | Video stops after N s, host disconnects (U10) | `--periodic-ping --periodic-ping-ms 100` | | Frames lost and never recovered (U10) | `--rfi`, if DESCRIBE has `refPicInvalidation`; else `--idr ` | | Surround (U26), only if time allows | `--audio 5.1` | ### S5. U28, a refused pairing (optional, 2 min) 1. `& $P unpair --host $H --out $O`. 2. `& $P pair --host $H --out $O --wrong-pin`. The probe prints one PIN, uses another, and must stop at step 3 with `ProofMismatch`. 3. Submit the printed PIN as in S2. 4. Look for: - what `/api/pin` answers; - whether B1's call still lists a pending pairing afterwards; - whether the client list stays without the probe; - whether a fresh `probe pair` works without any clean-up. That last point is U28's answer. 5. Leave it unpaired. ## 4. Reading the log One JSON object per line, flushed as written: ```json {"n":12,"t_ms":845.210,"step":"rtsp.setup_video","kind":"recv","u":["U5","U7"],"data":{…}} ``` - **`kind`:** - `send`: what the probe sent; - `recv`: what the host sent; - `note`: an observation; - `parse_error`: the parser's error plus the bytes that caused it (hex or text, capped at 4 KiB); - `stop`: the stop-and-report rule fired; - `summary`: the end-of-step counters. - **`u`:** the UNKNOWNs the record bears on. - **Filtering** (PowerShell): `Get-Content log.jsonl | ConvertFrom-Json | ? { $_.u -contains 'U5' } | ConvertTo-Json -Depth 8`. - **Run folder contents:** - `video.h264` (or `.h265`): the first `--dump-frames` frames' Annex-B elementary stream, for `ffprobe` later. The probe decodes nothing. - `video-packets.bin`: plaintext video packets, `--dump-packets` of them. - `audio-packets.bin`: audio datagrams as received. The `.bin` files use the format in `tools/gs-probe/src/dump.rs`. **The video files hold frames of Mark's game:** they never go into git and are deleted after analysis. ## 5. From the log to PROTOCOL.md and the code 1. **Facts first.** Each settled UNKNOWN gets its fact in PROTOCOL.md with the tag `[L2]` (live sitting, date, Sunshine `v2026.914.233613`, probe commit). Add the tag to the tag table and the row to §8. An UNKNOWN that stays open says why. 2. **Tests before code** (repo rule). Every fact becomes a unit test or vector in `crates/domistream`: - structure and constants only; - re-encrypted with keys generated in the test; - never bytes of Mark's video. 3. **Where each U lands:** | U | PROTOCOL.md | Code | | :-- | :-- | :-- | | U1, U28 | 1.5 | `pairing/mod.rs` (`request`, step order) | | U2 | 1.5 | `pairing/identity.rs` (`generate`) | | U4 | 1.4 | `http/launch.rs` (`launch_request`, the `sessionUrl0` default) | | U5 | 2.1, 2.2 | `rtsp/mod.rs` (`RtspFramer`), `rtsp/client.rs` (`CLIENT_VERSION`, `SETUP_TARGETS`, `TRANSPORT`, `Session` echo, PLAY target) | | U6 | 2.4 | `rtsp/sdp.rs` (`build_announce`) | | U7 | 2.2 | `rtsp/client.rs` (`advance`, `NegotiatedStream`) | | U8 | 5.1, 6.1 | `rtsp/client.rs` (`PING_PAYLOAD`); the ping interval in the platform layer's docs | | U9 | 3.1 | the `EnetConfig` defaults the callers use (docs in `enet/mod.rs`); `enet/protocol.rs` only if the host sends something stock 1.3 lacks | | U10 | 3.3 | `control/message.rs` (`encode_client_message`: START_A, START_B, PERIODIC_PING, IDR bodies instead of `Unsupported`), `control/mod.rs` (send PERIODIC_PING on `ping_interval`) | | U11 | 3.2 | `control/mod.rs` (`next_sequence` start, replay rule) | | U13, U15 | 5.2 | `video/packet.rs` (docs, `FrameHeader`) | | U14 | 5.3 | `fec.rs`: confirmed, nothing to change (or stop and report if `u14_no_match`) | | U16 | 6.4 | a `pub const` parity matrix in `audio/mod.rs`, used as `AudioFec::ParityMatrix` by the callers | | U17 | 6.3 | `AudioConfig.cipher` policy (docs in `audio/mod.rs`) | | U19 | 7 | `video/mod.rs` (`VideoCipher::decrypt`) | | U23 | 3.3 | `control/message.rs` (host event bodies) | | U25, U27 | 1.2, 1.1 | `http/serverinfo.rs`, `http/xml.rs` docs | | U26 | 2.3 | `rtsp/sdp.rs` | | U29 | 5.2 | `rtp.rs` / `video/mod.rs` docs | 4. **Re-run** clippy, fmt, rustdoc, the tests, the mutation script and the fuzz targets of the touched parsers (load gate first). 5. **Re-run the probe** against Sunshine with the patched crate: `launch` with **no** variant flags must give `decode_ready_frames > 0`, audio packets, and no `stop`. Then release `stream-v0.1.1` (HANDOVER). 6. **Arena:** B1–B5 answers go to Arena `docs/PLAY-REMOTELY.md` §8/§15/§17, through the Arena build lead (Arena's files are theirs). **Not settled by the probe:** - U20, U21, U22: no keyboard, touch or gamepad input beyond the one mouse nudge. - U24 beyond what rustls negotiates. - U26 beyond stereo, unless the 5.1 variant runs. - U19, if the host does not offer video encryption. - U23, if no host event arrives. `tools/lab-relay` cannot be used as it stands: its upstream must be loopback, and Sunshine listens on .140 only. `--relay` is ready on the probe side if the build lead ever widens that rule. The probe's own log already holds the plaintext of HTTP, HTTPS and RTSP, and the decrypted control messages. ## 6. Stop and report **Stop** means: no further probe command, no Sunshine call beyond read-only GETs, no retry outside table V. Report to the coordinator: - the step; - the log path and the record number `n`; - what was expected; - what was seen. Then wait. **Stop when:** - a probe command exits with code 3 (a `stop` record), or with 1; - anything appears on Mark's screen beyond section 1's list, or Mark asks to stop; - any socket of the probe or of Sunshine talks to an address other than `192.168.100.140` or loopback; - Sunshine crashes, restarts, or its notifications show an error; - the game misbehaves, or the PC slows down noticeably; - an answer fits none of the expectations above, even if the probe accepted it; - table V is used up (6 launches), or a variant would need a code change, a Sunshine setting or an install; - a secret shows up anywhere it should not (terminal, log, file name). Stop at once and delete the record. ## 7. Clean-up (same sitting) 1. `& $P quit --host $H --out $O`, if a game is still running. 2. `& $P unpair --host $H --out $O`, then B2 again: the client list no longer shows the probe. 3. Delete `$O\identity\` (the probe's test key). 4. **The run folders stay** until the facts are in PROTOCOL.md and the tests are in. Then they are deleted on the build lead's word. `video.*` and `video-packets.bin` go first, right after the U13/U14/U15/U29 analysis. 5. Nothing to undo on Sunshine, arena-host or the firewall: nothing was changed. ## 8. Timeline for Mark (about 20 minutes) | When | What happens | Mark | | :-- | :-- | :-- | | 0:00 | S0, S1: read-only checks, `serverinfo` | nothing | | 0:02 | S2: the probe pairs (we submit the PIN through Sunshine's API). Sunshine may show a notification | nothing | | 0:05 | S3, S4: the agreed game starts on his PC and streams to the probe for 30 s; then we close it | hands off mouse and keyboard while it runs | | 0:07-0:15 | Variants, only if needed (up to 6 launches, each about 1 min) | same | | 0:15 | S5 (optional), clean-up | nothing | | later | Analysis offline; the game frames are deleted | nothing |