This pack is for a reviewer landing cold on M004/S05. After reading it, the reviewer should be able to trace R045 and R046 from the product target through local executable proof, run the validation guard for this pack, and perform the prerequisite-gated manual UAT for the legacy web generate speech to Soundboard workflow without using privileged browser storage writes.
This document validates the M004 product-visible path where generated speech is saved for Soundboard reuse. It consumes these tracked source documents instead of replacing them:
docs/product/generate-speech-soundboard-workflow-target.md defines the legacy web target surface and acceptance criteria.docs/contracts/speech-workflow-contract.md defines the canonical request, success, error, retryability, and artifact path semantics for web and native callers.docs/contracts/native-speech-parity-anchor.md records the Android native parity evidence, including server-side artifact_path save parity.docs/architecture/m004-storage-revisit-decision.md records the D019 storage revisit outcome and the deployed provider/storage smoke follow-up boundary.web/python-web-app/tests/js/tts_soundboard_workflow_runtime_check.mjs is the deterministic browser VM diagnostic for the generated speech to Soundboard handoff.This pack does not claim live Supabase, GCS, ElevenLabs, or production-storage proof. Manual UAT that depends on live provider or storage credentials is prerequisite-gated and must be recorded separately when those credentials and a safe test account are available.
artifact_path Soundboard save parity guarded locally, and schedule provider smoke evidence before broad migration rollout.R045 requires users to generate speech from text and save or reuse the generated result from the Soundboard workflow. The proof chain is:
window.latestTTSSpeechArtifact and window.__ttsSoundboardWorkflowTestHooks.getState() expose the generated artifact and save diagnostics without depending on toast prose alone./api/text-to-speech, /api/soundboard/save-clip, canonical artifact fields, save metadata, category reload metadata, and structured missing/invalid artifact failures.R045 is advanced by local deterministic proof and manual instructions. It is not fully closed by this T01 document alone; later S05 validation must record fresh command evidence and any prerequisite-gated manual UAT result. The user-visible mapping includes category reload. Play the saved clip from Soundboard. Use the download control. Reuse the saved clip as follow-through checks for the saved artifact.
R046 requires a stable request, response, and error contract with explicit artifact path and status semantics. The proof chain is:
success, status, artifact_id, artifact_path, audio_path, and download_path.category, original text, and canonical artifact_path; it accepts audio_path for compatibility but keeps privileged storage writes server-side.error, error_code, operation, status, and retryable, with bounded details that do not expose provider secrets, bearer tokens, absolute paths, or full upstream bodies.tts-generate handler contract.TTSRepositoryTest, TTSViewModelTest, and SoundboardRepositoryTest) guard native parsing, UI state, server-side save handoff, canonical generation success, malformed success rejection, traversal/absolute artifact path rejection, structured failures, stale-artifact clearing, and save-retry preservation.R046 is advanced by this cross-surface mapping and by requiring the exact commands below. Native/server save-to-Soundboard parity now forwards artifact_path to server-side save logic instead of relying only on the Android local-upload path. The remaining follow-up is live provider/storage smoke against deployed tts-generate artifact mode plus soundboard-save-generated.
Run commands from the repository root. These checks do not require production secrets.
node web/python-web-app/tests/js/tts_soundboard_workflow_runtime_check.mjs
Proof target: browser generation artifact retention, save payload construction, structured browser diagnostics, missing-artifact blocking, malformed generation handling, and safe retry behavior.
web/python-web-app/venv/bin/pytest web/python-web-app/tests/api/test_speech_contract_hardening.py web/python-web-app/tests/api/test_tts_soundboard_workflow_target.py web/python-web-app/tests/api/test_tts.py web/python-web-app/tests/api/test_soundboard_supabase_mode.py web/python-web-app/tests/test_m004_workflow_validation_pack.py
Proof target: canonical artifact fields, save-to-Soundboard server path, Soundboard reload metadata, structured Flask failures, Supabase-mode compatibility, and this pack’s structural coverage.
deno test backend/supabase/functions/tts-generate/handler_test.ts
Proof target: edge handler validation, provider/runtime failures, success envelope shape, and error semantics at the privileged server boundary.
./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'
Proof target: native contract parsing, UI state handling, generated speech artifacts, server-side save handoff, structured diagnostics, stale-artifact clearing, unsafe path rejection, and retry-preserving save failures.
web/python-web-app/venv/bin/pytest web/python-web-app/tests/test_m004_workflow_validation_pack.py
Proof target: this document contains required R045/R046, D017/D018/D019, command, UAT, diagnostic, redaction, and tracked-source references.
python3 scripts/verify_m004_s05_workflow_validation.py
Proof target: later S05 validation evidence rows, required command strings, diagnostics, and redaction rules. This command is part of the S05 closure bar and is available through the repository-root validation gate.
These rows are deterministic local proof from the S05 final validation pass. They do not require production secrets and do not claim live provider/storage smoke.
| Command | Exit code | Result summary | Proof target |
|---|---|---|---|
node web/python-web-app/tests/js/tts_soundboard_workflow_runtime_check.mjs |
0 | ✅ pass — browser VM reported tts_soundboard_workflow_runtime_check: OK. |
R045 browser artifact handoff, save payload construction, missing-artifact blocking, malformed generation handling, save diagnostics, and retry behavior. |
web/python-web-app/venv/bin/pytest web/python-web-app/tests/api/test_speech_contract_hardening.py web/python-web-app/tests/api/test_tts_soundboard_workflow_target.py web/python-web-app/tests/api/test_tts.py web/python-web-app/tests/api/test_soundboard_supabase_mode.py web/python-web-app/tests/test_m004_workflow_validation_pack.py |
0 | ✅ pass — 44 Flask/API/pack tests passed. | R045 save-to-Soundboard server workflow and R046 Flask contract hardening, canonical artifact fields, structured failures, Supabase-mode compatibility, and pack structural coverage. |
deno test backend/supabase/functions/tts-generate/handler_test.ts |
0 | ✅ pass — 11 edge handler tests passed. | R046 Supabase Edge request validation, auth/config failures, quota/provider failures, bounded details, and success envelope pass-through. |
./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' |
0 | ✅ pass — Gradle completed :app:testDebugUnitTest successfully for the focused TTS repository, view-model, and Soundboard repository classes. |
R046 Android native generation artifact parsing, server-side save handoff, structured diagnostics, stale-artifact clearing, unsafe path rejection, and retry-preserving save failure state. |
web/python-web-app/venv/bin/pytest web/python-web-app/tests/test_m004_workflow_validation_pack.py |
0 | ✅ pass — validation-pack pytest passed after evidence update. | S05 structural guard for R045/R046 mappings, D017/D018/D019 references, required commands, diagnostics, UAT guidance, and redaction constraints. |
python3 scripts/verify_m004_s05_workflow_validation.py |
0 | ✅ pass — workflow validation gate passed after evidence update. | S05 final gate for required evidence rows, required command strings, R045/R046 mapping, diagnostics, D019 deferred storage scope, and unsafe-content redaction constraints. |
Deterministic local proof covers the browser VM handoff, Flask workflow contracts, Supabase Edge handler semantics, Android native parity state, and this pack’s structural validation. It is sufficient for the M004/S05 local closure bar because it exercises the generate speech → save/reuse contract without requiring production credentials.
Deferred smoke remains intentionally separate. Live ElevenLabs generation, Supabase-hosted edge execution, GCS or production object-storage writes, billing entitlements, and user-media persistence require safe credentials and a disposable account; those runs should be recorded as prerequisite-gated provider/storage smoke evidence and must not rewrite the deterministic local proof above.
Manual UAT is prerequisite-gated. Do not claim it as local deterministic proof unless all prerequisites are available and the result is recorded with date, runtime mode, and test account details that do not include secrets.
Prerequisites:
Lecture1 or a clearly named test category.Prohibited during UAT:
M004 S05 reusable speech UAT, and generate speech.success: true, numeric status: 200, artifact_id, artifact_path, audio_path, and download_path are present.window.__ttsSoundboardWorkflowTestHooks.getState() if available. Confirm the latest artifact is present and no stale generation diagnostic is active.category, original text, and artifact_path or compatible audio_path. Confirm it does not include provider credentials, service-role keys, direct object-storage write credentials, traversal paths, or absolute filesystem paths.success: true and clip metadata including filename and category.These checks verify structured invalid or missing artifact failures without privileged browser storage writes.
artifact_path and audio_path.SPEECH_ARTIFACT_REFERENCE_REQUIRED, operation save-clip-to-soundboard, status 400, and retryable: false.SPEECH_ARTIFACT_NOT_FOUND, operation save-clip-to-soundboard, status 404, and retryable: false.Use these signals before changing code:
window.latestTTSSpeechArtifact and window.__ttsSoundboardWorkflowTestHooks.getState().error_code, status, retryability, message, bounded details, and saving flag./api/text-to-speech and /api/soundboard/save-clip JSON envelopes with canonical success fields or structured failure fields.save-clip-to-soundboard, provider upload path, text sidecar path, clip-order update result, and cache invalidation log.tts-generate handler status and structured provider/runtime error mapping.Triage order:
error_code and status instead of message prose.artifact_path Soundboard save handoff, and retry-preserving save failure state.A reviewer can act on this pack when all items are true: