Skip to content

Commit ffb8e39

Browse files
author
DavidQ
committed
BUILD_PR_LEVEL_09_13_ASSET_LOOKUP_CONSOLIDATION
1 parent fc390f4 commit ffb8e39

14 files changed

Lines changed: 288 additions & 250 deletions

docs/dev/CODEX_COMMANDS.md

Lines changed: 7 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -1,74 +1,7 @@
1-
# MODEL
2-
GPT-5.4
3-
4-
# REASONING
5-
high
6-
7-
# COMMAND
8-
Create BUILD_PR_LEVEL_09_12_ASSET_REFERENCE_ADOPTION as a docs-first, surgical PR for `HTML-JavaScript-Gaming`.
9-
10-
## Mission
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.
12-
13-
## Dependency context
14-
This PR follows:
15-
- 09_09 asset pipeline tooling
16-
- 09_10 game asset manifest coordination
17-
- 09_11 runtime asset binding
18-
19-
Use the approved binding surface introduced in 09_11.
20-
Do not bypass it with direct asset path assumptions where touched.
21-
22-
## Required scope
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
34-
35-
## Hard rules
36-
- do not perform a repo-wide migration
37-
- do not redesign tools
38-
- do not add gameplay features
39-
- do not introduce new asset formats
40-
- do not allow runtime access to editor/tool data
41-
- keep the PR surgical and dependency-ordered
42-
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-
48-
## Deliverables
49-
Return a single repo-structured ZIP at:
50-
`<project folder>/tmp/BUILD_PR_LEVEL_09_12_ASSET_REFERENCE_ADOPTION.zip`
51-
52-
Include:
53-
- docs/pr/BUILD_PR_LEVEL_09_12_ASSET_REFERENCE_ADOPTION.md
54-
- docs/dev/codex_commands.md
55-
- docs/dev/commit_comment.txt
56-
- docs/dev/next_command.txt
57-
- docs/dev/reports/change_summary.txt
58-
- docs/dev/reports/validation_checklist.txt
59-
60-
## Validation
61-
Run focused checks only:
62-
- node --check on touched files
63-
- focused adoption tests
64-
- existing runtime binding tests
65-
- existing GameAssetManifestCoordinator tests
66-
- existing AssetPipelineTooling tests
67-
- existing ProjectToolDataContracts tests as needed
68-
69-
## Success definition
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
74-
- final output is one ZIP in `<project folder>/tmp/`
1+
MODEL: GPT-5.4
2+
REASONING: high
3+
COMMAND:
4+
- Consolidate runtime asset lookup into shared interface
5+
- Replace duplicate lookup logic where touched
6+
- Use manifest binding as source of truth
7+
- Update roadmap status only (no text changes)

docs/dev/COMMIT_COMMENT.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
BUILD_PR_LEVEL_09_12_ASSET_REFERENCE_ADOPTION
1+
BUILD_PR_LEVEL_09_13_ASSET_LOOKUP_CONSOLIDATION
22

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.
3+
Consolidates runtime asset lookup into a shared manifest-backed interface, replaces duplicated runtime lookup logic in touched consumers, enforces manifest binding as the source of truth for bindable domains, and applies a status-only roadmap bracket update.

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_13_ASSET_LOOKUP_CONSOLIDATION
1+
BUILD_PR_LEVEL_09_14_RUNTIME_ASSET_VALIDATION
Lines changed: 20 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,23 @@
11
Summary
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.
2+
- Consolidated runtime asset lookup behind one shared interface: `tools/shared/pipeline/runtimeAssetLookup.js`.
3+
- Replaced duplicated runtime lookup resolver logic in touched consumers with the shared manifest-backed lookup.
4+
- Kept manifest binding as the lookup source of truth for bindable runtime asset domains.
55

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
6+
Implementation
7+
- Added `createRuntimeManifestAssetLookup` and `getRuntimeBindingDomain`:
8+
- Builds/uses `coordinateGameAssetManifest` + `createRuntimeAssetBinding`
9+
- Exposes `resolvePackagedAsset` for runtime loaders
10+
- Supports strict (`missingBindingBehavior: "null"`) and fallback (`"static"`) missing-binding handling
11+
- Replaced local duplicate resolver logic in:
12+
- `tools/shared/asteroidsPlatformDemo.js`
13+
- `tools/shared/vectorNativeTemplate.js`
14+
- `tools/shared/vectorTemplateSampleGame.js`
15+
- `tools/shared/vectorAssetSystem.js`
16+
- Added focused consolidation test:
17+
- `tests/tools/RuntimeAssetLookupConsolidation.test.mjs`
18+
- Registered the test in `tests/run-tests.mjs`.
1719

18-
Scope guard
19-
- No engine core changes.
20-
- No tool UI redesign.
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.
20+
Roadmap (status-only)
21+
- Updated one bracket status only in `docs/dev/roadmaps/MASTER_ROADMAP_HIGH_LEVEL.md`:
22+
- `Normalize tools/shared and tool boundaries` moved from `[.]` to `[x]`
23+
- No roadmap prose/order/wording edits.
Lines changed: 24 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,32 @@
1-
Validation Checklist - BUILD_PR_LEVEL_09_12_ASSET_REFERENCE_ADOPTION
1+
Validation Checklist - BUILD_PR_LEVEL_09_13_ASSET_LOOKUP_CONSOLIDATION
22

33
Scope
4-
[x] PR remains in the asset reference adoption lane only
5-
[x] No broad repo-wide migration introduced
6-
[x] No tool UI redesign introduced
7-
[x] No gameplay feature changes introduced
8-
[x] No new asset format work introduced
4+
[x] Runtime asset lookup consolidated via shared interface
5+
[x] Duplicate lookup logic replaced where touched
6+
[x] Manifest binding used as source of truth for bindable runtime domains
7+
[x] No engine-core changes
8+
[x] No tool UI changes
99

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
10+
Code
11+
[x] Added `tools/shared/pipeline/runtimeAssetLookup.js`
12+
[x] Updated `tools/shared/asteroidsPlatformDemo.js`
13+
[x] Updated `tools/shared/vectorNativeTemplate.js`
14+
[x] Updated `tools/shared/vectorTemplateSampleGame.js`
15+
[x] Updated `tools/shared/vectorAssetSystem.js`
16+
[x] Added `tests/tools/RuntimeAssetLookupConsolidation.test.mjs`
17+
[x] Updated `tests/run-tests.mjs`
1618

1719
Validation
20+
[x] `node --check tools/shared/pipeline/runtimeAssetLookup.js`
1821
[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
22+
[x] `node --check tools/shared/vectorNativeTemplate.js`
23+
[x] `node --check tools/shared/vectorTemplateSampleGame.js`
24+
[x] `node --check tools/shared/vectorAssetSystem.js`
25+
[x] `node --check tests/tools/RuntimeAssetLookupConsolidation.test.mjs`
26+
[x] Focused test passes: `RuntimeAssetLookupConsolidation`
27+
[x] Existing tests pass: RuntimeAssetBinding, GameAssetManifestCoordinator, AssetPipelineTooling, ProjectToolDataContracts
28+
[x] Existing touched-consumer non-regression tests pass: AsteroidsAssetReferenceAdoption, AsteroidsPlatformDemo, VectorNativeTemplate, VectorTemplateSampleGame, VectorAssetSystem
2629

2730
Roadmap
28-
[x] Roadmap status update not applied (not clearly required in this checkpoint)
29-
[x] No roadmap prose/text changes made
30-
31-
Packaging
32-
[x] docs/pr document included
33-
[x] docs/dev/codex_commands.md included
34-
[x] docs/dev/commit_comment.txt included
35-
[x] docs/dev/next_command.txt included
36-
[x] docs/dev/reports/change_summary.txt included
37-
[x] docs/dev/reports/validation_checklist.txt included
38-
[x] Single ZIP produced at `<project folder>/tmp/BUILD_PR_LEVEL_09_12_ASSET_REFERENCE_ADOPTION.zip`
39-
31+
[x] Status-only update applied
32+
[x] No roadmap prose/text/order changes

docs/dev/roadmaps/MASTER_ROADMAP_HIGH_LEVEL.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -593,7 +593,7 @@
593593
- [ ] Apply master roadmap baseline
594594
- [ ] Normalize samples phase structure
595595
- [ ] Establish games/_template and normalize games layer
596-
- [.] Normalize tools/shared and tool boundaries
596+
- [x] Normalize tools/shared and tool boundaries
597597
- [.] Normalize assets/data ownership
598598
- [.] Expand testing/validation structure
599599

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# BUILD_PR — LEVEL 09_13 — ASSET LOOKUP CONSOLIDATION
2+
3+
## Objective
4+
Consolidate all runtime asset lookup paths into a single shared lookup interface built on top of the manifest-driven binding layer.
5+
6+
## Purpose
7+
Remove remaining fragmented lookup logic and ensure all runtime consumers use one consistent resolution path.
8+
9+
## Scope
10+
- centralize lookup helpers
11+
- remove duplicated lookup logic where touched
12+
- enforce manifest-first lookup
13+
- preserve runtime/editor boundary
14+
15+
## Out of Scope
16+
- no broad refactor
17+
- no engine changes
18+
- no tool UI changes
19+
20+
## Roadmap Instruction
21+
Update roadmap status only. No text edits.
22+
23+
## Deliverables
24+
Standard docs/dev bundle.

tests/run-tests.mjs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ import { run as runProjectToolDataContracts } from './tools/ProjectToolDataContr
9393
import { run as runAssetPipelineTooling } from './tools/AssetPipelineTooling.test.mjs';
9494
import { run as runGameAssetManifestCoordinator } from './tools/GameAssetManifestCoordinator.test.mjs';
9595
import { run as runRuntimeAssetBinding } from './tools/RuntimeAssetBinding.test.mjs';
96+
import { run as runRuntimeAssetLookupConsolidation } from './tools/RuntimeAssetLookupConsolidation.test.mjs';
9697
import { run as runToolEntryLaunchContract } from './tools/ToolEntryLaunchContract.test.mjs';
9798
import { run as runProjectPackagingSystem } from './tools/ProjectPackagingSystem.test.mjs';
9899
import { run as runRuntimeAssetLoader } from './tools/RuntimeAssetLoader.test.mjs';
@@ -211,6 +212,7 @@ const tests = [
211212
['AssetPipelineTooling', runAssetPipelineTooling],
212213
['GameAssetManifestCoordinator', runGameAssetManifestCoordinator],
213214
['RuntimeAssetBinding', runRuntimeAssetBinding],
215+
['RuntimeAssetLookupConsolidation', runRuntimeAssetLookupConsolidation],
214216
['ToolEntryLaunchContract', runToolEntryLaunchContract],
215217
['ProjectPackagingSystem', runProjectPackagingSystem],
216218
['RuntimeAssetLoader', runRuntimeAssetLoader],
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
import assert from "node:assert/strict";
2+
import { createRuntimeManifestAssetLookup, getRuntimeBindingDomain } from "../../tools/shared/pipeline/runtimeAssetLookup.js";
3+
4+
export async function run() {
5+
assert.equal(getRuntimeBindingDomain("vector.ship"), "vectors");
6+
assert.equal(getRuntimeBindingDomain("tilemap.main"), "tilemaps");
7+
assert.equal(getRuntimeBindingDomain("parallax.bg"), "parallax");
8+
assert.equal(getRuntimeBindingDomain("palette.hud"), "");
9+
10+
const strictLookup = createRuntimeManifestAssetLookup({
11+
gameId: "Asteroids",
12+
runtimeAssetSources: {
13+
"vector.ship": { file: "games/asteroids/assets/vectors/ship.vector.json", kind: "vector" },
14+
"tilemap.main": { file: "games/asteroids/assets/tilemaps/main.tilemap.json", kind: "tilemap" },
15+
"parallax.bg": { file: "games/asteroids/assets/parallax/background.parallax.json", kind: "parallaxLayer" },
16+
"vector.tool-only": { file: "games/asteroids/assets/vectors/data/tool-only.vector.json", kind: "vector" },
17+
"palette.hud": { kind: "palette", colors: ["#ffffffff"] }
18+
},
19+
missingBindingBehavior: "null"
20+
});
21+
22+
assert.equal(strictLookup.binding.status, "ready");
23+
assert.equal(strictLookup.binding.issues.length, 0);
24+
assert.equal(strictLookup.binding.domains.vectors.length, 1);
25+
assert.equal(strictLookup.binding.domains.tilemaps.length, 1);
26+
assert.equal(strictLookup.binding.domains.parallax.length, 1);
27+
assert.equal(
28+
strictLookup.binding.rejected.some((entry) => entry.assetId === "vector.tool-only" && entry.reason === "non-runtime-path"),
29+
true
30+
);
31+
32+
assert.equal(strictLookup.resolvePackagedAsset({ id: "vector.ship", type: "vector" }).file, "games/asteroids/assets/vectors/ship.vector.json");
33+
assert.equal(strictLookup.resolvePackagedAsset({ id: "vector.tool-only", type: "vector" }), null);
34+
assert.equal(strictLookup.resolvePackagedAsset({ id: "palette.hud", type: "palette" }).kind, "palette");
35+
36+
const fallbackLookup = createRuntimeManifestAssetLookup({
37+
gameId: "TemplateGame",
38+
runtimeAssetSources: {
39+
"vector.template.player": {
40+
file: "tools/templates/vector-native-arcade/assets/data/vectors/template-player.vector.json",
41+
path: "tools/templates/vector-native-arcade/assets/data/vectors/template-player.vector.json",
42+
kind: "vector"
43+
}
44+
},
45+
missingBindingBehavior: "static"
46+
});
47+
48+
const fallbackResolved = fallbackLookup.resolvePackagedAsset({ id: "vector.template.player", type: "vector" });
49+
assert.equal(fallbackResolved.file, "tools/templates/vector-native-arcade/assets/data/vectors/template-player.vector.json");
50+
assert.equal(fallbackLookup.binding.domains.vectors.length, 0);
51+
}

0 commit comments

Comments
 (0)