Skip to content

Commit fb7c781

Browse files
committed
Create real sprite asset handoff from Objects render selection - PR_26161_003-object-render-asset-handoff
1 parent 9eea1ad commit fb7c781

13 files changed

Lines changed: 3792 additions & 1159 deletions
Lines changed: 23 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,32 @@
11
# git status --short
2-
M docs_build/dev/reports/coverage_changed_js_guardrail.txt
2+
M docs_build/dev/reports/codex_changed_files.txt
3+
M docs_build/dev/reports/codex_review.diff
4+
M docs_build/dev/reports/coverage_changed_js_guardrail.txt
35
M docs_build/dev/reports/playwright_v8_coverage_report.txt
6+
M src/dev-runtime/persistence/tool-repositories/assets-mock-repository.js
7+
M src/engine/object-model/objectDefinitionSchema.js
8+
M src/engine/object-model/objectDefinitionValidator.js
9+
M src/engine/object-model/objectModelRegistry.js
10+
M tests/engine/ObjectModelContract.test.mjs
411
M tests/playwright/tools/ObjectsTool.spec.mjs
512
M toolbox/objects/index.html
613
M toolbox/objects/objects.js
7-
?? docs_build/dev/reports/db-object-model-contract-report.md
8-
?? src/engine/object-model/
9-
?? tests/engine/ObjectModelContract.test.mjs
14+
?? docs_build/dev/reports/object-render-asset-handoff-report.md
1015

1116
# git ls-files --others --exclude-standard
12-
docs_build/dev/reports/db-object-model-contract-report.md
13-
src/engine/object-model/index.js
14-
src/engine/object-model/objectDefinitionSchema.js
15-
src/engine/object-model/objectDefinitionValidator.js
16-
src/engine/object-model/objectModelRegistry.js
17-
tests/engine/ObjectModelContract.test.mjs
17+
docs_build/dev/reports/object-render-asset-handoff-report.md
1818

1919
# git diff --stat
20-
.../dev/reports/coverage_changed_js_guardrail.txt | 6 +-
21-
.../dev/reports/playwright_v8_coverage_report.txt | 34 ++--
22-
tests/playwright/tools/ObjectsTool.spec.mjs | 7 +
23-
toolbox/objects/index.html | 15 +-
24-
toolbox/objects/objects.js | 179 +++++++++++++++++----
25-
5 files changed, 185 insertions(+), 56 deletions(-)
20+
docs_build/dev/reports/codex_changed_files.txt | 32 +-
21+
docs_build/dev/reports/codex_review.diff | 1990 +++++++++-----------
22+
.../dev/reports/coverage_changed_js_guardrail.txt | 12 +-
23+
.../dev/reports/playwright_v8_coverage_report.txt | 33 +-
24+
.../tool-repositories/assets-mock-repository.js | 179 ++
25+
src/engine/object-model/objectDefinitionSchema.js | 14 +
26+
.../object-model/objectDefinitionValidator.js | 103 +
27+
src/engine/object-model/objectModelRegistry.js | 8 -
28+
tests/engine/ObjectModelContract.test.mjs | 36 +-
29+
tests/playwright/tools/ObjectsTool.spec.mjs | 66 +-
30+
toolbox/objects/index.html | 21 +-
31+
toolbox/objects/objects.js | 147 +-
32+
12 files changed, 1473 insertions(+), 1168 deletions(-)

docs_build/dev/reports/codex_review.diff

Lines changed: 3117 additions & 1099 deletions
Large diffs are not rendered by default.

docs_build/dev/reports/coverage_changed_js_guardrail.txt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@ Missing changed runtime JS files are WARN, not FAIL.
66
Source: Playwright/Chromium built-in V8 coverage from the active Playwright run.
77

88
Changed runtime JS files considered:
9-
(0%) src/dev-runtime/guest-seeds/tool-metadata-inventory.js - WARNING: changed runtime JS file was not collected by Playwright V8 coverage; advisory only
10-
(67%) src/engine/object-model/objectModelRegistry.js - executed lines 146/146; executed functions 4/6
11-
(70%) src/engine/object-model/objectDefinitionValidator.js - executed lines 269/269; executed functions 14/20
12-
(75%) src/engine/object-model/objectDefinitionSchema.js - executed lines 44/44; executed functions 3/4
13-
(94%) toolbox/objects/objects.js - executed lines 466/466; executed functions 58/62
9+
(0%) src/dev-runtime/persistence/tool-repositories/assets-mock-repository.js - WARNING: changed runtime JS file was not collected by Playwright V8 coverage; advisory only
10+
(67%) src/engine/object-model/objectModelRegistry.js - executed lines 139/139; executed functions 4/6
11+
(74%) src/engine/object-model/objectDefinitionValidator.js - executed lines 360/360; executed functions 17/23
12+
(75%) src/engine/object-model/objectDefinitionSchema.js - executed lines 58/58; executed functions 3/4
13+
(96%) toolbox/objects/objects.js - executed lines 590/590; executed functions 68/71
1414
(100%) src/engine/object-model/index.js - executed lines 29/29; executed functions 1/1
1515

1616
Guardrail warnings:
17-
(0%) src/dev-runtime/guest-seeds/tool-metadata-inventory.js - WARNING: changed runtime JS file missing from coverage; advisory only
17+
(0%) src/dev-runtime/persistence/tool-repositories/assets-mock-repository.js - WARNING: changed runtime JS file missing from coverage; advisory only
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
# PR_26161_003 Object Render Asset Handoff Report
2+
3+
## Branch Guard
4+
5+
- Current branch: `main`
6+
- Expected branch: `main`
7+
- Local branches found: `* main`
8+
- Branch validation: PASS
9+
10+
## Scope Result
11+
12+
- PASS: Read `docs_build/dev/PROJECT_INSTRUCTIONS.md` before edits.
13+
- PASS: Continued the PR_26161_002 object-model migration without restoring legacy `objectStatic` / `objectDynamic` / `objectKillable` classes.
14+
- PASS: Removed `bounces` from object identity traits. Bounce remains a future behavior/physics/event configuration concern.
15+
- PASS: Added object definition render config schema/validation for `None` and `Sprite`.
16+
- PASS: Wired Objects to the shared object-model registry and shared asset repository contract instead of owning duplicate sprite asset records.
17+
- PASS: Added Render Type = Sprite handoff that creates or resolves a real mock-adapter asset row named from the object key, for example `sprite_ball`.
18+
- PASS: Linked the object render config to the returned sprite asset key and shared asset preview path.
19+
- PASS: Objects shows the linked sprite key/path and an Edit Sprite route with `assetKey`, `objectKey`, and `sourceTool=objects` query context.
20+
- PASS: Missing sprite assets create a minimal editable default sprite asset record with visible status diagnostics.
21+
- PASS: No fake `placeholder` asset key/concept and no `imageDataUrl` were introduced.
22+
- PASS: Object ownership stays in Objects; sprite content ownership stays with Assets/Sprite Editor.
23+
- PASS: No sample JSON alignment, auth behavior, production DB behavior, or unrelated tool rewrites were added.
24+
- PASS: Toolbox/Admin tool metadata was not changed.
25+
26+
## Implementation Evidence
27+
28+
- `src/engine/object-model/objectModelRegistry.js`: removed `bounces` trait registration.
29+
- `src/engine/object-model/objectDefinitionSchema.js`: added declared render config shape.
30+
- `src/engine/object-model/objectDefinitionValidator.js`: added actionable render validation diagnostics.
31+
- `src/dev-runtime/persistence/tool-repositories/assets-mock-repository.js`: added mock-adapter `ensureSpriteAssetForObject` create/resolve support for sprite assets.
32+
- `toolbox/objects/index.html`: added Render Type input, Render Asset column, linked sprite preview, and Edit Sprite action using Theme V2 markup only.
33+
- `toolbox/objects/objects.js`: requests shared sprite assets, stores linked render config, logs warnings, and displays preview/action state.
34+
- `tests/engine/ObjectModelContract.test.mjs`: validates no `bounces` object trait and sprite render asset-key validation.
35+
- `tests/playwright/tools/ObjectsTool.spec.mjs`: validates sprite render selection creating/resolving `sprite_ball`, DB row evidence, no placeholder key, and no visible `bounces` trait.
36+
37+
## Validation
38+
39+
- PASS: Changed-file syntax checks:
40+
- `node --check src/engine/object-model/objectModelRegistry.js`
41+
- `node --check src/engine/object-model/objectDefinitionSchema.js`
42+
- `node --check src/engine/object-model/objectDefinitionValidator.js`
43+
- `node --check src/dev-runtime/persistence/tool-repositories/assets-mock-repository.js`
44+
- `node --check toolbox/objects/objects.js`
45+
- `node --check tests/engine/ObjectModelContract.test.mjs`
46+
- `node --check tests/playwright/tools/ObjectsTool.spec.mjs`
47+
- PASS: HTML restrictions check:
48+
- Node assertion confirmed `toolbox/objects/index.html` has no inline `<script>` block, no `<style>` block, and no inline event handlers.
49+
- PASS: Targeted object-model validator test:
50+
- `node tests/engine/ObjectModelContract.test.mjs`
51+
- PASS: Targeted Objects Playwright:
52+
- `npx playwright test tests/playwright/tools/ObjectsTool.spec.mjs --reporter=line`
53+
- Final result: 3 passed.
54+
- Note: the first Playwright run exposed that Game Configuration readiness was being treated as a hard block for the sprite mock asset handoff. The final implementation records it as a visible warning when an active project path exists, and the final targeted run passed.
55+
- PASS: Playwright V8 coverage produced:
56+
- `docs_build/dev/reports/playwright_v8_coverage_report.txt`
57+
- Browser-covered changed runtime JS includes `toolbox/objects/objects.js`, object-model schema/registry/validator, and shared object-model index.
58+
- WARN: `src/dev-runtime/persistence/tool-repositories/assets-mock-repository.js` is server-side dev-runtime code and is not collected by browser V8 coverage.
59+
60+
## Skipped Lanes
61+
62+
- SKIP: Toolbox/Admin metadata Playwright. Safe to skip because no Toolbox/Admin metadata changed.
63+
- SKIP: Sprite Editor launch/handoff validation. Safe to skip because no Sprite Editor/Sprites files changed; Objects Playwright validates the routed `assetKey`/`objectKey`/`sourceTool` href context.
64+
- SKIP: Full samples validation. Safe to skip because sample JSON alignment was explicitly out of scope and no sample files changed.
65+
- SKIP: Full test suite. Safe to skip because this PR changed the targeted object-model contract, dev mock asset repository handoff, and Objects tool surface only; requested targeted lanes passed.
66+
67+
## Remaining Follow-Up
68+
69+
- Bounce/rebound configuration should be added later under behavior, physics, or event configuration contracts. It must not return as an object identity trait.
70+
- Sprite Editor content editing remains owned by the Sprite Editor/Sprites tool; this PR only provides the linked asset context and shared asset record handoff.
71+
72+
## Required Artifacts
73+
74+
- PASS: `docs_build/dev/reports/object-render-asset-handoff-report.md`
75+
- PASS: `docs_build/dev/reports/codex_review.diff`
76+
- PASS: `docs_build/dev/reports/codex_changed_files.txt`
77+
- PASS: `docs_build/dev/reports/playwright_v8_coverage_report.txt`

docs_build/dev/reports/playwright_v8_coverage_report.txt

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -12,40 +12,39 @@ Note: entry percentages use function coverage when available, otherwise line cov
1212
Note: coverage entries are aggregated across every page/tool where coverageReporter.start(page) and coverageReporter.stop(page) ran.
1313

1414
Exercised tool entry points detected:
15-
(88%) Toolbox Index - exercised 2 runtime JS files
15+
(89%) Toolbox Index - exercised 3 runtime JS files
1616
(0%) Tool Template V2 - not exercised by this Playwright run
1717
(59%) Theme V2 Shared JS - exercised 2 runtime JS files
1818

1919
Changed runtime JS files covered:
20-
(0%) src/dev-runtime/guest-seeds/tool-metadata-inventory.js - WARNING: changed runtime JS file was not collected by Playwright V8 coverage; advisory only
21-
(67%) src/engine/object-model/objectModelRegistry.js - executed lines 146/146; executed functions 4/6
22-
(70%) src/engine/object-model/objectDefinitionValidator.js - executed lines 269/269; executed functions 14/20
23-
(75%) src/engine/object-model/objectDefinitionSchema.js - executed lines 44/44; executed functions 3/4
24-
(94%) toolbox/objects/objects.js - executed lines 466/466; executed functions 58/62
20+
(0%) src/dev-runtime/persistence/tool-repositories/assets-mock-repository.js - WARNING: changed runtime JS file was not collected by Playwright V8 coverage; advisory only
21+
(67%) src/engine/object-model/objectModelRegistry.js - executed lines 139/139; executed functions 4/6
22+
(74%) src/engine/object-model/objectDefinitionValidator.js - executed lines 360/360; executed functions 17/23
23+
(75%) src/engine/object-model/objectDefinitionSchema.js - executed lines 58/58; executed functions 3/4
24+
(96%) toolbox/objects/objects.js - executed lines 590/590; executed functions 68/71
2525
(100%) src/engine/object-model/index.js - executed lines 29/29; executed functions 1/1
2626

2727
Files with executed line/function counts where available:
28-
(36%) src/engine/api/server-api-client.js - executed lines 159/159; executed functions 5/14
28+
(53%) src/engine/api/server-api-client.js - executed lines 159/159; executed functions 10/19
2929
(58%) assets/theme-v2/js/gamefoundry-partials.js - executed lines 603/603; executed functions 30/52
3030
(64%) assets/theme-v2/js/tool-display-mode.js - executed lines 209/209; executed functions 9/14
31-
(67%) src/engine/object-model/objectModelRegistry.js - executed lines 146/146; executed functions 4/6
32-
(70%) src/engine/object-model/objectDefinitionValidator.js - executed lines 269/269; executed functions 14/20
33-
(75%) src/engine/object-model/objectDefinitionSchema.js - executed lines 44/44; executed functions 3/4
31+
(67%) src/engine/object-model/objectModelRegistry.js - executed lines 139/139; executed functions 4/6
32+
(67%) toolbox/assets/assets-api-client.js - executed lines 17/17; executed functions 2/3
33+
(74%) src/engine/object-model/objectDefinitionValidator.js - executed lines 360/360; executed functions 17/23
34+
(75%) src/engine/object-model/objectDefinitionSchema.js - executed lines 58/58; executed functions 3/4
3435
(75%) toolbox/tool-registry-api-client.js - executed lines 152/152; executed functions 21/28
35-
(94%) toolbox/objects/objects.js - executed lines 466/466; executed functions 58/62
36+
(96%) toolbox/objects/objects.js - executed lines 590/590; executed functions 68/71
3637
(100%) src/engine/object-model/index.js - executed lines 29/29; executed functions 1/1
3738

3839
Uncovered or low-coverage changed JS files:
39-
(0%) src/dev-runtime/guest-seeds/tool-metadata-inventory.js - WARNING: uncovered changed runtime JS file; advisory only
40+
(0%) src/dev-runtime/persistence/tool-repositories/assets-mock-repository.js - WARNING: uncovered changed runtime JS file; advisory only
4041

4142
Changed JS files considered:
42-
(0%) src/dev-runtime/guest-seeds/tool-metadata-inventory.js - changed JS file not collected as browser runtime coverage
43+
(0%) src/dev-runtime/persistence/tool-repositories/assets-mock-repository.js - changed JS file not collected as browser runtime coverage
4344
(0%) tests/engine/ObjectModelContract.test.mjs - changed JS file not collected as browser runtime coverage
4445
(0%) tests/playwright/tools/ObjectsTool.spec.mjs - changed JS file not collected as browser runtime coverage
45-
(0%) tests/playwright/tools/RootToolsFutureState.spec.mjs - changed JS file not collected as browser runtime coverage
46-
(0%) tests/playwright/tools/ToolboxAdminMetadataSsot.spec.mjs - changed JS file not collected as browser runtime coverage
4746
(67%) src/engine/object-model/objectModelRegistry.js - changed JS file with browser V8 coverage
48-
(70%) src/engine/object-model/objectDefinitionValidator.js - changed JS file with browser V8 coverage
47+
(74%) src/engine/object-model/objectDefinitionValidator.js - changed JS file with browser V8 coverage
4948
(75%) src/engine/object-model/objectDefinitionSchema.js - changed JS file with browser V8 coverage
50-
(94%) toolbox/objects/objects.js - changed JS file with browser V8 coverage
49+
(96%) toolbox/objects/objects.js - changed JS file with browser V8 coverage
5150
(100%) src/engine/object-model/index.js - changed JS file with browser V8 coverage

0 commit comments

Comments
 (0)