VoicePTT/AGENTS.md

39 KiB

Windows Voice PTT Transcription App — Codex Prompt Pack

This file contains one standalone prompt per Step for sequential submission to Codex.

Global project context

Target product: Windows desktop application packaged as EXE.

Core capabilities:

  • local speech-to-text via Faster-Whisper;
  • selectable model: base, small, medium, and other supported models available for download;
  • optional NVIDIA CUDA acceleration with CPU fallback;
  • Push-To-Talk via global hotkey;
  • insert transcription into the window that was active when PTT started;
  • minimize to system tray;
  • GUI with hotkey reassignment, PTT button, transcript output area, settings, runtime status;
  • configurable logging stored under %APPDATA%;
  • transcription history with default retention limit of 1000 records;
  • default text injection mode: direct typing.

Default settings to enforce unless a step explicitly changes them:

  • models root directory: C:\models\
  • logs root directory: %APPDATA%\VoicePTT\logs\
  • config path: %APPDATA%\VoicePTT\config.json
  • history DB path: %APPDATA%\VoicePTT\history.db
  • default history limit: 1000
  • default injection mode: direct_typing
  • supported model choices in UI and config: base, small, medium, plus other downloadable supported Faster-Whisper models exposed by the model registry layer.

Implementation constraints:

  • Windows only
  • Python 3.11
  • PySide6 for GUI
  • faster-whisper for ASR
  • ctranslate2 as inference backend
  • sounddevice for microphone capture
  • pywin32 and/or ctypes for Win32 integration
  • PyInstaller for packaging
  • keep business logic out of UI where practical
  • do not silently ignore failures
  • all long-running operations must avoid blocking the UI thread
  • each Step must be implemented as a separate commit

Recommended repository structure:

voice_ptt_app/
  app/
    main.py
    bootstrap.py

  core/
    orchestrator.py
    app_state.py
    config_service.py
    runtime_info.py
    dependency_probe.py

  ui/
    main_window.py
    settings_dialog.py
    tray_controller.py
    model_missing_dialog.py
    history_dialog.py
    status_panel.py

  audio/
    capture_service.py
    device_service.py
    audio_buffer.py

  asr/
    model_registry.py
    model_locator.py
    model_downloader.py
    model_manager.py
    transcription_worker.py
    backend_selector.py

  hotkeys/
    hotkey_service.py
    hotkey_parser.py

  injection/
    target_window_service.py
    text_injector.py
    clipboard_fallback.py

  history/
    history_store.py
    history_pruner.py

  logging_ext/
    logging_service.py

  platform/
    windows/
      hotkey_win32.py
      foreground_window_win32.py
      sendinput_win32.py

  resources/
    icons/

  packaging/
    pyinstaller/
      app.spec

  tests/
    unit/
    integration/
    manual/

git init before the start implementation. Commit after each step implementation.


Step 0.1 — Repository bootstrap

Implement Step 0.1 for the Windows desktop voice PTT transcription application.

Goal:
Initialize the repository and create the project skeleton.

Scope:
- create the project directory structure
- add requirements management file(s)
- add README.md
- add base entrypoint files
- add .gitignore
- prepare the repository for incremental implementation

Constraints:
- Windows only
- Python 3.11
- keep the structure aligned with the architecture
- do not implement full business logic yet

Expected result:
- repository is bootstrapped
- directory tree matches the planned architecture
- application has a minimal runnable entrypoint scaffold

Output requirements:
- modify only files required for this step
- keep code production-oriented
- add concise comments only where needed
- provide a summary of changed files
- provide the exact git commit message:
chore: bootstrap repository structure for voice ptt app

Step 0.2 — Centralized configuration

Implement Step 0.2 for the Windows desktop voice PTT transcription application.

Goal:
Add a centralized configuration service with persistent settings and defaults.

Scope:
- create core/config_service.py
- define configuration schema and default values
- support loading and saving configuration
- include defaults for:
  - models root directory = C:\models\
  - logs root directory = %APPDATA%\VoicePTT\logs\
  - config path under %APPDATA%
  - history DB path under %APPDATA%
  - default model
  - backend mode = auto
  - default hotkey
  - logging settings
  - default history size limit = 1000
  - default injection mode = direct_typing
- ensure supported model choices include base, small, medium, plus other downloadable supported models exposed by the registry layer

Constraints:
- configuration must be decoupled from UI
- paths must be centralized
- configuration file format must be stable and explicit
- create missing app data directories when appropriate

Expected result:
- application can read and save settings
- defaults are applied when config is absent or incomplete

Output requirements:
- modify only files required for this step
- add or update tests where appropriate
- provide a summary of changed files
- provide the exact git commit message:
feat: add centralized config service with default app settings

Step 0.3 — Logging baseline

Implement Step 0.3 for the Windows desktop voice PTT transcription application.

Goal:
Add a configurable logging subsystem.

Scope:
- create logging_ext/logging_service.py
- support configurable log level
- support configurable log directory under %APPDATA%
- support configurable log file name
- support rotation by size and backup count
- log application startup and shutdown
- ensure logging can be initialized early in bootstrap

Constraints:
- use standard Python logging facilities unless there is a strong reason otherwise
- logging failures must not crash the GUI
- keep log paths and defaults consistent with config service

Expected result:
- application writes rotating logs to the configured location under %APPDATA%

Output requirements:
- modify only files required for this step
- add or update tests where appropriate
- provide a summary of changed files
- provide the exact git commit message:
feat: add configurable logging service with file rotation

Step 0.4 — Runtime diagnostics baseline

Implement Step 0.4 for the Windows desktop voice PTT transcription application.

Goal:
Add runtime diagnostics and dependency probing.

Scope:
- create core/dependency_probe.py
- detect:
  - faster-whisper availability
  - ctranslate2 availability
  - CUDA availability
  - microphone device availability
- create core/runtime_info.py
- aggregate runtime state in a structured form for UI and orchestration

Constraints:
- probing must be safe and must not crash the app on missing optional dependencies
- results must be explicit enough for user-facing diagnostics
- keep this layer independent from the GUI

Expected result:
- application can report the current runtime capabilities and effective environment state

Output requirements:
- modify only files required for this step
- add or update tests where appropriate
- provide a summary of changed files
- provide the exact git commit message:
feat: add runtime diagnostics and dependency probing service

Step 1.1 — Main window shell

Implement Step 1.1 for the Windows desktop voice PTT transcription application.

Goal:
Create the main application window shell.

Scope:
- add the main window UI
- add a transcript output area
- add a PTT button placeholder
- add a status area
- add a panel showing current settings and runtime state placeholders
- structure the window so later business logic can be connected cleanly

Constraints:
- use PySide6
- do not implement the full transcription pipeline yet
- separate UI layout from orchestration logic as much as practical

Expected result:
- a basic main window exists and can be shown
- the UI has dedicated areas for transcript, status, and current settings

Output requirements:
- modify only files required for this step
- provide a summary of changed files
- provide the exact git commit message:
feat: add main window shell with status and transcript panel

Step 1.2 — Tray integration

Implement Step 1.2 for the Windows desktop voice PTT transcription application.

Goal:
Add system tray integration and close-to-tray behavior.

Scope:
- add a tray icon
- add tray menu actions such as show window and exit
- implement close-to-tray behavior
- support restoring the main window from the tray

Constraints:
- keep tray logic isolated in a dedicated controller
- avoid embedding orchestration logic into the tray layer

Expected result:
- the application can minimize to the system tray and continue running

Output requirements:
- modify only files required for this step
- provide a summary of changed files
- provide the exact git commit message:
feat: add system tray integration and close-to-tray behavior

Step 1.3 — Settings dialog shell

Implement Step 1.3 for the Windows desktop voice PTT transcription application.

Goal:
Create the settings dialog skeleton.

Scope:
- add a settings dialog with sections or tabs for:
  - General
  - Model
  - Audio
  - Logging
  - History
  - Hotkey
- build form placeholders and initial wiring to config values where appropriate
- do not implement all business rules yet

Constraints:
- use PySide6
- keep settings fields structured for later integration
- do not hardcode business logic into widget classes

Expected result:
- the application has a structured settings dialog ready for progressive feature wiring

Output requirements:
- modify only files required for this step
- provide a summary of changed files
- provide the exact git commit message:
feat: add settings dialog skeleton with configuration sections

Step 2.1 — Local model registry and discovery

Implement Step 2.1 for the Windows desktop voice PTT transcription application.

Goal:
Add a local model registry and filesystem-based model discovery.

Scope:
- create asr/model_registry.py
- create asr/model_locator.py
- define supported model choices including base, small, medium, plus other downloadable supported Faster-Whisper models
- detect whether a model exists under the configured models root directory
- provide a list of locally available models
- keep the registry design extensible for future metadata such as download URLs and size hints

Constraints:
- do not assume that every supported model is present locally
- discovery must be explicit and deterministic
- do not perform downloads in this step

Expected result:
- the application can enumerate locally available models and validate whether the selected model exists on disk

Output requirements:
- modify only files required for this step
- add or update tests where appropriate
- provide a summary of changed files
- provide the exact git commit message:
feat: add local model registry and filesystem model discovery

Step 2.2 — Missing model dialog

Implement Step 2.2 for the Windows desktop voice PTT transcription application.

Goal:
Add the startup UX for a missing selected model.

Scope:
- create ui/model_missing_dialog.py
- show a modal warning when the configured model is not found locally
- include actions:
  - Download
  - Choose another model
  - Cancel or Close
- return the user action in a way that the orchestrator can consume later

Constraints:
- keep this dialog independent from actual download implementation
- wording must clearly explain that the selected model is missing from local storage

Expected result:
- the application has a formal UX for missing-model handling at startup

Output requirements:
- modify only files required for this step
- provide a summary of changed files
- provide the exact git commit message:
feat: add missing model dialog for startup model validation

Step 2.3 — Model downloader

Implement Step 2.3 for the Windows desktop voice PTT transcription application.

Goal:
Add a managed model downloader service.

Scope:
- create asr/model_downloader.py
- download a selected model into the configured models directory
- use a temporary staging location before finalizing installation
- validate success before marking the model as available
- report failures such as network errors, cancellation, permission issues, or insufficient disk space
- design the service so it can run asynchronously without blocking the UI

Constraints:
- do not block the UI thread
- keep download logic separate from the dialog layer
- handle partial downloads safely

Expected result:
- the application can attempt managed local installation of a model

Output requirements:
- modify only files required for this step
- add or update tests where appropriate
- provide a summary of changed files
- provide the exact git commit message:
feat: add model downloader service for managed local model installation

Step 2.4 — Fallback model selection after download failure

Implement Step 2.4 for the Windows desktop voice PTT transcription application.

Goal:
Add fallback model selection after a failed download attempt.

Scope:
- handle the flow where model download fails
- show an error message to the user
- offer selection from models already available locally
- if no local models exist, show a clear blocking state instead of proceeding incorrectly
- update the persisted configuration when the user picks a fallback model

Constraints:
- do not silently continue with an invalid configuration
- keep flow orchestration separate from widget internals as much as practical

Expected result:
- the application can recover from download failure by guiding the user to a locally available model when possible

Output requirements:
- modify only files required for this step
- provide a summary of changed files
- provide the exact git commit message:
feat: add fallback model selection flow after download failure

Step 2.5 — Model manager

Implement Step 2.5 for the Windows desktop voice PTT transcription application.

Goal:
Add a model manager for Faster-Whisper lifecycle and backend selection.

Scope:
- create asr/model_manager.py
- support preload of the selected model
- support unload and reload on model change
- support configured backend mode:
  - auto
  - cuda
  - cpu
- report the effective backend actually used
- keep the manager compatible with locally installed models under the configured models directory

Constraints:
- do not block the UI thread for long-running operations
- errors such as missing CUDA must degrade gracefully to CPU when appropriate
- this layer must not depend on UI widgets

Expected result:
- the application has a single lifecycle manager for model loading and backend selection

Output requirements:
- modify only files required for this step
- add or update tests where appropriate
- provide a summary of changed files
- provide the exact git commit message:
feat: add model manager for whisper lifecycle and backend selection

Step 3.1 — Audio device discovery

Implement Step 3.1 for the Windows desktop voice PTT transcription application.

Goal:
Add audio device discovery and selection.

Scope:
- create audio/device_service.py
- enumerate microphone input devices
- determine a default input device
- persist selected input device in configuration
- expose device information for the settings UI

Constraints:
- use sounddevice
- handle absence of microphones without crashing
- keep device enumeration separate from UI logic

Expected result:
- the application can detect microphone devices and persist the user's selection

Output requirements:
- modify only files required for this step
- add or update tests where appropriate
- provide a summary of changed files
- provide the exact git commit message:
feat: add audio device discovery and selection service

Step 3.2 — Audio capture service

Implement Step 3.2 for the Windows desktop voice PTT transcription application.

Goal:
Add buffered audio capture for PTT recording.

Scope:
- create audio/capture_service.py
- add start and stop recording
- buffer PCM audio suitable for later transcription
- enforce a maximum recording duration
- handle device and stream errors safely

Constraints:
- do not block the UI thread
- keep capture logic independent from transcription logic
- make the output format clear and stable for downstream ASR consumption

Expected result:
- the application can record a single PTT audio segment into a buffer

Output requirements:
- modify only files required for this step
- add or update tests where appropriate
- provide a summary of changed files
- provide the exact git commit message:
feat: add ptt audio capture service with buffered recording

Step 3.3 — UI PTT button flow

Implement Step 3.3 for the Windows desktop voice PTT transcription application.

Goal:
Wire the main-window PTT button to the audio capture workflow.

Scope:
- make button press start recording
- make button release stop recording
- update UI status accordingly
- keep this step limited to in-window PTT, without global hotkey support yet

Constraints:
- do not add full transcription in this step
- maintain clear separation between UI event handling and capture service behavior

Expected result:
- PTT works inside the main window using the button interaction alone

Output requirements:
- modify only files required for this step
- provide a summary of changed files
- provide the exact git commit message:
feat: wire ui ptt button to audio capture workflow

Step 4.1 — Hotkey parser and persistence

Implement Step 4.1 for the Windows desktop voice PTT transcription application.

Goal:
Add parsing, validation, and persistence of the configured hotkey.

Scope:
- create hotkeys/hotkey_parser.py
- define a normalized internal representation for key combinations
- support serialization to config and deserialization from config
- validate allowed combinations suitable for global registration on Windows

Constraints:
- keep the representation stable and explicit
- separate parsing logic from the platform registration layer

Expected result:
- the configured hotkey becomes a validated, persistent domain object

Output requirements:
- modify only files required for this step
- add or update tests where appropriate
- provide a summary of changed files
- provide the exact git commit message:
feat: add hotkey parser and persistent hotkey configuration

Step 4.2 — Win32 global hotkey service

Implement Step 4.2 for the Windows desktop voice PTT transcription application.

Goal:
Add global hotkey support using Win32 registration.

Scope:
- create hotkeys/hotkey_service.py
- create platform/windows/hotkey_win32.py
- register and unregister the configured global hotkey
- surface key press and key release events suitable for PTT flow
- detect and report registration conflicts

Constraints:
- use Win32 integration appropriate for a PySide6 desktop app
- avoid burying platform code inside generic service modules
- handle registration failure explicitly

Expected result:
- the application can receive a global PTT hotkey outside the main window

Output requirements:
- modify only files required for this step
- add or update tests where practical
- provide a summary of changed files
- provide the exact git commit message:
feat: add global hotkey service using win32 registration

Step 4.3 — Hotkey settings UI

Implement Step 4.3 for the Windows desktop voice PTT transcription application.

Goal:
Add hotkey configuration to the settings UI.

Scope:
- add a hotkey assignment control in the settings dialog
- validate user input
- save the new hotkey to config
- trigger re-registration of the hotkey after changes
- show user-facing errors for conflicts or invalid combinations

Constraints:
- do not hardcode hotkey behavior into widgets
- preserve configuration consistency if re-registration fails

Expected result:
- users can change the global PTT hotkey from the GUI

Output requirements:
- modify only files required for this step
- provide a summary of changed files
- provide the exact git commit message:
feat: add hotkey settings ui and dynamic re-registration flow

Step 5.1 — Background transcription worker

Implement Step 5.1 for the Windows desktop voice PTT transcription application.

Goal:
Add a background transcription worker for Faster-Whisper.

Scope:
- create asr/transcription_worker.py
- accept a buffered audio segment
- run transcription asynchronously
- return transcript results and error states through signals, callbacks, or another clear mechanism
- keep it compatible with the model manager

Constraints:
- transcription must not block the UI thread
- do not implement target-window insertion in this step
- keep worker logic separated from UI widgets

Expected result:
- audio segments can be transcribed in the background without freezing the interface

Output requirements:
- modify only files required for this step
- add or update tests where appropriate
- provide a summary of changed files
- provide the exact git commit message:
feat: add background transcription worker for faster whisper

Step 5.2 — Main transcription flow in GUI

Implement Step 5.2 for the Windows desktop voice PTT transcription application.

Goal:
Connect the PTT recording flow to the background transcription pipeline.

Scope:
- after recording stops, send audio to the transcription worker
- display status transitions such as:
  - Recording
  - Transcribing
  - Completed
  - Error
- display the resulting transcript in the main window
- do not perform insertion into the target window yet

Constraints:
- keep orchestration logic out of widget code where practical
- handle worker errors without crashing the application

Expected result:
- the application works as a local PTT recorder and transcriber inside its own window

Output requirements:
- modify only files required for this step
- provide a summary of changed files
- provide the exact git commit message:
feat: connect ptt recording flow to background transcription pipeline

Step 5.3 — Runtime mode reporting

Implement Step 5.3 for the Windows desktop voice PTT transcription application.

Goal:
Show effective runtime mode and current operational state.

Scope:
- display configured backend mode
- display effective backend in use
- display CUDA availability
- display selected model
- display whether a model is loaded
- display selected microphone device
- keep the runtime status visible in the main window and/or status panel

Constraints:
- reflect actual runtime state, not only stored configuration
- avoid duplicating probing logic in UI classes

Expected result:
- users can clearly see the current effective runtime environment and major active settings

Output requirements:
- modify only files required for this step
- provide a summary of changed files
- provide the exact git commit message:
feat: add runtime mode reporting for backend model and device state

Step 6.1 — Capture target foreground window

Implement Step 6.1 for the Windows desktop voice PTT transcription application.

Goal:
Capture the target foreground window at PTT start.

Scope:
- create injection/target_window_service.py
- capture the active window handle when recording begins
- validate the handle before later use
- expose the captured target in a way suitable for later injection logic

Constraints:
- do not implement text injection in this step
- keep this service separate from the audio capture and UI layers

Expected result:
- the application can remember the window that was active when PTT started

Output requirements:
- modify only files required for this step
- provide a summary of changed files
- provide the exact git commit message:
feat: capture target foreground window at ptt start

Step 6.2 — Direct text injection

Implement Step 6.2 for the Windows desktop voice PTT transcription application.

Goal:
Add direct text injection into the captured target window.

Scope:
- create injection/text_injector.py
- create or use platform/windows/sendinput_win32.py as needed
- implement default injection mode: direct_typing
- attempt to send transcription text to the captured target window
- log injection success or failure

Constraints:
- use Windows-appropriate input injection
- handle failure explicitly
- keep platform-specific details isolated
- do not add clipboard fallback in this step

Expected result:
- the application can directly type the transcript into the previously captured target window

Output requirements:
- modify only files required for this step
- provide a summary of changed files
- provide the exact git commit message:
feat: add direct text injection into captured target window

Step 6.3 — Clipboard fallback

Implement Step 6.3 for the Windows desktop voice PTT transcription application.

Goal:
Add a clipboard-based fallback injection path.

Scope:
- create injection/clipboard_fallback.py
- add a configurable fallback mechanism to use clipboard paste when direct typing fails or when configured
- preserve or restore clipboard content as reasonably as possible
- keep default injection mode unchanged as direct_typing

Constraints:
- do not change the default injection mode
- do not remove or weaken direct typing support
- handle clipboard access failures safely

Expected result:
- the application has a compatibility fallback for text insertion while retaining direct typing as the default mode

Output requirements:
- modify only files required for this step
- provide a summary of changed files
- provide the exact git commit message:
feat: add clipboard fallback mode for text injection

Step 6.4 — End-to-end PTT to target flow

Implement Step 6.4 for the Windows desktop voice PTT transcription application.

Goal:
Implement the full end-to-end pipeline from PTT to target-window insertion.

Scope:
- on hotkey press:
  - capture target window
  - start recording
- on hotkey release:
  - stop recording
  - transcribe audio
  - inject the transcript into the captured target window
- update UI state across the full flow
- log major lifecycle events across the pipeline

Constraints:
- keep orchestration structured and maintainable
- do not hide failures
- do not block the UI thread

Expected result:
- the core product scenario works end to end:
  PTT -> audio capture -> transcription -> insertion into the original target window

Output requirements:
- modify only files required for this step
- provide a summary of changed files
- provide the exact git commit message:
feat: implement end to end ptt transcription and target injection flow

Step 7.1 — History store

Implement Step 7.1 for the Windows desktop voice PTT transcription application.

Goal:
Add a SQLite-based transcription history store.

Scope:
- create history/history_store.py
- define a SQLite schema for history records
- store:
  - timestamp
  - selected model
  - effective backend
  - audio duration
  - transcript text
  - injection status
  - error text if applicable
- store the database under %APPDATA%\VoicePTT\history.db

Constraints:
- keep the storage layer independent from UI
- keep schema explicit and versionable for future migrations

Expected result:
- the application has persistent local history storage for transcription sessions

Output requirements:
- modify only files required for this step
- add or update tests where appropriate
- provide a summary of changed files
- provide the exact git commit message:
feat: add sqlite based transcription history store

Step 7.2 — Persist sessions into history

Implement Step 7.2 for the Windows desktop voice PTT transcription application.

Goal:
Persist transcription sessions into the history store.

Scope:
- write successful transcription sessions to history
- write failed sessions with useful metadata and error text
- integrate history writes into the main workflow without destabilizing it

Constraints:
- history write failures must not crash the app
- preserve major session metadata for later user review

Expected result:
- transcription activity is persisted and can be reviewed later

Output requirements:
- modify only files required for this step
- provide a summary of changed files
- provide the exact git commit message:
feat: persist transcription sessions into history store

Step 7.3 — Configurable history retention

Implement Step 7.3 for the Windows desktop voice PTT transcription application.

Goal:
Add configurable history retention with pruning.

Scope:
- create history/history_pruner.py
- enforce a maximum history size
- use default history limit = 1000
- remove oldest records when the configured limit is exceeded
- keep retention logic configurable from the central config

Constraints:
- pruning must be deterministic and safe
- do not couple pruning logic to UI classes

Expected result:
- transcription history is automatically bounded by a configurable maximum record count

Output requirements:
- modify only files required for this step
- add or update tests where appropriate
- provide a summary of changed files
- provide the exact git commit message:
feat: add configurable history size limit and pruning logic

Step 7.4 — History dialog UI

Implement Step 7.4 for the Windows desktop voice PTT transcription application.

Goal:
Add a history browsing dialog.

Scope:
- create ui/history_dialog.py
- show history records in a table or list
- allow viewing transcript content and metadata
- allow copying transcript text
- allow deleting individual records
- surface useful metadata such as model, backend, timestamp, and injection status

Constraints:
- keep data access separate from widget code where practical
- do not embed SQL directly in UI classes

Expected result:
- users can browse and work with stored transcription history from the GUI

Output requirements:
- modify only files required for this step
- provide a summary of changed files
- provide the exact git commit message:
feat: add history dialog for browsing and copying transcripts

Step 8.1 — Logging settings UI integration

Implement Step 8.1 for the Windows desktop voice PTT transcription application.

Goal:
Add logging configuration to the settings UI.

Scope:
- add controls for:
  - log level
  - log directory under %APPDATA% or a user-selected subpath
  - log file name
  - rotation size
  - backup count
- apply changes through the logging service
- keep configuration persistent

Constraints:
- do not require manual editing of config files
- keep logging reconfiguration safe and explicit

Expected result:
- users can configure logging behavior from the GUI

Output requirements:
- modify only files required for this step
- provide a summary of changed files
- provide the exact git commit message:
feat: add logging settings ui and runtime reconfiguration support

Step 8.2 — Model and backend settings UI integration

Implement Step 8.2 for the Windows desktop voice PTT transcription application.

Goal:
Add model and backend settings to the GUI.

Scope:
- add model selection controls
- add models directory control
- add backend mode control:
  - auto
  - cuda
  - cpu
- display the effective backend separately from the configured backend
- trigger model reload when appropriate
- keep supported model choices aligned with the model registry layer

Constraints:
- do not duplicate model discovery logic inside widgets
- configuration updates must remain consistent if reload fails

Expected result:
- users can manage ASR model and backend configuration from the GUI

Output requirements:
- modify only files required for this step
- provide a summary of changed files
- provide the exact git commit message:
feat: add model and backend settings ui with reload support

Step 8.3 — History settings UI integration

Implement Step 8.3 for the Windows desktop voice PTT transcription application.

Goal:
Add history settings and maintenance controls to the GUI.

Scope:
- add control for maximum history size
- initialize it with the default value of 1000
- add manual clear-history action
- display current history usage summary if practical

Constraints:
- keep retention logic in the history subsystem, not in widget code
- manual deletion and bulk cleanup must be deliberate and explicit

Expected result:
- users can manage history retention policy and cleanup from the settings UI

Output requirements:
- modify only files required for this step
- provide a summary of changed files
- provide the exact git commit message:
feat: add history retention settings and manual cleanup actions

Step 9.1 — Central application orchestrator

Implement Step 9.1 for the Windows desktop voice PTT transcription application.

Goal:
Introduce a central orchestrator for major workflows.

Scope:
- create or complete core/orchestrator.py
- centralize the main workflows:
  - startup validation
  - missing model flow
  - PTT flow
  - transcription flow
  - injection flow
  - history persistence flow
- reduce workflow scattering across UI modules

Constraints:
- keep orchestration logic testable
- do not turn the orchestrator into a dumping ground for low-level platform details
- preserve existing behavior while improving structure

Expected result:
- the application has a clear central coordination layer for end-to-end workflows

Output requirements:
- modify only files required for this step
- add or update tests where appropriate
- provide a summary of changed files
- provide the exact git commit message:
refactor: introduce central application orchestrator for major workflows

Step 9.2 — Error handling hardening

Implement Step 9.2 for the Windows desktop voice PTT transcription application.

Goal:
Harden workflow error handling and user-facing diagnostics.

Scope:
- add consistent error mapping and user-facing messages for:
  - missing selected model
  - download failure
  - microphone unavailable
  - CUDA unavailable or unusable
  - model load failure
  - injection failure
- eliminate silent failure paths where practical
- improve diagnostic logging across these scenarios

Constraints:
- do not overcomplicate the architecture
- preserve clear separation between low-level errors and user-facing messages

Expected result:
- major operational failures are handled predictably and communicated clearly to the user

Output requirements:
- modify only files required for this step
- provide a summary of changed files
- provide the exact git commit message:
feat: harden workflow error handling and user facing diagnostics

Step 10.1 — PyInstaller packaging

Implement Step 10.1 for the Windows desktop voice PTT transcription application.

Goal:
Add PyInstaller-based Windows packaging.

Scope:
- create packaging/pyinstaller/app.spec
- include required resources such as icons and Qt plugins
- ensure the built application can start as a packaged EXE
- document any packaging-specific runtime considerations

Constraints:
- keep packaging reproducible
- do not hardcode machine-specific absolute paths unless clearly templated or configurable

Expected result:
- the project has a working PyInstaller packaging definition for Windows EXE delivery

Output requirements:
- modify only files required for this step
- provide a summary of changed files
- provide the exact git commit message:
build: add pyinstaller spec for windows executable packaging

Step 10.2 — Release profiles and deployment notes

Implement Step 10.2 for the Windows desktop voice PTT transcription application.

Goal:
Add release profiles and deployment requirements documentation.

Scope:
- document CPU build profile
- document CUDA-capable build profile
- document runtime prerequisites and deployment expectations
- include notes about logs under %APPDATA%, models under C:\models\, history DB location, and default behavior such as direct typing and default history limit of 1000

Constraints:
- documentation must reflect the actual implemented architecture
- keep operational guidance clear and concise

Expected result:
- release packaging and deployment expectations are explicitly documented

Output requirements:
- modify only files required for this step
- provide a summary of changed files
- provide the exact git commit message:
docs: add release profiles and deployment requirements for cpu and cuda builds

Step 11.1 — Unit tests for core services

Implement Step 11.1 for the Windows desktop voice PTT transcription application.

Goal:
Add unit tests for core services.

Scope:
- add unit tests for:
  - config service
  - logging service
  - model locator or registry
  - hotkey parser
  - history pruning
- keep the tests isolated and deterministic

Constraints:
- do not rely on actual GPU presence
- avoid brittle tests tied to external network state

Expected result:
- core logic has baseline automated coverage

Output requirements:
- modify only files required for this step
- provide a summary of changed files
- provide the exact git commit message:
test: add unit coverage for configuration model and history services

Step 11.2 — Integration tests for orchestration

Implement Step 11.2 for the Windows desktop voice PTT transcription application.

Goal:
Add integration tests for major orchestration scenarios.

Scope:
- add integration tests for:
  - startup with missing model
  - fallback after failed download
  - PTT to transcription workflow
  - history persistence
- use mocks or controlled substitutes where direct platform interaction would otherwise make tests brittle

Constraints:
- keep tests meaningful without depending on real network downloads or real GPU hardware
- preserve a clear line between unit and integration scope

Expected result:
- major user workflows have automated integration-level validation

Output requirements:
- modify only files required for this step
- provide a summary of changed files
- provide the exact git commit message:
test: add integration tests for startup model flow and transcription pipeline

Step 11.3 — Manual QA checklist

Implement Step 11.3 for the Windows desktop voice PTT transcription application.

Goal:
Add a manual QA checklist for Windows validation.

Scope:
- create a manual QA checklist covering:
  - tray behavior
  - hotkey conflicts
  - CPU and CUDA switching
  - missing model UX
  - failed download fallback
  - direct typing insertion
  - clipboard fallback behavior
  - logging configuration under %APPDATA%
  - history retention behavior with default limit 1000 and custom values
  - packaged EXE smoke test

Constraints:
- keep the checklist actionable and concise
- reflect the actual implemented features

Expected result:
- the project includes a practical manual validation checklist for release readiness

Output requirements:
- modify only files required for this step
- provide a summary of changed files
- provide the exact git commit message:
docs: add manual qa checklist for windows voice ptt application