Branch: feature/streaming-transcription. Tracking commits, design decisions,
and what is left.
Adds the trait, event types, and State::Streaming variant. No backends yet,
no daemon.rs wiring yet. All existing Transcriber impls untouched (default
as_streaming() returns None). All 544 existing lib tests still pass; 7 new
tests added (5 in state::tests, 2 in transcribe::streaming::tests).
Changed files:
src/state.rs—State::Streaming { started_at, model_override, partial_buffer, finalized_text, typed_chars }.is_recording()now also returnstrueforStreaming. Newis_streaming()helper.Displayimpl extended.src/transcribe/mod.rs—pub mod streaming;and a defaultas_streaming(&self) -> Option<&dyn StreamingTranscriber>method onTranscriber.src/transcribe/streaming.rs— new file.StreamingEvent { Partial, Final, Ended, Error },StreamHandle { events: mpsc::Receiver, cancel: oneshot::Sender, task: JoinHandle },StreamingTranscribertrait takingmpsc::Receiver<Vec<f32>>(matchesAudioCapture's output type).
Design notes / divergences from the v2 proposal in the prior STATUS:
- The v2 proposal had
cancel: Box<dyn FnOnce() + Send>. Replaced withoneshot::Sender<()>—FnOncerequires consumingselfto call, awkward to share alongside the events Receiver. A oneshot is cleaner and idiomatic in tokio. - Added
task: JoinHandle<Result<(), TranscribeError>>so the daemon canawaitthe backend's drive task on shutdown / error reporting. StreamingEventis notClone(becauseTranscribeErrorisn't). Documented in code; events are consumed once from the channel which is the only realistic path.
src/output/streaming.rs adds StreamingSession:
commit_segment()types a finalized segment via the existingoutput_with_fallbackchain. Trackstyped_charsin Unicode scalars (not bytes) so cancel-rewind sends one BackSpace per visible character.observe_partial()updates an in-memory partial buffer. Never typed.rewind()emits N BackSpace events via wtype → dotool → ydotool fallback. Best-effort: returnsErr(AllMethodsFailed)if no backend works, daemon may surface as a soft warning.- Post-process decision: per-segment, with
VOXTYPE_CONTEXTset to finalized-text-so-far. Matches the existing eager-mode pattern inoutput/post_process.rs::process_with_context. Skipping it would silently break users who rely on the hook for cleanup. End-of-session would defeat the latency win. Per-segment is the only choice that keeps both. - pre/post output hooks fire once per finalized segment (not once per session). Compositor submap toggles need to wrap each typing burst.
550 lib tests pass (6 new in output::streaming::tests). Mock RecordingOutput
covers commit, unicode counting, empty-segment no-op, partial replacement,
finalize-clears-partial, and zero-char rewind.
- Commit 3 — Gemini Live backend via
tokio-tungstenite. Add dependency, implementStreamingTranscriber. Daemon wiring — only when[transcribe] streaming = true. Largest commit; will likely need its own session. - Commit 4 — one local streaming backend. First investigate
whisper-rsstreaming; fall back to chunked-VAD over the existingWhisperTranscriberif it doesn't expose stream APIs. - Commit 5 — docs (USER_MANUAL.md, CONFIGURATION.md, TROUBLESHOOTING.md).
Resolved. git -C <wt> ... and cd <wt> && ... forms both work. cargo check, cargo test, and explicit-file rustfmt invocations work. Note: cargo fmt -- path/to/file.rs in workspace mode reformats the whole crate, not just the named files — pre-existing fmt drift in unmodified files leaks in. Workaround: format the new files in isolation, then git checkout any unrelated file the workspace fmt touched.