16 · Developer Guide
Architecture
See how the app records, transcribes, and inserts text.
Two Layer Design
Steno/ contains the SwiftUI/AppKit application, DictationController, views, settings, onboarding, and menu bar integration. StenoKit/ contains models, protocols, services, platform-specific service implementations, actors, and benchmark support.
Pipeline
- A recording control or hotkey changes the recording state.
- Steno captures audio locally. If live transcription is enabled, provisional text appears in the island.
- The retained Whisper helper transcribes the completed recording using the selected model. It communicates over inherited process pipes with no HTTP server or network listener.
- The session pipeline applies text shortcuts, word corrections, local cleanup, and eligible continuation rules.
- Insertion tries the configured transports with target checks and clipboard recovery.
- Completed transcript data goes to History; usage metadata goes to the separate Insights store.
The helper keeps the model loaded between dictations. It reloads when the model, the model file, the VAD configuration, or the thread count changes; saving other settings keeps the loaded model. If the helper's background process ends between dictations, Steno starts a new one.
Recoverable helper failures can fall back to the local CLI. Cancellation, stale responses, and VAD integrity failures do not use that retry. If the backup path stops responding, Steno stops it after a time limit that grows with the recording length. The retained helper also repairs a long recording's 30-second stretches: when a stretch comes back as a repeated phrase, as a copy of the stretch before it, or with most of its words missing, Steno transcribes it again in shorter pieces and keeps the new text only when it is clearly better. The CLI fallback includes neither that repair nor the helper's prompt-verification correction, so recognition can differ between the two paths.
Concurrency
Session coordination uses actors and explicit recording states to avoid overlapping sessions. UI updates run on the main actor. Cancellation and target revalidation affect processing as well as the interface. Besides running the automated tests, try cancellation and target changes in the app with your own editor and recording setup.
Extension Points
To change a service, work through the existing transcription, cleanup, insertion, capture, history, and usage interfaces. Keep nearby editor context temporary, and keep it out of recognition prompts and storage. Read the current implementation and its tests before adding a transport or changing fallback behavior.