Skip to content

Commit ba3bcf5

Browse files
committed
Complete Messages Creator Tool
1 parent 98729af commit ba3bcf5

10 files changed

Lines changed: 1379 additions & 40 deletions

File tree

dev/build/database/ddl/messages.sql

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,9 @@ CREATE TABLE IF NOT EXISTS messages_records (
7272
"emotionProfileKey" text NOT NULL REFERENCES messages_emotion_profiles(key),
7373
"voiceProfileKey" text NOT NULL REFERENCES messages_tts_profiles(key),
7474
"messageText" text NOT NULL,
75+
"speaker" text NOT NULL DEFAULT '',
76+
"trigger" text NOT NULL DEFAULT '',
77+
"typewriterSpeed" numeric NOT NULL DEFAULT 30,
7578
"notes" text NOT NULL DEFAULT '',
7679
"active" boolean NOT NULL DEFAULT true,
7780
"createdAt" timestamptz NOT NULL DEFAULT now(),
@@ -106,6 +109,10 @@ CREATE TABLE IF NOT EXISTS messages_event_actions (
106109
"updatedBy" text NOT NULL REFERENCES users(key)
107110
);
108111

112+
ALTER TABLE messages_records ADD COLUMN IF NOT EXISTS "speaker" text NOT NULL DEFAULT '';
113+
ALTER TABLE messages_records ADD COLUMN IF NOT EXISTS "trigger" text NOT NULL DEFAULT '';
114+
ALTER TABLE messages_records ADD COLUMN IF NOT EXISTS "typewriterSpeed" numeric NOT NULL DEFAULT 30;
115+
109116
CREATE INDEX IF NOT EXISTS idx_messages_records_categorykey ON messages_records ("categoryKey");
110117
CREATE INDEX IF NOT EXISTS idx_messages_records_emotionprofilekey ON messages_records ("emotionProfileKey");
111118
CREATE INDEX IF NOT EXISTS idx_messages_records_voiceprofilekey ON messages_records ("voiceProfileKey");
Lines changed: 128 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,128 @@
1+
# PR_26180_BRAVO_002-complete-messages-creator-tool
2+
3+
## Branch Validation
4+
5+
PASS - Current branch is `PR_26180_BRAVO_002-complete-messages-creator-tool`.
6+
PASS - Scoped PR_002 Messages Creator Tool changes were preserved.
7+
PASS - Artifact paths use `dev/reports` and `dev/workspace/zips`.
8+
PASS - `dev/build/database/seed/guest/game-crew.json` was not modified.
9+
PASS - `dev/tests/dev-runtime/DbSeedIntegrity.test.mjs` was not modified for Game Crew.
10+
PASS - PR_003+ Game Crew cleanup was not started from this dirty branch.
11+
12+
## Product Owner Testable Outcome
13+
14+
After applying this PR, the Product Owner can test the API-backed Message Studio MVP workflow:
15+
16+
- Create, edit, save, archive, and delete Messages.
17+
- Use creator-facing `Speaker`, `Text`, `Trigger`, `Typewriter Speed`, and `TTS Profile` fields.
18+
- Preview Message and sentence playback through existing Text To Speech behavior.
19+
- Add sentences with emotions scoped by the selected TTS Profile.
20+
- Confirm guest browsing is allowed while guest saves redirect to `account/sign-in.html`.
21+
- Confirm referenced Messages cannot be deleted while they have sentence usage.
22+
23+
This PR is not part of the Game Crew cleanup batch. Previous dependency: none for PR_002. Next dependency: resolve the separate Game Crew guest seed ownership cleanup before running full seed integrity as a required gate.
24+
25+
## Requirement Checklist
26+
27+
PASS - Preserve current PR_002 Messages Creator Tool changes.
28+
PASS - Do not modify guest `game-crew` seed files.
29+
PASS - Do not modify `DbSeedIntegrity` for Game Crew in this PR.
30+
PASS - Do not run or plan PR_003+ from this dirty branch.
31+
PASS - Document Game Crew seed integrity failure as unrelated/out-of-scope.
32+
PASS - Run only in-scope Messages validation and impacted Playwright.
33+
PASS - Produce PR_002 artifacts.
34+
PASS - Browser-owned product data was not introduced.
35+
PASS - No silent JSON fallback was introduced.
36+
PASS - No MEM DB/local-mem was introduced.
37+
PASS - No unrelated cleanup.
38+
39+
## Changed File Inventory
40+
41+
- `dev/build/database/ddl/messages.sql`
42+
- `dev/tests/dev-runtime/MessagesPublishValidation.test.mjs`
43+
- `dev/tests/helpers/playwrightRepoServer.mjs`
44+
- `dev/tests/playwright/tools/MessagesTool.spec.mjs`
45+
- `src/dev-runtime/messages/messages-postgres-service.mjs`
46+
- `toolbox/messages/index.html`
47+
- `toolbox/messages/messages.js`
48+
- `dev/reports/codex_changed_files.txt`
49+
- `dev/reports/codex_review.diff`
50+
- `dev/reports/PR_26180_BRAVO_002-complete-messages-creator-tool.md`
51+
52+
## DB/API Inventory
53+
54+
- `messages_records` DDL includes `speaker`, `trigger`, and `typewriterSpeed`.
55+
- Messages Postgres service normalizes, validates, serializes, creates, and updates `speaker`, `trigger`, and `typewriterSpeed`.
56+
- `typewriterSpeed` must be a number of 0 or greater.
57+
- Messages write resources require authenticated API actors.
58+
- Existing Text To Speech profile and Emotion Profile service contracts remain API-backed.
59+
- Guest writes redirect to `account/sign-in.html` through the existing account route.
60+
61+
## Validation Lane Report
62+
63+
PASS - Scoped Node/API Messages validation:
64+
65+
```powershell
66+
node --test dev/tests/tools/Text2SpeechShell.test.mjs dev/tests/tools/MessagesPlaybackSource.test.mjs dev/tests/dev-runtime/MessagesPublishValidation.test.mjs
67+
```
68+
69+
Result: PASS, 21/21 tests.
70+
71+
PASS - Messages Playwright validation:
72+
73+
```powershell
74+
npx playwright test --config dev/workspace/tmp/pr_26180_bravo_002.playwright.headless.config.cjs dev/tests/playwright/tools/MessagesTool.spec.mjs --project=playwright
75+
```
76+
77+
Result: PASS, 6/6 tests.
78+
79+
PASS - Text To Speech Playwright validation:
80+
81+
```powershell
82+
npx playwright test --config dev/workspace/tmp/pr_26180_bravo_002.playwright.headless.config.cjs dev/tests/playwright/tools/TextToSpeechFunctional.spec.mjs --project=playwright
83+
```
84+
85+
Result: PASS, 4/4 tests.
86+
87+
INFO - A temporary ignored Playwright config under `dev/workspace/tmp` was used to run the repo's `playwright` project headlessly in this environment. The product/test delta does not depend on that generated file.
88+
89+
## Playwright Impacted Assessment
90+
91+
PASS - `dev/tests/playwright/tools/MessagesTool.spec.mjs` validates:
92+
93+
- table-first Message Studio structure
94+
- Speaker, Text, Trigger, Typewriter Speed fields
95+
- TTS Profile selection
96+
- API-backed profile consumption
97+
- sentence emotion filtering by selected profile
98+
- referenced Message delete protection
99+
- guest save redirect
100+
- Creator-safe load failures
101+
102+
PASS - `dev/tests/playwright/tools/TextToSpeechFunctional.spec.mjs` validates existing Text To Speech behavior remains intact.
103+
104+
The Playwright repo helper was fixed so static files are served from the repository root instead of `dev/`.
105+
106+
## Manual Validation Notes
107+
108+
Recommended Product Owner manual validation:
109+
110+
1. Open Message Studio as an authenticated Creator.
111+
2. Add a message with Speaker, Text, Trigger, Typewriter Speed, and TTS Profile.
112+
3. Save and reload to confirm API/Postgres persistence.
113+
4. Edit the same fields and confirm changes persist.
114+
5. Add a sentence with a profile-scoped emotion and confirm playback.
115+
6. Confirm guest can browse but Save redirects to `account/sign-in.html`.
116+
7. Confirm referenced Message Delete remains blocked.
117+
118+
## Known Issues
119+
120+
- Full `DbSeedIntegrity` remains blocked outside PR_002 because `dev/build/database/seed/guest/game-crew.json` publishes `game-crew` while canonical inventory expects Game Crew under `users`.
121+
- This PR intentionally does not clean up Game Crew guest seed JSON ownership.
122+
- The Game Crew cleanup should be planned from clean `main` as a separate batch after PR_002 is clean, committed, and opened.
123+
124+
## ZIP Outcome
125+
126+
DELTA artifact:
127+
128+
`dev/workspace/zips/PR_26180_BRAVO_002-complete-messages-creator-tool_delta.zip`
Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
1-
dev/reports/PR_26179_OWNER_009-pr-stack-realignment_branch-validation.md
2-
dev/reports/PR_26179_OWNER_009-pr-stack-realignment_manual-validation-notes.md
3-
dev/reports/PR_26179_OWNER_009-pr-stack-realignment_report.md
4-
dev/reports/PR_26179_OWNER_009-pr-stack-realignment_requirement-checklist.md
5-
dev/reports/PR_26179_OWNER_009-pr-stack-realignment_validation-report.md
1+
dev/build/database/ddl/messages.sql
62
dev/reports/codex_changed_files.txt
73
dev/reports/codex_review.diff
4+
dev/reports/PR_26180_BRAVO_002-complete-messages-creator-tool.md
5+
dev/tests/dev-runtime/MessagesPublishValidation.test.mjs
6+
dev/tests/helpers/playwrightRepoServer.mjs
7+
dev/tests/playwright/tools/MessagesTool.spec.mjs
8+
src/dev-runtime/messages/messages-postgres-service.mjs
9+
toolbox/messages/index.html
10+
toolbox/messages/messages.js

0 commit comments

Comments
 (0)