Add speaker queue addition and removal callbacks
Implement opt-in speaker_queued and speaker_queue_removed HTTP callbacks using the existing room event channel and per-room callback delivery/subscriptions. Work in an isolated worktree based on local main; leave the original checkout untouched. Cover operator and Bosch effective-queue changes, duplicate turns, activation consumption and queue clearing. Reorder-only changes and mirrored duplicates must not emit callbacks. Preserve best-effort/no-replay delivery, validate meeting ownership, expose subscriptions in the dashboard and update the callback contract. No new dependencies or deployment. Implementation: room-side SpeakerQueueChanged batches carry occurrence-aware differences of the effective queue, shared by operator edits, Bosch polling, activation consumption and atomic meeting stop/reset clearing. Queue restoration and off-meeting changes remain silent. Router forwards the two opt-in callbacks with meeting ownership checks, allows stopped-meeting cleanup removals and suppresses stopped-meeting additions. Dashboard choices and contract documentation are updated. Verified outcome: committed as ac1d733 and pushed on feature/add-speaker-queued-callback at /home/mathias/work/Kaukus-Streaming/streaming-engines-speaker-queued, based on local main (81c0feb). Original checkout left untouched. Red-green tests cover queue notifications and HTTP delivery; added API PUT/GET subscription round-trip and protocol serialization regressions. Final cargo check --workspace, cargo test --workspace (425 passed, zero failed, three existing opt-in hardware/RTMP tests ignored), cargo fmt --all -- --check and git diff --check pass. Affected-crate Clippy completes with warnings in unchanged code; dashboard npm build passes. npm ci reports nine existing dependency vulnerabilities; no dependency changes made. The initial full test build exhausted the /tmp quota; artifacts were moved into this worktree and the complete rerun passed. No real Bosch hardware/NATS deployment or browser acceptance was performed. Rollout requires updated room agent/router plus explicit destination subscriptions; best-effort events are not replayed. Acceptance: both callbacks include meeting/room and seat identity, queue source/name and occurrence time; meaningful addition/removal regressions and relevant format/check/test validation pass. Concurrency follow-up committed as 1955a36 and pushed to the existing PR #131 branch in the same isolated worktree; worktree is clean. Operator queue commands now defer queue event emission across hardware synchronization and local operator commit with a cancellation-safe scope guard. Watcher observations still update cached state, but only the net queue change is emitted after the operation, preserving operator sources and hiding transient hardware clears/refills. Failed/cancelled commands retain the previous operator target and emit actual observed Bosch changes; subsequent watcher events resume normally. No synchronous lock is held across network awaits. Deterministic HTTP fixture tests execute the actual watcher snapshot synchronization while the Bosch command response is blocked before local commit. Both source/intermediate-snapshot regressions failed before the fix and pass afterward. Five new tests cover duplicate operator slots, source-preserving replacement/removal, transient physical-entry clear/refill, failed writes, cancellation and rejection before hardware changes. Final cargo check --workspace, cargo test --workspace (430 passed, zero failed, three existing opt-in tests ignored), formatting and diff checks pass. Local-streamer all-target Clippy completes with warnings in unchanged code. No live hardware validation or deployment performed; PR #131 now includes both ac1d733 and the concurrency fix 1955a36. Pull request: #131 https://git.kaukus.no/Kaukus/streaming-engines/pulls/131 — feature/add-speaker-queued-callback → main.
Checklist
4 of 4 complete- Implement and verify callback routing, subscriptions, ownership checks, dashboard choices and documented payload contract.
- Run relevant Rust and dashboard validation and record limitations.
- Implement and verify room queue addition/removal events across operator, Bosch, consumption and clearing paths.
- Reproduce watcher/operator interleaving and verify authoritative queue sources, including failed or cancelled hardware synchronization.
- Area
- Streaming
- Project
- streaming-engines
- Kind
- Feature
- Task ID
tsk_gsmkx4ek87- Updated