|
| 1 | +# PR_26177_BRAVO_008-delete-empty-tts-profile-parents |
| 2 | + |
| 3 | +## Branch Validation |
| 4 | +- PASS: Initial branch was `bravo/26177-text-to-speech`. |
| 5 | +- PASS: Work stayed on the active Bravo branch; main was not checked out. |
| 6 | +- PASS: No `start_of_day` folders were modified. |
| 7 | + |
| 8 | +## Scope Summary |
| 9 | +- Added server-side cleanup for TTS parent profiles that have no child emotion settings. |
| 10 | +- Empty TTS parent profiles are deleted instead of repaired with fallback child rows. |
| 11 | +- Orphaned profile-emotion settings are pruned before empty-parent cleanup. |
| 12 | +- TTS profile creates now require at least one child emotion setting. |
| 13 | +- TTS profile updates that remove all child emotion settings delete the parent and return a 410 error. |
| 14 | +- TTS UI save validation now blocks empty parent saves before an API write. |
| 15 | +- Guest save redirect behavior to `account/sign-in.html` is preserved. |
| 16 | + |
| 17 | +## Requirement Checklist |
| 18 | +- PASS: Empty parent TTS Profile rows are removed from service/runtime display. |
| 19 | +- PASS: Orphaned child emotion settings are removed. |
| 20 | +- PASS: No fallback child emotion rows are created. |
| 21 | +- PASS: Broken/empty profiles are deleted, not repaired. |
| 22 | +- PASS: UI save validation prevents creating empty parent rows. |
| 23 | +- PASS: Guest save redirect behavior is unchanged. |
| 24 | +- PASS: Targeted unit/API and impacted Playwright specs were updated. |
| 25 | +- PASS: No governance changes. |
| 26 | +- PASS: No unrelated cleanup or repo-wide refactor. |
| 27 | + |
| 28 | +## File Inventory |
| 29 | +- `assets/toolbox/text-to-speech/js/index.js` |
| 30 | +- `docs_build/database/seed/messages.json` |
| 31 | +- `src/dev-runtime/messages/messages-postgres-service.mjs` |
| 32 | +- `tests/dev-runtime/MessagesPublishValidation.test.mjs` |
| 33 | +- `tests/playwright/tools/MessagesTool.spec.mjs` |
| 34 | +- `tests/playwright/tools/TextToSpeechFunctional.spec.mjs` |
| 35 | +- `docs_build/dev/reports/PR_26177_BRAVO_008-delete-empty-tts-profile-parents.md` |
| 36 | +- `docs_build/dev/reports/codex_changed_files.txt` |
| 37 | +- `docs_build/dev/reports/codex_review.diff` |
| 38 | + |
| 39 | +## DB/API Inventory |
| 40 | +- `messages_tts_profiles`: profiles without child settings are deleted. |
| 41 | +- `messages_tts_profile_emotion_settings`: orphaned rows are deleted before empty-parent evaluation. |
| 42 | +- `messages_records`, `messages_segments`, `messages_event_actions`: stale rows referencing deleted empty parents are removed to avoid orphaned database references. |
| 43 | +- `POST /api/messages/tts-profiles`: rejects empty parent saves. |
| 44 | +- `PATCH /api/messages/tts-profiles/:key`: deletes the parent when the requested emotion settings become empty. |
| 45 | + |
| 46 | +## Test Inventory |
| 47 | +- Added/extended `Messages seed cleanup deletes retired parent TTS profiles and orphaned settings` to include empty parent cleanup and stale reference deletion. |
| 48 | +- Added `Messages TTS profile saves reject empty parent profiles instead of creating fallback children`. |
| 49 | +- Updated Text To Speech Playwright expectations to block empty UI saves and use API-created profiles with child settings for preview. |
| 50 | +- Updated Messages Playwright profile setup to create profiles through the Local API with child settings supplied up front. |
| 51 | + |
| 52 | +## Validation Lane Report |
| 53 | +- PASS: `node --check assets/toolbox/text-to-speech/js/index.js` |
| 54 | +- PASS: `node --check src/dev-runtime/messages/messages-postgres-service.mjs` |
| 55 | +- PASS: `node --check tests/dev-runtime/MessagesPublishValidation.test.mjs` |
| 56 | +- PASS: `node --check tests/playwright/tools/TextToSpeechFunctional.spec.mjs` |
| 57 | +- PASS: `node --check tests/playwright/tools/MessagesTool.spec.mjs` |
| 58 | +- PASS: `node --test tests/dev-runtime/MessagesPublishValidation.test.mjs` (8/8) |
| 59 | +- PASS: `node --test --test-name-pattern "Messages Local API seeds" tests/dev-runtime/DbSeedIntegrity.test.mjs` (1/1) |
| 60 | +- PASS: `node --test tests/tools/Text2SpeechShell.test.mjs` (6/6) |
| 61 | +- BLOCKED: `npx playwright test tests/playwright/tools/TextToSpeechFunctional.spec.mjs tests/playwright/tools/MessagesTool.spec.mjs tests/playwright/tools/EventsTool.spec.mjs --project=playwright` |
| 62 | + - Browser launch failed before page code ran because Chromium is missing at `C:\Users\davidq\AppData\Local\ms-playwright\chromium-1217\chrome-win64\chrome.exe`. |
| 63 | + |
| 64 | +## Manual Validation Notes |
| 65 | +- Reviewed the TTS profile create/update/list paths for empty-parent persistence. |
| 66 | +- Verified no local storage product-data path or fallback child creation was added. |
| 67 | +- Playwright/manual browser validation remains blocked by the missing local Chromium install. |
| 68 | + |
| 69 | +## Known Issues |
| 70 | +- Playwright browser validation cannot complete in this environment until the matching Chromium browser is installed. |
| 71 | + |
| 72 | +## Repo-Structured ZIP |
| 73 | +- `tmp/PR_26177_BRAVO_008-delete-empty-tts-profile-parents_delta.zip` |
0 commit comments