diff --git a/checklist.md b/checklist.md index 9b30af4..6631447 100644 --- a/checklist.md +++ b/checklist.md @@ -103,6 +103,37 @@ These probes are read-only and do not alter the saved profile or live volumes. it must not silently select `pulse` after the manual request fails. - [ ] Confirm none of these probe commands changes application volume or mute. +## Real-daemon integration fixture + +- [ ] Confirm `paplay` is installed with `command -v paplay` and pause any audio + you do not want visible in the diagnostic output. +- [ ] Run the non-disruptive isolated-stream fixture: + + ```sh + cargo test --locked -p volume_lib --test pulse_daemon --all-features \ + real_stream_commands_external_edits_and_churn_converge -- \ + --ignored --exact --nocapture + ``` + +- [ ] Confirm it passes after showing the uniquely named + `fader-master-fixture-*` stream converge through worker volume/mute commands, + external changes, removal, and replacement. Other streams may be listed but + must not be changed. +- [ ] Only when interrupting all desktop audio is acceptable, run: + + ```sh + FADER_MASTER_RESTART_PIPEWIRE=1 \ + cargo test --locked -p volume_lib --test pulse_daemon --all-features \ + pipewire_restart_disconnects_and_a_new_epoch_resnapshots -- \ + --ignored --exact --nocapture + ``` + +- [ ] Confirm the restart fixture observes a disconnect, reconnects with a new + backend epoch, completes a fresh snapshot, and that `pactl info` works again. + +The fixture design and standalone-PulseAudio CI instructions are documented in +[`docs/pulse-daemon-fixture.md`](docs/pulse-daemon-fixture.md). + The main TUI is still explicitly backed by demo state at this milestone. Passing this checklist validates the real Pulse control boundary that will feed the server and live multi-application/group TUI; it does not yet validate MIDI or diff --git a/docs/pulse-daemon-fixture.md b/docs/pulse-daemon-fixture.md new file mode 100644 index 0000000..59a07d1 --- /dev/null +++ b/docs/pulse-daemon-fixture.md @@ -0,0 +1,52 @@ +# Real Pulse daemon fixture + +The M4.4 fixture is opt-in because it connects to the current user's real audio +session. Its normal phase creates a uniquely named, silent stereo stream with +`paplay`, changes only that stream, and always terminates the child process. +It never parses shell output in the production adapter. + +## Prerequisites + +- A reachable PulseAudio-compatible server. This can be PulseAudio itself or + PipeWire's `pipewire-pulse` service. +- The `paplay` executable and libpulse development/runtime files. On Arch these + are supplied by `libpulse`. +- Permission to access the user audio socket. Sandboxed test runners must expose + that socket deliberately. + +Run the non-disruptive phase with: + +```sh +cargo test --locked -p volume_lib --test pulse_daemon --all-features \ + real_stream_commands_external_edits_and_churn_converge -- \ + --ignored --exact --nocapture +``` + +It verifies discovery of the isolated stream, worker volume and mute commands, +readback, changes made by an independent Pulse client, removal, and a replacement +stream with a fresh handle. Existing desktop streams are observed but never +selected for writes. The fixture fails rather than silently passing when the +daemon, `paplay`, expected notifications, or cleanup behavior is unavailable. + +Set `PULSE_SERVER` before the command to target an explicitly isolated daemon. +This is the intended way to run the same fixture against a standalone PulseAudio +CI instance without touching the desktop session. + +## Disruptive PipeWire restart phase + +This phase intentionally restarts the current user's PipeWire, pipewire-pulse, +and WirePlumber services. It interrupts all desktop audio and must not run in the +ordinary test suite. Close or pause important audio applications first, then +acknowledge the interruption explicitly: + +```sh +FADER_MASTER_RESTART_PIPEWIRE=1 \ +cargo test --locked -p volume_lib --test pulse_daemon --all-features \ + pipewire_restart_disconnects_and_a_new_epoch_resnapshots -- \ + --ignored --exact --nocapture +``` + +The fixture requires a visible disconnect diagnostic, retries with bounded +backoff, reconnects under a new backend epoch, and waits for a complete fresh +snapshot. Without the acknowledgement variable it fails before restarting +anything. diff --git a/task.md b/task.md index 52d125e..46a1a29 100644 --- a/task.md +++ b/task.md @@ -121,6 +121,14 @@ Dependencies: M3. never falls back; application profiles reject hardware-only candidates. Disconnect backoff remains pinned to the selected authority until a reload. - [ ] **M4.4 Real-daemon fixture:** isolated playback streams and external control client. Acceptance: server command and external change both converge to the observed value/mute; stream churn and daemon restart recover. Document commands and opt-in fixture requirements; do not label mocks as hardware verification. + An opt-in fixture now creates a uniquely named silent `paplay` stream and + verifies real worker volume/mute writes, independent-client edits, readback, + removal, and replacement without targeting other desktop streams. That phase + passed against PipeWire 1.6.9 through `pipewire-pulse` on 2026-10-14. A + separately acknowledged test restarts the known PipeWire user services and + requires disconnect, bounded retry, a new epoch, and a complete resnapshot. + Keep this item open until that disruptive phase passes; the same stream fixture + can target an isolated standalone PulseAudio server through `PULSE_SERVER`. M4.2 verification on 2026-10-14: the scripted worker contract suite passes without an audio daemon, and a read-only owner-thread smoke run against PipeWire