slice-4 (dev-a): Reflex<P> + LocalVadReflex<P> (Task 2 + 2b) #8
Reference in New Issue
Block a user
Delete Branch "slice-4-dev-a-reflex"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What lands
Reflex<P>barge-in state machine (4-state machine per spec §3.2 — Playing/SpeechStarted→Muted; Muted/SpeechStarted re-barge; Muted/Playing SpeechStopped observation no-toggle; Muted inner Some → Playing; Muted inner None → Muted + frames_suppressed).LocalVadReflex<P>— the wedge-#1 PRIMARY trigger (spec §3.4). RMS/energy VAD inon_pcm_frameon the dedicated thread, in the 20ms loop, with ZERO brain round-trip. Debounce N=3 frames = 60ms. Composes asLocalVadReflex<Reflex<TapAudioPipe>>; both the local VAD + the brain's advisory feed the sameadvisory_txmpsc (§6.1 two-sender composition).What this proves (so far)
The decorator pattern + the trigger source are landed. Combined with dev-b's chain (Task 5 signature + Task 4 advisory forwarding), the slice-4 e2e (Task 9) proves wedge #1: caller speech → kill within ≤80ms wallclock, zero brain round-trip.
What is deferred from this PR
MediaThreaddedicated std::thread) — blocked on dev-b Task 5 (spawn_tap_enginesignature change acceptingadvisory_tx).session_map.rsrewire to command-channel pattern) — blocked on Task 6.Why partial
The plan's dependency graph makes Task 6 strictly depend on dev-b's Task 5 signature change. Shipping Tasks 2 + 2b now locks the decorator + trigger patterns for review while the thread-chain waits on the dependency. Lane-stays-clear: dev-b's chain is the critical path through Task 5 → Task 6.
Merge instructions
Test evidence
cargo test -p rutster-media --lib reflex::tests: 15 passing (3 Task 1 + 6 Task 2 + 6 Task 2b).cargo fmt --all --check: passcargo clippy --all --all-targets -- -D warnings: passcargo test --all: 108 passing across all test binsloop_driver.rs+rtc_session.rsverified byte-identical to main viagit diff origin/main -- ...(empty).