Repository navigation
feat(tts): reintroduce Japanese TTS and read Visual Preview summaries aloud - #259
Conversation
… profile Add tts-speaker, a thin FastAPI gateway that normalizes and chunks text, calls Irodori-TTS-Server with retries, and terminates inbound mTLS via the in-process PKI copied from news-creator. Add an Alt-owned build of Irodori-TTS-Server pinned to upstream commits, with a CUDA memory probe, operator scripts for pinned checkpoints, local MF quantization and voice registration, and a stdlib harness that measures VRAM and RTF for the four candidate configurations. Both services live in compose/tts.yaml under the tts profile, so a plain up or deploy never starts them. Register tts-speaker in the service registry, CI, CodeQL, the ops-surface inventory and the PKI provisioner lists, and record the decision as proposed ADR-000991, which supersedes ADR-000900.
…expandable segments Peak GPU memory follows the length of the synthesized audio, so 100-char chunks overshot the budget at 1.0x for every configuration. Lower the tts-speaker chunk default to 60 characters, enable PyTorch expandable segments for irodori-tts, align the worst-case bench inputs, add a playback speed option to the harness, and record the measurement progress in ADR-000991.
… to C3 compose run rebuilt the image on every call because of pull_policy: build, so voice registration took minutes; the scripts now use docker run on the local image. C3 sounded most natural in listening tests, so it becomes the default configuration, and ADR-000991 records the voice and G5 progress.
Listening tests found 1.25x the most natural and 2.0x dropping characters. ADR-000991 records the speed policy and the G4/G5 listening verdicts.
…FF and FE Restore alt.tts.v1.TTSService with only SynthesizeStream (public) and its generated code, and add failing tests for the tts-speaker Connect service and streaming usecase, the BFF dedicated TTS route (streaming pass-through, auth, disabled failed_precondition, wiring log), the frontend player, speech state and Visual Preview button, plus a Playwright @contract suite for the stream framing. ADR-000992 records the decision as proposed.
…nect RPC tts-speaker now serves alt.tts.v1.TTSService/SynthesizeStream instead of the REST endpoint. Each 60-character chunk is sent as a self-contained 16-bit PCM WAV as soon as it is synthesized, so the first audio arrives after one chunk instead of after the whole text. Requests take an optional speed (0.5-1.5, default 1.25). A client disconnect cancels the synthesis and releases the single-flight lock instead of waiting for GC. The BFF proxies the procedure over a dedicated HTTP/1.1 mTLS transport to tts-speaker:9443 and requires TTS_PROXY=enabled|disabled at startup. When disabled it answers with a failed_precondition end-of-stream frame; when enabled without a transport it panics instead of falling back. The Visual Preview card shows "Play summary" once the summary has fully arrived and plays the complete server text, not the typed-out prefix. Chunks are decoded and scheduled back to back on one shared AudioContext that is resumed inside the tap, a closed context is replaced on the next tap, and the status is announced through a live region. A disabled proxy latches "Speech unavailable"; other failures are retryable. Contract coverage follows the streaming precedent: a Playwright @contract suite against tts-speaker with a fake Irodori upstream, BFF httptest cases, and mocked-stream FE E2E. No Pact, see ADR-000992. Some RED tests were adjusted while going green: timing assertions in the speech hook test were relaxed to vi.waitFor, and the FE E2E mock now sends failed_precondition as an HTTP 200 end-of-stream frame to match the BFF.
️✅ There are no secrets present in this pull request anymore.If these secrets were true positive and are still valid, we highly recommend you to revoke them. 🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request. |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
# Conflicts: # alt-butterfly-facade/CLAUDE.md # alt-butterfly-facade/README.md # alt-frontend-sv/tests/e2e/fixtures/mockData.ts # proto/buf.yaml
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d8341140e3
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| - PEER_IDENTITY_TRUSTED=off | ||
| - PKI_ENROLLMENT=disabled | ||
| - INBOUND_MTLS=false | ||
| - LOG_LEVEL=info |
There was a problem hiding this comment.
Use an accepted log level in the staging service
The tts-speaker staging container exits during configuration loading because Settings.log_level only accepts the uppercase literals defined in tts-speaker/tts_speaker/config/settings.py, while this profile supplies lowercase info. Consequently, the new tts-speaker Playwright suite never reaches its health check and fails every run; set this to INFO or normalize case in the settings validator.
Useful? React with 👍 / 👎.
The staging stack passes LOG_LEVEL=info like every other service, and the upper-case Literal rejected it, so tts-speaker exited at startup.
Summary
tts-speakerservice (ADR-000991, accepted). It runs under the opt-in compose profiletts; weights and reference voices stay local-only.tts-speakerstreamsalt.tts.v1.TTSService/SynthesizeStream, one self-contained WAV per 60-character chunk. Default speed is 1.25x, capped at 1.5x.TTS_PROXY=enabled|disabledis required at startup.Testing
@contractsuite against a fake Irodori upstreamgo vet,go test ./...bun run check,bun run test, the speech browser tests, mobile E2E for Visual Preview speechdocdag validateBefore merge / deploy
ttsprofile running. ADR-000992 moves to accepted after that.ttsprofile off, the button shows a retryable error.TTS_PROXY=disabledshows a fixed "Speech unavailable".🤖 Generated with Claude Code