Skip to content

Commit 7415046

Browse files
author
Team Bravo
committed
PR_26174_BRAVO_messages_tts_stack
1 parent c4a495f commit 7415046

38 files changed

Lines changed: 4972 additions & 1208 deletions

File tree

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
# PR_26174_BRAVO_001-messages-table-structure
2+
3+
## Summary
4+
5+
Converted Message Studio to the approved table-first Messages surface with server-owned persistence, inline row editing, and guarded message deletion. The visible table now uses Theme V2 table classes and exposes Message, Text, Tags, Emotion, Voice, Updated, and Actions columns.
6+
7+
## Branch Validation
8+
9+
| Check | Result | Notes |
10+
| --- | --- | --- |
11+
| Current branch is main | PASS | `git branch --show-current` returned `main`. |
12+
13+
## Requirement Checklist
14+
15+
| Requirement | Result | Notes |
16+
| --- | --- | --- |
17+
| Convert existing Messages tool/page to approved GFS table-first layout | PASS | `toolbox/messages/index.html` and `toolbox/messages/messages.js` now render the Messages table as the primary center surface. |
18+
| Columns: Message, Text, Tags, Emotion, Voice, Updated, Actions | PASS | Static table headers match the requested seven-column structure. |
19+
| Add Message button above/near table | PASS | Added a Theme V2 button in the table surface header. |
20+
| Row actions: Edit, Delete | PASS | Saved rows render Edit and Delete only. |
21+
| Edit mode actions: Save, Cancel | PASS | Inline editor rows render Save and Cancel only. |
22+
| Delete blocked/disabled when referenced | PASS | UI disables Delete when message parts reference the message; service delete path returns 409 for referenced rows. |
23+
| Use Theme V2 and existing reusable table patterns | PASS | Reused `surface-header`, `action-group`, `table-wrapper`, and `data-table`; no page-local CSS added. |
24+
| No inline styles, style blocks, inline handlers, or script blocks in HTML | PASS | Static PCRE check returned no matches for inline style/script/handler patterns. |
25+
| No browser-owned authoritative product data | PASS | Messages, emotions, and reference counts load through the Local API; no localStorage/product-data fallback added. |
26+
| No TTS implementation in this PR | PASS | Removed visible playback/TTS controls from Message Studio and did not add TTS behavior. Existing server TTS endpoints were not expanded. |
27+
| No Emotion Profiles or Voice Profiles tools yet | PASS | Emotion/Voice remain visible reference columns/placeholders only; no profile management UI added. |
28+
| Creator-safe empty/error states | PASS | Empty table and runtime failure messages avoid server diagnostics and stack details. |
29+
| Required repo-structured ZIP under tmp/ | PASS | Prepared for `tmp/PR_26174_BRAVO_001-messages-table-structure_delta.zip`. |
30+
31+
## Validation Lane Report
32+
33+
| Lane | Result | Command / Notes |
34+
| --- | --- | --- |
35+
| Branch check | PASS | `git branch --show-current` -> `main`. |
36+
| JS syntax | PASS | `node --check` on touched JS/MJS files. |
37+
| Messages service contract | PASS | Inline Node check verified create, unreferenced delete, and referenced delete guard using `createMessagesPostgresClientStub`. |
38+
| HTML restriction static check | PASS | `rg -n --pcre2 '<style|style=| on[a-z]+\s*=|<script(?![^>]*\bsrc=)' toolbox/messages/index.html` returned no matches. |
39+
| Diff whitespace | PASS | `git diff --check -- <touched files>` passed with line-ending warnings only. |
40+
| Dependency install for validation | PASS_WITH_NOTE | `npm ci` completed; npm reported one existing high-severity audit finding, not changed in this PR. |
41+
| Targeted Playwright Messages spec | BLOCKED | `npx playwright test tests/playwright/tools/MessagesTool.spec.mjs` could not launch because Chromium was missing. `npx playwright install chromium` timed out twice (about 184s and 364s). A temporary system-Chrome config using `C:\Program Files\Google\Chrome\Application\chrome.exe` also timed out after about 184s, so browser assertions did not complete. |
42+
43+
## Manual Validation Notes
44+
45+
- Static source inspection confirms the Messages table headers are Message, Text, Tags, Emotion, Voice, Updated, Actions.
46+
- Static source inspection confirms Add Message, Edit/Delete, Save/Cancel paths are present in the Messages controller.
47+
- Static source inspection confirms old visible TTS Profile, Play Message, Stop Playback, and TTS selector hooks are absent from `toolbox/messages/index.html` and `toolbox/messages/messages.js`.
48+
- Manual browser validation was not completed because the Playwright Chromium binary could not be installed and the fallback system-Chrome run timed out within the available command window.
49+
- Unrelated pre-existing `.gitignore` modification was left untouched and excluded from this PR delta.
50+
51+
## Changed Files
52+
53+
- `src/dev-runtime/messages/messages-postgres-service.mjs`
54+
- `tests/helpers/messagesPostgresClientStub.mjs`
55+
- `tests/playwright/tools/MessagesTool.spec.mjs`
56+
- `toolbox/messages/index.html`
57+
- `toolbox/messages/messages-api-client.js`
58+
- `toolbox/messages/messages.js`
59+
- `docs_build/dev/reports/codex_review.diff`
60+
- `docs_build/dev/reports/codex_changed_files.txt`
61+
- `docs_build/dev/reports/PR_26174_BRAVO_001-messages-table-structure.md`
62+
63+
## ZIP
64+
65+
- `tmp/PR_26174_BRAVO_001-messages-table-structure_delta.zip`
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
# PR_26174_BRAVO_002-message-parts-child-table
2+
3+
## Summary
4+
5+
Added expandable Message Parts child rows under each parent Message row. The child surface uses the existing Theme V2 table pattern with Order, Text, Emotion, Voice, and Actions columns, and supports Add Part, Edit, Save, Cancel, and Delete through the Local API.
6+
7+
## Branch Validation
8+
9+
| Check | Result | Notes |
10+
| --- | --- | --- |
11+
| Current branch is Bravo work branch | PASS | `git branch --show-current` returned `team/BRAVO/messages`. |
12+
| Did not return to main | PASS | All PR_002 work was performed on `team/BRAVO/messages`. |
13+
14+
## Requirement Checklist
15+
16+
| Requirement | Result | Notes |
17+
| --- | --- | --- |
18+
| Add expandable child rows to Messages | PASS | Parent rows expose a Parts action that expands a child host row. |
19+
| Parent row remains Message | PASS | The parent table remains Message-first with PR_001 columns. |
20+
| Child rows are Message Parts | PASS | Expanded host renders Message Part rows from `messages_segments`. |
21+
| Child columns Order, Text, Emotion, Voice, Actions | PASS | Child table renders exactly those headers. |
22+
| Support Add Part, Edit, Save, Cancel, Delete | PASS | Inline child table actions are wired through external JS and Local API calls. |
23+
| Reuse approved table-child-surface pattern | PASS | Reused `content-stack`, `surface-header`, `table-wrapper`, and `data-table data-table--fixed`. |
24+
| Do not implement TTS playback yet | PASS | Voice remains a visible placeholder; no playback controls or speech calls were added. |
25+
| No browser-owned authoritative product data | PASS | Message Parts are read/written/deleted through the Local API service. |
26+
| Server/API owns authoritative key generation | PASS | Segment create still uses server-generated ULID keys. |
27+
| Creator-safe errors only | PASS | UI save/delete failures use Creator-safe copy without server details. |
28+
| Delete blocked when records are referenced | PASS | Parent message delete remains disabled when child parts exist; segment delete has no downstream references in this PR. |
29+
30+
## Validation Lane Report
31+
32+
| Lane | Result | Command / Notes |
33+
| --- | --- | --- |
34+
| JS syntax | PASS | `node --check toolbox/messages/messages.js; node --check toolbox/messages/messages-api-client.js; node --check src/dev-runtime/messages/messages-postgres-service.mjs; node --check tests/playwright/tools/MessagesTool.spec.mjs`. |
35+
| Message Parts Local API contract | PASS | Inline Node check verified part create, parent delete block while referenced, part update, part delete, and parent delete unblock. |
36+
| HTML restriction static check | PASS | `rg -n --pcre2 '<style|style=| on[a-z]+\s*=|<script(?![^>]*\bsrc=)' toolbox/messages/index.html` returned no matches. |
37+
| Diff whitespace | PASS | `git diff --check -- <PR_002 files>` passed with line-ending warnings only. |
38+
| Targeted Playwright | BLOCKED | Browser execution remains blocked because Playwright Chromium is missing in this workspace. |
39+
| Fallback `npm run test:workspace-v2` | BLOCKED | The fallback lane also invokes Playwright and failed at browser launch with missing Chromium. |
40+
41+
## Manual Validation Notes
42+
43+
- Static inspection confirms no inline styles, style blocks, inline handlers, or HTML script blocks were added.
44+
- Static inspection confirms PR_002 did not add TTS playback or provider runtime behavior.
45+
- The parent delete guard now updates naturally after child part deletion because reference counts are reloaded from the Local API.
46+
- Browser validation could not complete in this environment due missing Playwright Chromium.
47+
48+
## Changed Files
49+
50+
- `src/dev-runtime/messages/messages-postgres-service.mjs`
51+
- `tests/playwright/tools/MessagesTool.spec.mjs`
52+
- `toolbox/messages/messages-api-client.js`
53+
- `toolbox/messages/messages.js`
54+
- `docs_build/dev/reports/codex_review.diff`
55+
- `docs_build/dev/reports/codex_changed_files.txt`
56+
- `docs_build/dev/reports/PR_26174_BRAVO_002-message-parts-child-table.md`
57+
58+
## ZIP
59+
60+
- `tmp/PR_26174_BRAVO_002-message-parts-child-table_delta.zip`
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# PR_26174_BRAVO_003-emotion-profiles-table
2+
3+
## Scope
4+
- Added an Emotion Profiles reusable-asset table to Message Studio.
5+
- Added inline Add/Edit/Save/Cancel behavior for emotion profiles through the Local API.
6+
- Kept Messages and Message Parts referencing Emotion Profiles by profile key.
7+
- Tightened emotion-profile rate/pitch/volume validation so invalid numeric inputs fail instead of falling back.
8+
9+
## Branch Validation
10+
| Check | Result | Notes |
11+
| --- | --- | --- |
12+
| Bravo branch retained | PASS | Current branch is `team/BRAVO/messages`. |
13+
| Did not return to main | PASS | PR_003 was built as a stacked delta on the Bravo branch. |
14+
| Did not merge or push main | PASS | No merge or push commands were run. |
15+
16+
## Requirement Checklist
17+
| Requirement | Result | Evidence |
18+
| --- | --- | --- |
19+
| Add Emotion Profiles as reusable assets | PASS | `toolbox/messages/index.html` adds the Emotion Profiles table and Add Emotion action; `toolbox/messages/messages.js` creates/updates profiles through the Local API. |
20+
| Table columns: Emotion, Rate, Pitch, Volume, Updated, Actions | PASS | Emotion Profiles table headers match the required column list. |
21+
| Seed/display Calm, Urgent, Whisper, Excited, Angry | PASS | Existing Local API seed data includes those required starter examples; the Playwright spec asserts their display. |
22+
| Messages reference Emotion Profiles | PASS | Message rows continue to store/select `emotionProfileKey`; no rate/pitch/volume fields were added to messages. |
23+
| Message Parts reference Emotion Profiles | PASS | Message Part rows continue to store/select `emotionProfileKey`; no rate/pitch/volume fields were added to parts. |
24+
| Do not duplicate rate/pitch/volume directly on messages | PASS | Service contract validation asserts messages and parts do not expose `rate`, `pitch`, or `volume`. |
25+
| Theme V2 and reusable table patterns | PASS | Uses `card`, `surface-header`, `table-wrapper`, `data-table`, `action-group`, and `btn`. |
26+
| No inline styles, style blocks, inline handlers, or inline script blocks | PASS | Static scan found no disallowed inline HTML patterns in `toolbox/messages/index.html`. |
27+
| No browser-owned authoritative product data | PASS | Profile creation and updates go through the Local API; keys remain server/API owned. |
28+
| No TTS implementation in this PR | PASS | No playback/runtime/provider behavior was added. |
29+
| No Emotion Profiles expansion beyond this PR purpose | PASS | Added only the requested profile table and profile references. |
30+
| Creator-safe empty/error states | PASS | Empty table and failure messages avoid server detail exposure. |
31+
| Delete blocked when referenced | PASS | No new direct delete path was introduced for emotion profiles; existing message delete guard remains intact. |
32+
33+
## Validation Lane Report
34+
| Lane | Result | Command / Evidence |
35+
| --- | --- | --- |
36+
| Syntax | PASS | `node --check toolbox/messages/messages.js; node --check src/dev-runtime/messages/messages-postgres-service.mjs; node --check tests/playwright/tools/MessagesTool.spec.mjs` |
37+
| Inline HTML guard | PASS | `rg -n --pcre2 '<style|style=| on[a-z]+\\s*=|<script(?![^>]*\\bsrc=)' toolbox/messages/index.html` returned no matches. |
38+
| Local API contract | PASS | Inline Node probe created/edited an emotion profile, rejected invalid numeric input, verified starter examples, and verified messages/parts only reference profile keys. |
39+
| Diff hygiene | PASS | `git diff --check -- toolbox/messages/index.html toolbox/messages/messages.js src/dev-runtime/messages/messages-postgres-service.mjs tests/playwright/tools/MessagesTool.spec.mjs` reported line-ending warnings only. |
40+
| Targeted Playwright | BLOCKED | `npx playwright test tests/playwright/tools/MessagesTool.spec.mjs --grep "Message Studio uses the approved table-first Messages structure" --project=playwright` failed because Chromium executable `chromium-1217` is not installed. |
41+
| Fallback validation | BLOCKED | `npm run test:workspace-v2` failed for the same missing Playwright Chromium executable. |
42+
43+
## Manual Validation Notes
44+
- Browser validation could not complete because this workstation is missing the Playwright Chromium executable.
45+
- The impacted UI path was covered by static DOM checks, focused spec updates, and a Local API service contract probe.
46+
- Generated fallback lane side reports were restored; only PR_003-required report files remain in the PR delta.
47+
48+
## Reports And Package
49+
| Artifact | Path |
50+
| --- | --- |
51+
| Review diff | `docs_build/dev/reports/codex_review.diff` |
52+
| Changed files | `docs_build/dev/reports/codex_changed_files.txt` |
53+
| PR report | `docs_build/dev/reports/PR_26174_BRAVO_003-emotion-profiles-table.md` |
54+
| Delta ZIP | `tmp/PR_26174_BRAVO_003-emotion-profiles-table_delta.zip` |
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# PR_26174_BRAVO_004-voice-profiles-table
2+
3+
## Scope
4+
- Added a Voice Profiles reusable-asset table to Message Studio.
5+
- Seeded the required starter voice examples: Narrator, Hero, Merchant, Robot, Monster.
6+
- Added server/API-owned `voiceProfileKey` references on Messages and Message Parts.
7+
- Replaced visible Voice placeholders with profile selects while keeping playback/TTS runtime out of scope.
8+
9+
## Branch Validation
10+
| Check | Result | Notes |
11+
| --- | --- | --- |
12+
| Bravo branch retained | PASS | Current branch is `team/BRAVO/messages`. |
13+
| Did not return to main | PASS | PR_004 was built as a stacked delta on the Bravo branch. |
14+
| Did not merge or push main | PASS | No merge or push commands were run. |
15+
16+
## Requirement Checklist
17+
| Requirement | Result | Evidence |
18+
| --- | --- | --- |
19+
| Add Voice Profiles as reusable assets | PASS | `toolbox/messages/index.html` adds the Voice Profiles table; `toolbox/messages/messages.js` creates/updates profiles through the Local API. |
20+
| Table columns: Voice, Provider, Voice Name, Language, Updated, Actions | PASS | Voice Profiles table headers match the required column list. |
21+
| Starter examples: Narrator, Hero, Merchant, Robot, Monster | PASS | `SEED_TTS_PROFILES` now includes all five required starter voice profiles. |
22+
| Messages reference Voice Profiles | PASS | Message rows now require and return `voiceProfileKey` / `voiceProfileName`. |
23+
| Message Parts reference Voice Profiles | PASS | Message Part rows now require and return `voiceProfileKey` / `voiceProfileName`. |
24+
| No browser-owned authoritative product data | PASS | Voice profiles and references are created through the Local API; keys remain server/API owned. |
25+
| No browser-generated authoritative database keys | PASS | The service continues to generate ULID-style keys server-side. |
26+
| No TTS implementation in this PR | PASS | No playback buttons, Browser Speech runtime, or provider runtime behavior was added. |
27+
| Theme V2 and reusable table patterns | PASS | Uses `card`, `surface-header`, `table-wrapper`, `data-table`, `action-group`, and `btn`. |
28+
| No inline styles, style blocks, inline handlers, or inline script blocks | PASS | Static scan found no disallowed inline HTML patterns in `toolbox/messages/index.html`. |
29+
| Creator-safe empty/error states | PASS | UI failure messages remain generic and do not expose server details. |
30+
| Use Local API / Local DB wording | PASS | The Messages page persistence label now uses Local DB wording. |
31+
| Delete blocked when referenced | PASS | No new direct delete path was introduced for voice profiles; existing message delete guard remains intact. |
32+
33+
## Validation Lane Report
34+
| Lane | Result | Command / Evidence |
35+
| --- | --- | --- |
36+
| Syntax | PASS | `node --check toolbox/messages/messages.js; node --check src/dev-runtime/messages/messages-postgres-service.mjs; node --check tests/playwright/tools/MessagesTool.spec.mjs; node --check tests/dev-runtime/DbSeedIntegrity.test.mjs` |
37+
| Inline HTML guard | PASS | `rg -n --pcre2 '<style|style=| on[a-z]+\\s*=|<script(?![^>]*\\bsrc=)' toolbox/messages/index.html` returned no matches. |
38+
| Local API contract | PASS | Inline Node probe verified starter voice profiles, required voice references, response voice names, and default backfill for legacy rows. |
39+
| Messages Local API seed subtest | PASS | `node --test --test-name-pattern "Messages Local API seeds" tests/dev-runtime/DbSeedIntegrity.test.mjs` |
40+
| Diff hygiene | PASS | `git diff --check -- src/dev-runtime/messages/messages-postgres-service.mjs tests/dev-runtime/DbSeedIntegrity.test.mjs tests/playwright/tools/MessagesTool.spec.mjs toolbox/messages/index.html toolbox/messages/messages.js` reported line-ending warnings only. |
41+
| Targeted Playwright | BLOCKED | `npx playwright test tests/playwright/tools/MessagesTool.spec.mjs --grep "Message Studio uses the approved table-first Messages structure" --project=playwright` failed because Chromium executable `chromium-1217` is not installed. |
42+
| Fallback validation | BLOCKED | `npm run test:workspace-v2` failed for the same missing Playwright Chromium executable. |
43+
44+
## Manual Validation Notes
45+
- Browser validation could not complete because this workstation is missing the Playwright Chromium executable.
46+
- The full `DbSeedIntegrity.test.mjs` file still has unrelated Local DB snapshot failures, but its Messages Local API subtest passes after the voice-profile changes.
47+
- Generated fallback lane side reports were restored; only PR_004-required report files remain in the PR delta.
48+
49+
## Reports And Package
50+
| Artifact | Path |
51+
| --- | --- |
52+
| Review diff | `docs_build/dev/reports/codex_review.diff` |
53+
| Changed files | `docs_build/dev/reports/codex_changed_files.txt` |
54+
| PR report | `docs_build/dev/reports/PR_26174_BRAVO_004-voice-profiles-table.md` |
55+
| Delta ZIP | `tmp/PR_26174_BRAVO_004-voice-profiles-table_delta.zip` |

0 commit comments

Comments
 (0)