Voice 7: fluxer-core::voice connection machine and ports #68

Closed
opened 2026-11-11 12:17:33 +00:00 by charles · 0 comments
Owner

Files:

  • Create: crates/fluxer-core/src/voice/{port.rs,connection.rs,local.rs}
  • Modify: crates/fluxer-core/src/{effect.rs,event.rs,app.rs,persist.rs}
  • Test: crates/fluxer-core/tests/voice_connection.rs

Interfaces:

  • Produces: exactly the port types of spec §5.3 (VoiceCommand, VoiceEvent, AudioCommand, AudioEvent, TrackSource, DisconnectReason, PlaybackSource, ClipRef, ClipTag, Chime, CaptureConfig, AudioDevices, DeviceId); Effect::{Voice(VoiceCommand), Audio(AudioCommand)}; CoreEvent::{Voice(VoiceEvent), Audio(AudioEvent)}; VoiceConnection (spec §5.1) with VoiceFailure::{Timeout, Gateway(GatewayErrorCode), Room(String), E2eeRequired}; UserAction::{JoinVoice { guild_id: Option<Snowflake>, channel_id }, LeaveVoice, RetryVoice, DismissVoiceError, ToggleSelfMute, ToggleSelfDeaf}; LocalVoiceState { self_mute, self_deaf } persisted through PersistOp (new local-settings section, old settings files still load); helpers effective_mute(&App) -> bool, effective_deaf(&App) -> bool.

  • Behaviour: every rule of spec §5.2 from "Join" through "Effective mute", including the 15 s timeout, moves, kicks, gateway resume re-sending op 4, and token refresh. Undeafening restores the mute state from before deafening (as the original).

  • Step 1: Write failing tests: join_sends_op4_then_connects_on_server_update, join_times_out_after_15s, gateway_error_12_fails_with_code, leave_disconnects_room_then_sends_null_channel, move_keeps_connection_id, kicked_by_moderator_goes_idle_and_plays_disconnect_chime, resume_resends_op4, fresh_server_update_reconnects_without_leaving, deafen_implies_mute_and_undeafen_restores, server_mute_blocks_unmute_of_track, room_disconnect_goes_reconnecting_then_failed, server_update_for_other_connection_is_ignored, proptest any_event_order_never_panics.

  • Step 2–5: FAIL → implement → PASS → commit feat(core): voice connection state machine and ports.

Plan: https://git.forked.io/charles/fluxer-native/src/branch/main/docs/superpowers/plans/2026-11-11-voice.md
Spec: https://git.forked.io/charles/fluxer-native/src/branch/main/docs/superpowers/specs/2026-11-11-fluxer-native-voice-design.md

**Files:** - Create: `crates/fluxer-core/src/voice/{port.rs,connection.rs,local.rs}` - Modify: `crates/fluxer-core/src/{effect.rs,event.rs,app.rs,persist.rs}` - Test: `crates/fluxer-core/tests/voice_connection.rs` **Interfaces:** - Produces: exactly the port types of spec §5.3 (`VoiceCommand`, `VoiceEvent`, `AudioCommand`, `AudioEvent`, `TrackSource`, `DisconnectReason`, `PlaybackSource`, `ClipRef`, `ClipTag`, `Chime`, `CaptureConfig`, `AudioDevices`, `DeviceId`); `Effect::{Voice(VoiceCommand), Audio(AudioCommand)}`; `CoreEvent::{Voice(VoiceEvent), Audio(AudioEvent)}`; `VoiceConnection` (spec §5.1) with `VoiceFailure::{Timeout, Gateway(GatewayErrorCode), Room(String), E2eeRequired}`; `UserAction::{JoinVoice { guild_id: Option<Snowflake>, channel_id }, LeaveVoice, RetryVoice, DismissVoiceError, ToggleSelfMute, ToggleSelfDeaf}`; `LocalVoiceState { self_mute, self_deaf }` persisted through `PersistOp` (new local-settings section, old settings files still load); helpers `effective_mute(&App) -> bool`, `effective_deaf(&App) -> bool`. - Behaviour: every rule of spec §5.2 from "Join" through "Effective mute", including the 15 s timeout, moves, kicks, gateway resume re-sending op 4, and token refresh. Undeafening restores the mute state from before deafening (as the original). - [ ] **Step 1: Write failing tests**: `join_sends_op4_then_connects_on_server_update`, `join_times_out_after_15s`, `gateway_error_12_fails_with_code`, `leave_disconnects_room_then_sends_null_channel`, `move_keeps_connection_id`, `kicked_by_moderator_goes_idle_and_plays_disconnect_chime`, `resume_resends_op4`, `fresh_server_update_reconnects_without_leaving`, `deafen_implies_mute_and_undeafen_restores`, `server_mute_blocks_unmute_of_track`, `room_disconnect_goes_reconnecting_then_failed`, `server_update_for_other_connection_is_ignored`, proptest `any_event_order_never_panics`. - [ ] **Step 2–5:** FAIL → implement → PASS → commit `feat(core): voice connection state machine and ports`. Plan: https://git.forked.io/charles/fluxer-native/src/branch/main/docs/superpowers/plans/2026-11-11-voice.md Spec: https://git.forked.io/charles/fluxer-native/src/branch/main/docs/superpowers/specs/2026-11-11-fluxer-native-voice-design.md
charles added this to the Voice milestone 2026-11-11 12:17:33 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
charles/fluxer-native#68
No description provided.