Skip to content

feat(speech): on-demand offline speech engine via verified release asset (PRD 10.2.4) - #760

Merged
accesswatch merged 2 commits into
mainfrom
feature/on-demand-speech-engine
Jun 29, 2026
Merged

feat(speech): on-demand offline speech engine via verified release asset (PRD 10.2.4)#760
accesswatch merged 2 commits into
mainfrom
feature/on-demand-speech-engine

Conversation

@accesswatch

Copy link
Copy Markdown
Contributor

What

The first safe slice of the AI footprint/optimization plan: a reliable, verified path for fetching a redistributable component from QUILL's own GitHub release asset, wired as Tools → Speech → Download Offline Speech Engine... The whisper.cpp engine stays bundled in the installer, so this is a recovery/optional path — capability never depends on a download.

Decision honored (no risk)

  • Only whisper.cpp (MIT) is re-hosted — published to a dedicated, not-latest assets-v1 release (tag does not match v*, so it never triggers the release workflow or the update feed).
  • Nothing is unbundled from the installer.
  • License-unclear engines (DECtalk, eSpeak GPL) and ffmpeg are not re-hosted.

Reliable acquisition (PRD 10.2.3/10.2.4)

quill/core/release_assets.py (new, wx-free):

  • Pinned + SHA-256-verified; is_pinned() refuses placeholder SHAs and moving refs (latest/head/main/master).
  • HTTPS-only, retry-with-backoff, resumable download (HTTP Range — closes the gap the PRD flagged).
  • Atomic verified install: download to a temp dir → verify SHA → copy in; a partial/failed download never half-installs.
  • Safe-Mode gated; GATE-9 egress entry added; clean errors for graceful degradation.

Installs into <data>/speech-engine, which resolve_whisper_executable() already searches.

Verified end-to-end

Ran the real path against the published asset: it downloads from …/releases/download/assets-v1/whisper-bin-x64.zip, SHA-256-verifies, and unpacks whisper-cli.exe + 14 DLLs. Plus 6 unit tests (pin/guard, Safe Mode, unknown component, unpinned refusal, checksum mismatch, verify-then-unpack) — no network.

UI

download_offline_speech_engine() mirrors the proven download_ffmpeg handler (confirm → cancelable progress → worker thread → SHA-verified install), with the #748 whole-percent throttle. New "Download Offline Speech Engine..." item in Tools → Speech.

Docs (all sources)

CHANGELOG, release notes (0.8.1 Beta 1), user guide (Offline transcription section), main PRD (§5.25c), planning roadmap (§1.2) + linkage to the AI-Optimization PRD. HTML/EPUB regenerated for every edited doc.

Gates

ruff clean; GATE-9 (no-silent-network) OK; GATE-11 budgets rebaselined (handlers live with the other download_* siblings) with a dated note; mypy clean on the core module.

🤖 Generated with Claude Code

…set (PRD 10.2.4)

First safe slice of the AI footprint/optimization plan: a reliable acquisition path
that fetches a redistributable component from QUILL's own pinned, SHA-256-verified
GitHub release asset. The engine stays bundled in the installer, so this is a
recovery/optional path and capability never depends on a download.

- quill/core/release_assets.py (new, wx-free): pinned manifest (whisper.cpp -> our
  assets-v1 release, SHA-256), is_pinned() guard (refuses placeholder SHAs / moving
  refs), HTTPS-only retry + RESUMABLE download (HTTP Range), atomic verified install
  (temp -> verify -> copy), Safe-Mode gate, clean errors for graceful degradation.
  Verified end-to-end against the published asset (downloads, verifies, unpacks
  whisper-cli.exe + DLLs).
- Tools > Speech > Download Offline Speech Engine... : download_offline_speech_engine()
  worker (mirrors download_ffmpeg) + menu item/id/binding. Installs into
  <data>/speech-engine, which resolve_whisper_executable() already searches.
- GATE-9: new egress site audited. GATE-11: main_frame_speech/main_frame_menu
  rebaselined (handlers live with the other download_* siblings).
- Published the MIT whisper.cpp v1.9.1 engine to the non-latest assets-v1 release.
- Docs everywhere: CHANGELOG, release notes, user guide, main PRD (5.25c), planning
  roadmap + AI-Optimization PRD linkage. Regenerated HTML/EPUB for edited docs.

Scope-limited per decision: only the MIT whisper.cpp engine is re-hosted; nothing
is unbundled from the installer; license-unclear engines (DECtalk/eSpeak) and ffmpeg
are NOT re-hosted.

Tests: 6 unit tests (pin/guard/safe-mode/unknown/checksum-mismatch/unpack) pass;
ruff + GATE-9 + GATE-11 green.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
…erization snapshot (#760)

The on-demand engine download added a public MainFrame method; update the
characterization fixture so the snapshot guard (and the unit-test suite) pass.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
@accesswatch
accesswatch merged commit 8fa7106 into main Jun 29, 2026
14 checks passed
@accesswatch
accesswatch deleted the feature/on-demand-speech-engine branch June 29, 2026 17:44
accesswatch added a commit that referenced this pull request Jun 29, 2026
…downloads (PRD 10.2.4) (#764)

* feat(packaging): unbundle Kokoro voices -> on-demand verified download (PRD 10.2.4)

Proof-of-concept unbundle that actually shrinks the installer ~120 MB, taken
safely. The Kokoro neural voices are no longer staged into the installer; they
download on demand from QUILL's pinned, SHA-256-verified release asset
(kokoro-models.zip on assets-v1) to %APPDATA%/kokoro-models, which the runtime
prefers.

Upgraders are protected automatically (verified): Inno only overlays new [Files]
and never removes old ones, [InstallDelete] does not touch kokoro-models, and
runtime resolution still checks {app}/kokoro-models -- so a user upgrading from a
release that bundled Kokoro keeps their copy with nothing to re-download. Kokoro is
"safe to unbundle": other read-aloud voices (DECtalk/eSpeak/Piper/SAPI) work offline
meanwhile.

- release_assets.py: add the pinned "kokoro" entry; add should_cancel/DownloadCancelled
  (cancel handled in-module, not via a swallowed progress-raise) and a `version` field
  (groundwork for newer-version notifications); the whisper handler uses should_cancel too.
- _download_kokoro_models: route through release_assets; SMART re-download -- if the
  voices are already present it offers to replace rather than silently re-fetching
  ~120 MB, and declining keeps the existing copy.
- build: stop staging Kokoro by default (still possible via --kokoro-dir for portable);
  remove the speechkokoro component + kokoro-models [Files] from the installer; iss
  regenerated; iss test updated to assert absence.
- Docs everywhere (CHANGELOG, release notes, user guide, PRD 5.25c, roadmap).
- Builds on #760 (release_assets). GATE-9/GATE-11 green; e2e verified against the
  published asset (downloads, verifies, unpacks the 88 MB model + 26 MB voices).

Co-Authored-By: Claude Opus 4.8 <[email protected]>

* feat(packaging): unbundle whisper.cpp too -> on-demand verified download (PRD 10.2.4)

Per decision, fully unbundle the offline speech engine like Kokoro. whisper.cpp is
no longer staged into the installer; fresh installs download the ~8 MB engine on
demand from QUILL's pinned, SHA-256-verified release asset (assets-v1) to
%APPDATA%/speech-engine, which the runtime searches.

Protected at point of use (it is the default offline engine): the dictation
pre-flight now OFFERS to download it ("Download it now? ~8 MB, verified") instead of
just pointing at a menu, so a fresh install is never stranded. The provider's
not-installed guidance points at Tools > Speech > Download Offline Speech Engine.

Upgraders keep their existing {app}/tools/speech/whispercpp copy automatically
(Inno never removes it; [InstallDelete] does not touch it; resolver still checks it).

- build: stop auto-staging whisper (still stageable via --whisper-dir); remove the
  speechwhisper component + whispercpp [Files]; iss regenerated.
- tests updated (bundledTools/speechAssets/iss assertions assert absence).
- docs updated everywhere (CHANGELOG, release notes, user guide, PRD 5.25c).
- GATE-9/GATE-11 green; main_frame_dictation_hotkeys rebaselined (+12 for the offer).

Co-Authored-By: Claude Opus 4.8 <[email protected]>

---------

Co-authored-by: Claude Opus 4.8 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant