Voice 26: Acceptance (#87) #147

Manually merged
charles merged 0 commits from voice-26-acceptance into voice 2026-11-12 01:46:29 +00:00
Owner

Stacked on: voice-23-voice-e2ee, voice-25-packaging-ci

What

  • apps/fluxer/tests/voice_acceptance.rs: voice_session_end_to_end, one session of the whole client (runtime, store, status API, REST and gateway over loopback) against the in-process devserver voice scenario, with FakeRoom and NullHost: login -> join -> ada speaks (sidebar ring for her and for us) -> self mute -> self deafen (track unsubscribed, nothing played) -> per-user volume 50 % / 100 % -> soundboard receive -> soundboard send -> 10 sends then 429 cooldown (from retry-after, no send during it, sending again after) -> move to Gaming (same connection id, new room) -> LiveKit reconnect -> gateway drop and resume -> leave. Every step asserts on snapshots (the selectors the views render) and on GET /status over a real TCP socket.
  • docs/acceptance/voice.md: per-item coverage of spec §2, the live checklist for items 1, 2, 6, 7, 9, 11 (including how to read the sharer's codec in Electron: the console line Selected screen share codec from XState capability intersection, and the "Automatic (...)" label of Advanced -> Preferred screen share codec), open question and follow-up issues, known gaps.

Testing

  • The test failed first on the status API's speaking (always false, #115 item 2), passes otherwise; ran 4 times in a row (about 28 s each).
  • FLUXER_SCREENSHOT_TESTS=1 cargo xtask ci green locally on Linux (LiveKit interop skipped, #120). Base (eb88cd0, voice + the two stacked branches) was green before any change.

Deviations

  • Gateway drop and resume is injected: the devserver answers RESUME with INVALID_SESSION and ends the session's voice connections, and has no hook to drop a socket. The test sends GatewayState::Reconnecting/Resuming, GatewayEvent::Resumed, GatewayState::Ready into the store and checks the re-sent op 4 is confirmed by the devserver over the real socket with the same connection_id, room untouched. Follow-up #146.
  • Status speaking: still false for everyone (#115, commented). The test asserts the current behaviour as a tripwire with the correct assertion in a comment beside it, so the fix of #115 must flip it. Not fixed here (fluxer-core, outside the task's files).
  • Found while writing the doc: op 12 is still not forwarded (#108), so refused joins only fail after the 15 s timeout and the E2EE-required message cannot show; listed as a known gap.

Closes #87

🤖 Generated with Claude Code

Stacked on: voice-23-voice-e2ee, voice-25-packaging-ci ## What - `apps/fluxer/tests/voice_acceptance.rs`: `voice_session_end_to_end`, one session of the whole client (runtime, store, status API, REST and gateway over loopback) against the in-process devserver `voice` scenario, with `FakeRoom` and `NullHost`: login -> join -> ada speaks (sidebar ring for her and for us) -> self mute -> self deafen (track unsubscribed, nothing played) -> per-user volume 50 % / 100 % -> soundboard receive -> soundboard send -> 10 sends then 429 cooldown (from `retry-after`, no send during it, sending again after) -> move to Gaming (same connection id, new room) -> LiveKit reconnect -> gateway drop and resume -> leave. Every step asserts on snapshots (the selectors the views render) and on `GET /status` over a real TCP socket. - `docs/acceptance/voice.md`: per-item coverage of spec §2, the live checklist for items 1, 2, 6, 7, 9, 11 (including how to read the sharer's codec in Electron: the console line `Selected screen share codec from XState capability intersection`, and the "Automatic (...)" label of Advanced -> Preferred screen share codec), open `question` and `follow-up` issues, known gaps. ## Testing - The test failed first on the status API's `speaking` (always false, #115 item 2), passes otherwise; ran 4 times in a row (about 28 s each). - `FLUXER_SCREENSHOT_TESTS=1 cargo xtask ci` green locally on Linux (LiveKit interop skipped, #120). Base (`eb88cd0`, voice + the two stacked branches) was green before any change. ## Deviations - **Gateway drop and resume is injected**: the devserver answers RESUME with INVALID_SESSION and ends the session's voice connections, and has no hook to drop a socket. The test sends `GatewayState::Reconnecting/Resuming`, `GatewayEvent::Resumed`, `GatewayState::Ready` into the store and checks the re-sent op 4 is confirmed by the devserver over the real socket with the same `connection_id`, room untouched. Follow-up #146. - **Status `speaking`**: still false for everyone (#115, commented). The test asserts the current behaviour as a tripwire with the correct assertion in a comment beside it, so the fix of #115 must flip it. Not fixed here (fluxer-core, outside the task's files). - Found while writing the doc: op 12 is still not forwarded (#108), so refused joins only fail after the 15 s timeout and the E2EE-required message cannot show; listed as a known gap. Closes #87 🤖 Generated with [Claude Code](https://claude.com/claude-code)
feat(voice): LiveKit room and interop test
Some checks failed
ci / Linux (x86_64) (push) Failing after 50s
ci / Windows (x64) (push) Has been cancelled
6af1f4984b
LiveKitRoom implements Room on the LiveKit Rust SDK: auto-subscribe off, the
endpoint's path prefix kept, one muted microphone track from a native 48 kHz
source (RED on, DTX off, bitrate clamped to 8-510 kbit/s), remote audio from
native audio streams, room events mapped to RoomEvents, round-trip time from
the nominated ICE candidate pair. VoiceSession::livekit starts a session on it.
fluxer_voice::apm wraps WebRTC's audio processing module behind an i16
interface.

The interop tests run against a local livekit-server v1.12.0 behind an in-test
/livekit reverse proxy when FLUXER_LIVEKIT_TESTS=1; cargo xtask ci starts the
server with tools/livekit-test-server.sh. The Linux CI job installs clang 21
and the glib headers the SDK's build needs.

Refs #74

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
fix(voice): keep data that arrives before its sender is announced
Some checks failed
ci / Windows (x64) (push) Has been cancelled
ci / Linux (x86_64) (push) Has been cancelled
2a9d5634c8
The advertisement a participant sends the moment it is connected reached the
others' data channels before its announcement reached their signalling
connections. The SDK reports such a packet without a sender, and the room
dropped it: data_round_trip_on_negotiation_topic failed against
livekit-server v1.12.0 every time. The room now keeps such packets (2 s, 32
packets, 256 KiB at most) and delivers them as the participant announced
next, 150 ms after the announcement and in order with what that participant
sends meanwhile; a second announcement within the 150 ms drops them, because
their sender is then uncertain.

Also:
- tools/livekit-test-server.sh is executable (the CI step runs it directly).
- room_receives_only_subscribed_tracks proves with the connection's received
  bytes (LiveKitRoom::bytes_received) that the server stops sending an
  unsubscribed track.
- New interop test: data sent on ParticipantJoined reaches the newcomer.
- xtask no longer passes the dev server's debug log (tokens included) on to
  the CI log.
- README names the WebRTC build the SDK fetches (webrtc-a545de4).

Refs #74

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
fix(voice): never drop early data whose sender is known
Some checks failed
ci / Windows (x64) (push) Failing after 7m7s
ci / Linux (x86_64) (push) Has been cancelled
10e11040c7
A second arrival within the settle window dropped the whole claim,
including the packets the first newcomer had sent under its own name
while its unnamed ones waited. Only the packets without a sender are in
doubt: the named ones are now delivered at once, in order, when the
claim is given up (second arrival, or the participant leaving).

The round-trip probe moves to a task of its own, so that statistics
that stall (while reconnecting) no longer hold up room events and data.

Refs #74

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
build(windows): link the static C runtime, as libwebrtc does
Some checks failed
ci / Linux (x86_64) (push) Has been cancelled
ci / Windows (x64) (push) Has been cancelled
7c28fba480
The Windows link of fluxer-voice failed with LNK2038 (MT_StaticRelease against
MD_DynamicRelease) and LNK2005 between libcpmt and msvcprt.

Refs #74, #128

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Merge remote-tracking branch 'origin/voice' into voice-13-voice-livekit-interop
Some checks failed
ci / Windows (x64) (push) Failing after 16m53s
ci / Linux (x86_64) (push) Successful in 29m32s
1678f3eb69
Merge remote-tracking branch 'origin/voice' into voice-13-voice-livekit-interop
All checks were successful
ci / Windows (x64) (push) Successful in 25m45s
ci / Linux (x86_64) (push) Successful in 31m19s
555028702d
Refs #86

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
build: package voice dependencies
All checks were successful
ci / Linux (x86_64) (push) Successful in 13m11s
ci / Windows (x64) (push) Successful in 14m30s
894d27b536
xtask package reads the libraries the release binary needs at load time
(ELF DT_NEEDED, PE imports and delay imports) and refuses one a clean
machine may lack. Linux declares ALSA's libasound.so.2 (AppRun names the
package to install); Windows delay-loads msdmo.dll and opengl32.dll, which
Server Core lacks, so the exe starts on the runner. The release workflow
installs the LiveKit build requirements and starts the AppImage in a bare
ubuntu:22.04. Windows CI: line-tables-only debug info, MIN_FREE_GB 12 from
the measured cold-build size, and a disk report step.

Refs #86

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
feat(voice): shared-key E2EE behind an experimental setting
All checks were successful
ci / Windows (x64) (push) Successful in 27m23s
ci / Linux (x86_64) (push) Successful in 30m57s
98443936d2
Refs #84

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
test: voice acceptance
All checks were successful
ci / Linux (x86_64) (push) Successful in 13m19s
ci / Windows (x64) (push) Successful in 15m1s
407d6746e0
Refs #87

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Author
Owner

Review: Voice 26 acceptance (independent reviewer)

Diff reviewed: eb88cd0..origin/voice-26-acceptance (407d674). It touches two files, apps/fluxer/tests/voice_acceptance.rs and docs/acceptance/voice.md. No code outside the task's files changed.

Plan steps

  • The end-to-end test voice_session_end_to_end covers every step the plan names. It runs on the devserver with FakeRoom and NullHost: login, join, a remote user speaking (ada's ring and our own), self mute, self deafen (with the unsubscribe asserted, Review Focus 1), per-user volume (50 % = 10^-0.6, ±15 %), soundboard receive and send, the 429 cooldown (10 sends per window, retry-after ≤ 10 s, nothing sent during the cooldown), a move (same connection_id), a room reconnect, the gateway drop and resume, and leave. The test asserts on snapshots and on GET /status over a real loopback TCP socket.
  • docs/acceptance/voice.md has the live checklist for spec §2 items 1, 2, 6, 7, 9 and 11. Each item has exact steps, and item 7 explains how to read the sharer's codec in the Electron devtools console and in Advanced settings. The doc also lists the open question and follow-up issues and the known gaps. Every test name it cites exists in the tree; I checked all 23. The issues it cites (#115, #146, #108, #120) are open with the labels it gives them.
  • The commit is test: voice acceptance, with Refs #87 and the attribution line.

Interfaces: this task has no Interfaces block, and no public API changed.

Invariants: no change to fluxer-core or fluxer-ui. There are no secrets in the diff: the status-API token is generated at runtime in the test.

Findings

  • minor: In the gateway drop and resume step, the drop and RESUMED are injected into the store instead of being driven by a real socket drop. The devserver cannot resume a session yet. This is documented in the test and the doc, and tracked as follow-up #146. The resent op 4 still goes over the real socket. Acceptable.
  • minor: The status-API speaking check deliberately asserts the current wrong value (!participant_speaking). It is a tripwire for #115 item 2, with the correct assertion in a comment beside it. Whoever fixes #115 has to flip it, and the failure message says so.

CI: FLUXER_SCREENSHOT_TESTS=1 cargo xtask ci is green locally in the review worktree; voice_session_end_to_end ... ok. The LiveKit interop step was skipped because FLUXER_LIVEKIT_TESTS is not set (#120).

Verdict: APPROVED. No blocking findings.

## Review: Voice 26 acceptance (independent reviewer) Diff reviewed: `eb88cd0..origin/voice-26-acceptance` (407d674). It touches two files, `apps/fluxer/tests/voice_acceptance.rs` and `docs/acceptance/voice.md`. No code outside the task's files changed. **Plan steps** - The end-to-end test `voice_session_end_to_end` covers every step the plan names. It runs on the devserver with FakeRoom and NullHost: login, join, a remote user speaking (ada's ring and our own), self mute, self deafen (with the unsubscribe asserted, Review Focus 1), per-user volume (50 % = 10^-0.6, ±15 %), soundboard receive and send, the 429 cooldown (10 sends per window, retry-after ≤ 10 s, nothing sent during the cooldown), a move (same connection_id), a room reconnect, the gateway drop and resume, and leave. The test asserts on snapshots and on `GET /status` over a real loopback TCP socket. - `docs/acceptance/voice.md` has the live checklist for spec §2 items 1, 2, 6, 7, 9 and 11. Each item has exact steps, and item 7 explains how to read the sharer's codec in the Electron devtools console and in Advanced settings. The doc also lists the open question and follow-up issues and the known gaps. Every test name it cites exists in the tree; I checked all 23. The issues it cites (#115, #146, #108, #120) are open with the labels it gives them. - The commit is `test: voice acceptance`, with `Refs #87` and the attribution line. **Interfaces:** this task has no Interfaces block, and no public API changed. **Invariants:** no change to fluxer-core or fluxer-ui. There are no secrets in the diff: the status-API token is generated at runtime in the test. **Findings** - minor: In the gateway drop and resume step, the drop and `RESUMED` are injected into the store instead of being driven by a real socket drop. The devserver cannot resume a session yet. This is documented in the test and the doc, and tracked as follow-up #146. The resent op 4 still goes over the real socket. Acceptable. - minor: The status-API `speaking` check deliberately asserts the current wrong value (`!participant_speaking`). It is a tripwire for #115 item 2, with the correct assertion in a comment beside it. Whoever fixes #115 has to flip it, and the failure message says so. **CI:** `FLUXER_SCREENSHOT_TESTS=1 cargo xtask ci` is green locally in the review worktree; `voice_session_end_to_end ... ok`. The LiveKit interop step was skipped because FLUXER_LIVEKIT_TESTS is not set (#120). **Verdict: APPROVED.** No blocking findings.
charles manually merged commit 53e3d60b8b into voice 2026-11-12 01:46:29 +00:00
Sign in to join this conversation.
No description provided.