Camera 21: Acceptance (#972) #1007

Closed
charles wants to merge 0 commits from camera-21-acceptance into camera
Owner

What

  • apps/fluxer/tests/camera_acceptance.rs::camera_session_end_to_end: the whole client, in-process, on the devserver camera scenario, with the fake camera, FakeRoom, NullHost, the fake screen capture and a FakeTray. No device, no window. It follows the plan's walk: login (ada's camera icon, two fake cameras listed, opened == 0), refused outside a call, join (nothing opened), ada shown (subscribed, frames on the bus, tile Video), "Disable video locally" (unsubscribed before the grace, tile DisabledLocally) and back, call view hidden (still subscribed at 1 s, gone after the 2 s grace), preview (open_now == 1, LocalCamera frames, nothing published, no op 4), "Turn on camera" (same capture, selfVideo while Starting, no self_video op 4 and no chime before the room confirms, then publication with the preset's codec/encoding/layers, op 4 self_video: true with every other flag, chime), mirror off/on (the room's frames never mirrored, pattern::is_mirrored), 480p (UpdateCameraEncoding, same publication), USB camera (restart, same publication), a screen share beside it, the shortcut off (closed, op 4 false, unpublished, chime, share untouched) and on without preview, device lost (toast), Gaming (no STREAM tooltip), the cap (gateway VOICE_CAMERA_USER_LIMIT toast, then the voice panel's cap tooltip and the control bar's participants tooltip), Busy then NotAllowed (toast, then modal, Off), window hidden with the camera on (tray row and " - Camera on", indication == Tray, the tray row turns it off), leave with the camera on, STREAM taken away while live (off, no message), the DM call (no permission needed, op 4 with no guild), and shutdown with a room that never confirms (open_now == 0 when it returns). Then the whole log and every --record file hold no frame bytes (raw or Debug), no device id (the log names the chosen one by hash) and not the session token.
  • real_back_end_refuses_under_the_ci_switch: under FLUXER_CAMERA_FORBID (which xtask ci sets, checked by xtask's ci_sets_camera_forbid) this OS's real back end refuses start (V4L2 on the Linux runner, Media Foundation on the Windows runner); without the switch it skips, so it can never reach a camera.
  • docs/acceptance/camera.md: what the suite covers; Charles's checklist with a Linux and a Windows section (probe commands and expected output, spec §2 items 1–7, the spec §14 hardware items, the manual lists of Camera 10 (#985), 11 (#984), 1, 2, 12 and 17); known gaps; open follow-ups.

How it was tested

  • FLUXER_SCREENSHOT_TESTS=1 cargo xtask ci green locally (with TMPDIR under the target dir because of #983). The acceptance test was also run 3 more times on its own (about 12 s each), all green.
  • No camera, microphone or screen was opened; every cargo test run outside the gate had FLUXER_CAMERA_FORBID=1. The client was not run. No FLUXER_DESKTOP_TESTS, FLUXER_CAMERA_TESTS or FLUXER_LIVEKIT_TESTS test was run.
  • Windows: this task adds no cfg(windows) code. The forbid test calls default_camera(); on Windows it reaches MfCamera::start, which checks forbidden() before COM.

Deviations from the plan

  • Order: hangout-loses-stream cannot be undone, and a channel without STREAM cannot be filled with cameras. So STREAM is taken away after "leave with the camera on", not right after the device loss.
  • The cap: the client refuses the shortcut by itself once it sees 25 others on camera. So the gateway's VOICE_CAMERA_USER_LIMIT is reached with this order: the shortcut while the room holds the publication, then fill-hangout-cameras, then the room confirms. The local refusal is checked after that.
  • Owner decision: no capture-card ("Devices" tab) item. This PR does not close #183, despite the plan's "Closes: #183".
  • No production code changed. Only the task's two files.

For Charles

Run the checklist in docs/acceptance/camera.md, Linux and Windows. The boxes stay unticked until you have run it.

Closes #972

🤖 Generated with Claude Code

https://claude.ai/code/session_0161qMQMsCyJhjYw4gqa6e4K

## What - `apps/fluxer/tests/camera_acceptance.rs::camera_session_end_to_end`: the whole client, in-process, on the devserver `camera` scenario, with the fake camera, `FakeRoom`, `NullHost`, the fake screen capture and a `FakeTray`. No device, no window. It follows the plan's walk: login (ada's camera icon, two fake cameras listed, `opened == 0`), refused outside a call, join (nothing opened), ada shown (subscribed, frames on the bus, tile `Video`), "Disable video locally" (unsubscribed before the grace, tile `DisabledLocally`) and back, call view hidden (still subscribed at 1 s, gone after the 2 s grace), preview (`open_now == 1`, `LocalCamera` frames, nothing published, no op 4), "Turn on camera" (same capture, `selfVideo` while `Starting`, no `self_video` op 4 and no chime before the room confirms, then publication with the preset's codec/encoding/layers, op 4 `self_video: true` with every other flag, chime), mirror off/on (the room's frames never mirrored, `pattern::is_mirrored`), 480p (`UpdateCameraEncoding`, same publication), USB camera (restart, same publication), a screen share beside it, the shortcut off (closed, op 4 false, unpublished, chime, share untouched) and on without preview, device lost (toast), Gaming (no STREAM tooltip), the cap (gateway `VOICE_CAMERA_USER_LIMIT` toast, then the voice panel's cap tooltip and the control bar's participants tooltip), `Busy` then `NotAllowed` (toast, then modal, `Off`), window hidden with the camera on (tray row and " - Camera on", `indication == Tray`, the tray row turns it off), leave with the camera on, STREAM taken away while live (off, no message), the DM call (no permission needed, op 4 with no guild), and shutdown with a room that never confirms (`open_now == 0` when it returns). Then the whole log and every `--record` file hold no frame bytes (raw or `Debug`), no device id (the log names the chosen one by hash) and not the session token. - `real_back_end_refuses_under_the_ci_switch`: under `FLUXER_CAMERA_FORBID` (which `xtask ci` sets, checked by `xtask`'s `ci_sets_camera_forbid`) this OS's real back end refuses `start` (V4L2 on the Linux runner, Media Foundation on the Windows runner); without the switch it skips, so it can never reach a camera. - `docs/acceptance/camera.md`: what the suite covers; Charles's checklist with a Linux and a Windows section (probe commands and expected output, spec §2 items 1–7, the spec §14 hardware items, the manual lists of Camera 10 (#985), 11 (#984), 1, 2, 12 and 17); known gaps; open follow-ups. ## How it was tested - `FLUXER_SCREENSHOT_TESTS=1 cargo xtask ci` green locally (with `TMPDIR` under the target dir because of #983). The acceptance test was also run 3 more times on its own (about 12 s each), all green. - No camera, microphone or screen was opened; every `cargo test` run outside the gate had `FLUXER_CAMERA_FORBID=1`. The client was not run. No `FLUXER_DESKTOP_TESTS`, `FLUXER_CAMERA_TESTS` or `FLUXER_LIVEKIT_TESTS` test was run. - Windows: this task adds no `cfg(windows)` code. The forbid test calls `default_camera()`; on Windows it reaches `MfCamera::start`, which checks `forbidden()` before COM. ## Deviations from the plan - Order: `hangout-loses-stream` cannot be undone, and a channel without STREAM cannot be filled with cameras. So STREAM is taken away after "leave with the camera on", not right after the device loss. - The cap: the client refuses the shortcut by itself once it sees 25 others on camera. So the gateway's `VOICE_CAMERA_USER_LIMIT` is reached with this order: the shortcut while the room holds the publication, then `fill-hangout-cameras`, then the room confirms. The local refusal is checked after that. - Owner decision: no capture-card ("Devices" tab) item. This PR does not close #183, despite the plan's "Closes: #183". - No production code changed. Only the task's two files. ## For Charles Run the checklist in `docs/acceptance/camera.md`, Linux and Windows. The boxes stay unticked until you have run it. Closes #972 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_0161qMQMsCyJhjYw4gqa6e4K
The whole client on the devserver's camera scenario, in-process, with the
fake camera, the fake room, the virtual sound host and a fake tray; the CI
switch's refusal by this OS's real back end; and docs/acceptance/camera.md
with Charles's Linux and Windows checklists.

Refs #972

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0161qMQMsCyJhjYw4gqa6e4K
Author
Owner

Review of Camera 21: Acceptance (independent reviewer)

Reviewed d8d429a77..origin/camera-21-acceptance (8614a5dde): apps/fluxer/tests/camera_acceptance.rs, docs/acceptance/camera.md. No production code changed.

Gate: FLUXER_SCREENSHOT_TESTS=1 cargo xtask ci run in the review worktree: all steps passed (camera_session_end_to_end ... ok, real_back_end_refuses_under_the_ci_switch ... ok; no TMPDIR workaround was needed here).

Checked

  1. Plan steps: the end-to-end walk covers every step of the plan's list: login with ada's icon, the 2 fake cameras and opened == 0; refused outside a call; join opens nothing; SetShown, disable locally and back; the 2 s grace (still subscribed at 1 s, gone after CAMERA_UNSUBSCRIBE_GRACE); the preview (open_now == 1, unmirrored on the bus, nothing published, no op 4); turn on (same capture, no self_video and no chime before the room confirms, then the preset's codec, encoding and layers, op 4 with mute/deaf/stream/viewer keys, chime, selfVideo); mirror both ways with the room's frames unmirrored; 480p = Low 640x360@20 (matches spec row 21 and VoiceEngineV2AppCameraResolutionPresets.ts:17); device switch with the same publication; a share beside it; shortcut off and on; device lost; Gaming; the cap; Busy and NotAllowed; the tray; leave; STREAM lost; DM; shutdown. The two order deviations (STREAM loss after the leave; cap reached through the gateway with the publication held) are justified and documented in the doc.
  2. Log and record grep: pattern bytes (raw and Debug-printed), both fake device ids and the token are searched in the log and every --record file; the hash of the chosen device must be present.
  3. CI switch: xtask/src/main.rs sets FLUXER_CAMERA_FORBID=1 and ci_sets_camera_forbid asserts it. The acceptance test starts default_camera() and expects Unsupported, with an exact match on Linux. On Windows a host without MF falls back to Unsupported with its own reason, which the test also accepts. Read as the Windows compiler would: no cfg-gated items, all imports used on both OSes, and the FakeTray/ShellPlatform::inert usage matches shell_acceptance.rs.
  4. Parity spot-checks against fluxer-soundboard: the gateway refuses when sets:size(camera users + requester) > 25 (guild_voice_connection_util.erl:121, constants.erl:168), which matches 25 others making the client's own start fail; "Cameras are off above {N} participants" (VoiceControlBar.tsx:129); "You can't turn on your camera in this channel" (VoiceSharedMessageDescriptors.ts:80); VOICE_CAMERA_USER_LIMIT (gateway_errors.erl:159); low preset 640x360@20.
  5. Review Focus 3 (no frame bytes outside memory/encoder): covered by the grep above. Owner decisions: no capture-card item; the PR closes only #972, not #183. Correct.
  6. Invariants: test-only and doc changes; no secrets or paths in fixtures; the token is only read in memory for the negative search.

Findings

  • minor: the shutdown step asserts open_now == 0 only after handle.shutdown() returns (bounded by the 30 s STEP). It does not prove the plan's "before the shutdown limits run". A capture closed only at the end of the shutdown timeouts would still pass. Suggest asserting the shutdown's elapsed time is below the room's shutdown limit, or polling open_now == 0 before the limit expires.
  • minor: the frame-byte telltale is taken once, from the first preview frame (Integrated camera, medium mode). Frames captured later at 640x360 or from the USB device are not searched for directly. It is still a strong signal, since the pattern is the same, but it is narrower than "no byte run of the pattern's frames".
  • minor: the log capture filter is debug, so a frame leak logged at trace would not be seen. Spec §13.4 covers every level.

Verdict: approved. No blocking findings; the local gate is green.

## Review of Camera 21: Acceptance (independent reviewer) Reviewed `d8d429a77..origin/camera-21-acceptance` (8614a5dde): `apps/fluxer/tests/camera_acceptance.rs`, `docs/acceptance/camera.md`. No production code changed. **Gate:** `FLUXER_SCREENSHOT_TESTS=1 cargo xtask ci` run in the review worktree: **all steps passed** (`camera_session_end_to_end ... ok`, `real_back_end_refuses_under_the_ci_switch ... ok`; no TMPDIR workaround was needed here). ### Checked 1. **Plan steps:** the end-to-end walk covers every step of the plan's list: login with ada's icon, the 2 fake cameras and `opened == 0`; refused outside a call; join opens nothing; SetShown, disable locally and back; the 2 s grace (still subscribed at 1 s, gone after `CAMERA_UNSUBSCRIBE_GRACE`); the preview (`open_now == 1`, unmirrored on the bus, nothing published, no op 4); turn on (same capture, no `self_video` and no chime before the room confirms, then the preset's codec, encoding and layers, op 4 with mute/deaf/stream/viewer keys, chime, `selfVideo`); mirror both ways with the room's frames unmirrored; 480p = Low 640x360@20 (matches spec row 21 and `VoiceEngineV2AppCameraResolutionPresets.ts:17`); device switch with the same publication; a share beside it; shortcut off and on; device lost; Gaming; the cap; Busy and NotAllowed; the tray; leave; STREAM lost; DM; shutdown. The two order deviations (STREAM loss after the leave; cap reached through the gateway with the publication held) are justified and documented in the doc. 2. **Log and record grep:** pattern bytes (raw and Debug-printed), both fake device ids and the token are searched in the log and every `--record` file; the hash of the chosen device must be present. 3. **CI switch:** `xtask/src/main.rs` sets `FLUXER_CAMERA_FORBID=1` and `ci_sets_camera_forbid` asserts it. The acceptance test starts `default_camera()` and expects `Unsupported`, with an exact match on Linux. On Windows a host without MF falls back to `Unsupported` with its own reason, which the test also accepts. Read as the Windows compiler would: no cfg-gated items, all imports used on both OSes, and the FakeTray/ShellPlatform::inert usage matches shell_acceptance.rs. 4. **Parity spot-checks against fluxer-soundboard:** the gateway refuses when `sets:size(camera users + requester) > 25` (`guild_voice_connection_util.erl:121`, `constants.erl:168`), which matches 25 others making the client's own start fail; "Cameras are off above {N} participants" (`VoiceControlBar.tsx:129`); "You can't turn on your camera in this channel" (`VoiceSharedMessageDescriptors.ts:80`); `VOICE_CAMERA_USER_LIMIT` (`gateway_errors.erl:159`); low preset 640x360@20. 5. **Review Focus 3** (no frame bytes outside memory/encoder): covered by the grep above. Owner decisions: no capture-card item; the PR closes only #972, not #183. Correct. 6. Invariants: test-only and doc changes; no secrets or paths in fixtures; the token is only read in memory for the negative search. ### Findings - **minor**: the shutdown step asserts `open_now == 0` only after `handle.shutdown()` returns (bounded by the 30 s STEP). It does not prove the plan's "before the shutdown limits run". A capture closed only at the end of the shutdown timeouts would still pass. Suggest asserting the shutdown's elapsed time is below the room's shutdown limit, or polling `open_now == 0` before the limit expires. - **minor**: the frame-byte telltale is taken once, from the first preview frame (Integrated camera, medium mode). Frames captured later at 640x360 or from the USB device are not searched for directly. It is still a strong signal, since the pattern is the same, but it is narrower than "no byte run of the pattern's frames". - **minor**: the log capture filter is `debug`, so a frame leak logged at `trace` would not be seen. Spec §13.4 covers every level. **Verdict: approved.** No blocking findings; the local gate is green.
Author
Owner

Merged into camera by hand (the merge API returns 405); the commits are in the branch.

Merged into `camera` by hand (the merge API returns 405); the commits are in the branch.
charles closed this pull request 2026-11-20 08:10:37 +00:00

Pull request closed

Sign in to join this conversation.
No description provided.