Skip to content

Commit fc390f4

Browse files
author
DavidQ
committed
BUILD_PR_LEVEL_09_12_ASSET_REFERENCE_ADOPTION
Adopts manifest-driven runtime asset binding in the next small set of active runtime consumers, reduces ad hoc asset-path assumptions where touched, preserves runtime/editor boundaries, and limits roadmap edits to status-only updates.
1 parent 1a2ccec commit fc390f4

9 files changed

Lines changed: 269 additions & 85 deletions

docs/dev/CODEX_COMMANDS.md

Lines changed: 32 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -5,45 +5,52 @@ GPT-5.4
55
high
66

77
# COMMAND
8-
Create BUILD_PR_LEVEL_09_11_RUNTIME_ASSET_BINDING as a docs-first, surgical PR for `HTML-JavaScript-Gaming`.
8+
Create BUILD_PR_LEVEL_09_12_ASSET_REFERENCE_ADOPTION as a docs-first, surgical PR for `HTML-JavaScript-Gaming`.
99

1010
## Mission
11-
Bind runtime asset consumers to the deterministic game asset manifest so runtime lookup is manifest-driven and cannot consume tool/editor-only data.
11+
Adopt the manifest-driven runtime asset binding layer in the next small set of high-value runtime consumers so the new coordinated asset lane becomes real usage, not just infrastructure.
1212

1313
## Dependency context
1414
This PR follows:
1515
- 09_09 asset pipeline tooling
1616
- 09_10 game asset manifest coordination
17+
- 09_11 runtime asset binding
1718

18-
Use the generated game asset manifest at:
19-
`games/<game>/assets/<game>.assets.json`
19+
Use the approved binding surface introduced in 09_11.
20+
Do not bypass it with direct asset path assumptions where touched.
2021

2122
## Required scope
22-
- introduce a runtime-facing asset binding layer
23-
- resolve runtime assets from the coordinated manifest
24-
- centralize lookup by asset/domain identifiers
25-
- exclude or reject `assets/<domain>/data/` content from runtime binding
26-
- support active domains first:
27-
- sprites
28-
- tilemaps
29-
- parallax
30-
- vectors
31-
- add focused tests for runtime binding behavior
23+
- find the smallest high-value runtime adoption points
24+
- replace touched ad hoc asset references with manifest-driven binding
25+
- keep runtime readers out of `assets/<domain>/data/`
26+
- add focused tests for adoption and non-regression
27+
- stop at a stable checkpoint after the first clean adoption slice
28+
29+
## Recommended targets
30+
Prefer low-risk, active callers such as:
31+
- Asteroids runtime asset references
32+
- shared runtime-safe asset loading helpers
33+
- nearby runtime consumers already in this lane
3234

3335
## Hard rules
36+
- do not perform a repo-wide migration
3437
- do not redesign tools
35-
- do not expand engine feature scope broadly
3638
- do not add gameplay features
37-
- do not introduce new asset format work
38-
- do not allow runtime readers to depend on editor/tool data
39+
- do not introduce new asset formats
40+
- do not allow runtime access to editor/tool data
3941
- keep the PR surgical and dependency-ordered
4042

43+
## Roadmap instruction
44+
Update roadmap status only where this PR clearly advances tracked work.
45+
Do not change any roadmap text, prose, descriptions, or ordering.
46+
Status changes only.
47+
4148
## Deliverables
4249
Return a single repo-structured ZIP at:
43-
`<project folder>/tmp/BUILD_PR_LEVEL_09_11_RUNTIME_ASSET_BINDING.zip`
50+
`<project folder>/tmp/BUILD_PR_LEVEL_09_12_ASSET_REFERENCE_ADOPTION.zip`
4451

4552
Include:
46-
- docs/pr/BUILD_PR_LEVEL_09_11_RUNTIME_ASSET_BINDING.md
53+
- docs/pr/BUILD_PR_LEVEL_09_12_ASSET_REFERENCE_ADOPTION.md
4754
- docs/dev/codex_commands.md
4855
- docs/dev/commit_comment.txt
4956
- docs/dev/next_command.txt
@@ -53,14 +60,15 @@ Include:
5360
## Validation
5461
Run focused checks only:
5562
- node --check on touched files
56-
- focused runtime binding tests
63+
- focused adoption tests
64+
- existing runtime binding tests
5765
- existing GameAssetManifestCoordinator tests
5866
- existing AssetPipelineTooling tests
5967
- existing ProjectToolDataContracts tests as needed
6068

6169
## Success definition
62-
- runtime asset lookup is manifest-driven
63-
- `/data/` records are excluded from runtime binding
64-
- active asset domains resolve consistently
65-
- existing pipeline/manifest tests remain green
70+
- selected runtime consumers adopt manifest-driven binding
71+
- `/data/` records remain excluded from runtime use
72+
- existing pipeline/manifest/binding tests remain green
73+
- roadmap gets status-only updates if applicable
6674
- final output is one ZIP in `<project folder>/tmp/`

docs/dev/COMMIT_COMMENT.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1-
build(runtime): bind runtime asset lookup to coordinated game asset manifest
1+
BUILD_PR_LEVEL_09_12_ASSET_REFERENCE_ADOPTION
2+
3+
Adopt manifest-driven runtime asset binding in Asteroids runtime demo consumers (vectors/tilemap/parallax) using the 09_11 binding surface, replace touched ad hoc runtime path resolution with binding-based lookup, and add focused adoption/non-regression tests while preserving runtime/editor data boundaries.

docs/dev/NEXT_COMMAND.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
BUILD_PR_LEVEL_09_12_ASSET_REFERENCE_ADOPTION
1+
BUILD_PR_LEVEL_09_13_ASSET_LOOKUP_CONSOLIDATION
Lines changed: 21 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,26 @@
11
Summary
2-
- Implemented a runtime-facing manifest binding layer under `tools/shared/pipeline/runtimeAssetBinding.js`.
3-
- Runtime lookup is now manifest-driven by domain + asset id.
4-
- Runtime binding explicitly excludes `/data/` records so runtime readers cannot consume editor/tool-only assets.
5-
- Added focused runtime binding tests and wired them into the test runner.
2+
- Implemented a surgical 09_12 adoption slice in the Asteroids runtime demo consumer lane.
3+
- Replaced touched ad hoc runtime file selection for bindable domains with 09_11 manifest-driven runtime binding.
4+
- Added focused adoption validation to prove runtime resolution uses binding outputs and remains `/data/`-safe.
65

7-
Implemented runtime binding surface
8-
- `createRuntimeAssetBinding(manifest)`
9-
- consumes `games/<game>/assets/<game>.assets.json`-shaped manifest payload
10-
- builds runtime-safe domain indexes for active domains:
11-
- sprites
12-
- tilemaps
13-
- parallax
14-
- vectors
15-
- rejects records whose runtime path resolves to `/data/`
16-
- `resolveRuntimeAsset(binding, { domain, assetId })`
17-
- deterministic runtime lookup by normalized domain + asset id
18-
- returns null for missing/rejected assets
19-
20-
Focused tests added
21-
- `tests/tools/RuntimeAssetBinding.test.mjs`
22-
- validates manifest-driven lookup
23-
- validates `/data/` exclusion
24-
- validates active domain support
25-
- validates invalid-manifest handling
26-
- `tests/run-tests.mjs` updated to include `RuntimeAssetBinding` test.
6+
Code changes
7+
- `tools/shared/asteroidsPlatformDemo.js`
8+
- imports and uses `coordinateGameAssetManifest`, `createRuntimeAssetBinding`, and `resolveRuntimeAsset`
9+
- adds bindable domain mapping for `vector.*`, `tilemap.*`, `parallax.*`, `sprite.*`
10+
- builds a coordinated game-asset manifest + runtime binding from runtime source records
11+
- resolves bindable runtime assets through manifest-driven binding instead of ad hoc direct path use in touched resolver code
12+
- preserves non-bindable runtime asset behavior and existing runtime/demo flow
13+
- `tests/games/AsteroidsAssetReferenceAdoption.test.mjs` (new)
14+
- asserts runtime binding is `ready` with no issues
15+
- asserts vector/tilemap/parallax assets resolve through binding and runtime paths do not include `/data/`
16+
- asserts runtime bootstrap asset table paths match binding runtime paths
2717

2818
Scope guard
19+
- No engine core changes.
2920
- No tool UI redesign.
30-
- No gameplay feature additions.
31-
- No broad engine scope expansion.
32-
- No new asset formats.
33-
- No unrelated asset movement.
21+
- No gameplay/runtime feature expansion.
22+
- No repo-wide migration.
23+
- No asset moves.
24+
25+
Roadmap
26+
- No roadmap file changes were required in this checkpoint.
Lines changed: 23 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,32 @@
1-
Validation Checklist - BUILD_PR_LEVEL_09_11_RUNTIME_ASSET_BINDING
1+
Validation Checklist - BUILD_PR_LEVEL_09_12_ASSET_REFERENCE_ADOPTION
22

33
Scope
4-
[x] PR remains in the runtime asset binding lane only
4+
[x] PR remains in the asset reference adoption lane only
5+
[x] No broad repo-wide migration introduced
56
[x] No tool UI redesign introduced
67
[x] No gameplay feature changes introduced
7-
[x] No broad engine scope expansion introduced
8-
[x] No unrelated asset moves introduced
8+
[x] No new asset format work introduced
99

10-
Binding
11-
[x] Runtime-facing binding reads from `games/<game>/assets/<game>.assets.json`
12-
[x] Lookup is manifest-driven rather than ad hoc where touched
13-
[x] Binding supports sprites
14-
[x] Binding supports tilemaps
15-
[x] Binding supports parallax
16-
[x] Binding supports vectors
17-
[x] Tilesets only included if directly required
18-
[x] `assets/<domain>/data/` content is excluded or rejected from runtime binding
19-
[x] Deterministic lookup works by asset/domain identifiers
10+
Adoption
11+
[x] Selected runtime consumers now use manifest-driven binding
12+
[x] Replaced ad hoc path assumptions where touched
13+
[x] `assets/<domain>/data/` content remains excluded from runtime use
14+
[x] Deterministic identifier-based resolution remains intact
15+
[x] Adoption stops at a stable checkpoint
2016

2117
Validation
22-
[x] `node --check` passes for touched files
23-
[x] Focused runtime binding tests pass
24-
[x] Existing GameAssetManifestCoordinator tests still pass
25-
[x] Existing AssetPipelineTooling tests still pass
26-
[x] Existing ProjectToolDataContracts tests still pass
18+
[x] `node --check tools/shared/asteroidsPlatformDemo.js`
19+
[x] `node --check tests/games/AsteroidsAssetReferenceAdoption.test.mjs`
20+
[x] Focused adoption test passes: `AsteroidsAssetReferenceAdoption`
21+
[x] Existing runtime binding test passes: `RuntimeAssetBinding`
22+
[x] Existing GameAssetManifestCoordinator test passes
23+
[x] Existing AssetPipelineTooling test passes
24+
[x] Existing ProjectToolDataContracts test passes
25+
[x] Existing AsteroidsPlatformDemo non-regression test passes
2726

28-
Executed commands
29-
- node --check tools/shared/pipeline/runtimeAssetBinding.js
30-
- node --check tests/tools/RuntimeAssetBinding.test.mjs
31-
- node --check tests/run-tests.mjs
32-
- node --input-type=module -e "import('./tests/tools/RuntimeAssetBinding.test.mjs').then(async ({ run }) => { await run(); console.log('PASS RuntimeAssetBinding'); })"
33-
- node --input-type=module -e "import('./tests/tools/GameAssetManifestCoordinator.test.mjs').then(async ({ run }) => { await run(); console.log('PASS GameAssetManifestCoordinator'); })"
34-
- node --input-type=module -e "import('./tests/tools/AssetPipelineTooling.test.mjs').then(async ({ run }) => { await run(); console.log('PASS AssetPipelineTooling'); })"
35-
- node --input-type=module -e "import('./tests/tools/ProjectToolDataContracts.test.mjs').then(async ({ run }) => { await run(); console.log('PASS ProjectToolDataContracts'); })"
27+
Roadmap
28+
[x] Roadmap status update not applied (not clearly required in this checkpoint)
29+
[x] No roadmap prose/text changes made
3630

3731
Packaging
3832
[x] docs/pr document included
@@ -41,4 +35,5 @@ Packaging
4135
[x] docs/dev/next_command.txt included
4236
[x] docs/dev/reports/change_summary.txt included
4337
[x] docs/dev/reports/validation_checklist.txt included
44-
[x] Single ZIP produced at `<project folder>/tmp/BUILD_PR_LEVEL_09_11_RUNTIME_ASSET_BINDING.zip`
38+
[x] Single ZIP produced at `<project folder>/tmp/BUILD_PR_LEVEL_09_12_ASSET_REFERENCE_ADOPTION.zip`
39+
Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
# BUILD_PR — LEVEL 09_12 — ASSET REFERENCE ADOPTION
2+
3+
## Objective
4+
Adopt the manifest-driven runtime asset binding path in the first targeted runtime consumers so active games and shared runtime-facing callers stop relying on ad hoc asset-path assumptions where touched.
5+
6+
This PR follows:
7+
- 09_09 asset pipeline tooling
8+
- 09_10 game asset manifest coordination
9+
- 09_11 runtime asset binding
10+
11+
09_11 established the runtime-safe manifest-driven binding layer.
12+
09_12 now applies that layer in the next small, dependency-ordered adoption pass.
13+
14+
## Why This PR Exists
15+
The repo now has:
16+
- shared asset pipeline stages
17+
- deterministic game asset manifests
18+
- runtime-safe manifest-driven binding
19+
20+
What remains is actual adoption in the callers that still assume direct paths or per-domain lookup behavior.
21+
22+
Without this PR:
23+
- the new binding layer exists but remains underused
24+
- games and runtime surfaces may continue drifting in lookup behavior
25+
- manifest coordination is not yet the default consumption path
26+
27+
## In Scope
28+
- identify the smallest set of active runtime consumers that should adopt manifest-driven asset lookup now
29+
- replace touched ad hoc runtime asset references with the approved binding surface
30+
- prefer high-value, low-risk adoption targets in active games or shared runtime consumers
31+
- preserve the runtime/tool-data boundary
32+
- add focused tests for adoption points and non-regression
33+
34+
## Out of Scope
35+
- no broad repo-wide migration
36+
- no tool UI work
37+
- no new asset-format work
38+
- no gameplay feature changes
39+
- no speculative engine redesign
40+
- no runtime access to `assets/<domain>/data/`
41+
42+
## Adoption Strategy
43+
This PR should be surgical:
44+
1. choose a very small number of high-value adoption sites
45+
2. swap them to manifest-driven lookup
46+
3. validate behavior
47+
4. stop at a stable checkpoint
48+
49+
Do not turn this PR into a full repo-wide migration.
50+
51+
## Recommended Initial Targets
52+
Prioritize active, low-risk consumers such as:
53+
- Asteroids runtime asset references where manifest-driven lookup clearly applies
54+
- shared runtime-safe asset loading helpers already adjacent to asset lookup
55+
- any touched code already participating in the new asset lane
56+
57+
## Hard Rules
58+
- runtime lookup must flow through the approved manifest/binding surface where touched
59+
- runtime code must not read tool/editor data
60+
- keep the delta small and purpose-specific
61+
- no broad cleanup unrelated to adoption
62+
- preserve deterministic identifier-based resolution
63+
64+
## Validation Expectations
65+
At minimum:
66+
- touched files parse cleanly
67+
- adoption sites resolve through the binding layer
68+
- `/data/` content remains excluded from runtime use
69+
- existing binding/manifest/pipeline tests remain green
70+
- focused adoption tests pass
71+
72+
## Roadmap Update Instruction
73+
Update roadmap status only where this PR clearly advances tracked work.
74+
Do not change roadmap wording, descriptions, ordering, or prose.
75+
Status updates only. No text edits.
76+
77+
## Acceptance Criteria
78+
- selected runtime consumers use manifest-driven binding
79+
- no touched runtime consumer relies on ad hoc path assumptions where replaced
80+
- runtime/editor boundary remains intact
81+
- tests/checks pass
82+
- roadmap receives status-only updates if applicable
83+
84+
## Deliverables
85+
Return a repo-structured ZIP at:
86+
`<project folder>/tmp/BUILD_PR_LEVEL_09_12_ASSET_REFERENCE_ADOPTION.zip`
87+
88+
Include:
89+
- docs/pr/BUILD_PR_LEVEL_09_12_ASSET_REFERENCE_ADOPTION.md
90+
- docs/dev/codex_commands.md
91+
- docs/dev/commit_comment.txt
92+
- docs/dev/next_command.txt
93+
- docs/dev/reports/change_summary.txt
94+
- docs/dev/reports/validation_checklist.txt
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
import assert from "node:assert/strict";
2+
import { buildAsteroidsPlatformDemo } from "../../tools/shared/asteroidsPlatformDemo.js";
3+
4+
export async function run() {
5+
const result = await buildAsteroidsPlatformDemo();
6+
const binding = result.demo.runtimeBinding;
7+
8+
assert.equal(binding?.status, "ready");
9+
assert.equal(Array.isArray(binding?.issues), true);
10+
assert.equal(binding.issues.length, 0);
11+
12+
const vectorBinding = (binding.domains.vectors || []).find((entry) => entry.assetId === "vector.asteroids.ship");
13+
const tilemapBinding = (binding.domains.tilemaps || []).find((entry) => entry.assetId === "tilemap.asteroids-stage");
14+
const parallaxBinding = (binding.domains.parallax || []).find((entry) => entry.assetId === "parallax.asteroids-title");
15+
16+
assert.equal(Boolean(vectorBinding), true);
17+
assert.equal(Boolean(tilemapBinding), true);
18+
assert.equal(Boolean(parallaxBinding), true);
19+
assert.equal(vectorBinding.runtimePath.includes("/data/"), false);
20+
assert.equal(tilemapBinding.runtimePath.includes("/data/"), false);
21+
assert.equal(parallaxBinding.runtimePath.includes("/data/"), false);
22+
23+
const runtimeAssetTable = result.demo.runtimeResult?.bootstrap?.assetTable || {};
24+
const runtimePathFor = (entry) => entry?.file || entry?.path || "";
25+
assert.equal(runtimePathFor(runtimeAssetTable["vector.asteroids.ship"]), vectorBinding.runtimePath);
26+
assert.equal(runtimePathFor(runtimeAssetTable["tilemap.asteroids-stage"]), tilemapBinding.runtimePath);
27+
assert.equal(runtimePathFor(runtimeAssetTable["parallax.asteroids-title"]), parallaxBinding.runtimePath);
28+
}

0 commit comments

Comments
 (0)