SpeakTrue

Native Speech Parity Anchor

Reader and action

This anchor is for native engineers extending SpeakTrue speech generation and Soundboard save behavior. After reading it, a native engineer should be able to re-run the Android parity evidence, understand which fields are guarded locally, and preserve the server-side artifact_path save parity path while keeping local upload as compatibility fallback.

Android scope

Android is the current native anchor for the speech workflow contract. Its local unit tests cover the generation response parser and the TTS presentation state that stores or clears generated speech artifacts.

This is executable local proof only. It does not prove live Supabase, ElevenLabs, object-storage, authorization, or production provider behavior. Live workflow proof remains owned by the browser/runtime and edge-function checks listed in the canonical speech workflow contract.

Executable evidence

Run the Android parity tests with:

./android/gradlew -p android :app:testDebugUnitTest --tests 'com.speaktrue.features.tts.data.TTSRepositoryTest' --tests 'com.speaktrue.features.tts.presentation.TTSViewModelTest'

The Android evidence is concentrated in these test classes:

Contract fields proven

Android local unit evidence now covers these speech workflow contract expectations:

Diagnostics and redaction rules

Native diagnostics must remain useful to agents and tests without exposing secrets or local machine state.

Save-to-Soundboard parity status

Android now proves the native handoff to server-side save-to-Soundboard artifact_path parity when canonical artifact metadata exists. Full playback mode requests the Supabase TTS artifact response mode; that stores the generated audio as a server artifact and returns artifact_id, artifact_path, audio_path, and download_path. TTSViewModel.saveLastAudioToSoundboard() then calls SoundboardRepository.saveGeneratedArtifactClip(), which posts the canonical metadata to the soundboard-save-generated edge function instead of downloading and re-uploading the audio locally.

The local-upload path remains as compatibility behavior only when a generation response is binary/audio-url-only and no canonical artifact exists.

Remaining production proof is live Supabase/ElevenLabs smoke evidence against deployed tts-generate artifact mode plus soundboard-save-generated; local unit and Deno tests prove the client/server contract and failure semantics.

Full contract guard commands

Run these checks before changing the native anchor or canonical speech workflow contract:

test -s docs/contracts/native-speech-parity-anchor.md && grep -q "TTSRepositoryTest" docs/contracts/native-speech-parity-anchor.md && grep -q "TTSViewModelTest" docs/contracts/native-speech-parity-anchor.md
./android/gradlew -p android :app:testDebugUnitTest --tests 'com.speaktrue.features.tts.data.TTSRepositoryTest' --tests 'com.speaktrue.features.tts.presentation.TTSViewModelTest' --tests 'com.speaktrue.features.soundboard.data.SoundboardRepositoryTest'
deno test backend/supabase/functions/soundboard-save-generated/handler_test.ts
node web/python-web-app/tests/js/tts_soundboard_workflow_runtime_check.mjs
deno test backend/supabase/functions/tts-generate/handler_test.ts
python3 -c "from graphify.watch import _rebuild_code; from pathlib import Path; _rebuild_code(Path('.'))"