VoiceStudio is the open-source, fully-local ElevenLabs alternative — voice cloning, voice design, video dubbing, dictation, transcription & audiobook creation in 646 languages.
Python aiaudiobookcudadubbingelevenlabs-alternativehuggingfacelocal-firstmlxomnivoice-studiospeech-to-texttext-to-speechtranscriptiontranslatettsvoice-aivoice-cloningvoice-generationvoicestudioworkflow
feat(updates): add an opt-in Beta release channel
velixiobfaf8a5c0aa1
diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.ymlindex 309d092ee..99e908eee 100644--- a/.github/workflows/docker.yml+++ b/.github/workflows/docker.yml@@ -15,6 +15,8 @@# :latest — rolling preview: latest commit on main (never a release build)# :main — alias of the same rolling main build (kept for back-compat)# :stable — most recent versioned release (set when a non-prerelease is published)+# :beta — most recent `vX.Y.Z-beta.N` prerelease (moves only on beta releases;+# a beta also gets its exact :X.Y.Z-beta.N tag, never :X.Y or :stable)# :0.3.6 — exact version from the git tag# :0.3 — major.minor floating tag (updated on every patch within the minor)# :sha-xxxx — specific commit SHA; produced by every build@@ -23,6 +25,7 @@# build-and-push-rocm job from the same Dockerfile via the BASE_IMAGE build-arg:# :rocm — rolling preview from main (the ROCm analogue of :latest)# :stable-rocm — most recent versioned release, ROCm build+# :beta-rocm — most recent beta prerelease, ROCm build# :0.3.6-rocm — exact version, ROCm build# :0.3-rocm — major.minor floating tag, ROCm build# :sha-xxxx-rocm — specific commit SHA, ROCm build@@ -92,7 +95,7 @@ jobs:env:RELEASE_REF: ${{ inputs.release_ref }}run: |- [[ "$RELEASE_REF" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]+ [[ "$RELEASE_REF" =~ ^v[0-9]+\.[0-9]+\.[0-9]+(-beta\.[0-9]+)?$ ]]test "$(git rev-parse HEAD)" = "$(git rev-parse "refs/tags/${RELEASE_REF}^{commit}")"TAG_VERSION="${RELEASE_REF#v}"PACKAGE_VERSION="$(python3 -c 'import json; print(json.load(open("package.json"))["version"])')"@@ -172,7 +175,8 @@ jobs:latest=falsetags: |type=semver,pattern={{version}},enable=${{ github.event_name == 'release' }}- type=semver,pattern={{major}}.{{minor}},enable=${{ github.event_name == 'release' }}+ type=semver,pattern={{major}}.{{minor}},enable=${{ github.event_name == 'release' && !contains(github.ref, '-') }}+ type=raw,value=beta,enable=${{ github.event_name == 'release' && github.event.release.prerelease && contains(github.ref, '-beta.') }}type=raw,value=stable,enable=${{ github.event_name == 'release' && !github.event.release.prerelease && !contains(github.ref, '-') }}type=raw,value=latest,enable=${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}type=raw,value=main,enable=${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}@@ -202,9 +206,15 @@ jobs:SOURCE_TAG: sha-${{ steps.source.outputs.short_sha }}run: |VERSION="${RELEASE_REF#v}"- MINOR="${VERSION%.*}"- TAGS=("$VERSION" "$MINOR")- if [[ "$PROMOTE_STABLE" == "true" ]]; then TAGS=(stable "${TAGS[@]}"); fi+ if [[ "$VERSION" == *-beta.* ]]; then+ # A beta never moves :stable or the floating major.minor tag.+ test "$PROMOTE_STABLE" != "true"+ TAGS=("$VERSION" beta)+ else+ MINOR="${VERSION%.*}"+ TAGS=("$VERSION" "$MINOR")+ if [[ "$PROMOTE_STABLE" == "true" ]]; then TAGS=(stable "${TAGS[@]}"); fi+ fifor IMAGE in "$IMAGE_NAME" "$LEGACY_IMAGE_NAME"; dofor TAG in "${TAGS[@]}"; dodocker buildx imagetools create \@@ -263,7 +273,7 @@ jobs:env:RELEASE_REF: ${{ inputs.release_ref }}run: |- [[ "$RELEASE_REF" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]+ [[ "$RELEASE_REF" =~ ^v[0-9]+\.[0-9]+\.[0-9]+(-beta\.[0-9]+)?$ ]]test "$(git rev-parse HEAD)" = "$(git rev-parse "refs/tags/${RELEASE_REF}^{commit}")"TAG_VERSION="${RELEASE_REF#v}"PACKAGE_VERSION="$(python3 -c 'import json; print(json.load(open("package.json"))["version"])')"@@ -330,7 +340,8 @@ jobs:latest=falsetags: |type=semver,pattern={{version}},suffix=-rocm,enable=${{ github.event_name == 'release' }}- type=semver,pattern={{major}}.{{minor}},suffix=-rocm,enable=${{ github.event_name == 'release' }}+ type=semver,pattern={{major}}.{{minor}},suffix=-rocm,enable=${{ github.event_name == 'release' && !contains(github.ref, '-') }}+ type=raw,value=beta-rocm,enable=${{ github.event_name == 'release' && github.event.release.prerelease && contains(github.ref, '-beta.') }}type=raw,value=stable-rocm,enable=${{ github.event_name == 'release' && !github.event.release.prerelease && !contains(github.ref, '-') }}type=raw,value=rocm,enable=${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}type=raw,value=sha-${{ steps.source.outputs.short_sha }}-rocm@@ -362,9 +373,15 @@ jobs:SOURCE_TAG: sha-${{ steps.source.outputs.short_sha }}-rocmrun: |VERSION="${RELEASE_REF#v}"- MINOR="${VERSION%.*}"- TAGS=("${VERSION}-rocm" "${MINOR}-rocm")- if [[ "$PROMOTE_STABLE" == "true" ]]; then TAGS=(stable-rocm "${TAGS[@]}"); fi+ if [[ "$VERSION" == *-beta.* ]]; then+ # A beta never moves :stable-rocm or the floating major.minor tag.+ test "$PROMOTE_STABLE" != "true"+ TAGS=("${VERSION}-rocm" beta-rocm)+ else+ MINOR="${VERSION%.*}"+ TAGS=("${VERSION}-rocm" "${MINOR}-rocm")+ if [[ "$PROMOTE_STABLE" == "true" ]]; then TAGS=(stable-rocm "${TAGS[@]}"); fi+ fifor IMAGE in "$IMAGE_NAME" "$LEGACY_IMAGE_NAME"; dofor TAG in "${TAGS[@]}"; dodocker buildx imagetools create \diff --git a/.github/workflows/electron-release.yml b/.github/workflows/electron-release.ymlindex a510fb91b..b125a925e 100644--- a/.github/workflows/electron-release.yml+++ b/.github/workflows/electron-release.yml@@ -1,6 +1,9 @@name: Electron desktop release# Builds are safe by default. Only an explicit publish dispatch exposes a release.+# Two channels, both cut from main: `vX.Y.Z` is Stable (GitHub's `latest`),+# `vX.Y.Z-beta.N` is Beta (a prerelease that never becomes `latest`). No other+# prerelease shape (-rc, -alpha, ...) is accepted.on:push:tags: ['v*']@@ -34,6 +37,8 @@ jobs:# The archived sunset tag was assembled separately; future tags are Electron-only.if: github.event_name == 'workflow_dispatch' || github.ref_name != vars.TAURI_SUNSET_TAGruns-on: ubuntu-latest+ outputs:+ channel: ${{ steps.channel.outputs.channel }}steps:- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0with:@@ -59,6 +64,11 @@ jobs:VERSION=$(node -p "require('./package.json').version")test "$REF" = "refs/tags/v$VERSION" || { echo "Select the exact version tag"; exit 1; }test "$(git rev-parse HEAD)" = "$(git rev-parse "$REF^{commit}")" || { echo "Checkout does not match the release tag"; exit 1; }+ - name: Resolve the release channel+ id: channel+ run: |+ # stable (X.Y.Z) or beta (X.Y.Z-beta.N); any other shape fails here.+ echo "channel=$(python3 scripts/prepare_electron_release.py --print-channel)" >> "$GITHUB_OUTPUT"package:needs: validateruns-on: ${{ matrix.runner }}@@ -102,7 +112,7 @@ jobs:shell: bashenv:VOICESTUDIO_RUST_TARGET: ${{ matrix.target }}- VOICESTUDIO_UPDATE_CHANNEL: electron-stable-${{ matrix.platform }}-${{ matrix.arch }}+ VOICESTUDIO_UPDATE_CHANNEL: electron-${{ needs.validate.outputs.channel }}-${{ matrix.platform }}-${{ matrix.arch }}CSC_IDENTITY_AUTO_DISCOVERY: 'false'VITE_POSTHOG_KEY: ${{ secrets.POSTHOG_PROJECT_TOKEN }}VITE_POSTHOG_HOST: ${{ vars.POSTHOG_HOST }}@@ -220,7 +230,7 @@ jobs:electron/release/store-artifact-manifest-*.jsonrelease:- needs: package+ needs: [validate, package]runs-on: ubuntu-latestpermissions:contents: write@@ -231,6 +241,7 @@ jobs:TAG: ${{ inputs.release_tag || github.ref_name }}SUNSET_TAG: ${{ vars.TAURI_SUNSET_TAG }}PUBLISH: ${{ inputs.publish }}+ CHANNEL: ${{ needs.validate.outputs.channel }}steps:- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0with:@@ -244,6 +255,9 @@ jobs:run: |python3 scripts/prepare_electron_release.py --assets release-assets --tag "$TAG"- name: Preserve the final Tauri updater feeds+ # Archived Tauri clients read `latest/download`, which never serves a+ # prerelease, so only Stable releases carry the sunset feeds.+ if: env.CHANNEL == 'stable'run: |test "$SUNSET_TAG" = "v0.5.3" || { echo "TAURI_SUNSET_TAG must be v0.5.3 before releasing"; exit 1; }# Every release carries copies pointing to immutable v0.5.3 payloads@@ -263,19 +277,30 @@ jobs:EOF- name: Create or update draftrun: |+ # A beta is always a prerelease so GitHub never makes it `latest`.+ PRERELEASE=false+ if [ "$CHANNEL" = beta ]; then PRERELEASE=true; fiif ! gh release view "$TAG" >/dev/null 2>&1; then- gh release create "$TAG" --verify-tag --draft --title "$TAG — VoiceStudio" --notes-file release-assets/RELEASE_NOTES.md+ gh release create "$TAG" --verify-tag --draft --prerelease="$PRERELEASE" --title "$TAG — VoiceStudio" --notes-file release-assets/RELEASE_NOTES.mdfitest "$(gh release view "$TAG" --json isDraft --jq .isDraft)" = true || { echo "Refusing to replace a published release"; exit 1; }- gh release edit "$TAG" --notes-file release-assets/RELEASE_NOTES.md+ gh release edit "$TAG" --prerelease="$PRERELEASE" --notes-file release-assets/RELEASE_NOTES.mdfind release-assets -maxdepth 1 -type f ! -name RELEASE_NOTES.md -print0 | xargs -0 gh release upload "$TAG" --clobber- name: Publish only when explicitly requestedif: github.event_name == 'workflow_dispatch' && inputs.publish == true- run: gh release edit "$TAG" --draft=false --latest+ run: |+ if [ "$CHANNEL" = beta ]; then+ gh release edit "$TAG" --draft=false --prerelease=true --latest=false+ else+ gh release edit "$TAG" --draft=false --prerelease=false --latest+ fi# docker.yml publishes release images on `release: published`, which a# GITHUB_TOKEN publish cannot trigger; dispatch its release backfill path.+ # Only Stable moves `:stable`; a beta gets `:beta` and its exact tag.- name: Publish release container imagesif: github.event_name == 'workflow_dispatch' && inputs.publish == truerun: |+ PROMOTE=false+ if [ "$CHANNEL" = stable ]; then PROMOTE=true; figh workflow run docker.yml --ref main \- -f backfill_release=true -f release_ref="$TAG" -f promote_stable=true+ -f backfill_release=true -f release_ref="$TAG" -f promote_stable="$PROMOTE"diff --git a/.github/workflows/snap-store.yml b/.github/workflows/snap-store.ymlindex 10c9972ee..b063a0338 100644--- a/.github/workflows/snap-store.yml+++ b/.github/workflows/snap-store.yml@@ -30,7 +30,8 @@ env:jobs:package:- if: ${{ !inputs.promote_revision }}+ # Beta tags (vX.Y.Z-beta.N) are not Snap releases: the Snap Store track is stable-only.+ if: ${{ !inputs.promote_revision && !(github.ref_type == 'tag' && contains(github.ref_name, '-beta.')) }}runs-on: ubuntu-24.04timeout-minutes: 75env:diff --git a/CHANGELOG.md b/CHANGELOG.mdindex ffec732fa..1c94412ec 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -11,9 +11,12 @@ metadata and the backend fallback mirror it.**Highlights**- Preview iOS and Android companion apps for your own VoiceStudio+- Opt-in Beta update channel: get fixes early from Settings → Updates, and roll onto the next stable release automatically### Added+- Beta update channel: choose Stable or Beta under Settings → Updates; betas are `-beta.N` prereleases that never reach Stable users, and Docker gets matching `:beta` tags ([guide](docs/update-channels.md))+- Preview iOS and Android companion apps: drive your own VoiceStudio from your phone (speak, voices and cloning, dubbing, dictation) after pairing by QR code; build from source for now ([guide](docs/mobile.md)) (#2965)- Smart Fit speed limits: set the fastest and slowest speed dubbing may apply to a line, from the Timing section (#3026) — thanks @MoonDragon-MD!diff --git a/CLAUDE.md b/CLAUDE.mdindex c44964414..71f242048 100644--- a/CLAUDE.md+++ b/CLAUDE.md@@ -41,7 +41,7 @@ Everything else (new engines, fancy features) is downstream of "the thing instal- **Default features must work on every platform (strict rule, 2026-05-20):** A feature that ships in default mode — out-of-the-box, no user customization, no opt-in toggle — must behave identically on macOS, Windows, and Linux. Platform-specific *implementation code* is allowed for OS APIs / shells / packaging, but the user-visible *default behavior* cannot diverge. Platform-only features (e.g., a macOS-only global shortcut, a Windows-only path picker) must go behind explicit user opt-in: Settings toggle, env var, or CLI flag. When a default doesn't work on a platform, that's a P0 bug — either fix it on the missing platform or move it behind opt-in. No third option. **This rule governs BEHAVIOUR, not PERFORMANCE** (clarified 2026-07-30, council): hardware acceleration is expected to vary by host — CUDA, MPS, DirectML, Triton availability and `torch.compile` are all host-dependent by design, and reading the rule to forbid that would forbid GPU support itself. An optimization that is skipped where it cannot work (missing Triton, an arch the wheel lacks, a path its toolchain cannot link) is NOT a parity violation; a *feature* the user can see and use on one OS but not another is.- **Backward-compatible project data**: Existing `omnivoice_data/` (user voices, projects, settings) must keep working without manual migration. Any DB schema change goes through alembic with a tested upgrade path.- **Local-first guarantee preserved**: nothing leaves the machine without the user's **explicit yes**, and the app must remain fully functional with everything declined. Auto bug reporting is opt-in and submits only to GitHub Issues (prefilled-URL, from the user's own browser). Product analytics (owner-sanctioned 2026-07-16; US project migration 2026-09-26) is opt-in PostHog US with a **first-run consent prompt** — two equal-weight Yes/No buttons, never default-on, skipping = off; consent-gated, allowlisted content-free metadata only (`backend/core/analytics.py`); every build — installer, Docker, and source alike (owner reversal 2026-07-20, #1193) — carries the in-repo publishable write-only token and shows the same consent ask, with env/baked token overriding it. No required cloud calls, accounts, or API keys. Sanctioned calls (owner-set 2026-10-02; full list in `.github/CONTRIBUTING.md` → Quality gates): during first-run setup the user starts — the pinned ffmpeg download from GitHub `zackees/ffmpeg_bins` (`backend/services/media_tools.py`), the huggingface.co/hf-mirror.com reachability probe for restricted networks (`backend/services/endpoint_race.py`), and Hugging Face model downloads; opening the community gallery (jsDelivr manifest, `backend/api/routers/community.py`) or enabling the voice-preview gallery (GitHub Releases, `backend/services/gallery.py`); packaged update checks against GitHub Releases (`electron/src/main/updater.ts`); yt-dlp updates from PyPI when the user clicks update; and, only after the user turns account features on (first-run setup or Settings → Account, off by default), VoiceStudio Cloud sign-in and account calls from Electron main (`electron/src/main/account/`), plus settings sync from the backend (`backend/services/cloud_sync/`) once cloud sync is also on, all stopped at once when switched off. Narrow owner-approved exception (2026-09-28): the GitHub Star badge may fetch the public repository star count when shown and refresh every 20 minutes while visible, without credentials or a referrer. It sends no project, recording, or account data, retains the last count on failure, and never blocks offline use.-- **Beta release cadence (no RC, no ceremony — strict rule, 2026-05-20):** the current release line (0.5.x today) has **no release candidates, no 48h soak, no formal release ceremony**. Every fix goes continuous-to-main; the owner tags a patch from main whenever the current state is worth cutting. No `-rc` tags. No phased release. No deferrals to a future minor or major version — every open issue and every open community PR gets absorbed into the current line or explicitly declined. Users follow `main` for previews; users wanting stable stay on the latest tagged release.+- **Beta release cadence (no RC, no ceremony — strict rule, 2026-05-20):** the current release line (0.5.x today) has **no release candidates, no 48h soak, no formal release ceremony**. Every fix goes continuous-to-main; the owner tags a patch from main whenever the current state is worth cutting. No `-rc` tags. No phased release. The one sanctioned prerelease is the opt-in **Beta channel** (owner-approved 2026-10-22): `vX.Y.Z-beta.N` tags cut from `main`, published as GitHub prereleases that never become `latest`, with their own `electron-beta-*` update feed and `:beta` Docker tag (see `docs/RELEASING.md` → Beta channel). It adds no soak, ceremony or side branch. No deferrals to a future minor or major version — every open issue and every open community PR gets absorbed into the current line or explicitly declined. Users follow `main` for previews; users wanting stable stay on the latest tagged release.<!-- GSD:project-end --><!-- GSD:stack-start source:research/STACK.md -->@@ -64,8 +64,8 @@ For anything new: prefer what's already pinned in `pyproject.toml` / `electron/p**Versioning (hard rule, owner-set 2026-06-11; single-source 2026-09-26):** **The root `package.json` is the SINGLE SOURCE OF TRUTH for the maintained Electron app version** — Electron's builder reads it directly and Vite injects `__APP_VERSION__` for the UI and bug reports. Two toolchain-required **mirrors** are kept equal to it and bumped in lockstep: `pyproject.toml` and `backend/core/version.py`'s `_FALLBACK_VERSION`. Guarded by `tests/test_app_version.py`. Version bumps are manual and happen only when the owner asks; until then, `main` may equal the latest released version. Consequences:- Every PR and preview build uses the canonical version. Preview artifacts add the workflow run number without changing the checked-in version.- Releasing = obtain owner approval for the version, bump the canonical version and maintained mirrors together, then tag that exact version from `main` after validation.-- Docker: `ghcr.io/debpalash/voicestudio:latest` = **main** (rolling preview); `:X.Y.Z` + `:X.Y` + `:stable` = tagged releases. `:latest` is the preview channel by design — stable users pin `:stable` or a version tag. The former `ghcr.io/debpalash/omnivoice-studio` coordinate remains a compatibility alias.-- Do not bump minor/major or invent RCs/codenames without the owner asking. No "defer to next version" labels — scope is absorbed or declined, never re-versioned.+- Docker: `ghcr.io/debpalash/voicestudio:latest` = **main** (rolling preview); `:X.Y.Z` + `:X.Y` + `:stable` = tagged releases; `:beta` + `:X.Y.Z-beta.N` = beta prereleases (never `:stable`/`:X.Y`). `:latest` is the preview channel by design — stable users pin `:stable` or a version tag. The former `ghcr.io/debpalash/omnivoice-studio` coordinate remains a compatibility alias.+- Do not bump minor/major or invent RCs/codenames without the owner asking. A beta version (`X.Y.Z-beta.N`) is bumped in the same three places, only when the owner asks, and uses the same lockstep. No "defer to next version" labels — scope is absorbed or declined, never re-versioned.**Docs-sync (hard rule, owner-set 2026-06-11):** any change that alters something these docs describe — README.md, `.github/CONTRIBUTING.md`, `.github/SECURITY.md`, `.github/SUPPORT.md`, LICENSE, or `docs/**` (install flows, Docker tag semantics, platform support, versioning/release behavior, review process, supported versions) — must update those docs **in the same PR** as the change. If a doc impact is discovered after merge, the docs fix is the immediate next commit, not backlog. Stale docs are treated as bugs.diff --git a/deploy/dockerhub-overview.md b/deploy/dockerhub-overview.mdindex a5b1bd50c..c732d9435 100644--- a/deploy/dockerhub-overview.md+++ b/deploy/dockerhub-overview.md@@ -124,6 +124,7 @@ see the [Docker install guide](https://github.com/debpalash/VoiceStudio/blob/mai| `:sha-xxxxxxx` | Exact commit — produced by every image build (main, releases, manual runs) || `:rocm` | **AMD GPU (ROCm) build** of the rolling preview — the ROCm analogue of `:latest` || `:stable-rocm`, `:0.5.6-rocm`, `:0.5-rocm`, `:sha-xxxxxxx-rocm` | ROCm builds of the corresponding tags above |+| `:beta`, `:0.5.9-beta.1` | Newest beta prerelease and its exact version. A beta never moves `:stable` or `:0.5`; `-rocm` forms exist too (`:beta-rocm`) |Release tags are published only when the GitHub Release is published.Preview builds always come from `main` and never version-sort below `:stable`,diff --git a/docs/RELEASING.md b/docs/RELEASING.mdindex 9e21716a1..49c39b48e 100644--- a/docs/RELEASING.md+++ b/docs/RELEASING.md@@ -155,9 +155,40 @@ After publication, verify each maintained channel:| Docker Hub overview | `docker.yml` | Read the `Update Docker Hub description` step log; the step may continue after a 403 || Rolling containers | `docker.yml` on `main` pushes only | `:latest`, `:main`, and `:rocm` timestamps move; a release never moves them |-A missing channel is a release bug. There are no RC tags and no preview update-channel; previews are builds from `main` (the `electron-build.yml` artifacts or-Docker `:latest`), never a side branch. No Tauri build is maintained.+A missing channel is a release bug. There are no RC tags; the one prerelease is+the opt-in **Beta** channel (below). Previews between betas are builds from+`main` (the `electron-build.yml` artifacts or Docker `:latest`), never a side+branch. No Tauri build is maintained.++## Beta channel++Beta is a second release channel cut from `main`, for testers who opt in under+**Settings → Updates → Update channel** ([user guide](update-channels.md)). It+has no soak period, no side branch and no cherry-picks.++| | Stable | Beta |+|---|---|---|+| Tag and `package.json` version | `vX.Y.Z` | `vX.Y.Z-beta.N` |+| GitHub Release | full release, becomes `latest` | **prerelease**, never `latest` |+| Update feed | `electron-stable-<os>-<arch>` | `electron-beta-<os>-<arch>` |+| Docker | `:X.Y.Z`, `:X.Y`, `:stable` | `:beta`, `:X.Y.Z-beta.N` (and `-rocm`) |+| Snap / Microsoft Store / Mac App Store | yes | no (Stable-only) |+| Tauri sunset feeds | copied into the release | not copied |++Cutting a beta: with owner approval of the version, bump `package.json`,+`pyproject.toml` and `_FALLBACK_VERSION` to `X.Y.Z-beta.N` together, add a+`## [X.Y.Z-beta.N]` section to `CHANGELOG.md`, tag from `main`, then run+`electron-release.yml` with `publish`. The workflow derives the channel from+the version (`prepare_electron_release.py --print-channel`), stamps it into every+platform feed, publishes with `--prerelease --latest=false`, and dispatches+Docker with `promote_stable=false`. Any other prerelease shape (`-rc`, `-alpha`)+is rejected.++Promoting to Stable is a normal `vX.Y.Z` release from `main`. Beta users roll+onto it automatically because the updater compares semver (`X.Y.Z-beta.N` sorts+below `X.Y.Z`). The verification table above applies to Stable; for a beta also+confirm the GitHub Release is flagged *Pre-release*, `releases/latest` still+points at the last stable, and `:stable` and `:X.Y` did not move.## Package requirementsdiff --git a/docs/install/docker.md b/docs/install/docker.mdindex 15c63104e..c2aa8f25b 100644--- a/docs/install/docker.md+++ b/docs/install/docker.md@@ -63,6 +63,7 @@ On an ARM64 host, pulling without an explicit platform can fail with> | `:sha-xxxxxxx` | Exact commit — produced by every image build (main, releases, manual runs) |> | `:rocm` | **AMD GPU (ROCm) build** of the rolling preview — the ROCm analogue of `:latest` |> | `:stable-rocm`, `:0.5.6-rocm`, `:0.5-rocm`, `:sha-xxxxxxx-rocm` | ROCm builds of the corresponding CUDA tags above |+> | `:beta`, `:0.5.9-beta.1` | Newest beta prerelease and its exact version. A beta never moves `:stable` or `:0.5`; `-rocm` forms exist too (`:beta-rocm`) |>> Release tags (`:X.Y.Z`, `:X.Y`, `:stable` and their `-rocm` forms) are> published only when the GitHub Release is published. Previews come only fromdiff --git a/docs/update-channels.md b/docs/update-channels.mdindex e3f23e540..1cc5211f6 100644--- a/docs/update-channels.md+++ b/docs/update-channels.md@@ -1,16 +1,30 @@# Desktop updates-VoiceStudio's desktop app offers **stable releases only**. It checks for an+VoiceStudio's desktop app follows **Stable** releases unless you opt in to+**Beta**. It checks for anupdate about 10 seconds after launch and every six hours while it stays open;**Settings → Updates** also has a manual check. The app never downloads anupdate until you ask, and an available update is only offered, never forced.| Build | Where it comes from | Who it's for ||-------|--------------------|--------------|-| **Stable** | The latest published `vX.Y.Z` GitHub Release. | Everyone. This is the only update channel. |+| **Stable** | The latest published `vX.Y.Z` GitHub Release. | Everyone. This is the default. |+| **Beta** | The newest `vX.Y.Z-beta.N` prerelease, cut from `main` before the matching stable release. | Testers who want fixes early and can live with bugs. Opt in under **Settings → Updates → Update channel**. |-There is no Preview update channel and no preview desktop feed. To try changes-before they are released:+Switching channel takes effect immediately and is remembered across restarts.+It is locked while an update is downloading or waiting to restart.++- **Beta rolls forward onto Stable.** When a stable release passes your beta+ (for example `0.5.9` after `0.5.9-beta.3`), Beta installs it, so you never+ linger on an old beta.+- **Switching back to Stable never downgrades.** If your beta is newer than the+ latest stable, you stay on it until the next stable release.+- Beta builds are GitHub *prereleases*: they never become the `latest` release+ and Stable users never see them. Microsoft Store, Snap Store and Mac App+ Store builds are Stable-only.+- Beta Linux AppImages update through the in-app updater, not AppImageUpdate.++There is no separate preview desktop feed. To try changes between betas:- **Run `main` from source** — see the platform install guides([macOS](install/macos.md#building-from-source) ·@@ -28,7 +42,9 @@ has finished and current drafts are flushed.There are **no accounts or updater telemetry**. A check fetches one smallplatform/architecture-specific manifest from-`github.com/debpalash/VoiceStudio/releases/latest/download/`; it carries the+`github.com/debpalash/VoiceStudio/releases/latest/download/` (Stable), or, on+Beta, from the newest beta or stable release found through the public GitHub+releases list; it carries thepackage's SHA-512 checksum, and the app rejects a package that fails it. OnLinux the in-app updater uses the AppImage; update a `.deb` installation byinstalling the newer `.deb`. Source checkouts do not self-update.diff --git a/electron/electron-builder.config.mjs b/electron/electron-builder.config.mjsindex a05d10bf8..a98e69f5d 100644--- a/electron/electron-builder.config.mjs+++ b/electron/electron-builder.config.mjs@@ -23,13 +23,15 @@ const artifactLabel ='mac-app-store': 'MacAppStore',}[DISTRIBUTION_TARGET] ?? 'Electron';const artifactPrefix = `${PRODUCT_NAME.replace(/[^A-Za-z0-9]+/g, '-')}-${artifactLabel}`;-// Stable is the only Electron update feed: there is no `preview` release to-// point at. Packaging rehearsals from main are stamped stable too; they are-// review artifacts and are never published.+// Stable and Beta are the Electron update feeds (Beta = `-beta.N` prereleases,+// stamped by electron-release.yml). Packaging rehearsals from main are stamped+// stable; they are review artifacts and are never published.const updateChannel =process.env.VOICESTUDIO_UPDATE_CHANNEL || `electron-stable-${process.platform}-${process.arch}`;if (- !/^electron-(?:microsoft-store-)?stable-(?:win32|darwin|linux)-(?:x64|arm64)$/.test(updateChannel)+ !/^electron-(?:(?:microsoft-store-)?stable|beta)-(?:win32|darwin|linux)-(?:x64|arm64)$/.test(+ updateChannel,+ )) {throw new Error(`Unsupported Electron update channel: ${updateChannel}`);}diff --git a/electron/scripts/embed-appimage-update.mjs b/electron/scripts/embed-appimage-update.mjsindex 6d87617af..dcfc8ab3d 100644--- a/electron/scripts/embed-appimage-update.mjs+++ b/electron/scripts/embed-appimage-update.mjs@@ -16,12 +16,18 @@ const filename = `VoiceStudio-Electron-${version}-linux-x64.AppImage`;const image = resolve(releaseDir, filename);const zsync = `${image}.zsync`;const channel = process.env.VOICESTUDIO_UPDATE_CHANNEL || 'electron-stable-linux-x64';-// Stable is the only Linux update feed (no `preview` release exists).-assert.equal(channel, 'electron-stable-linux-x64', 'Known Linux updater channel');+assert(+ ['electron-stable-linux-x64', 'electron-beta-linux-x64'].includes(channel),+ 'Known Linux updater channel',+);+// AppImageUpdate's `latest` skips prereleases and could roll a beta back to an+// older stable, so a beta image is pinned to its own tag (it updates in-app).+const isBeta = channel === 'electron-beta-linux-x64';const releaseTag = `v${version}`;const manifestPath = resolve(releaseDir, `${channel}-linux.yml`);-const updateInfo =- 'gh-releases-zsync|debpalash|VoiceStudio|latest|VoiceStudio-Electron-*-linux-x64.AppImage.zsync';+const updateInfo = `gh-releases-zsync|debpalash|VoiceStudio|${+ isBeta ? releaseTag : 'latest'+}|VoiceStudio-Electron-*-linux-x64.AppImage.zsync`;// The pinned electron-builder runtime reserves a fixed-size .upd_info ELF// section. Read its actual offset instead of assuming a particular runtimediff --git a/electron/src/main/updater.test.ts b/electron/src/main/updater.test.tsindex a8aefb2b2..0fb78c957 100644--- a/electron/src/main/updater.test.ts+++ b/electron/src/main/updater.test.ts@@ -3,11 +3,15 @@ import { beforeEach, describe, expect, test, vi } from 'vitest';const mocks = vi.hoisted(() => {const handlers = new Map<string, Set<(...args: any[]) => void>>();const ipcHandlers = new Map<string, (...args: any[]) => unknown>();- // updates.json once stored the retired channel choice.- const disk = { channel: undefined as 'stable' | 'preview' | undefined };+ // updates.json holds the saved update channel ("preview" is a retired value).+ const disk = { file: undefined as string | undefined };const fs = {- rmSync: vi.fn((_path: string) => {- disk.channel = undefined;+ readFileSync: vi.fn((_path: string) => {+ if (disk.file === undefined) throw new Error('ENOENT');+ return disk.file;+ }),+ writeFileSync: vi.fn((_path: string, data: string) => {+ disk.file = data;}),};const autoUpdater = {@@ -63,7 +67,9 @@ import {DesktopUpdater,feedManifestName,listDesktopReleases,+ readSavedUpdateChannel,registerUpdateIpc,+ resolveBetaFeed,resolveUpdateFeedUrl,UPDATE_CHANNELS,} from './updater';@@ -76,7 +82,7 @@ describe('DesktopUpdater', () => {beforeEach(() => {mocks.handlers.clear();mocks.ipcHandlers.clear();- mocks.disk.channel = undefined;+ mocks.disk.file = undefined;mocks.app.isPackaged = true;mocks.autoUpdater.autoDownload = true;mocks.autoUpdater.autoInstallOnAppQuit = true;@@ -220,33 +226,120 @@ describe('DesktopUpdater', () => {});});- test('migrates a saved Preview choice to Stable without errors', async () => {- mocks.disk.channel = 'preview';- const updater = new DesktopUpdater();+ test('reads a saved Preview or damaged choice as Stable', () => {+ for (const saved of ['{"channel":"preview"}', 'not json', '{}', 'null']) {+ mocks.disk.file = saved;+ expect(readSavedUpdateChannel()).toBe('stable');+ expect(new DesktopUpdater().snapshot().channel).toBe('stable');+ }+ mocks.disk.file = undefined;+ expect(readSavedUpdateChannel()).toBe('stable');+ });- expect(mocks.fs.rmSync).toHaveBeenCalledWith(expect.stringContaining('updates.json'), {- force: true,- });- expect(mocks.disk.channel).toBeUndefined();+ test('a saved Beta choice survives restarts and checks the newest beta or stable release', async () => {+ const platform = process.platform;+ const arch = process.arch;+ const beta = feedManifestName(platform, arch, 'direct', 'beta');+ const stable = feedManifestName(platform, arch, 'direct', 'stable');+ const feedFetcher = vi.fn(+ async () =>+ new Response(+ JSON.stringify([+ { tag_name: 'v0.5.9-beta.2', assets: [{ name: beta }] },+ { tag_name: 'v0.5.9-beta.10', assets: [{ name: beta }] },+ { tag_name: 'v0.5.8', assets: [{ name: stable }] },+ { tag_name: 'v0.5.10-beta.1', draft: true, assets: [{ name: beta }] },+ { tag_name: 'v0.5.9-beta.11', assets: [{ name: 'unrelated.txt' }] },+ { tag_name: 'nightly', assets: [{ name: beta }] },+ ]),+ { status: 200 },+ ),+ );+ mocks.disk.file = '{"channel":"beta"}';+ const updater = new DesktopUpdater('direct', feedFetcher);+ expect(updater.snapshot().channel).toBe('beta');await updater.check();- expect(updater.snapshot().status).toBe('idle');- expect(updater.snapshot()).not.toHaveProperty('channel');- expect(mocks.autoUpdater.allowPrerelease).toBe(false);expect(mocks.autoUpdater.allowDowngrade).toBe(false);+ expect(mocks.autoUpdater.channel).toBe(`electron-beta-${platform}-${arch}`);expect(mocks.autoUpdater.setFeedURL).toHaveBeenLastCalledWith({provider: 'generic',- url: 'https://github.com/debpalash/VoiceStudio/releases/latest/download',+ url: 'https://github.com/debpalash/VoiceStudio/releases/download/v0.5.9-beta.10',+ channel: `electron-beta-${platform}-${arch}`,+ });+ });++ test('Beta rolls onto a stable release that passes the newest beta', async () => {+ const stable = feedManifestName(process.platform, process.arch, 'direct', 'stable');+ const beta = feedManifestName(process.platform, process.arch, 'direct', 'beta');+ const feed = await resolveBetaFeed(+ process.platform,+ process.arch,+ vi.fn(+ async () =>+ new Response(+ JSON.stringify([+ { tag_name: 'v0.5.9-beta.3', assets: [{ name: beta }] },+ { tag_name: 'v0.5.9', assets: [{ name: stable }] },+ ]),+ { status: 200 },+ ),+ ),+ );+ expect(feed).toEqual({+ url: 'https://github.com/debpalash/VoiceStudio/releases/download/v0.5.9',channel: `electron-stable-${process.platform}-${process.arch}`,});- expect(updater).not.toHaveProperty('setChannel');});- test('a leftover settings file that cannot be removed never blocks the updater', () => {- mocks.fs.rmSync.mockImplementationOnce(() => {+ test('Beta feed lookup fails closed on an unusable response', async () => {+ await expect(+ resolveBetaFeed(+ process.platform,+ process.arch,+ vi.fn(async () => new Response('', { status: 503 })),+ ),+ ).rejects.toThrow('503');+ await expect(+ resolveBetaFeed(+ process.platform,+ process.arch,+ vi.fn(async () => new Response('[]', { status: 200 })),+ ),+ ).rejects.toThrow('No beta or stable release');+ });++ test('switching channel persists, clears the old offer, and is refused mid-download', () => {+ const updater = new DesktopUpdater();+ emit('update-available', { version: '0.5.3', releaseNotes: 'Old' });++ expect(updater.setChannel('beta')).toMatchObject({ status: 'idle', channel: 'beta' });+ expect(updater.snapshot().availableVersion).toBeUndefined();+ expect(JSON.parse(mocks.disk.file!)).toEqual({ channel: 'beta' });+ expect(readSavedUpdateChannel()).toBe('beta');++ emit('download-progress', { percent: 10 });+ expect(updater.setChannel('stable').channel).toBe('beta');+ expect(readSavedUpdateChannel()).toBe('beta');+ });++ test('Store builds expose no channel and ignore switch requests', () => {+ const updater = new DesktopUpdater('microsoft-store', vi.fn());+ expect(updater.snapshot()).not.toHaveProperty('channel', expect.anything());+ updater.setChannel('beta');+ expect(mocks.fs.writeFileSync).not.toHaveBeenCalled();+ expect(feedManifestName(process.platform, process.arch, 'microsoft-store', 'beta')).toContain(+ 'microsoft-store-stable',+ );+ });++ test('a channel file that cannot be written never blocks the updater', () => {+ mocks.fs.writeFileSync.mockImplementationOnce(() => {throw new Error('EPERM');});- expect(() => new DesktopUpdater()).not.toThrow();+ const updater = new DesktopUpdater();+ expect(() => updater.setChannel('beta')).not.toThrow();+ expect(updater.snapshot().channel).toBe('beta');});test('keeps startup checks quiet while reporting manual check failures', async () => {@@ -396,7 +489,7 @@ describe('update IPC', () => {beforeEach(() => {mocks.handlers.clear();mocks.ipcHandlers.clear();- mocks.disk.channel = undefined;+ mocks.disk.file = undefined;mocks.app.isPackaged = true;vi.clearAllMocks();mocks.autoUpdater.checkForUpdates.mockResolvedValue(undefined);@@ -426,8 +519,16 @@ describe('update IPC', () => {}),).toThrow('Untrusted update request');- expect(UPDATE_CHANNELS).not.toHaveProperty('setChannel');+ const setChannel = mocks.ipcHandlers.get(UPDATE_CHANNELS.setChannel)!;+ const trustedEvent = { sender: webContents, senderFrame: webContents.mainFrame };+ expect(() => setChannel(trustedEvent, 'nightly')).toThrow('Unknown update channel');+ // A downloaded update pins the channel until it is installed.+ expect(setChannel(trustedEvent, 'beta')).toMatchObject({ channel: 'stable' });+ expect(() =>+ setChannel({ sender: {}, senderFrame: { url: 'https://attacker.invalid' } }, 'beta'),+ ).toThrow('Untrusted update request');+dispose();- expect(mocks.ipcMain.removeHandler).toHaveBeenCalledTimes(6);+ expect(mocks.ipcMain.removeHandler).toHaveBeenCalledTimes(7);});});diff --git a/electron/src/main/updater.ts b/electron/src/main/updater.tsindex 19ab373fe..324869063 100644--- a/electron/src/main/updater.ts+++ b/electron/src/main/updater.ts@@ -1,6 +1,6 @@import { app, BrowserWindow, ipcMain } from 'electron';import updaterPackage, { type ProgressInfo, type UpdateInfo } from 'electron-updater';-import { rmSync } from 'node:fs';+import { readFileSync, writeFileSync } from 'node:fs';import { join } from 'node:path';import { isTrustedRenderer } from './trusted-renderer';import type { UpdateReleaseInfo, UpdateState } from '../preload/index.d';@@ -12,9 +12,12 @@ import type { DistributionTarget } from '../../../config/distributions.mjs';// named runtime imports fail before the app can create a window.const { autoUpdater } = updaterPackage;-// Only tagged releases are published as an update feed. A Preview channel used-// to exist, but no workflow ever published its feed, so it silently served-// Stable; it was removed rather than left as a choice that does nothing.+// Two update channels, both fed by tagged GitHub releases cut from main:+// Stable follows `vX.Y.Z` (the `latest` release); Beta follows `vX.Y.Z-beta.N`+// prereleases and rolls onto the next stable once it passes them. GitHub's+// `latest/download` never serves a prerelease, so Beta resolves its release+// through the releases API (see resolveBetaFeed).+export type UpdateChannel = 'stable' | 'beta';const STABLE_FEED = 'https://github.com/debpalash/VoiceStudio/releases/latest/download';const RELEASES_API = 'https://api.github.com/repos/debpalash/VoiceStudio/releases?per_page=30';@@ -22,9 +25,11 @@ function feedChannelName(platform: NodeJS.Platform = process.platform,arch: string = process.arch,distribution: DistributionTarget = CURRENT_DISTRIBUTION,+ channel: UpdateChannel = 'stable',): string {+ // Store builds are stable-only: the Store listing is the beta gate.const prefix =- distribution === 'microsoft-store' ? 'electron-microsoft-store-stable' : 'electron-stable';+ distribution === 'microsoft-store' ? 'electron-microsoft-store-stable' : `electron-${channel}`;return `${prefix}-${platform}-${arch}`;}@@ -32,9 +37,90 @@ export function feedManifestName(platform: NodeJS.Platform = process.platform,arch: string = process.arch,distribution: DistributionTarget = CURRENT_DISTRIBUTION,+ channel: UpdateChannel = 'stable',): string {const suffix = platform === 'darwin' ? '-mac' : platform === 'linux' ? '-linux' : '';- return `${feedChannelName(platform, arch, distribution)}${suffix}.yml`;+ return `${feedChannelName(platform, arch, distribution, channel)}${suffix}.yml`;+}++const RELEASE_DOWNLOAD = 'https://github.com/debpalash/VoiceStudio/releases/download';+const RELEASE_TAG = /^v(\d+)\.(\d+)\.(\d+)(?:-beta\.(\d+))?$/;++/** Orders `vX.Y.Z-beta.N` below `vX.Y.Z`, as semver does. */+function releaseRank(tag: string): number[] | null {+ const match = RELEASE_TAG.exec(tag);+ if (!match) return null;+ return [+ Number(match[1]),+ Number(match[2]),+ Number(match[3]),+ match[4] === undefined ? Number.MAX_SAFE_INTEGER : Number(match[4]),+ ];+}++/**+ * Beta follows the newest stable-or-beta release that publishes this platform's+ * manifest. When a stable release is the newest, Beta reads the stable manifest+ * from it, so beta users land on the final build instead of lingering on a beta.+ */+export async function resolveBetaFeed(+ platform: NodeJS.Platform = process.platform,+ arch: string = process.arch,+ fetcher: typeof fetch = fetch,+): Promise<{ url: string; channel: string }> {+ const response = await fetcher(RELEASES_API, {+ headers: { Accept: 'application/vnd.github+json', 'User-Agent': 'VoiceStudio' },+ signal: AbortSignal.timeout(10_000),+ });+ if (!response.ok) throw new Error(`Beta update feed lookup failed (${response.status})`);+ const releases: unknown = await response.json();+ if (!Array.isArray(releases)) throw new Error('Beta update feed lookup returned invalid data');+ const candidates = releases.flatMap((value) => {+ if (!value || typeof value !== 'object') return [];+ const item = value as Record<string, unknown>;+ const tag = typeof item.tag_name === 'string' ? item.tag_name : '';+ const rank = releaseRank(tag);+ if (!rank || item.draft === true || !Array.isArray(item.assets)) return [];+ const kind = rank[3] === Number.MAX_SAFE_INTEGER ? 'stable' : 'beta';+ const manifest = feedManifestName(platform, arch, 'direct', kind);+ const published = item.assets.some(+ (asset) => asset && (asset as Record<string, unknown>).name === manifest,+ );+ return published+ ? [{ tag, rank, channel: feedChannelName(platform, arch, 'direct', kind) }]+ : [];+ });+ candidates.sort((left, right) => {+ for (let index = 0; index < left.rank.length; index += 1) {+ const difference = right.rank[index] - left.rank[index];+ if (difference) return difference;+ }+ return 0;+ });+ const newest = candidates[0];+ if (!newest)+ throw new Error('No beta or stable release publishes an update feed for this device');+ return { url: `${RELEASE_DOWNLOAD}/${encodeURIComponent(newest.tag)}`, channel: newest.channel };+}++const CHANNEL_FILE = 'updates.json';++/** Anything but an explicit "beta" (including the retired "preview") is Stable. */+export function readSavedUpdateChannel(userData: string = app.getPath('userData')): UpdateChannel {+ try {+ const saved: unknown = JSON.parse(readFileSync(join(userData, CHANNEL_FILE), 'utf8'));+ return saved && (saved as Record<string, unknown>).channel === 'beta' ? 'beta' : 'stable';+ } catch {+ return 'stable';+ }+}++function saveUpdateChannel(channel: UpdateChannel, userData: string = app.getPath('userData')) {+ try {+ writeFileSync(join(userData, CHANNEL_FILE), JSON.stringify({ channel }));+ } catch {+ // Best effort: the choice still applies for this session.+ }}export async function resolveUpdateFeedUrl(@@ -100,6 +186,7 @@ export const UPDATE_CHANNELS = {dismiss: 'updates:dismiss',install: 'updates:install',listReleases: 'updates:listReleases',+ setChannel: 'updates:setChannel',state: 'updates:state',} as const;@@ -151,35 +238,27 @@ function releaseSize(info: UpdateInfo): number | undefined {return total > 0 ? total : undefined;}-/**- * updates.json only ever stored the retired channel choice. Forget it so a- * saved "preview" cannot linger; the updater always follows Stable now.- */-export function forgetSavedUpdateChannel(userData: string = app.getPath('userData')): void {- try {- rmSync(join(userData, 'updates.json'), { force: true });- } catch {- // Best effort: an unreadable leftover is ignored either way.- }-}-export class DesktopUpdater {private listeners = new Set<(state: UpdateState) => void>();private state: UpdateState;private checkInFlight: Promise<UpdateState> | null = null;private downloadInFlight: Promise<UpdateState> | null = null;+ private channel: UpdateChannel = 'stable';constructor(private readonly distribution: DistributionTarget = CURRENT_DISTRIBUTION,private readonly feedFetcher: typeof fetch = fetch,) {const supported = this.updatesSupported();+ // Store builds are stable-only, so they expose no channel to switch.+ const selectable = supported && distribution !== 'microsoft-store';+ if (selectable) this.channel = readSavedUpdateChannel();this.state = {status: supported ? 'idle' : 'unsupported',currentVersion: app.getVersion(),progress: 0,+ channel: selectable ? this.channel : undefined,};- forgetSavedUpdateChannel();if (!supported) return;autoUpdater.autoDownload = false;@@ -256,7 +335,7 @@ export class DesktopUpdater {autoUpdater.on('error', (error) =>this.patch({ status: 'error', error: error.message || String(error) }),);- if (this.distribution !== 'microsoft-store') this.configureFeed(STABLE_FEED);+ if (this.distribution !== 'microsoft-store') this.configureFeed(STABLE_FEED, feedChannelName());}snapshot(): UpdateState {@@ -288,16 +367,21 @@ export class DesktopUpdater {});const operation = (async () => {try {- const feedUrl =+ const feed =this.distribution === 'microsoft-store'- ? await resolveUpdateFeedUrl(- this.distribution,- process.platform,- process.arch,- this.feedFetcher,- )- : STABLE_FEED;- this.configureFeed(feedUrl);+ ? {+ url: await resolveUpdateFeedUrl(+ this.distribution,+ process.platform,+ process.arch,+ this.feedFetcher,+ ),+ channel: feedChannelName(process.platform, process.arch, this.distribution),+ }+ : this.channel === 'beta'+ ? await resolveBetaFeed(process.platform, process.arch, this.feedFetcher)+ : { url: STABLE_FEED, channel: feedChannelName() };+ this.configureFeed(feed.url, feed.channel);await autoUpdater.checkForUpdates();if (this.state.status === 'checking') {this.patch({ status: 'idle', lastCheckedAt: Date.now() });@@ -359,26 +443,49 @@ export class DesktopUpdater {status: 'idle',currentVersion: this.state.currentVersion,progress: 0,+ channel: this.state.channel,lastCheckedAt: this.state.lastCheckedAt,};this.emit();return this.snapshot();}+ /** Switches channel. Refused mid-download; clears any offer from the old channel. */+ setChannel(channel: UpdateChannel): UpdateState {+ if (+ this.state.channel === undefined ||+ channel === this.channel ||+ this.downloadInFlight ||+ ['checking', 'downloading', 'downloaded'].includes(this.state.status)+ )+ return this.snapshot();+ this.channel = channel;+ saveUpdateChannel(channel);+ this.state = {+ status: 'idle',+ currentVersion: this.state.currentVersion,+ progress: 0,+ channel,+ };+ this.emit();+ return this.snapshot();+ }+install(): void {if (!this.updatesSupported() || this.state.status !== 'downloaded') return;autoUpdater.quitAndInstall(false, true);}- private configureFeed(url: string): void {+ private configureFeed(url: string, feedChannel: string): void {if (!this.updatesSupported()) return;+ // Feeds are resolved per release and read through the generic provider, so+ // electron-updater's own prerelease filtering never applies.autoUpdater.allowPrerelease = false;- const feedChannel = feedChannelName(process.platform, process.arch, this.distribution);autoUpdater.channel = feedChannel;// electron-updater's channel setter silently enables downgrades; keep the// app monotonic.autoUpdater.allowDowngrade = false;- // Explicit, so a build packaged with another feed URL still follows Stable.+ // Explicit, so a build packaged with another feed URL follows the chosen channel.autoUpdater.setFeedURL({provider: 'generic',url,@@ -438,6 +545,11 @@ export function registerUpdateIpc(await beforeInstall();updater.install();});+ ipcMain.handle(UPDATE_CHANNELS.setChannel, (event, channel: unknown) => {+ trusted(event);+ if (channel !== 'stable' && channel !== 'beta') throw new Error('Unknown update channel');+ return updater.setChannel(channel);+ });ipcMain.handle(UPDATE_CHANNELS.listReleases, (event) => {trusted(event);return listDesktopReleases();diff --git a/electron/src/preload/index.d.ts b/electron/src/preload/index.d.tsindex 55485e055..0f007d41e 100644--- a/electron/src/preload/index.d.ts+++ b/electron/src/preload/index.d.ts@@ -106,9 +106,12 @@ export type UpdateStatus =| 'downloading'| 'downloaded'| 'error';+export type UpdateChannel = 'stable' | 'beta';export interface UpdateState {status: UpdateStatus;currentVersion: string;+ /** Absent when this build cannot switch channels (Store builds, dev runs). */+ channel?: UpdateChannel;availableVersion?: string;notes?: string | null;progress: number;@@ -334,7 +337,10 @@ export interface VoiceStudioBridge {signIn(): Promise<void>;cancelSignIn(): Promise<void>;signOut(): Promise<void>;- setSwitches(patch: { accountEnabled?: boolean; syncEnabled?: boolean }): Promise<AccountPublicState>;+ setSwitches(patch: {+ accountEnabled?: boolean;+ syncEnabled?: boolean;+ }): Promise<AccountPublicState>;updateProfile(patch: { display_name?: string }): Promise<AccountPublicState>;onState(cb: (state: AccountPublicState) => void): () => void;};@@ -360,6 +366,7 @@ export interface VoiceStudioBridge {check(): Promise<UpdateState>;download(): Promise<UpdateState>;dismiss(): Promise<UpdateState>;+ setChannel(channel: UpdateChannel): Promise<UpdateState>;install(): Promise<void>;listReleases(): Promise<UpdateReleaseInfo[]>;onState(cb: (state: UpdateState) => void): () => void;diff --git a/electron/src/preload/index.ts b/electron/src/preload/index.tsindex 0a8a66fd4..2a76136ca 100644--- a/electron/src/preload/index.ts+++ b/electron/src/preload/index.ts@@ -51,9 +51,10 @@ const bridge: VoiceStudioBridge = {check: () => ipcRenderer.invoke('updates:check') as Promise<UpdateState>,download: () => ipcRenderer.invoke('updates:download') as Promise<UpdateState>,dismiss: () => ipcRenderer.invoke('updates:dismiss') as Promise<UpdateState>,+ setChannel: (channel) =>+ ipcRenderer.invoke('updates:setChannel', channel) as Promise<UpdateState>,install: () => ipcRenderer.invoke('updates:install') as Promise<void>,- listReleases: () =>- ipcRenderer.invoke('updates:listReleases') as Promise<UpdateReleaseInfo[]>,+ listReleases: () => ipcRenderer.invoke('updates:listReleases') as Promise<UpdateReleaseInfo[]>,onState: (cb) => subscribe<UpdateState>('updates:state', cb),},watch: {diff --git a/electron/src/renderer/src/features/settings/update-settings.test.tsx b/electron/src/renderer/src/features/settings/update-settings.test.tsxindex 989d4fa34..7c87ef616 100644--- a/electron/src/renderer/src/features/settings/update-settings.test.tsx+++ b/electron/src/renderer/src/features/settings/update-settings.test.tsx@@ -15,6 +15,7 @@ const mocks = vi.hoisted(() => ({check: vi.fn(),download: vi.fn(),dismiss: vi.fn(),+ setChannel: vi.fn(),install: vi.fn(),listReleases: vi.fn(),flushDubDraft: vi.fn(),@@ -31,6 +32,7 @@ vi.mock('@/components/bridge', () => ({check: mocks.check,download: mocks.download,dismiss: mocks.dismiss,+ setChannel: mocks.setChannel,install: mocks.install,listReleases: mocks.listReleases,onState: (listener: (state: UpdateState) => void) => {@@ -100,20 +102,83 @@ describe('UpdateSettings', () => {afterEach(cleanup);- test('checks for updates and offers no update-channel choice', async () => {+ test('checks for updates and hides the channel choice when the build cannot switch', async () => {renderSettings();fireEvent.click(await screen.findByRole('button', { name: 'updates.check_now' }));await waitFor(() => expect(mocks.check).toHaveBeenCalledOnce());- // No Preview feed is published, so a channel picker would only mislead.- expect(screen.queryByText('about.update_channel')).not.toBeInTheDocument();- expect(screen.queryByRole('button', { name: 'about.channel_preview' })).not.toBeInTheDocument();+ // Store and dev builds report no channel, so a picker would do nothing.+ expect(screen.queryByText('update.channel')).not.toBeInTheDocument();+ expect(screen.queryByRole('button', { name: 'update.channel_beta' })).not.toBeInTheDocument();+ });++ test('switches to Beta and checks that channel straight away', async () => {+ mocks.state = { ...mocks.state, channel: 'stable' };+ const beta = { ...mocks.state, channel: 'beta' as const };+ mocks.setChannel.mockResolvedValue(beta);+ mocks.check.mockResolvedValue({+ ...beta,+ status: 'available',+ availableVersion: '0.5.9-beta.1',+ });+ renderSettings();++ const stable = await screen.findByRole('button', { name: 'update.channel_stable' });+ expect(stable).toHaveAttribute('aria-pressed', 'true');+ fireEvent.click(screen.getByRole('button', { name: 'update.channel_beta' }));++ await waitFor(() => expect(mocks.setChannel).toHaveBeenCalledWith('beta'));+ await waitFor(() => expect(mocks.check).toHaveBeenCalledOnce());+ expect(await screen.findByText('update.available')).toBeInTheDocument();+ });++ test('does not check when the channel switch is refused', async () => {+ mocks.state = { ...mocks.state, channel: 'stable' };+ mocks.setChannel.mockResolvedValue(mocks.state);+ renderSettings();++ fireEvent.click(await screen.findByRole('button', { name: 'update.channel_beta' }));+ await waitFor(() => expect(mocks.setChannel).toHaveBeenCalledWith('beta'));+ expect(mocks.check).not.toHaveBeenCalled();+ });++ test('locks the channel while an update is downloading', async () => {+ mocks.state = { ...mocks.state, channel: 'stable', status: 'downloading', progress: 5 };+ renderSettings();+ expect(await screen.findByRole('button', { name: 'update.channel_beta' })).toBeDisabled();+ });++ test('lists betas only for Beta users', async () => {+ mocks.state = { ...mocks.state, channel: 'beta' };+ mocks.listReleases.mockResolvedValue([+ {+ version: '0.5.9-beta.1',+ name: 'v0.5.9-beta.1',+ date: '2026-09-13T00:00:00Z',+ prerelease: true,+ notes: '',+ },+ ]);+ renderSettings();+ expect(await screen.findByText('v0.5.9-beta.1')).toBeInTheDocument();});test('lists tagged releases only', async () => {mocks.listReleases.mockResolvedValue([- { version: '0.5.2', name: 'v0.5.2', date: '2026-09-12T00:00:00Z', prerelease: false, notes: '' },- { version: '0.5.3-7', name: 'preview', date: '2026-09-13T00:00:00Z', prerelease: true, notes: '' },+ {+ version: '0.5.2',+ name: 'v0.5.2',+ date: '2026-09-12T00:00:00Z',+ prerelease: false,+ notes: '',+ },+ {+ version: '0.5.3-7',+ name: 'preview',+ date: '2026-09-13T00:00:00Z',+ prerelease: true,+ notes: '',+ },]);renderSettings();expect(await screen.findByText('v0.5.2')).toBeInTheDocument();diff --git a/electron/src/renderer/src/features/settings/update-settings.tsx b/electron/src/renderer/src/features/settings/update-settings.tsxindex 9577f11a6..007e8b65b 100644--- a/electron/src/renderer/src/features/settings/update-settings.tsx+++ b/electron/src/renderer/src/features/settings/update-settings.tsx@@ -22,7 +22,7 @@ import { dubSession, flushDubDraft, useDubSession } from '@/features/dub/dub-sesimport { hasActiveAppWork, useAppActivityCount } from '@/lib/app-activity';import { apiJson, describeError } from '@/lib/api/client';import { SettingsSection } from './settings-layout';-import type { UpdateReleaseInfo, UpdateState } from '../../../../preload/index.d';+import type { UpdateChannel, UpdateReleaseInfo, UpdateState } from '../../../../preload/index.d';const initial: UpdateState = {status: 'unsupported',@@ -112,8 +112,8 @@ export function UpdateSettings() {staleTime: 15 * 60_000,});const releaseRows = (releaseHistory.data || [])- // Updates follow tagged releases only, so the history lists those.- .filter((release) => !release.prerelease)+ // Betas are tagged prereleases; only beta users are offered them.+ .filter((release) => state.channel === 'beta' || !release.prerelease).slice().sort((left, right) => right.date.localeCompare(left.date)).map((release) => ({@@ -152,6 +152,12 @@ export function UpdateSettings() {setAction(false);}};+ const switchChannel = (channel: UpdateChannel) =>+ updates &&+ void run(async () => {+ const next = await updates.setChannel(channel);+ return next.channel === channel ? updates.check() : next;+ });const restart = async () => {setAction(true);try {@@ -310,6 +316,36 @@ export function UpdateSettings() {)}</div></div>+ {state.channel && (+ <div className="flex flex-col gap-2 px-4 py-3 @2xl:flex-row @2xl:items-center">+ <div className="min-w-0 flex-1">+ <p id="update-channel-label" className="text-sm font-medium">+ {t('update.channel')}+ </p>+ {state.channel === 'beta' && (+ <p className="mt-0.5 text-xs text-muted-foreground">+ {t('update.channel_beta_hint')}+ </p>+ )}+ </div>+ <div role="group" aria-labelledby="update-channel-label" className="flex gap-1">+ {(['stable', 'beta'] as const).map((channel) => (+ <Button+ key={channel}+ size="sm"+ variant={state.channel === channel ? 'secondary' : 'outline'}+ aria-pressed={state.channel === channel}+ disabled={+ action || ['checking', 'downloading', 'downloaded'].includes(state.status)+ }+ onClick={() => switchChannel(channel)}+ >+ {t(`update.channel_${channel}`)}+ </Button>+ ))}+ </div>+ </div>+ )}<div className="flex items-center gap-2 px-4 py-2.5 text-[11px] text-muted-foreground"><ShieldCheckIcon className="size-3.5 text-success" aria-hidden="true" />{t('update.safety')}diff --git a/electron/src/renderer/src/i18n/locales/ar.json b/electron/src/renderer/src/i18n/locales/ar.jsonindex 1ab8cf79b..f143aa9a8 100644--- a/electron/src/renderer/src/i18n/locales/ar.json+++ b/electron/src/renderer/src/i18n/locales/ar.json@@ -2741,7 +2741,11 @@"toast_available": "الإصدار {{version}} من VoiceStudio متاح","toast_install": "تثبيت وإعادة التشغيل","toast_whats_new": "ما الجديد",- "toast_later": "لاحقًا"+ "toast_later": "لاحقًا",+ "channel": "قناة التحديث",+ "channel_stable": "مستقرة",+ "channel_beta": "تجريبية",+ "channel_beta_hint": "تحصل القناة التجريبية على إصدارات مبكرة وقد تحتوي على أخطاء. تنتقل تلقائيًا إلى الإصدار المستقر التالي."},"openapi": {"title": "واجهة VoiceStudio البرمجية",diff --git a/electron/src/renderer/src/i18n/locales/de.json b/electron/src/renderer/src/i18n/locales/de.jsonindex b8ec66c08..b10a617b7 100644--- a/electron/src/renderer/src/i18n/locales/de.json+++ b/electron/src/renderer/src/i18n/locales/de.json@@ -2733,7 +2733,11 @@"toast_available": "VoiceStudio {{version}} ist verfügbar","toast_install": "Installieren und neu starten","toast_whats_new": "Neuerungen",- "toast_later": "Später"+ "toast_later": "Später",+ "channel": "Update-Kanal",+ "channel_stable": "Stabil",+ "channel_beta": "Beta",+ "channel_beta_hint": "Beta liefert frühe Versionen und kann Fehler enthalten. Du wechselst automatisch auf die nächste stabile Version."},"openapi": {"title": "VoiceStudio-API",diff --git a/electron/src/renderer/src/i18n/locales/en.json b/electron/src/renderer/src/i18n/locales/en.jsonindex 00006d82e..96f9101a0 100644--- a/electron/src/renderer/src/i18n/locales/en.json+++ b/electron/src/renderer/src/i18n/locales/en.json@@ -2796,7 +2796,11 @@"toast_available": "VoiceStudio {{version}} is available","toast_install": "Install and restart","toast_whats_new": "What's new",- "toast_later": "Later"+ "toast_later": "Later",+ "channel": "Update channel",+ "channel_stable": "Stable",+ "channel_beta": "Beta",+ "channel_beta_hint": "Beta gets early builds and may have bugs. You move to the next stable release automatically."},"openapi": {"title": "VoiceStudio API",diff --git a/electron/src/renderer/src/i18n/locales/es.json b/electron/src/renderer/src/i18n/locales/es.jsonindex e60d2c218..f89947330 100644--- a/electron/src/renderer/src/i18n/locales/es.json+++ b/electron/src/renderer/src/i18n/locales/es.json@@ -2735,7 +2735,11 @@"toast_available": "VoiceStudio {{version}} está disponible","toast_install": "Instalar y reiniciar","toast_whats_new": "Novedades",- "toast_later": "Más tarde"+ "toast_later": "Más tarde",+ "channel": "Canal de actualizaciones",+ "channel_stable": "Estable",+ "channel_beta": "Beta",+ "channel_beta_hint": "Beta recibe versiones tempranas y puede tener errores. Pasas automáticamente a la siguiente versión estable."},"openapi": {"title": "API de VoiceStudio",diff --git a/electron/src/renderer/src/i18n/locales/fr.json b/electron/src/renderer/src/i18n/locales/fr.jsonindex 29350f936..7d1244777 100644--- a/electron/src/renderer/src/i18n/locales/fr.json+++ b/electron/src/renderer/src/i18n/locales/fr.json@@ -2735,7 +2735,11 @@"toast_available": "VoiceStudio {{version}} est disponible","toast_install": "Installer et redémarrer","toast_whats_new": "Nouveautés",- "toast_later": "Plus tard"+ "toast_later": "Plus tard",+ "channel": "Canal de mise à jour",+ "channel_stable": "Stable",+ "channel_beta": "Bêta",+ "channel_beta_hint": "La bêta reçoit des versions anticipées et peut contenir des bogues. Vous passez automatiquement à la prochaine version stable."},"openapi": {"title": "API VoiceStudio",diff --git a/electron/src/renderer/src/i18n/locales/hi.json b/electron/src/renderer/src/i18n/locales/hi.jsonindex 94cbef535..9636b48e8 100644--- a/electron/src/renderer/src/i18n/locales/hi.json+++ b/electron/src/renderer/src/i18n/locales/hi.json@@ -2733,7 +2733,11 @@"toast_available": "VoiceStudio {{version}} उपलब्ध है","toast_install": "इंस्टॉल करें और पुनः आरंभ करें","toast_whats_new": "नया क्या है",- "toast_later": "बाद में"+ "toast_later": "बाद में",+ "channel": "अपडेट चैनल",+ "channel_stable": "स्थिर",+ "channel_beta": "बीटा",+ "channel_beta_hint": "बीटा में शुरुआती बिल्ड मिलते हैं और उनमें बग हो सकते हैं। अगली स्थिर रिलीज़ पर आप अपने आप चले जाते हैं।"},"openapi": {"title": "VoiceStudio API",diff --git a/electron/src/renderer/src/i18n/locales/id.json b/electron/src/renderer/src/i18n/locales/id.jsonindex 183592bbd..6629fd605 100644--- a/electron/src/renderer/src/i18n/locales/id.json+++ b/electron/src/renderer/src/i18n/locales/id.json@@ -2733,7 +2733,11 @@"toast_available": "VoiceStudio {{version}} tersedia","toast_install": "Instal dan mulai ulang","toast_whats_new": "Yang baru",- "toast_later": "Nanti"+ "toast_later": "Nanti",+ "channel": "Kanal pembaruan",+ "channel_stable": "Stabil",+ "channel_beta": "Beta",+ "channel_beta_hint": "Beta menerima versi awal dan mungkin berisi bug. Anda otomatis pindah ke rilis stabil berikutnya."},"openapi": {"title": "API VoiceStudio",diff --git a/electron/src/renderer/src/i18n/locales/it.json b/electron/src/renderer/src/i18n/locales/it.jsonindex 7afa3a29c..3363df1f0 100644--- a/electron/src/renderer/src/i18n/locales/it.json+++ b/electron/src/renderer/src/i18n/locales/it.json@@ -2735,7 +2735,11 @@"toast_available": "VoiceStudio {{version}} è disponibile","toast_install": "Installa e riavvia","toast_whats_new": "Novità",- "toast_later": "Più tardi"+ "toast_later": "Più tardi",+ "channel": "Canale di aggiornamento",+ "channel_stable": "Stabile",+ "channel_beta": "Beta",+ "channel_beta_hint": "La beta riceve versioni anticipate e può avere bug. Passi automaticamente alla prossima versione stabile."},"openapi": {"title": "API VoiceStudio",diff --git a/electron/src/renderer/src/i18n/locales/ja.json b/electron/src/renderer/src/i18n/locales/ja.jsonindex 2f4a01828..7d1883478 100644--- a/electron/src/renderer/src/i18n/locales/ja.json+++ b/electron/src/renderer/src/i18n/locales/ja.json@@ -2733,7 +2733,11 @@"toast_available": "VoiceStudio {{version}} が利用可能です","toast_install": "インストールして再起動","toast_whats_new": "新機能",- "toast_later": "後で"+ "toast_later": "後で",+ "channel": "アップデートチャンネル",+ "channel_stable": "安定版",+ "channel_beta": "ベータ版",+ "channel_beta_hint": "ベータ版は先行ビルドを受け取るため、不具合がある場合があります。次の安定版が出ると自動的に切り替わります。"},"openapi": {"title": "VoiceStudio API",diff --git a/electron/src/renderer/src/i18n/locales/ko.json b/electron/src/renderer/src/i18n/locales/ko.jsonindex 1b27909c4..f8cb922e6 100644--- a/electron/src/renderer/src/i18n/locales/ko.json+++ b/electron/src/renderer/src/i18n/locales/ko.json@@ -2733,7 +2733,11 @@"toast_available": "VoiceStudio {{version}}을(를) 사용할 수 있습니다","toast_install": "설치 후 재시작","toast_whats_new": "새로운 기능",- "toast_later": "나중에"+ "toast_later": "나중에",+ "channel": "업데이트 채널",+ "channel_stable": "안정",+ "channel_beta": "베타",+ "channel_beta_hint": "베타는 초기 빌드를 받으며 버그가 있을 수 있습니다. 다음 안정 버전이 나오면 자동으로 전환됩니다."},"openapi": {"title": "VoiceStudio API",diff --git a/electron/src/renderer/src/i18n/locales/nl.json b/electron/src/renderer/src/i18n/locales/nl.jsonindex 483dbd415..fc06e1abf 100644--- a/electron/src/renderer/src/i18n/locales/nl.json+++ b/electron/src/renderer/src/i18n/locales/nl.json@@ -2733,7 +2733,11 @@"toast_available": "VoiceStudio {{version}} is beschikbaar","toast_install": "Installeren en herstarten","toast_whats_new": "Wat is er nieuw",- "toast_later": "Later"+ "toast_later": "Later",+ "channel": "Updatekanaal",+ "channel_stable": "Stabiel",+ "channel_beta": "Bèta",+ "channel_beta_hint": "Bèta krijgt vroege versies en kan bugs bevatten. Je stapt automatisch over naar de volgende stabiele versie."},"openapi": {"title": "VoiceStudio-API",diff --git a/electron/src/renderer/src/i18n/locales/pl.json b/electron/src/renderer/src/i18n/locales/pl.jsonindex d71a31b65..6a51df4a3 100644--- a/electron/src/renderer/src/i18n/locales/pl.json+++ b/electron/src/renderer/src/i18n/locales/pl.json@@ -2737,7 +2737,11 @@"toast_available": "VoiceStudio {{version}} jest dostępna","toast_install": "Zainstaluj i uruchom ponownie","toast_whats_new": "Co nowego",- "toast_later": "Później"+ "toast_later": "Później",+ "channel": "Kanał aktualizacji",+ "channel_stable": "Stabilny",+ "channel_beta": "Beta",+ "channel_beta_hint": "Beta otrzymuje wczesne wersje i może zawierać błędy. Automatycznie przechodzisz na następną wersję stabilną."},"openapi": {"title": "API VoiceStudio",diff --git a/electron/src/renderer/src/i18n/locales/pt.json b/electron/src/renderer/src/i18n/locales/pt.jsonindex 0d9da7492..78f844281 100644--- a/electron/src/renderer/src/i18n/locales/pt.json+++ b/electron/src/renderer/src/i18n/locales/pt.json@@ -2735,7 +2735,11 @@"toast_available": "VoiceStudio {{version}} está disponível","toast_install": "Instalar e reiniciar","toast_whats_new": "Novidades",- "toast_later": "Mais tarde"+ "toast_later": "Mais tarde",+ "channel": "Canal de atualização",+ "channel_stable": "Estável",+ "channel_beta": "Beta",+ "channel_beta_hint": "O Beta recebe versões antecipadas e pode ter erros. Você passa automaticamente para a próxima versão estável."},"openapi": {"title": "API do VoiceStudio",diff --git a/electron/src/renderer/src/i18n/locales/ru.json b/electron/src/renderer/src/i18n/locales/ru.jsonindex 89aa20111..fff84220b 100644--- a/electron/src/renderer/src/i18n/locales/ru.json+++ b/electron/src/renderer/src/i18n/locales/ru.json@@ -2737,7 +2737,11 @@"toast_available": "VoiceStudio {{version}} доступна","toast_install": "Установить и перезапустить","toast_whats_new": "Что нового",- "toast_later": "Позже"+ "toast_later": "Позже",+ "channel": "Канал обновлений",+ "channel_stable": "Стабильный",+ "channel_beta": "Бета",+ "channel_beta_hint": "Бета получает ранние сборки и может содержать ошибки. Вы автоматически перейдёте на следующий стабильный выпуск."},"openapi": {"title": "API VoiceStudio",diff --git a/electron/src/renderer/src/i18n/locales/sv.json b/electron/src/renderer/src/i18n/locales/sv.jsonindex 0239c8b1e..779f694c0 100644--- a/electron/src/renderer/src/i18n/locales/sv.json+++ b/electron/src/renderer/src/i18n/locales/sv.json@@ -2733,7 +2733,11 @@"toast_available": "VoiceStudio {{version}} är tillgänglig","toast_install": "Installera och starta om","toast_whats_new": "Nyheter",- "toast_later": "Senare"+ "toast_later": "Senare",+ "channel": "Uppdateringskanal",+ "channel_stable": "Stabil",+ "channel_beta": "Beta",+ "channel_beta_hint": "Beta får tidiga versioner och kan innehålla buggar. Du byter automatiskt till nästa stabila version."},"openapi": {"title": "VoiceStudio API",diff --git a/electron/src/renderer/src/i18n/locales/th.json b/electron/src/renderer/src/i18n/locales/th.jsonindex f45c4b04e..3ba236bc6 100644--- a/electron/src/renderer/src/i18n/locales/th.json+++ b/electron/src/renderer/src/i18n/locales/th.json@@ -2733,7 +2733,11 @@"toast_available": "VoiceStudio {{version}} พร้อมใช้งาน","toast_install": "ติดตั้งและรีสตาร์ท","toast_whats_new": "มีอะไรใหม่",- "toast_later": "ภายหลัง"+ "toast_later": "ภายหลัง",+ "channel": "ช่องทางอัปเดต",+ "channel_stable": "เสถียร",+ "channel_beta": "เบต้า",+ "channel_beta_hint": "เบต้าได้รับบิลด์รุ่นแรก ๆ และอาจมีข้อบกพร่อง คุณจะย้ายไปยังรุ่นเสถียรถัดไปโดยอัตโนมัติ"},"openapi": {"title": "API ของ VoiceStudio",diff --git a/electron/src/renderer/src/i18n/locales/tr.json b/electron/src/renderer/src/i18n/locales/tr.jsonindex a4a81f4bf..c49972853 100644--- a/electron/src/renderer/src/i18n/locales/tr.json+++ b/electron/src/renderer/src/i18n/locales/tr.json@@ -2733,7 +2733,11 @@"toast_available": "VoiceStudio {{version}} kullanılabilir","toast_install": "Yükle ve yeniden başlat","toast_whats_new": "Yenilikler",- "toast_later": "Daha sonra"+ "toast_later": "Daha sonra",+ "channel": "Güncelleme kanalı",+ "channel_stable": "Kararlı",+ "channel_beta": "Beta",+ "channel_beta_hint": "Beta erken sürümleri alır ve hatalar içerebilir. Bir sonraki kararlı sürüme otomatik olarak geçersiniz."},"openapi": {"title": "VoiceStudio API",diff --git a/electron/src/renderer/src/i18n/locales/uk.json b/electron/src/renderer/src/i18n/locales/uk.jsonindex 724bfcfcc..1d5acf498 100644--- a/electron/src/renderer/src/i18n/locales/uk.json+++ b/electron/src/renderer/src/i18n/locales/uk.json@@ -2737,7 +2737,11 @@"toast_available": "VoiceStudio {{version}} доступна","toast_install": "Встановити та перезапустити","toast_whats_new": "Що нового",- "toast_later": "Пізніше"+ "toast_later": "Пізніше",+ "channel": "Канал оновлень",+ "channel_stable": "Стабільний",+ "channel_beta": "Бета",+ "channel_beta_hint": "Бета отримує ранні збірки й може містити помилки. Ви автоматично перейдете на наступний стабільний випуск."},"openapi": {"title": "API VoiceStudio",diff --git a/electron/src/renderer/src/i18n/locales/vi.json b/electron/src/renderer/src/i18n/locales/vi.jsonindex 3e58877f9..4c196bef8 100644--- a/electron/src/renderer/src/i18n/locales/vi.json+++ b/electron/src/renderer/src/i18n/locales/vi.json@@ -2733,7 +2733,11 @@"toast_available": "VoiceStudio {{version}} đã có","toast_install": "Cài đặt và khởi động lại","toast_whats_new": "Có gì mới",- "toast_later": "Để sau"+ "toast_later": "Để sau",+ "channel": "Kênh cập nhật",+ "channel_stable": "Ổn định",+ "channel_beta": "Beta",+ "channel_beta_hint": "Beta nhận các bản dựng sớm và có thể có lỗi. Bạn sẽ tự động chuyển sang bản ổn định tiếp theo."},"openapi": {"title": "API VoiceStudio",diff --git a/electron/src/renderer/src/i18n/locales/zh-CN.json b/electron/src/renderer/src/i18n/locales/zh-CN.jsonindex a0316819f..5688b0e81 100644--- a/electron/src/renderer/src/i18n/locales/zh-CN.json+++ b/electron/src/renderer/src/i18n/locales/zh-CN.json@@ -2733,7 +2733,11 @@"toast_available": "VoiceStudio {{version}} 可用","toast_install": "安装并重启","toast_whats_new": "更新内容",- "toast_later": "稍后"+ "toast_later": "稍后",+ "channel": "更新渠道",+ "channel_stable": "稳定版",+ "channel_beta": "测试版",+ "channel_beta_hint": "测试版会收到早期构建,可能存在缺陷。下一个稳定版发布后会自动切换。"},"openapi": {"title": "VoiceStudio API",diff --git a/electron/src/renderer/src/i18n/locales/zh-TW.json b/electron/src/renderer/src/i18n/locales/zh-TW.jsonindex b478ce44c..9d3651363 100644--- a/electron/src/renderer/src/i18n/locales/zh-TW.json+++ b/electron/src/renderer/src/i18n/locales/zh-TW.json@@ -2733,7 +2733,11 @@"toast_available": "VoiceStudio {{version}} 可用","toast_install": "安裝並重新啟動","toast_whats_new": "新增內容",- "toast_later": "稍後"+ "toast_later": "稍後",+ "channel": "更新頻道",+ "channel_stable": "穩定版",+ "channel_beta": "測試版",+ "channel_beta_hint": "測試版會收到早期組建,可能有錯誤。下一個穩定版發布後會自動切換。"},"openapi": {"title": "VoiceStudio API",diff --git a/electron/tests/update-package-contract.mjs b/electron/tests/update-package-contract.mjsindex a55a7ca1f..5d55f05d7 100644--- a/electron/tests/update-package-contract.mjs+++ b/electron/tests/update-package-contract.mjs@@ -48,11 +48,11 @@ const channel = option(process.env.VOICESTUDIO_UPDATE_CHANNEL || `electron-stable-${platform}-${arch}`,);const releaseDir = resolve(electronRoot, option('release', 'release'));-const expectedChannel =+const expectedChannels =process.env.VOICESTUDIO_DISTRIBUTION === 'microsoft-store'- ? `electron-microsoft-store-stable-${platform}-${arch}`- : `electron-stable-${platform}-${arch}`;-assert.equal(channel, expectedChannel, 'Distribution uses its dedicated stable update channel');+ ? [`electron-microsoft-store-stable-${platform}-${arch}`]+ : [`electron-stable-${platform}-${arch}`, `electron-beta-${platform}-${arch}`];+assert(expectedChannels.includes(channel), 'Distribution uses its dedicated update channel');assert(['win32', 'darwin', 'linux'].includes(platform), `Supported platform: ${platform}`);assert(['x64', 'arm64'].includes(arch), `Supported architecture: ${arch}`);diff --git a/scripts/check_electron_release_assets.py b/scripts/check_electron_release_assets.pyindex 8218ef3d2..cfbfce1ad 100644--- a/scripts/check_electron_release_assets.py+++ b/scripts/check_electron_release_assets.py@@ -15,6 +15,12 @@ from pathlib import Pathfrom typing import Any+# Stable is `X.Y.Z`; Beta is `X.Y.Z-beta.N`. Nothing else is an update channel.+CHANNEL_VERSION = {+ "stable": re.compile(r"\d+\.\d+\.\d+"),+ "beta": re.compile(r"\d+\.\d+\.\d+-beta\.\d+"),+}+TARGETS = {# electron-updater's Provider.getCustomChannelName appends an OS suffix# for macOS/Linux but leaves Windows channel names unchanged.@@ -57,12 +63,12 @@ def _asset_map(release: dict[str, Any]) -> dict[str, dict[str, Any]]:def verify_release(release: dict[str, Any], manifest_dir: Path, *, channel: str, version: str) -> list[str]:- # Stable is the only Electron update feed; there is no `preview` release.- if channel != "stable":+ if channel not in CHANNEL_VERSION:raise ReleaseContractError(f"unsupported channel: {channel}")- if re.fullmatch(r"\d+\.\d+\.\d+", version) is None:+ if CHANNEL_VERSION[channel].fullmatch(version) is None:raise ReleaseContractError(f"{channel} version has the wrong shape: {version}")- if release.get("isPrerelease"):+ # Beta ships as a GitHub prerelease so it can never become `latest`.+ if bool(release.get("isPrerelease")) != (channel == "beta"):raise ReleaseContractError(f"{channel} prerelease flag does not match the channel")expected_tag = f"v{version}"if release.get("tagName") != expected_tag:@@ -131,7 +137,7 @@ def main() -> int:parser = argparse.ArgumentParser()parser.add_argument("--release-json", type=Path, required=True)parser.add_argument("--manifest-dir", type=Path, required=True)- parser.add_argument("--channel", choices=("stable",), required=True)+ parser.add_argument("--channel", choices=tuple(CHANNEL_VERSION), required=True)parser.add_argument("--version", required=True)args = parser.parse_args()release = json.loads(args.release_json.read_text(encoding="utf-8"))diff --git a/scripts/prepare_electron_release.py b/scripts/prepare_electron_release.pyindex 7fdd68949..d34fef809 100644--- a/scripts/prepare_electron_release.py+++ b/scripts/prepare_electron_release.py@@ -22,17 +22,26 @@ def validate_sunset(manifest, tag):if not entry.get("signature"):raise ValueError("Missing Tauri signature")+def channel_for(version):+ """`X.Y.Z` is Stable, `X.Y.Z-beta.N` is Beta; any other shape is not a release."""+ if re.fullmatch(r"\d+\.\d+\.\d+", version):+ return "stable"+ if re.fullmatch(r"\d+\.\d+\.\d+-beta\.\d+", version):+ return "beta"+ raise ValueError(f"Not a stable or beta release version: {version}")+def prepare(assets, tag, sunset_tag=None):version = json.loads(Path("package.json").read_text())["version"]if tag != f"v{version}":raise ValueError("Tag must match package version")+ channel = channel_for(version)files = [p for p in assets.iterdir() if p.is_file()]- release = {"tagName": tag, "isPrerelease": False, "assets": [+ release = {"tagName": tag, "isPrerelease": channel == "beta", "assets": [{"name": p.name, "size": p.stat().st_size,"digest": "sha256:" + hashlib.sha256(p.read_bytes()).hexdigest()}for p in files]}- verify_release(release, assets, channel="stable", version=version)- for manifest in assets.glob("electron-stable-*.yml"):+ verify_release(release, assets, channel=channel, version=version)+ for manifest in assets.glob(f"electron-{channel}-*.yml"):text = manifest.read_text()artifact = re.search(r"^\s+- url:\s*(.+)$", text, re.M)[1].strip().strip("'\"")expected = re.search(r"^\s{4}sha512:\s*(.+)$", text, re.M)[1].strip().strip("'\"")@@ -42,7 +51,9 @@ def prepare(assets, tag, sunset_tag=None):for suffix in ("mac-arm64.dmg", "mac-x64.dmg", "linux-x64.deb"):if not (assets / f"VoiceStudio-Electron-{version}-{suffix}").is_file():raise ValueError(f"Missing installer: {suffix}")- if sunset_tag:+ # Archived Tauri clients read `latest/download`, which never serves a+ # prerelease, so betas carry no sunset feeds.+ if sunset_tag and channel == "stable":for name in ("latest.json", "latest-user.json"):validate_sunset(json.loads((assets / name).read_text()), sunset_tag)section = re.search(rf"^## \[{re.escape(version)}\][^\n]*\n(.*?)(?=^## |\Z)",@@ -57,8 +68,15 @@ def prepare(assets, tag, sunset_tag=None):if __name__ == "__main__":parser = argparse.ArgumentParser()- parser.add_argument("--assets", type=Path, required=True)- parser.add_argument("--tag", required=True)+ parser.add_argument("--assets", type=Path)+ parser.add_argument("--tag")parser.add_argument("--sunset-tag")+ parser.add_argument("--print-channel", action="store_true",+ help="Print stable or beta for the package version and exit")args = parser.parse_args()- prepare(args.assets, args.tag, args.sunset_tag)+ if args.print_channel:+ print(channel_for(json.loads(Path("package.json").read_text())["version"]))+ elif args.assets and args.tag:+ prepare(args.assets, args.tag, args.sunset_tag)+ else:+ parser.error("--assets and --tag are required")diff --git a/tests/test_beta_release_channel.py b/tests/test_beta_release_channel.pynew file mode 100644index 000000000..c66af6718--- /dev/null+++ b/tests/test_beta_release_channel.py@@ -0,0 +1,138 @@+"""Beta is a second release channel cut from main: `vX.Y.Z-beta.N` prereleases.++Stable users must never receive a beta, so these guards pin the places where a+beta could leak: GitHub's `latest`, the Docker `:stable`/`:X.Y` tags, the Snap+Store, and the Tauri sunset feeds.+"""+from __future__ import annotations++import base64+import hashlib+import importlib.util+import json+from pathlib import Path++import pytest+import yaml++ROOT = Path(__file__).resolve().parents[1]+WORKFLOWS = ROOT / ".github" / "workflows"+++def release_module(monkeypatch):+ monkeypatch.syspath_prepend(str(ROOT / "scripts"))+ spec = importlib.util.spec_from_file_location(+ "prepare_release_beta_test", ROOT / "scripts/prepare_electron_release.py"+ )+ module = importlib.util.module_from_spec(spec)+ spec.loader.exec_module(module)+ return module+++ ("version", "channel"),+ [("0.5.9", "stable"), ("0.5.9-beta.1", "beta"), ("1.0.0-beta.12", "beta")],+)+def test_channel_follows_the_version_shape(release_module, version, channel):+ assert release_module.channel_for(version) == channel+++ "version", ["0.5.9-rc.1", "0.5.9-beta", "0.5.9-beta.1.2", "0.5.9-alpha.1", "0.5.9+build", "0.5"]+)+def test_other_prerelease_shapes_are_not_releases(release_module, version):+ with pytest.raises(ValueError, match="stable or beta"):+ release_module.channel_for(version)+++def test_beta_release_uses_beta_notes_and_skips_sunset_feeds(release_module, monkeypatch, tmp_path):+ seen = {}+ monkeypatch.setattr(+ release_module, "verify_release", lambda release, *a, **k: seen.update(release=release, **k)+ )+ monkeypatch.setattr(+ release_module,+ "validate_sunset",+ lambda *a: pytest.fail("betas carry no Tauri sunset feeds"),+ )+ monkeypatch.chdir(tmp_path)+ Path("package.json").write_text(json.dumps({"version": "1.2.3-beta.2"}))+ Path("CHANGELOG.md").write_text(+ "## [Unreleased]\n\n- Later\n\n## [1.2.3-beta.2] — 2026-10-22\n\n- Beta fix\n\n"+ "## [1.2.2] — 2026-10-01\n\n- Older\n"+ )+ assets = tmp_path / "assets"+ assets.mkdir()+ for suffix in ("mac-arm64.dmg", "mac-x64.dmg", "linux-x64.deb"):+ (assets / f"VoiceStudio-Electron-1.2.3-beta.2-{suffix}").write_bytes(b"x")+ payload = b"foo"+ digest = base64.b64encode(hashlib.sha512(payload).digest()).decode()+ (assets / "electron-beta-win32-x64.yml").write_text(+ f"files:\n - url: a.exe\n sha512: {digest}\n"+ )+ (assets / "a.exe").write_bytes(payload)+ # An unrelated stable manifest must not be what the checksum loop trusts.+ (assets / "electron-stable-win32-x64.yml").write_text("garbage")+ release_module.prepare(assets, "v1.2.3-beta.2", sunset_tag="v0.5.3")++ assert seen["channel"] == "beta"+ assert seen["release"]["isPrerelease"] is True+ assert (assets / "RELEASE_NOTES.md").read_text() == "- Beta fix\n"+++def test_prepare_rejects_a_tag_that_is_not_the_package_version(release_module, monkeypatch, tmp_path):+ monkeypatch.chdir(tmp_path)+ Path("package.json").write_text(json.dumps({"version": "1.2.3-beta.2"}))+ with pytest.raises(ValueError, match="Tag must match"):+ release_module.prepare(tmp_path, "v1.2.3")+++def _release_workflow() -> dict:+ return yaml.safe_load((WORKFLOWS / "electron-release.yml").read_text(encoding="utf-8"))+++def test_release_workflow_stamps_the_channel_into_every_feed():+ workflow = _release_workflow()+ assert workflow["jobs"]["validate"]["outputs"]["channel"]+ env = workflow["jobs"]["package"]["env"]["VOICESTUDIO_UPDATE_CHANNEL"]+ assert "needs.validate.outputs.channel" in env+ assert "electron-stable" not in env, "a hardcoded stable feed would ship betas to stable users"+++def test_a_beta_is_never_published_as_latest():+ steps = {s["name"]: s for s in _release_workflow()["jobs"]["release"]["steps"] if "name" in s}+ publish = steps["Publish only when explicitly requested"]["run"]+ beta_branch, stable_branch = publish.split("else")+ assert "--prerelease=true" in beta_branch and "--latest=false" in beta_branch+ assert "--latest" in stable_branch and "--prerelease=false" in stable_branch+ draft = steps["Create or update draft"]["run"]+ assert 'CHANNEL" = beta' in draft and '--prerelease="$PRERELEASE"' in draft+++def test_only_stable_moves_the_stable_container_tags():+ run = next(+ s["run"]+ for s in _release_workflow()["jobs"]["release"]["steps"]+ if s.get("name") == "Publish release container images"+ )+ assert 'CHANNEL" = stable' in run and 'promote_stable="$PROMOTE"' in run+ docker = (WORKFLOWS / "docker.yml").read_text(encoding="utf-8")+ assert docker.count('test "$PROMOTE_STABLE" != "true"') == 2, "both flavors must refuse"+ for line in docker.splitlines():+ if "pattern={{major}}.{{minor}}" in line or "value=stable" in line:+ assert "!contains(github.ref, '-')" in line, f"beta must not move: {line.strip()}"+++def test_snap_store_skips_beta_tags():+ snap = yaml.safe_load((WORKFLOWS / "snap-store.yml").read_text(encoding="utf-8"))+ assert "-beta." in snap["jobs"]["package"]["if"]+ assert snap["jobs"]["upload"]["needs"] == "package"+++def test_every_electron_channel_regex_accepts_beta():+ config = (ROOT / "electron" / "electron-builder.config.mjs").read_text(encoding="utf-8")+ assert "stable|beta" in config+ assert "electron-beta-linux-x64" in (+ ROOT / "electron" / "scripts" / "embed-appimage-update.mjs"+ ).read_text(encoding="utf-8")diff --git a/tests/test_docker_workflow.py b/tests/test_docker_workflow.pyindex 898e106fa..df2331809 100644--- a/tests/test_docker_workflow.py+++ b/tests/test_docker_workflow.py@@ -77,7 +77,8 @@ def test_token_published_releases_still_publish_images():runs = "\n".join(step.get("run", "") for step in job["steps"])assert "gh workflow run docker.yml" in runsassert "backfill_release=true" in runs- assert "promote_stable=true" in runs+ # Stable promotes :stable; a beta dispatches the same path with promotion off.+ assert 'promote_stable="$PROMOTE"' in runs and "PROMOTE=true" in runs# Every -f key must be a real docker.yml dispatch input, or the run fails at publish time.command = runs[runs.index("gh workflow run docker.yml"):]command = command[: command.find("\n", command.find("promote_stable"))]diff --git a/tests/test_electron_release_assets.py b/tests/test_electron_release_assets.pyindex 4dfec0a6c..2ade3179c 100644--- a/tests/test_electron_release_assets.py+++ b/tests/test_electron_release_assets.py@@ -53,7 +53,7 @@ def _release(assets.append({"name": f"{artifact}.blockmap", "size": 10, "digest": "sha256:map"})return {"tagName": f"v{version}",- "isPrerelease": False,+ "isPrerelease": channel == "beta","assets": assets,}@@ -104,6 +104,34 @@ def test_stable_requires_a_plain_version(tmp_path: Path):verify_release(_release(tmp_path), tmp_path, channel="stable", version="0.5.3-144")+def test_beta_release_is_a_prerelease_with_beta_manifests(tmp_path: Path):+ release = _release(tmp_path, channel="beta", version="0.5.9-beta.1")+ result = verify_release(release, tmp_path, channel="beta", version="0.5.9-beta.1")+ assert len(result) == 4+ assert all(item.startswith("electron-beta-") for item in result)+++def test_beta_must_never_be_published_as_a_full_release(tmp_path: Path):+ """A non-prerelease beta would become GitHub's `latest` and reach stable users."""+ release = _release(tmp_path, channel="beta", version="0.5.9-beta.1")+ release["isPrerelease"] = False+ with pytest.raises(ReleaseContractError, match="prerelease flag"):+ verify_release(release, tmp_path, channel="beta", version="0.5.9-beta.1")+++def test_stable_must_not_be_flagged_a_prerelease(tmp_path: Path):+ release = _release(tmp_path)+ release["isPrerelease"] = True+ with pytest.raises(ReleaseContractError, match="prerelease flag"):+ verify_release(release, tmp_path, channel="stable", version="0.5.3")++[email protected]("version", ["0.5.9", "0.5.9-rc.1", "0.5.9-beta", "0.5.9-beta.1.2"])+def test_beta_requires_a_beta_version(tmp_path: Path, version: str):+ with pytest.raises(ReleaseContractError, match="wrong shape"):+ verify_release(_release(tmp_path), tmp_path, channel="beta", version=version)++def test_stable_release_tag_must_match_the_manifest_version(tmp_path: Path):release = _release(tmp_path, channel="stable", version="0.5.3")release["tagName"] = "v0.5.2"diff --git a/tests/test_published_image_path_is_pinned.py b/tests/test_published_image_path_is_pinned.pyindex 680e33489..38519196b 100644--- a/tests/test_published_image_path_is_pinned.py+++ b/tests/test_published_image_path_is_pinned.py@@ -36,7 +36,7 @@ def test_both_ghcr_paths_are_published_by_both_builds():def test_current_release_tags_are_backfilled_for_both_gpu_flavors():text = open(WORKFLOW, encoding="utf-8").read()- assert text.count('[[ "$RELEASE_REF" =~ ^v[0-9]+\\.[0-9]+\\.[0-9]+$ ]]') == 2+ assert text.count('[[ "$RELEASE_REF" =~ ^v[0-9]+\\.[0-9]+\\.[0-9]+(-beta\\.[0-9]+)?$ ]]') == 2assert text.count('${RELEASE_REF}^{commit}') == 2assert text.count('VERSION="${RELEASE_REF#v}"') == 4assert text.count("test \"$PACKAGE_VERSION\" = '1.0.0'") == 2