Skip to content

Premium Cloud TTS Voices — Android implementation (BYOK, 5 presets) #451

Closed

Description

@libravault-xyz

Summary

Implement Premium Cloud TTS Voices on Android, per
docs/cloud-tts-premium-prd.md
(merge that PRD PR first if it hasn't landed — this issue depends on it).
Governance sign-off: #449.

Scope (v1 — see PRD §3 for what's explicitly deferred)

  • New core:cloudtts module, same flavor-source-set shape as core:billing:
    shared CloudTtsProvider interface in src/main, five vendor HTTP
    adapters (ElevenLabs, OpenAI, Google Cloud TTS, Azure AI Speech, Amazon
    Polly) in the non-F-Droid flavor source set, NoOp implementation in
    src/fdroid — confirm zero new dependency reaches the F-Droid runtime
    classpath the same way core:billing did.
  • Secure key storage: Android Keystore-backed EncryptedSharedPreferences,
    never plaintext, never logged.
  • Two independent gates, both required before any network call (PRD §4):
    SupportBillingClient's subscriptionActive, and a separate "Cloud
    Voices" consent toggle (off by default) with its own disclosure copy —
    buying the subscription must not itself enable any network call.
  • Settings UI: new "Cloud Voices" section (visible only when subscribed),
    provider picker, per-provider key entry with a cheap validation call,
    first-enable disclosure modal per PRD §6.
  • Wire into the existing Read Aloud engine (core:tts / feature:player,
    see [enhancement] Wire Android Read Aloud: EPUB mini-bar, matching the audiobook player #137/[enhancement] Full Player-screen parity for Android Read Aloud (match iOS's expandable player) #138) as an additional voice source, not a replacement for
    on-device TTS. Falls back to on-device TTS on any cloud error.

Testing (PRD §7)

  • Per-adapter unit tests against mocked HTTP responses — no real network
    calls in CI.
  • Four-quadrant gate test (subscription × consent, on/off).
  • Secure-storage round-trip test.
  • Fallback-on-error test per adapter.
  • Regression test pinning the five fixed endpoint hosts.

Out of scope (do not implement here)

Custom/arbitrary provider endpoint, any LibraVault-run proxy, in-app
provider account creation/OAuth, usage-cost telemetry beyond a simple local
counter. Open a new issue for any of these if requested later.

Activity

  1. added
    enhancement
    status:triage
    on Aug 22, 2026
  2. github-actions commented on Aug 22, 2026

    @github-actions
    Contributor

    Triage: stopping before implementation, for two independent reasons.

    1. Unmet dependency. This issue explicitly depends on the PRD landing first ("merge that PRD PR first if it hasn't landed"). PR #450 (docs: PRD for Premium Cloud TTS Voices (BYOK)) is still open — currently status:needs-review, awaiting the principal review agent, not yet merged to dev. Implementing against a PRD that could still change under review risks building against a moving target.

    2. Networking policy. My operating rules require stopping and asking a human before adding any new networking dependency or network call, non-negotiably, regardless of how well-scoped the surrounding feature is. This issue's entire v1 scope is exactly that: five new HTTP adapters calling third-party TTS vendor APIs (ElevenLabs, OpenAI, Google Cloud TTS, Azure AI Speech, Amazon Polly) with user-supplied keys and the text of whatever the user is reading. I'm aware #449 already records product-owner sign-off for this specific networking-scope reversal — that covers the product decision, but not this pipeline's separate requirement that an agent not add the networking code itself without a human explicitly greenlighting that step too.

    Applying security given the key-storage and third-party data-transmission surface, and status:needs-info in place of status:triage. Recommend, once #450 merges: a human (or a re-triage after explicit go-ahead) confirms this is ready for an agent to implement, and consider whether the five-vendor scope should be split into smaller PRs (e.g. module scaffolding + gating first, then adapters) rather than one large change — this is a big enough diff that agent-policy.yml's 400-line auto-mergeable threshold will be blown through regardless, but smaller review units still help.

    No branch or PR opened for this issue.

  3. added
    status:needs-info
    security
    and removed
    status:triage
    on Aug 22, 2026
  4. libravault-xyz commented on Aug 22, 2026

    @libravault-xyz
    CollaboratorAuthor

    Sweep note (blocker-cleared re-check): This issue's triage-stop comment cited PR #450 ("docs: PRD for Premium Cloud TTS Voices (BYOK)") as still open and blocking implementation. #450 has since merged (2026-08-22T18:35:22Z). That clears the first of the two reasons triage stopped here — the second (the standing "stop and ask before adding any new networking dependency" rule, given this issue's v1 scope is five new HTTP adapters with user-supplied keys) is a real scoping/security decision this routine isn't authorized to make.

    Swapping status:needs-info → status:blocker-cleared so this is visible as unblocked-on-the-PRD-but-still-needs-a-human-go-ahead, rather than flipping straight to status:ready-for-dev myself.


    Generated by Claude Code

  5. added
    status:blocker-cleared
    and removed
    status:needs-info
    on Aug 22, 2026
  6. libravault-xyz commented on Aug 23, 2026

    @libravault-xyz
    CollaboratorAuthor

    Human authorization to proceed (security-sensitive gate acknowledged).

    Scope adjustment before implementation starts: App Store Connect / Play Console tax & banking setup is not complete yet, so the real SupportBillingClient.subscriptionActive purchase path has nothing live to gate against on-device.

    For this pass, implement the subscription half of the four-quadrant gate as a mock/stub "subscription active" toggle (e.g. a debug-settings or build-config flag), not wired to a real Play Billing purchase flow. Keep it behind the same SupportBillingClient interface shape so swapping in the real purchase-verified value later is a one-line change, not a rework. The consent-toggle half of the gate stays real from day one. Call this out explicitly in the PR description so QA/review don't mistake the stub for the real gate.

    Proceeding under this constraint.

  7. libravault-xyz commented on Aug 23, 2026

    @libravault-xyz
    CollaboratorAuthor

    Correction to my previous comment: drop the mock/stub subscription toggle — checked PRD §8 (Rollout) after posting, and it already specifies the right approach: wire straight to the real SupportBillingClient.observeSubscriptionActive(). It safely evaluates false until the Play Console product exists, so the feature ships inert and lights up automatically once store setup completes — no stub, no follow-up swap needed. Consent toggle as originally scoped. Human authorization to proceed stands.

  8. libravault-xyz commented on Aug 23, 2026

    @libravault-xyz
    CollaboratorAuthor

    PR 1 of 4 (Android foundation) opened: #462 — module skeleton, secure BYOK key storage (reusing core:vaultstore's HardwareKeyWrapFactory, not EncryptedSharedPreferences per the PRD's literal wording — see PR description for why), and the four-quadrant gate wired to the real subscriptionActive signal. 13 new tests, verified locally (all passing on both flavors). No vendor adapters/engine/UI yet — those are PRs 2-4, each gated on the previous merging.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    androidenhancementsecuritystatus:blocker-cleared

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions