Skip to content

Commit 3dcb965

Browse files
committed
PR_26171_006-016 Laptop BUILD docs for Messages, TTS, playback, and MIDI roadmap
1 parent 6423154 commit 3dcb965

6 files changed

Lines changed: 509 additions & 0 deletions
Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
# BUILD PR_26171_006-message-emotion-profile-management
2+
3+
## Branch Name
4+
5+
`pr/PR_26171_006-message-emotion-profile-management`
6+
7+
## Purpose
8+
9+
Strengthen Messages Emotion Profile management by making profile usage visible and preventing accidental deactivation of profiles that are currently referenced by messages or message segments.
10+
11+
## Exact Scope
12+
13+
- Extend the Messages Local API emotion profile payloads with computed usage diagnostics:
14+
- `messageUsageCount`
15+
- `segmentUsageCount`
16+
- `usageCount`
17+
- `references`
18+
- Count references from `messages_records.emotionProfileKey` and `messages_segments.emotionProfileKey`.
19+
- Preserve add, edit, and Active/Inactive behavior for unreferenced emotion profiles.
20+
- Block attempts to deactivate an emotion profile when it is referenced by any message or segment.
21+
- Display usage counts in the Emotion Profiles table.
22+
- Display visible actionable diagnostics when profile deactivation is blocked.
23+
- Add targeted test coverage for profile usage counts and referenced-profile deactivation blocking.
24+
25+
## Out Of Scope
26+
27+
- Delete endpoints.
28+
- Text To Speech profiles.
29+
- Speech preview.
30+
- Voice provider adapters.
31+
- Runtime playback contracts.
32+
- Audio generation or playback.
33+
- Schema changes unless required for computed usage diagnostics.
34+
- Changes to Messages, Categories, or Segments behavior beyond profile reference diagnostics.
35+
36+
## Files Likely Affected
37+
38+
- `src/dev-runtime/messages/messages-sqlite-service.mjs`
39+
- `toolbox/messages/messages.js`
40+
- `toolbox/messages/index.html`
41+
- `tests/playwright/tools/MessagesTool.spec.mjs`
42+
- `docs_build/dev/reports/*`
43+
44+
## API/DB Rules
45+
46+
- Browser must keep using the Messages Local API.
47+
- Browser must not read or write SQLite directly.
48+
- No delete endpoint may be introduced.
49+
- Usage diagnostics are computed from existing Messages SQLite tables.
50+
- No browser-owned product data or local storage source of truth.
51+
- Server/API retains authoritative key and audit ownership.
52+
53+
## Theme V2 Rules
54+
55+
- Use existing Theme V2 classes only.
56+
- Do not add page-local CSS, tool-local CSS, inline styles, `<style>` blocks, inline scripts, or inline event handlers.
57+
- Keep event wiring in external JavaScript.
58+
59+
## Validation
60+
61+
- Verify branch starts from clean `main`.
62+
- Run `node --check` on touched JavaScript files.
63+
- Run targeted Messages Local API validation for usage counts and deactivate blocking.
64+
- Run `npx playwright test tests/playwright/tools/MessagesTool.spec.mjs --project=playwright --workers=1 --reporter=list`.
65+
- Run `npm run test:workspace-v2`.
66+
- Run `git diff --check`.
67+
68+
## Manual Test Notes
69+
70+
- Create a message using an active emotion profile.
71+
- Confirm the profile row shows a nonzero usage count.
72+
- Attempt to disable the referenced profile.
73+
- Confirm the save is blocked with a visible actionable message.
74+
- Confirm an unreferenced profile can still be disabled.
75+
76+
## Required Reports
77+
78+
- `docs_build/dev/reports/codex_review.diff`
79+
- `docs_build/dev/reports/codex_changed_files.txt`
80+
- `docs_build/dev/reports/PR_26171_006-message-emotion-profile-management.md`
81+
- `docs_build/dev/reports/PR_26171_006-message-emotion-profile-management-validation.txt`
82+
- `docs_build/dev/reports/PR_26171_006-message-emotion-profile-management-manual-validation.md`
83+
- `tmp/PR_26171_006-message-emotion-profile-management_delta.zip`
Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
# BUILD PR_26171_008-message-tts-profile-foundation
2+
3+
## Branch Name
4+
5+
`pr/PR_26171_008-message-tts-profile-foundation`
6+
7+
## Purpose
8+
9+
Add server-owned Text To Speech profile configuration for Messages so future speech preview and playback can choose reusable speech settings without generating audio yet.
10+
11+
## Exact Scope
12+
13+
- Add `messages_tts_profiles` persistence under the grouped `messages` ownership area.
14+
- Add Local API contracts for TTS Profiles:
15+
- list
16+
- get
17+
- create
18+
- update
19+
- Add server-seeded default TTS profiles:
20+
- Browser Speech Default
21+
- Narration Preview
22+
- TTS profile fields:
23+
- Name
24+
- Description
25+
- Provider Key
26+
- Voice Name
27+
- Language
28+
- Volume
29+
- Pitch
30+
- Rate
31+
- Active / Inactive
32+
- Add a Theme V2 TTS Profiles management section to the existing Messages tool.
33+
- TTS profiles are configuration records only in this PR.
34+
35+
## Out Of Scope
36+
37+
- Speech preview.
38+
- Speech synthesis.
39+
- Audio playback.
40+
- Audio file generation.
41+
- Voice provider adapters beyond storing a provider key string.
42+
- Runtime message playback.
43+
- Dialog trees, localization, translation, or AI voices.
44+
- Delete endpoints.
45+
46+
## Files Likely Affected
47+
48+
- `src/dev-runtime/messages/messages-sqlite-service.mjs`
49+
- `toolbox/messages/messages-api-client.js`
50+
- `toolbox/messages/messages.js`
51+
- `toolbox/messages/index.html`
52+
- `docs_build/database/ddl/messages.sql`
53+
- `docs_build/database/dml/messages.sql`
54+
- `docs_build/database/seed/messages.json`
55+
- `tests/playwright/tools/MessagesTool.spec.mjs`
56+
- `docs_build/dev/reports/*`
57+
58+
## API/DB Rules
59+
60+
- Browser must use Local API contracts only.
61+
- Browser must not generate authoritative keys.
62+
- SQLite service must generate keys and audit fields.
63+
- No delete endpoints.
64+
- TTS profiles must live under the `messages` ownership group.
65+
- Missing required fields must fail visibly and actionably.
66+
67+
## Theme V2 Rules
68+
69+
- Use existing Theme V2 form, table, card, status, and action classes.
70+
- Do not add new CSS unless documented as a reusable Theme V2 gap.
71+
- No inline styles, `<style>` blocks, inline scripts, or inline event handlers.
72+
73+
## Validation
74+
75+
- Verify branch starts from clean `main`.
76+
- Run `node --check` on touched JavaScript files.
77+
- Run targeted Local API/SQLite validation for TTS profile seed, create, update, and restart persistence.
78+
- Run targeted Messages Playwright validation.
79+
- Run `npm run test:workspace-v2`.
80+
- Run `git diff --check`.
81+
82+
## Manual Test Notes
83+
84+
- Confirm seeded TTS profiles appear in the Messages UI.
85+
- Create a custom TTS profile.
86+
- Edit its voice/configuration fields.
87+
- Disable and re-enable the profile.
88+
- Restart Local API against the same SQLite file and confirm persistence.
89+
- Confirm no speech preview or audio playback occurs in this PR.
90+
91+
## Required Reports
92+
93+
- `docs_build/dev/reports/codex_review.diff`
94+
- `docs_build/dev/reports/codex_changed_files.txt`
95+
- `docs_build/dev/reports/PR_26171_008-message-tts-profile-foundation.md`
96+
- `docs_build/dev/reports/PR_26171_008-message-tts-profile-foundation-validation.txt`
97+
- `docs_build/dev/reports/PR_26171_008-message-tts-profile-foundation-manual-validation.md`
98+
- `tmp/PR_26171_008-message-tts-profile-foundation_delta.zip`
Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
# BUILD PR_26171_010-message-speech-preview
2+
3+
## Branch Name
4+
5+
`pr/PR_26171_010-message-speech-preview`
6+
7+
## Purpose
8+
9+
Add a browser-local speech preview workflow for Messages using the existing Message, Segment, Emotion Profile, and TTS Profile configuration records.
10+
11+
## Exact Scope
12+
13+
- Add a Theme V2 Speech Preview section to the Messages tool.
14+
- Allow previewing:
15+
- selected full message text
16+
- selected ordered active message segments
17+
- Use selected or default active TTS Profile settings for preview controls.
18+
- Use selected segment Emotion Profile settings when previewing segments.
19+
- Use browser `speechSynthesis` when available.
20+
- Show a visible actionable diagnostic when browser speech synthesis is unavailable.
21+
- Add Stop Preview behavior.
22+
- Add external JavaScript-only preview controller logic inside `toolbox/messages/messages.js`.
23+
- Add tests that stub browser speech synthesis and validate preview payloads without requiring real audio output.
24+
25+
## Out Of Scope
26+
27+
- Server-side TTS generation.
28+
- Audio file generation or persistence.
29+
- External AI voices.
30+
- Voice provider adapters beyond direct browser speech preview.
31+
- Runtime playback API.
32+
- Dialog trees, localization, translation, or game runtime integration.
33+
- Storing preview history.
34+
35+
## Files Likely Affected
36+
37+
- `toolbox/messages/index.html`
38+
- `toolbox/messages/messages.js`
39+
- `tests/playwright/tools/MessagesTool.spec.mjs`
40+
- `docs_build/dev/reports/*`
41+
42+
## API/DB Rules
43+
44+
- Speech preview reads existing Local API data already loaded by the Messages UI.
45+
- No new persistence is required.
46+
- Browser preview state must not become product-data source of truth.
47+
- No new server endpoint in this PR unless required only for diagnostics.
48+
49+
## Theme V2 Rules
50+
51+
- Use existing Theme V2 UI classes.
52+
- No page-local CSS or tool-local CSS.
53+
- No inline styles, `<style>` blocks, inline scripts, or inline event handlers.
54+
- Stop and preview buttons must be wired from external JavaScript.
55+
56+
## Validation
57+
58+
- Verify branch starts from clean `main`.
59+
- Run `node --check` on touched JavaScript files.
60+
- Run targeted Messages Playwright validation with stubbed `speechSynthesis`.
61+
- Validate preview selected message.
62+
- Validate preview active ordered segments.
63+
- Validate Stop Preview.
64+
- Validate unavailable speech synthesis diagnostic.
65+
- Run `npm run test:workspace-v2`.
66+
- Run `git diff --check`.
67+
68+
## Manual Test Notes
69+
70+
- Select or create a message.
71+
- Create two active segments with different emotion profiles.
72+
- Click Preview Message and confirm the status log reports a preview request.
73+
- Click Preview Segments and confirm ordered segment preview is requested.
74+
- Click Stop Preview and confirm preview stops.
75+
- Simulate missing browser speech support and confirm visible diagnostic.
76+
77+
## Required Reports
78+
79+
- `docs_build/dev/reports/codex_review.diff`
80+
- `docs_build/dev/reports/codex_changed_files.txt`
81+
- `docs_build/dev/reports/PR_26171_010-message-speech-preview.md`
82+
- `docs_build/dev/reports/PR_26171_010-message-speech-preview-validation.txt`
83+
- `docs_build/dev/reports/PR_26171_010-message-speech-preview-manual-validation.md`
84+
- `tmp/PR_26171_010-message-speech-preview_delta.zip`
Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
# BUILD PR_26171_012-message-voice-provider-adapters
2+
3+
## Branch Name
4+
5+
`pr/PR_26171_012-message-voice-provider-adapters`
6+
7+
## Purpose
8+
9+
Introduce a small browser-side voice provider adapter registry for Messages speech preview so provider behavior is explicit and future providers can be added without rewriting the Messages UI.
10+
11+
## Exact Scope
12+
13+
- Add a Messages voice provider adapter module.
14+
- Supported adapters in this PR:
15+
- `browser-speech`
16+
- `diagnostic-only`
17+
- Adapter contract:
18+
- provider key
19+
- display name
20+
- availability check
21+
- preview method
22+
- stop method
23+
- diagnostic message
24+
- Route Speech Preview through the adapter registry.
25+
- Keep the existing TTS Profile `providerKey` as the selector.
26+
- Show visible diagnostics for unknown providers and unavailable providers.
27+
- Add targeted tests for browser-speech, diagnostic-only, and unknown-provider behavior.
28+
29+
## Out Of Scope
30+
31+
- Network providers.
32+
- AI voices.
33+
- Secret/API-key handling.
34+
- Server-side speech generation.
35+
- Audio file persistence.
36+
- Runtime playback API.
37+
- New database tables.
38+
- Local storage.
39+
40+
## Files Likely Affected
41+
42+
- `toolbox/messages/message-voice-provider-adapters.js`
43+
- `toolbox/messages/messages.js`
44+
- `toolbox/messages/index.html`
45+
- `tests/playwright/tools/MessagesTool.spec.mjs`
46+
- `docs_build/dev/reports/*`
47+
48+
## API/DB Rules
49+
50+
- No new persistence.
51+
- No secrets exposed to the browser.
52+
- Provider adapters must not require environment variables.
53+
- Browser must continue using safe public UI data only.
54+
- TTS Profile provider keys remain configuration only.
55+
56+
## Theme V2 Rules
57+
58+
- Use existing Theme V2 status/logging patterns.
59+
- No inline styles, `<style>` blocks, inline scripts, or inline event handlers.
60+
- No tool-local CSS.
61+
62+
## Validation
63+
64+
- Verify branch starts from clean `main`.
65+
- Run `node --check` on touched JavaScript files.
66+
- Run targeted adapter unit/static validation if added.
67+
- Run targeted Messages Playwright validation for provider routing.
68+
- Run `npm run test:workspace-v2`.
69+
- Run `git diff --check`.
70+
71+
## Manual Test Notes
72+
73+
- Select a TTS Profile with `browser-speech`.
74+
- Confirm preview routes through the browser-speech adapter.
75+
- Select or create a profile with `diagnostic-only`.
76+
- Confirm no audio is attempted and a visible diagnostic is shown.
77+
- Use an unknown provider key and confirm an actionable error.
78+
79+
## Required Reports
80+
81+
- `docs_build/dev/reports/codex_review.diff`
82+
- `docs_build/dev/reports/codex_changed_files.txt`
83+
- `docs_build/dev/reports/PR_26171_012-message-voice-provider-adapters.md`
84+
- `docs_build/dev/reports/PR_26171_012-message-voice-provider-adapters-validation.txt`
85+
- `docs_build/dev/reports/PR_26171_012-message-voice-provider-adapters-manual-validation.md`
86+
- `tmp/PR_26171_012-message-voice-provider-adapters_delta.zip`

0 commit comments

Comments
 (0)