Skip to content

Commit 14bc2bb

Browse files
author
DavidQ
committed
Reduce duplicate shape schema fields and use tool as shape behavior SSoT - PR_26133_031-shape-schema-field-reduction
1 parent 73c4903 commit 14bc2bb

13 files changed

Lines changed: 690 additions & 641 deletions

docs/dev/reports/playwright_v8_coverage_report.md

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
# PR_26133_030 Playwright V8 Coverage Report
1+
# PR_26133_031 Playwright V8 Coverage Report
22

3-
Task: PR_26133_030-shape-identity-schema-and-ui-cleanup
3+
Task: PR_26133_031-shape-schema-field-reduction
44
Date: 2026-05-14
55

66
## Result
@@ -26,14 +26,17 @@ PASS - Coverage reporting was generated during `npm run test:workspace-v2`.
2626
## Changed Runtime JS Coverage
2727

2828
```text
29-
(0%) tools/shared/vectorAssetSystem.js - WARNING: changed runtime JS file was not collected by Playwright V8 coverage; advisory only
30-
(94%) tools/object-vector-studio-v2/js/ToolStarterApp.js - executed lines 4196/4196; executed functions 453/484
31-
(95%) tools/object-vector-studio-v2/js/services/ObjectVectorStudioV2SchemaService.js - executed lines 430/430; executed functions 54/57
32-
(98%) src/engine/rendering/ObjectVectorRuntimeAssetService.js - executed lines 935/935; executed functions 107/109
29+
(93%) tools/object-vector-studio-v2/js/ToolStarterApp.js - executed lines 4243/4243; executed functions 450/483
30+
(95%) tools/object-vector-studio-v2/js/services/ObjectVectorStudioV2SchemaService.js - executed lines 434/434; executed functions 56/59
31+
(98%) src/engine/rendering/ObjectVectorRuntimeAssetService.js - executed lines 949/949; executed functions 111/113
3332
```
3433

35-
Note: the generated V8 reporter includes `tools/shared/vectorAssetSystem.js` because it also considers HEAD-changed runtime files. This PR did not modify that file.
34+
## Guardrail
35+
36+
```text
37+
(100%) none - no changed runtime JS coverage warnings
38+
```
3639

3740
## PR-Specific Note
3841

39-
The Object Vector Studio V2 app and schema service were collected by V8 coverage in the Workspace V2 run. The runtime object-vector asset service was also collected through the Asteroids runtime-loading flow.
42+
The Workspace V2 run exercised the Object Vector Studio V2 editor, schema service, and runtime object-vector asset service using the reduced shape contract. Coverage remains advisory only.
Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
# PR_26133_030 Workspace V2 Playwright Results
1+
# PR_26133_031 Workspace V2 Playwright Results
22

3-
Task: PR_26133_030-shape-identity-schema-and-ui-cleanup
3+
Task: PR_26133_031-shape-schema-field-reduction
44
Date: 2026-05-14
55

66
## Result
@@ -10,11 +10,20 @@ PASS - `npm run test:workspace-v2` completed successfully.
1010
- Command: `npm run test:workspace-v2`
1111
- Playwright target: `tests/playwright/tools/WorkspaceManagerV2.spec.mjs --project=playwright --workers=1 --reporter=list`
1212
- Final result: 49 passed, 0 failed.
13-
- Runtime console checks: Object Vector Studio V2 targeted flows asserted empty page errors/console errors where covered by the suite.
13+
- Follow-up targeted rerun before the full suite: 3 passed for the Object Vector Studio V2 authoring, animation, and Workspace tile flows.
1414

1515
## PR-Specific Coverage
1616

17-
- Object Vector Studio V2 loads schema-valid Asteroids object-vector payloads using local `shapeKey` metadata.
18-
- Shape list rendering and selection use `data-shape-key` / `data-object-tile-shape-key`.
19-
- Object Geometry header no longer renders the selected shape type/name suffix.
20-
- Shape override cleanup and delete flows preserve schema-valid `shapeKey` references.
17+
- Object Vector Studio V2 loads Asteroids object geometry without shape-level `shapeKey`, `label`, or duplicate semantic `type` fields.
18+
- Shape list rendering and selection use local sorted shape indexes through `data-shape-index` / `data-object-tile-shape-index`.
19+
- Shape frame overrides use `shapeIndex` and remain schema-valid after object/shape editing flows.
20+
- Tool-based behavior remains covered for polygon, line, ellipse, rectangle, arc, text, circle, and triangle-compatible polygon geometry.
21+
- Runtime console checks: covered Workspace V2 flows asserted no page errors or console errors where the suite monitors them.
22+
23+
## Additional Validation
24+
25+
PASS - Custom manifest/schema validation loaded `games/Asteroids/game.manifest.json`, validated the embedded Object Vector Studio V2 payload, and loaded it through `ObjectVectorRuntimeAssetService`.
26+
27+
PASS - `node tests/games/AsteroidsAssetReferenceAdoption.test.mjs`
28+
29+
PASS - `node tests/games/AsteroidsPlatformDemo.test.mjs`
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# PR_26133_031 Shape Schema Field Reduction Report
2+
3+
Task: PR_26133_031-shape-schema-field-reduction
4+
Date: 2026-05-14
5+
6+
## Contract Changes
7+
8+
- Removed persisted shape-level `shapeKey` from Object Vector Studio V2 shape contracts.
9+
- Removed persisted shape-level `label` from Object Vector Studio V2 shape contracts.
10+
- Removed persisted shape-level `type` because it duplicated `tool` for Object Vector Studio V2 shapes.
11+
- Kept `tool` as the required editor/runtime semantic field for each shape.
12+
- Kept object IDs as the runtime object identity source of truth.
13+
- Replaced frame `shapeOverrides[*].shapeKey` with `shapeOverrides[*].shapeIndex`, which references the local sorted shape row for the object including inherited rows.
14+
15+
## Schema Updates
16+
17+
- Updated `tools/schemas/tools/object-vector-studio-v2.schema.json` so shape variants discriminate by `tool`.
18+
- Updated `tools/schemas/game.manifest.schema.json` to embed the same reduced Object Vector Studio V2 shape contract.
19+
- Updated schema guards in `ObjectVectorStudioV2SchemaService` and `ObjectVectorRuntimeAssetService` so deprecated shape fields fail validation if reintroduced.
20+
- Added duplicate local shape-order validation because sorted local order now carries editor row identity.
21+
22+
## Manifest/Data Updates
23+
24+
- Updated `games/Asteroids/game.manifest.json` to remove shape-level `shapeKey`, `label`, and `type` from Asteroids Object Vector Studio V2 objects.
25+
- Updated ship animation frame overrides to use `shapeIndex` for the two thrust-line visibility toggles.
26+
- Preserved media/file asset `type` fields for audio, font, and image assets because those are not Object Vector Studio V2 shape semantics.
27+
28+
## Editor/Runtime Updates
29+
30+
- Updated Object Vector Studio V2 selection, tile actions, palette sync, geometry editing, transforms, z-ordering, grouping, shape delete, and frame override logic to use local shape indexes.
31+
- Derived UI display names from `tool` instead of removed local shape labels.
32+
- Derived rendering and geometry behavior from `tool`; `triangle` continues to use polygon geometry where required.
33+
- Updated runtime canvas/SVG rendering, bounds calculation, inheritance merging, and frame override application to use `tool` plus sorted local shape rows.
34+
35+
## Validation
36+
37+
- PASS - `npm run test:workspace-v2` completed with 49 passed, 0 failed.
38+
- PASS - `games/Asteroids/game.manifest.json` validates against `tools/schemas/game.manifest.schema.json`.
39+
- PASS - Embedded Object Vector Studio V2 payload validates against `tools/schemas/tools/object-vector-studio-v2.schema.json`.
40+
- PASS - `ObjectVectorRuntimeAssetService` loads the reduced Asteroids payload.
41+
- PASS - `node tests/games/AsteroidsAssetReferenceAdoption.test.mjs`.
42+
- PASS - `node tests/games/AsteroidsPlatformDemo.test.mjs`.

games/Asteroids/game.manifest.json

Lines changed: 8 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -262,10 +262,7 @@
262262
"name": "Asteroids Ship",
263263
"shapes": [
264264
{
265-
"shapeKey": "ship-hull",
266-
"label": "ship-hull",
267265
"tool": "polygon",
268-
"type": "polygon",
269266
"order": 0,
270267
"visible": true,
271268
"locked": false,
@@ -306,10 +303,7 @@
306303
}
307304
},
308305
{
309-
"shapeKey": "ship-thrust-port",
310-
"label": "ship-thrust-port",
311306
"tool": "line",
312-
"type": "line",
313307
"order": 1,
314308
"visible": true,
315309
"locked": false,
@@ -336,10 +330,7 @@
336330
}
337331
},
338332
{
339-
"shapeKey": "ship-thrust-starboard",
340-
"label": "ship-thrust-starboard",
341333
"tool": "line",
342-
"type": "line",
343334
"order": 2,
344335
"visible": true,
345336
"locked": false,
@@ -377,12 +368,12 @@
377368
"durationFrames": 1,
378369
"shapeOverrides": [
379370
{
380-
"shapeKey": "ship-thrust-port",
381-
"visible": false
371+
"visible": false,
372+
"shapeIndex": 1
382373
},
383374
{
384-
"shapeKey": "ship-thrust-starboard",
385-
"visible": false
375+
"visible": false,
376+
"shapeIndex": 2
386377
}
387378
]
388379
}
@@ -398,12 +389,12 @@
398389
"durationFrames": 1,
399390
"shapeOverrides": [
400391
{
401-
"shapeKey": "ship-thrust-port",
402-
"visible": true
392+
"visible": true,
393+
"shapeIndex": 1
403394
},
404395
{
405-
"shapeKey": "ship-thrust-starboard",
406-
"visible": true
396+
"visible": true,
397+
"shapeIndex": 2
407398
}
408399
]
409400
}
@@ -416,10 +407,7 @@
416407
"name": "Large Asteroid",
417408
"shapes": [
418409
{
419-
"shapeKey": "large-asteroid-ridge",
420-
"label": "large-asteroid-ridge",
421410
"tool": "polygon",
422-
"type": "polygon",
423411
"order": 0,
424412
"visible": true,
425413
"locked": false,
@@ -512,10 +500,7 @@
512500
"name": "Medium Asteroid",
513501
"shapes": [
514502
{
515-
"shapeKey": "medium-asteroid-ridge",
516-
"label": "medium-asteroid-ridge",
517503
"tool": "polygon",
518-
"type": "polygon",
519504
"order": 0,
520505
"visible": true,
521506
"locked": false,
@@ -588,10 +573,7 @@
588573
"name": "Small Asteroid",
589574
"shapes": [
590575
{
591-
"shapeKey": "small-asteroid-ridge",
592-
"label": "small-asteroid-ridge",
593576
"tool": "polygon",
594-
"type": "polygon",
595577
"order": 0,
596578
"visible": true,
597579
"locked": false,
@@ -660,10 +642,7 @@
660642
"name": "Large UFO",
661643
"shapes": [
662644
{
663-
"shapeKey": "large-ufo-body",
664-
"label": "large-ufo-body",
665645
"tool": "ellipse",
666-
"type": "ellipse",
667646
"order": 0,
668647
"visible": true,
669648
"locked": false,
@@ -690,10 +669,7 @@
690669
}
691670
},
692671
{
693-
"shapeKey": "large-ufo-canopy",
694-
"label": "large-ufo-canopy",
695672
"tool": "ellipse",
696-
"type": "ellipse",
697673
"order": 1,
698674
"visible": true,
699675
"locked": false,
@@ -740,10 +716,7 @@
740716
"name": "Small UFO",
741717
"shapes": [
742718
{
743-
"shapeKey": "small-ufo-body",
744-
"label": "small-ufo-body",
745719
"tool": "ellipse",
746-
"type": "ellipse",
747720
"order": 0,
748721
"visible": true,
749722
"locked": false,
@@ -770,10 +743,7 @@
770743
}
771744
},
772745
{
773-
"shapeKey": "small-ufo-canopy",
774-
"label": "small-ufo-canopy",
775746
"tool": "ellipse",
776-
"type": "ellipse",
777747
"order": 1,
778748
"visible": true,
779749
"locked": false,

0 commit comments

Comments
 (0)