Files
VoiceStudio/docs/DESKTOP_RELEASE.md
T
Palash DebnathandClaude Opus 5 41722afe3b refactor(launchpad): quieter, borderless design refresh (#1515)
* refactor(launchpad): quieter, borderless design refresh

The launchpad carried decoration from an earlier direction: icon chips,
corner-hung count badges, a permanently visible filled arrow, uppercase
mono card titles, and a dotted stipple divider — plus a frame that had
been invisible since the app-wide border tokens were zeroed.

Rework it around what the borderless direction actually implies:

- Feature tiles get a whisper-faint surface instead of a dead frame, and
  read as three bands (bare glyph + count / title + arrow / description).
  `--card-hue` is spent sparingly — the glyph at rest, the surface, count
  and arrow only once raised. Titles move to sans sentence case; counts
  are plain tabular numerals. Lift softened 4px -> 2px, coloured glow ->
  neutral shadow, plus an explicit focus ring and a staggered entrance.
- Hero drops the boxed "646" pill and the filled A/B-Compare button for
  quiet type, with a hairline standing in for the separation.
- Section labels trade the dotted stipple for a single fading hairline;
  rows are transparent until hover and reveal "Open" on hover/focus (it
  stays in the DOM, so AT and keyboard always reach it).
- Hero, tiles, recent files, callout and project lists now share one
  1180px column — previously only the top half was capped, so lists ran
  edge-to-edge on a wide display while the deck stayed centred.

Two bugs found and fixed while doing it:

- Buttons that had `border border-solid border-transparent` removed fell
  back to the UA default border and rendered a visible 1px outline. They
  now carry `border-0` explicitly.
- `.lp-animate` used `animation-fill-mode: both`, so after the entrance
  it kept owning `transform` — and animation-origin declarations outrank
  normal ones, which silently killed the card hover lift. Now `backwards`,
  which still holds the from-state through the stagger delay.

Also drops CSS the page has not rendered since #904: the cursor-spotlight
layer, the breath ring, and the per-card waveform strip.

Verified with headless renders at 1600/1280/940 and the empty state.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

* fix(dictation): decode Wayland portal signals and show the capture pill

The GlobalShortcuts portal declares Activated/Deactivated as
(o session, s shortcut_id, t timestamp, a{sv} options). We decoded the
timestamp as u32, so zbus rejected every signal with

  Signature mismatch: got `(osta{sv})`, expected `(osua{sv})`

and the press was dropped as an invalid signal. Registration succeeded
and the desktop even reported the bound chord back, so the hotkey looked
wired up while doing nothing at all — on every Wayland compositor, for
the whole life of the feature (#1490). Decode the 64-bit timestamp, and
keep the 32-bit spelling as a fallback so a non-conforming portal
degrades to working rather than to silence.

With presses arriving, the second half of the failure showed: nothing
had shown the widget window since it became a hidden recorder host, so a
capture ran with no pill on screen — and a mic or Accessibility failure
rendered into a window nobody could see. Add show_dictation_pill, which
bottom-centres the capsule on the monitor under the pointer and shows it
without taking focus (Windows keeps SW_SHOWNOACTIVATE so paste still
lands in the user's document), and call it from the widget for every
state but idle. Wayland denies clients their own placement, so the
compositor picks the spot there; the pill still appears.

dispatch_dictation_capture now logs whether a press was emitted or
queued — a press that reaches Rust and produces nothing was otherwise
indistinguishable from one the compositor never delivered.

Tests: portal signals decode at both timestamp widths (the 64-bit case
fails before this change with the exact production error); pill
placement centres, respects a second monitor's origin, and clamps rather
than going off-screen; the widget shows for a state needing the user,
stays hidden while idle, and never shows for a press that arrives while
dictation is disabled.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

* chore: sync in-progress workspace changes

Uncommitted work already in the tree, checkpointed so the branch matches
the local machine:

- Remote GPU workers: join-from-the-app flow, one-time secrets, QR join
  codes, a Compute control in the status bar, and the device-list
  Workers panel (#1516)
- Model Catalogue workspace, with Settings pointing at it
- Settings sidebar search and keyboard navigation
- Demo assets for dubbing, dictation and voice design, plus the scripts
  that render them
- Backend: validation-error handling, ASR request-path degradation, and
  the accompanying tests
- CHANGELOG entries for the above and for the Wayland dictation fix

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

* fix(tests): follow Engines to the Model Catalogue, and green the sweep

- test_supertonic3 asserted the license gate points at "Settings" while
  the engine now names Model Catalogue → Engines, which is where the
  accept button actually lives. The assertion follows the move; what it
  pins is unchanged — the hint must name a place the user can reach it.
- Carries the CJK allowlist entries for the rendered dub bundle (#1517)
  and the regenerated route snapshot for /workers/agent (#1516), both of
  which this branch inherits from the workspace sync.
- docs/install/linux.md: the dictation capsule is bottom-anchored
  everywhere except Wayland, where the protocol gives applications no
  say in their placement. Documented rather than left as a surprise
  (CodeRabbit).

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

* ci: stop a flaky dependency fetch from failing green runs

en-core-web-sm resolves to a direct GitHub release URL, and github.com
intermittently answers `http2 error: refused stream before processing
any application logic`. uv's own three retries all land within the same
few seconds and fail together, so the whole job dies on a dependency
that has nothing to do with the change under test — it cost #1518 and
#1517 an otherwise-green run tonight.

Two changes: back off between whole `uv sync` attempts, which is what
actually clears it, and pass --no-sync to the pytest steps. `uv run`
re-resolves the environment before running, so every test step was a
fresh chance to hit the same fetch even though the install step had
already synced — that is exactly how #1518 failed, in the isolated
backend/tests step, with all 5467 tests already passed.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

* ci: one retry seam for every uv sync, not just the job that failed last

en-core-web-sm resolves to a direct GitHub *release* URL rather than a
package index, and github.com intermittently answers `http2 error:
refused stream before processing any application logic`. uv's own
retries all land inside the same ~10 seconds and fail together, so a job
dies on a dependency unrelated to the change under test. Tonight that
cost four otherwise-green runs across #1515, #1517 and #1518 — and the
first fix only covered the Tests job, so the next failure simply moved
to Smoke (Linux), which syncs separately.

The fetch is per-job, so the fix has to be per-job: scripts/uv-sync-retry.sh
backs off between whole attempts (15s, 45s, 90s) and every workflow that
syncs now goes through it — ci.yml (tests + the platform matrix),
release.yml, security.yml, evals.yml. It still fails loudly after four
attempts, so a genuinely broken lockfile is not disguised as a flake.

The Tests job also lacked the UV_HTTP_TIMEOUT / UV_HTTP_RETRIES the smoke
matrix has always set, which is part of why it was the one that kept
dying; it has them now.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

* test(ci): pin the Intel-Mac contract by intent, not by command spelling

test_ci_verifies_intel_mac_as_the_documented_remote_only_host asserted
the literal line `run: uv sync --extra pockettts`, so routing every sync
through scripts/uv-sync-retry.sh read as a broken Intel-Mac contract. The
contract it exists to protect is that the pockettts extra installs ONLY
on backend_supported legs — which the regex now pins, while leaving how
the sync is invoked free to change.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

* ci: keep every uv run out of the resolver, and bound the retry budget

CodeRabbit, #1517:

- `uv run` re-resolves before running, so the smoke suite, the
  worker-artifact tests, the release test run and the eval run were each
  a fresh chance to hit the flaky direct-URL fetch outside the retry
  loop. All of them pass --no-sync now; the environment is already
  synced by the step that owns the retries. security.yml's
  `uv run --with pip-audit` is deliberately left alone — it layers an
  ephemeral package rather than running the project's own tests.
- The retry count multiplied uv's own budget (UV_HTTP_RETRIES=5 with a
  120 s timeout on the smoke matrix). Three attempts and 60 s of total
  backoff outlast the refusals actually observed while staying well
  inside the jobs' timeout-minutes.
- The Intel-Mac contract test pinned the smoke command literally too, so
  --no-sync tripped it exactly like the sync line did. Same fix: assert
  the contract (smoke runs only on backend_supported legs), not its
  spelling.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-12 23:46:07 +00:00

13 KiB
Raw Blame History

Desktop release plan — VoiceStudio

A shippable macOS (and eventually cross-platform) desktop release where the user drags the .app to Applications, double-clicks once, and does everything else from the UI — dependency runtime, model weights, first-run consent, all inside the app.

Stack: Tauri v2 + FastAPI sidecar + PyInstaller. Target: ~500 MB signed + notarized arm64 DMG, with matching Windows .msi/.nsis later. Large optional payloads (CUDA libs, extra model packs) ship as separate lazy-download tarballs, not in the base DMG.


Target architecture

Layer Contents Ships in DMG?
Tauri v2 shell (Rust) Native window, process lifecycle, filesystem paths Yes
Frontend bundle React/Vite build in .app/Contents/Resources/dist/ Yes
FastAPI sidecar binary PyInstaller-frozen omnivoice-backend with Python + torch + mlx + soundfile + demucs + yt_dlp + omnivoice TTS Yes (~400–500 MB bundle)
ffmpeg arm64 binary in .app/Contents/Resources/bin/ Yes (~20 MB)
Model weights (VoiceStudio TTS, MLX Whisper) ~/Library/Application Support/OmniVoice/models/ No — first-run download
Optional engine packs (VoxCPM2 CUDA, pyannote, MOSS-TTS) Separate .tar.gz via GitHub Releases manifest No — first-run download if user opts in

Target DMG size: ~500 MB. First-run model download: ~2.4 GB one-time (the TTS model is the only required download; ASR/transcription models are optional per-platform curated picks installed on demand from the wizard or Settings).


Four key techniques

1. Sidecar port-reuse dance (dev ergonomics + crash recovery)

Tauri's startup flow:

  1. Check if 127.0.0.1:17493/health responds.
  2. If yes, verify JSON shape: status == "healthy", model_loaded: bool, gpu_available: bool. If valid, attach to the existing process instead of spawning.
  3. If a legacy port (8000) has an orphan, kill via lsof -ti :8000 | xargs kill -9.
  4. Otherwise spawn the frozen backend sidecar via Tauri's externalBin.
  5. On app close: send SIGTERM, wait 2 s, SIGKILL if still alive.

Why this matters: you can still uv run uvicorn … in dev and Tauri cooperates. Restarting a crashed backend is a port-probe, not a process-kill dance.

Our files to touch: frontend/src-tauri/src/lib.rs (replace current find_project_root / uv run logic with port-probe + externalBin launch).

2. tqdm → SSE progress for HuggingFace downloads

Our backend/utils/hf_progress.py is ~80 lines:

from huggingface_hub.utils import _tqdm as hf_tqdm_module
from tqdm.auto import tqdm as base_tqdm

class TrackedTqdm(base_tqdm):
    def update(self, n=1):
        super().update(n)
        callback(self.desc or "download", self.n, self.total)

# Monkey-patch once at startup — every hf_hub_download() across every
# library (transformers, diffusers, accelerate, mlx_whisper) now reports.
hf_tqdm_module._original_tqdm_class = hf_tqdm_module.tqdm_class
hf_tqdm_module.tqdm_class = TrackedTqdm

Pipe callbacks to a new /setup/download/stream SSE endpoint. React subscribes with EventSource, renders per-file progress bars, locks the rest of the UI until models are ready.

Zero changes to calling code. Every mlx_whisper.load_model(...) now reports progress for free.

Our files to add: backend/utils/hf_progress.py + backend/api/routers/setup.py with /setup/status and /setup/download/stream endpoints. Frontend src/pages/SetupWizard.jsx that renders when /setup/status says models aren't present.

3. Two-tier binary: small base DMG + lazy optional payloads

We exclude every nvidia.* wheel from the Apple Silicon build (saves ~2 GB) and ship CUDA libs in a separate cuda-libs-cu128-v1.tar.gz (~2 GB), referenced by cuda-libs.json on the release.

For us:

  • Base DMG ships MPS + MLX path only. Excludes nvidia.*, triton, flash-attn, anything CUDA-specific in the spec.
  • Optional pack: VoxCPM2 (requires CUDA). Not installed by default. Model Catalogue → Engines → "Install VoxCPM2" triggers download from our voxcpm2-cu128-v1.tar.gz release asset.
  • Optional pack: pyannote (HF-token gated). Default off. Settings → Speaker diarisation → "Enable" prompts for HF token, downloads + installs.
  • Optional pack: MOSS-TTS-Nano. Same pattern.

Manifest format for cuda-libs.json:

{
  "url": "https://github.com/.../releases/download/v0.1.0/voxcpm2-cu128-v1.tar.gz",
  "sha256": "…",
  "size_bytes": 2100000000,
  "extract_to": "packs/voxcpm2"
}

4. PyInstaller spec + runtime hooks

Starting point: our existing backend.spec (already rewritten this session).

Two runtime hooks we need:

  • pyi_rth_numpy_compat.py — fixes a numpy compat shim that PyInstaller misses.
  • pyi_rth_torch_compiler_disable.py — disables torch.compile code paths that break under frozen imports.

Exclude list (saves space on Apple Silicon build):

excludes = [
    'nvidia.cublas', 'nvidia.cudnn', 'nvidia.cuda_runtime',
    'nvidia.nccl', 'nvidia.nvtx',
    'triton', 'flash_attn',
    'tkinter', 'matplotlib.backends._tkagg',
]

Hidden-imports to add (iterative — fix as PyInstaller errors surface):

  • mlx.core, mlx.nn
  • omnivoice, omnivoice.models.omnivoice
  • soundfile._soundfile
  • demucs.separate, demucs.pretrained
  • huggingface_hub.repocard_data

Phased execution plan

Each phase produces a testable artifact. Don't proceed to the next phase until the current one verifies end-to-end.

Phase A — Frozen backend works (3–5 h, highest risk)

Deliverable: dist/omnivoice-backend/omnivoice-backend runs standalone + serves the full API.

  1. Add two runtime hooks to backend/hooks/.
  2. Update backend.spec with the exclude list + the runtime hook paths.
  3. Run uv run pyinstaller backend.spec --noconfirm --clean.
  4. Iterate on hidden-imports until ./dist/omnivoice-backend/omnivoice-backend starts cleanly and /system/info returns 200.
  5. End-to-end smoke: transcribe the Fireship fixture → generate dub in Spanish → verify output audio exists.

Verify: curl -sf http://127.0.0.1:17493/system/info on the frozen binary returns JSON in <2 s.

Fail-path: if PyInstaller can't bundle after 5 hours, pivot to "ship a portable .venv inside .app/Contents/Resources/" — uglier, reliably works. Adds ~300 MB but skips PyInstaller drama.

Phase B — Tauri launches the frozen sidecar (2 h)

Deliverable: bun run desktop launches a dev .app that uses the frozen backend, not uv run.

  1. Rewrite frontend/src-tauri/src/lib.rs's setup hook:
    • Check port 17493 first (port-reuse dance).
    • If free, launch the bundled Contents/Resources/backend/omnivoice-backend via Tauri's shell_plugin::Command.
    • Kill orphans on port 8000 (legacy).
  2. Wire tauri.conf.json bundle.resources to include ../../dist/omnivoice-backend/** and binaries/ffmpeg.
  3. Change backend's default port from 8000 → 17493 (new namespace, fewer conflicts with other dev tools).

Verify: launch the dev app with bun run desktop — window opens, segment table loads, test ingest-url works.

Phase C — First-run model download UI (4–6 h)

Deliverable: fresh app on a machine with no cached HF models walks user through download with live progress.

  1. Implement hf_progress.py — ~80 LOC.
  2. New backend/api/routers/setup.py:
    • GET /setup/status → { models_ready: bool, missing: [...], disk_free_gb: number }.
    • GET /setup/download/stream → SSE: { type: "progress", file, bytes, total, pct } then { type: "done" }.
  3. Frontend src/pages/SetupWizard.jsx:
    • Shown when /setup/status says models missing.
    • Per-file progress bars driven by the SSE stream.
    • Disk-space check; error state if <10 GB free.
    • Retry on network failure.
  4. App-level route guard: if setupWizardNeeded, render <SetupWizard> instead of <Launchpad>.

Verify: move/rename ~/Library/Application Support/OmniVoice/models/ — launch app — wizard shows up — progress bars tick — models download — UI unlocks.

Phase D — DMG build + clean-machine test (2–3 h)

Deliverable: signed-but-not-notarized DMG that works on a virgin Mac after right-click → Open.

  1. bun run tauri build (via scripts/build_desktop.sh we'll add).
  2. Artifact: frontend/src-tauri/target/release/bundle/dmg/VoiceStudio_0.1.0_aarch64.dmg.
  3. Copy to a fresh macOS user account (or a second Mac).
  4. Right-click → Open once, walk the wizard, dub the Fireship fixture.
  5. Fix whatever breaks.

Verify: target Mac with NO development tools installed can dub a YouTube URL in the target language end-to-end.

Phase E — (optional) Signed + notarized

Deliverable: DMG that opens without Gatekeeper override.

Requires:

  • Apple Developer ID (~$99/yr).
  • Code-signing cert, App Store Connect API key.
  • GitHub Actions workflow (.github/workflows/release.yml):
    • apple-actions/import-codesign-certs@v3
    • tauri-apps/tauri-action@v0.6 with APPLE_SIGNING_IDENTITY + APPLE_API_KEY + APPLE_API_ISSUER + APPLE_PROVIDER_SHORT_NAME
    • Explicit DMG re-notarize step — macOS 15 Sequoia rejects DMGs that wrap a signed .app but aren't themselves notarized. Run xcrun notarytool submit --wait + xcrun stapler staple on the DMG, re-upload as release asset.

Cross-platform extension (future)

Targets: macOS arm64 + macOS x64 + Windows x64 (.msi, .nsis, .exe). Linux is best-effort.

We can mirror this by extending the CI matrix once Phases A–D are green:

Target Runner PyInstaller variant Notes
macOS Apple Silicon macos-14 (ARM) backend.spec (MPS/MLX) Our primary
macOS Intel macos-13 backend.spec (MPS/x64 torch) MLX absent — falls back to CPU Whisper
Windows x64 (NVIDIA) windows-2022 backend.spec + --bootloader + CUDA Requires second CUDA tarball (cuda-libs-cu128-v1.tar.gz)
Linux x64 ubuntu-22.04 backend.spec Best-effort — untested

Each platform's first build will take the longest (PyInstaller hidden-import tuning is per-OS). Subsequent builds reuse the spec.

Honest caveat: Windows is a whole separate set of headaches — mlx_whisper doesn't exist there, pyannote + soundfile have different wheel sources, signing requires a separate Windows code-signing cert. Add 1 full session per additional platform.

For our current goal (friend on the same M2 air), stop at Phase D. Cross-platform is a later conversation once macOS is solid.


Risks & mitigations

Risk Likelihood Mitigation
PyInstaller can't bundle torch Metal libs Medium Use collect_all(...) calls for torch + MLX. Fallback: portable .venv approach
torch.compile breaks under frozen imports Certain pyi_rth_torch_compiler_disable.py runtime hook
DMG size >800 MB Medium Keep nvidia/triton/matplotlib out of the spec; defer optional packs to lazy download
First-run download fails halfway Medium SSE retry + resumable hf_hub_download (supported natively). Show disk-space check upfront
Gatekeeper blocks unsigned app Certain Document right-click → Open as the one-time step. Long-term: buy Apple Developer ID
User's friend has <10 GB free Low Pre-check in /setup/status. Refuse to start download if insufficient. Point user to clear space
Apple Silicon build runs on Intel Mac Possible Warn in installer + app header. Don't promise cross-arch without actual Intel build

Success criteria (for this plan, per phase)

  • A ✅ when ./dist/omnivoice-backend/omnivoice-backend starts in <3 s on a clean shell and serves /system/info.
  • B ✅ when bun run desktop launches a window that uses the frozen binary (not uv run) and all core APIs work.
  • C ✅ when deleting the models dir and launching shows a wizard that completes to functional state without any terminal interaction.
  • D ✅ when an unrelated M-series Mac runs the DMG end-to-end (Fireship clip → Spanish dub) with zero developer tooling installed, just right-click → Open once.

Key implementation files

  • backend.spec — PyInstaller spec
  • backend/utils/hf_progress.py — tqdm monkey-patch for download progress
  • backend/hooks/pyi_rth_numpy_compat.py — numpy runtime hook
  • backend/hooks/pyi_rth_torch_compiler_disable.py — torch.compile disable
  • frontend/src-tauri/src/lib.rs — sidecar spawn + port-reuse
  • frontend/src-tauri/tauri.conf.json — bundle + updater config
  • scripts/build_desktop.sh — build entry
  • .github/workflows/release.yml — full release pipeline (signing, notarization, DMG re-notarize)

Out-of-scope for v1

  • Auto-update (Tauri has tauri-plugin-updater, but requires signing + hosted latest.json).
  • Automatic crash reporting (needs a Sentry-type endpoint).
  • User telemetry of any kind.
  • In-app feedback form.
  • Notarized installer — Phase E, deferred.
  • Cross-platform builds — see "Cross-platform extension" section.
  • Homebrew cask — possible later, not blocking.

Timeline (honest, single developer)

Phase Hours Confidence
A — frozen backend 3–5 High
B — Tauri sidecar + port-reuse 2 High
C — first-run wizard + hf progress 3–4 High (80 LOC + UI)
D — DMG + clean-machine test 2–3 Medium (Gatekeeper dance)
Total (macOS arm64 only) 10–14 Phaseable over 2–3 sessions
E — signing + notarization +3 Blocked on Apple Developer ID
Cross-platform (each OS) +8 Per-OS effort