From 97a410ca3995b6bbf01688e3a954ab89161855f0 Mon Sep 17 00:00:00 2001 From: Zhongshu Audit Date: Sat, 20 Jun 2026 21:33:51 +0800 Subject: [PATCH] docs: clarify LiveDictationController and DictationBridge status Both classes are kept in v0.1.2 (they serve the in-app keyboard preview and the one-shot host-app dictation handoff path), but their primary role was taken over by FlowSessionManager + FlowContinuousCapture in v0.1.1. Add a STATUS section to each file header explaining the current role and listing the call sites, so future readers do not assume they are dead code and try to delete them (which would break PreviewASRController and KeyboardPreviewSheet). Refs: AUDIT_APPSTORE.md P0-3 --- OSGKeyboardShared/Services/DictationBridge.swift | 6 ++++++ .../Services/LiveDictationController.swift | 16 ++++++++++++++++ 2 files changed, 22 insertions(+) diff --git a/OSGKeyboardShared/Services/DictationBridge.swift b/OSGKeyboardShared/Services/DictationBridge.swift index a0d3b8f..ecac7c2 100644 --- a/OSGKeyboardShared/Services/DictationBridge.swift +++ b/OSGKeyboardShared/Services/DictationBridge.swift @@ -5,6 +5,12 @@ // keyboard extension -> open host app for recording // host app -> writes final transcript // keyboard extension -> consumes pending transcript and inserts text +// +// STATUS (v0.1.2): Retained. Consumed by `KeyboardViewController` for +// the "one-shot" host-app dictation path (where the keyboard extension +// launches the host app, the user records there, and the resulting +// text is consumed back by the extension). The *continuous* path goes +// through `FlowSessionBridge` + `FlowSessionManager` instead. import Foundation diff --git a/OSGKeyboardShared/Services/LiveDictationController.swift b/OSGKeyboardShared/Services/LiveDictationController.swift index bee1d52..46d46dc 100644 --- a/OSGKeyboardShared/Services/LiveDictationController.swift +++ b/OSGKeyboardShared/Services/LiveDictationController.swift @@ -4,6 +4,22 @@ // Unified on-device dictation session: mic capture + iOS 26 SpeechAnalyzer. // Used by the keyboard preview sheet, host-app dictation handoff, and any // other foreground surface that needs live ASR without duplicating pipeline code. +// +// STATUS (v0.1.2): Retained as a "preview / one-shot handoff" path. +// The *primary* voice-session path is `FlowSessionManager` + +// `FlowContinuousCapture` (TypeWhisper-style continuous capture shared +// between host app and keyboard extension). The keyboard extension +// consumes results through `FlowSessionBridge`. +// +// This class is still imported by: +// - `OSGKeyboard/Views/PreviewASRController.swift` (typealias) +// - `OSGKeyboard/Views/KeyboardPreviewSheet.swift` (in-app preview) +// - `OSGKeyboard/Views/DictationCaptureView.swift` (host-app fallback) +// - `OSGKeyboardTests/PreviewASRControllerStateTests.swift` +// +// Do NOT remove without updating those call sites. The earlier +// `OSGKeyboardExt/Services/AudioCaptureService.swift` *was* a true +// dead duplicate and has been deleted (see AUDIT_APPSTORE.md P0-3). // Owns its own AVAudioEngine + AVAudioSession, downsamples to 16 kHz // mono Float32 on the audio thread (same as `AudioCaptureService`), and // feeds `AudioBufferSnapshot` to the shared `ASRService` (the same