Skip to content

Commit ea47fc7

Browse files
author
DavidQ
committed
Wire Text to Speech V2 workspace return and manifest save contract - PR_26130_018-text-to-speech-v2-workspace-save-contract
1 parent 444404b commit ea47fc7

7 files changed

Lines changed: 591 additions & 74 deletions

File tree

Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
# PR_26130_018-text-to-speech-v2-workspace-save-contract
2+
3+
## Summary
4+
5+
Updated Text to Speech V2 and Workspace Manager V2 integration so workspace-launched speech payloads use `tools/schemas/tools/text2speach-V2.schema.json` as the strict load/save contract. Invalid payload drift is rejected before Text to Speech V2 queue render and before Workspace Manager V2 Save.
6+
7+
## Scope
8+
9+
- Tools fixed: Text to Speech V2 and Workspace Manager V2 integration.
10+
- Failing behavior before: Text to Speech V2 workspace payloads were shape-checked but not fully schema-validated before render, and Workspace Manager V2 did not enforce maximum numeric schema ranges in its local validator.
11+
- Remaining failures after this PR: none known in scope.
12+
- Out of scope: non-browser speech backends, sample JSON alignment, and full samples smoke validation.
13+
14+
## Changes
15+
16+
- `tools/text2speach-V2/js/TextToSpeechToolApp.js`
17+
- Requires `hostContextId` for workspace launches.
18+
- Loads `tools/schemas/tools/text2speach-V2.schema.json` before queue render.
19+
- Validates workspace payloads before rendering queue tiles or hydrating speech controls.
20+
- Rejects drift fields such as `autoSpeak`, `repeatCount`, and `delayBetweenRepeats`.
21+
- Validates edited payload data before writing it back to `workspace.tools.text2speach-V2`.
22+
- Logs loaded source path, schema validation result, dirty state, and manifest write-back target.
23+
- `tools/text2speach-V2/js/bootstrap.js`
24+
- Handles async Text to Speech V2 startup with visible failure logging.
25+
- `tools/text2speach-V2/js/controls/ActionNavControl.js`
26+
- Shows workspace controls only for complete Workspace Manager launches with `hostContextId`.
27+
- `tools/workspace-manager-v2/js/services/WorkspaceManagerV2ContextService.js`
28+
- Enforces JSON schema `maximum`, `minItems`, and `maxItems` in the local validator.
29+
- `tools/workspace-manager-v2/js/WorkspaceManagerV2App.js`
30+
- Validates refreshed tool session payloads before Save applies/render-refreshes the save context.
31+
- Logs Text to Speech V2 source/payload counts during hydration and Save.
32+
- Logs Text to Speech V2 manifest write-back target and saved queue count.
33+
- `tests/playwright/tools/WorkspaceManagerV2.spec.mjs`
34+
- Adds coverage for workspace launch controls, strict schema rejection, no partial invalid render, return context preservation, payload write-back, and game manifest persistence.
35+
36+
## Playwright
37+
38+
Playwright impacted: Yes.
39+
40+
Validated behavior:
41+
- Workspace-launched Text to Speech V2 shows workspace controls and Return to Workspace only when `hostContextId` is present.
42+
- Return to Workspace preserves the active Workspace Manager V2 context and dirty Text to Speech V2 toolState data.
43+
- Text to Speech V2 rejects invalid workspace payload drift before rendering queue tiles.
44+
- Schema contract checks confirm root and queue item `additionalProperties: false`.
45+
- Required item fields, enum values, and volume/rate/pitch maximum ranges are enforced.
46+
- Removed fields `autoSpeak`, `repeatCount`, and `delayBetweenRepeats` are rejected.
47+
- Text to Speech V2 edits update `workspace.tools.text2speach-V2`.
48+
- Workspace Manager V2 Save persists edited Text to Speech V2 payload into `game.manifest.json`.
49+
50+
Expected pass behavior:
51+
- Valid manifest payloads render and save normally.
52+
- Edited Text to Speech V2 queue data is saved back into `game.workspace.tools["text2speach-V2"]`.
53+
- Save logs source binding, write-back target, saved payload count, file size, item details, and validation result.
54+
55+
Expected fail behavior:
56+
- Invalid Text to Speech V2 payloads do not render queue tiles.
57+
- Workspace Manager V2 Save is blocked when Text to Speech V2 toolState data contains schema drift.
58+
- No manifest write occurs when schema validation fails.
59+
60+
## Validation
61+
62+
- PASS: `node --check tools/text2speach-V2/js/TextToSpeechToolApp.js`
63+
- PASS: `node --check tools/text2speach-V2/js/bootstrap.js`
64+
- PASS: `node --check tools/text2speach-V2/js/controls/ActionNavControl.js`
65+
- PASS: `node --check tools/workspace-manager-v2/js/WorkspaceManagerV2App.js`
66+
- PASS: `node --check tools/workspace-manager-v2/js/services/WorkspaceManagerV2ContextService.js`
67+
- PASS: `node --check tests/playwright/tools/WorkspaceManagerV2.spec.mjs`
68+
- PASS: `tools/schemas/tools/text2speach-V2.schema.json` parsed with `JSON.parse`.
69+
- PASS: `npx playwright test tests/playwright/tools/WorkspaceManagerV2.spec.mjs --project=playwright --workers=1 --reporter=list -g "Text to Speech V2|text2speach-V2"` passed 7 tests.
70+
- PASS: `npm run test:workspace-v2` passed 30 tests.
71+
- PASS: `git diff --check HEAD -- .` passed with only Windows line-ending warnings.
72+
- PASS: HTML restriction scans found no inline event handlers or inline styles; only external module scripts are present.
73+
- PASS: Forbidden-scope scan found no `tools/shared`, `imageDataUrl`, or `start_of_day` matches in changed implementation/test scopes.
74+
75+
## Coverage
76+
77+
Playwright V8 coverage was generated by the required Workspace V2 run.
78+
79+
- `(75%) tools/text2speach-V2/js/bootstrap.js - changed JS file with browser V8 coverage`
80+
- `(88%) tools/workspace-manager-v2/js/WorkspaceManagerV2App.js - changed JS file with browser V8 coverage`
81+
- `(91%) tools/workspace-manager-v2/js/services/WorkspaceManagerV2ContextService.js - changed JS file with browser V8 coverage`
82+
- `(97%) tools/text2speach-V2/js/TextToSpeechToolApp.js - changed JS file with browser V8 coverage`
83+
- `(100%) tools/text2speach-V2/js/controls/ActionNavControl.js - changed JS file with browser V8 coverage`
84+
85+
## Full Samples Smoke Test
86+
87+
Skipped. This PR changes Text to Speech V2 workspace payload validation and Workspace Manager V2 save integration only. It does not modify shared sample loading, sample JSON, broad game launch behavior, or shared sample runtime paths.
88+
89+
## Manual Validation
90+
91+
1. Open Workspace Manager V2 and pick the repo folder.
92+
2. Select Asteroids and launch Text to Speech V2.
93+
3. Confirm the workspace action row includes Speak, Pause, Resume, Stop, and Return to Workspace.
94+
4. Edit a named speech item and return to Workspace Manager V2.
95+
5. Confirm Text to Speech V2 is marked dirty, then Save.
96+
6. Confirm the status log includes the manifest write-back target and saved Text to Speech V2 payload count.
97+
7. Confirm the saved `game.manifest.json` contains the edited `game.workspace.tools["text2speach-V2"].queue` data.
98+
99+
Expected outcome: valid payload edits persist to the active game manifest; invalid drift fields are rejected before render or Save.

0 commit comments

Comments
 (0)