Skip to content

Commit 874847e

Browse files
author
DavidQ
committed
Expose asset pipeline + runtime state to debug layer.
1 parent e075392 commit 874847e

17 files changed

Lines changed: 176 additions & 49 deletions

docs/dev/CODEX_COMMANDS.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
MODEL: GPT-5.4
22
REASONING: high
33
COMMAND:
4-
- implement asset error handling standard
5-
- unify error propagation
6-
- integrate with validation + pipeline
7-
- roadmap status only update
4+
- add debug visibility hooks for asset pipeline
5+
- expose manifest + lookup state
6+
- roadmap status only update

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_15_ASSET_ERROR_HANDLING
1+
BUILD_PR_LEVEL_09_16_ASSET_DEBUG_VISIBILITY
22

3-
Implements a shared asset error standard, unifies error propagation across runtime validation + runtime lookup + asset pipeline tooling, adds debug-friendly structured error reporting, and applies a status-only roadmap update.
3+
Adds debug visibility hooks for asset pipeline + runtime lookup, exposes manifest and lookup state snapshots in debug reporting, and applies a roadmap status-only 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_16_ASSET_DEBUG_VISIBILITY
1+
BUILD_PR_LEVEL_09_17_ASSET_PERFORMANCE_OPTIMIZATION
Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,30 @@
11
Summary
2-
- Implemented a shared asset error handling standard for pipeline/runtime layers.
3-
- Unified error propagation through runtime validation + runtime lookup + pipeline tooling.
4-
- Added debug-friendly structured error reporting with stable codes/stages.
2+
- Added debug visibility hooks for asset pipeline and runtime lookup layers.
3+
- Exposed manifest + lookup state snapshots through shared debug reporting.
4+
- Kept scope surgical with no engine/runtime behavior redesign.
55

66
Implementation
7-
- Added `tools/shared/pipeline/assetErrorHandling.js`:
8-
- shared error shape (`level`, `code`, `stage`, `domain`, `assetId`, `message`, `details`)
9-
- helper append utilities for consistent propagation
10-
- Updated `tools/shared/pipeline/runtimeAssetValidation.js`:
11-
- emits standardized errors while preserving compatibility `issues` messages
12-
- rejects `/data/` runtime/source paths with explicit error codes
13-
- validates required domain metadata with stable codes per domain
147
- Updated `tools/shared/pipeline/runtimeAssetLookup.js`:
15-
- collects/propagates binding issues, binding rejections, lookup misses, and runtime validation errors
16-
- exposes `errors` and `getErrors()` for debug/reporting
8+
- exposes `gameAssetManifest`
9+
- adds `getDebugState()` snapshot with lookup counters, manifest, and propagated errors
1710
- Updated `tools/shared/pipeline/assetPipelineTooling.js`:
18-
- emits standardized `errors` for invalid tool-contract stage failures
11+
- adds `debugState` snapshot in both ready and invalid paths
12+
- includes stage/status/record/error summaries and coordinated manifest reference when available
13+
- Updated `tools/shared/debugVisualizationLayer.js`:
14+
- added sections `Asset Runtime State` and `Asset Pipeline State`
15+
- renders manifest-domain and lookup/pipeline summary lines for debug visibility
16+
- Updated touched runtime consumers to pass lookup debug state into debug visualization:
17+
- `tools/shared/asteroidsPlatformDemo.js`
18+
- `tools/shared/vectorNativeTemplate.js`
19+
- `tools/shared/vectorTemplateSampleGame.js`
20+
- `tools/shared/vectorAssetSystem.js`
1921

2022
Tests
21-
- Added `tests/tools/AssetErrorHandlingStandard.test.mjs`
22-
- Updated `tests/tools/RuntimeAssetValidation.test.mjs`
23+
- Updated `tests/tools/DebugVisualizationLayer.test.mjs`
2324
- Updated `tests/tools/RuntimeAssetLookupConsolidation.test.mjs`
2425
- Updated `tests/tools/AssetPipelineTooling.test.mjs`
25-
- Updated `tests/run-tests.mjs` registrations
2626

2727
Roadmap (status-only)
2828
- `docs/dev/roadmaps/MASTER_ROADMAP_HIGH_LEVEL.md`
29-
- `Expand testing/validation structure` moved from `[.]` to `[x]`
29+
- `debug tools align with engine/debug maturity` moved from `[.]` to `[x]`
3030
- No roadmap prose/text/order edits.

docs/dev/reports/validation_checklist.txt

Lines changed: 15 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,29 @@
1-
Validation Checklist - BUILD_PR_LEVEL_09_15_ASSET_ERROR_HANDLING
1+
Validation Checklist - BUILD_PR_LEVEL_09_16_ASSET_DEBUG_VISIBILITY
22

33
Scope
4-
[x] Asset error handling standard implemented
5-
[x] Error propagation unified in touched pipeline/runtime layers
6-
[x] Runtime validation + lookup integration completed
7-
[x] Debug-friendly structured reporting added
4+
[x] Debug visibility hooks added for asset pipeline + runtime lookup
5+
[x] Manifest + lookup state exposed through debug layer
86
[x] No engine redesign
9-
[x] No UI changes
7+
[x] No gameplay/runtime feature expansion
8+
[x] No UI redesign work outside debug reporting sections
109

1110
Code
12-
[x] Added `tools/shared/pipeline/assetErrorHandling.js`
13-
[x] Updated `tools/shared/pipeline/runtimeAssetValidation.js`
1411
[x] Updated `tools/shared/pipeline/runtimeAssetLookup.js`
1512
[x] Updated `tools/shared/pipeline/assetPipelineTooling.js`
16-
[x] Added `tests/tools/AssetErrorHandlingStandard.test.mjs`
17-
[x] Updated `tests/tools/RuntimeAssetValidation.test.mjs`
13+
[x] Updated `tools/shared/debugVisualizationLayer.js`
14+
[x] Updated `tools/shared/asteroidsPlatformDemo.js`
15+
[x] Updated `tools/shared/vectorNativeTemplate.js`
16+
[x] Updated `tools/shared/vectorTemplateSampleGame.js`
17+
[x] Updated `tools/shared/vectorAssetSystem.js`
18+
[x] Updated `tests/tools/DebugVisualizationLayer.test.mjs`
1819
[x] Updated `tests/tools/RuntimeAssetLookupConsolidation.test.mjs`
1920
[x] Updated `tests/tools/AssetPipelineTooling.test.mjs`
20-
[x] Updated `tests/run-tests.mjs`
2121

2222
Validation
23-
[x] `node --check tools/shared/pipeline/assetErrorHandling.js`
24-
[x] `node --check tools/shared/pipeline/runtimeAssetValidation.js`
25-
[x] `node --check tools/shared/pipeline/runtimeAssetLookup.js`
26-
[x] `node --check tools/shared/pipeline/assetPipelineTooling.js`
27-
[x] `node --check tests/tools/AssetErrorHandlingStandard.test.mjs`
28-
[x] `node --check tests/tools/RuntimeAssetValidation.test.mjs`
29-
[x] `node --check tests/tools/RuntimeAssetLookupConsolidation.test.mjs`
30-
[x] `node --check tests/tools/AssetPipelineTooling.test.mjs`
31-
[x] `node --check tests/run-tests.mjs`
32-
[x] Focused tests pass: AssetErrorHandlingStandard, RuntimeAssetValidation, RuntimeAssetLookupConsolidation, AssetPipelineTooling
33-
[x] Existing regression tests pass: RuntimeAssetBinding, GameAssetManifestCoordinator, ProjectToolDataContracts, AsteroidsAssetReferenceAdoption, AsteroidsPlatformDemo, VectorNativeTemplate, VectorTemplateSampleGame, VectorAssetSystem
23+
[x] `node --check` passes on touched files
24+
[x] Focused tests pass: DebugVisualizationLayer, RuntimeAssetLookupConsolidation, AssetPipelineTooling
25+
[x] Existing regression tests pass: RuntimeAssetValidation, RuntimeAssetBinding, GameAssetManifestCoordinator, ProjectToolDataContracts
26+
[x] Existing consumer tests pass: AsteroidsAssetReferenceAdoption, AsteroidsPlatformDemo, VectorNativeTemplate, VectorTemplateSampleGame, VectorAssetSystem
3427

3528
Roadmap
3629
[x] Status-only update applied

docs/dev/roadmaps/MASTER_ROADMAP_HIGH_LEVEL.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -448,7 +448,7 @@
448448
- [ ] 2D tool stabilization before 3D tool expansion
449449
- [ ] 3D prerequisite samples before advanced 3D tools
450450
- [.] content pipeline tools after asset complexity justifies them
451-
- [.] debug tools align with engine/debug maturity
451+
- [x] debug tools align with engine/debug maturity
452452
- [ ] no standalone showcase-only tool tracks
453453

454454
### Recent Tool Shell Notes
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# BUILD_PR — LEVEL 09_16 — ASSET DEBUG VISIBILITY
2+
3+
Expose asset pipeline + runtime state to debug layer.

tests/tools/AssetPipelineTooling.test.mjs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,9 @@ export async function run() {
3939

4040
assert.equal(ready.status, "ready");
4141
assert.deepEqual(ready.errors, []);
42+
assert.equal(ready.debugState.pipeline.status, "ready");
43+
assert.equal(ready.debugState.pipeline.recordCount, 4);
44+
assert.equal(Object.keys(ready.debugState.manifest.domains).length, 4);
4245
assert.equal(ready.stages.validate.valid, true);
4346
assert.equal(ready.records.length, 4);
4447
assert.equal(ready.stages.emit.coordinatorPath, "games/asteroids/assets/asteroids.assets.json");
@@ -80,6 +83,8 @@ export async function run() {
8083
assert.equal(invalid.status, "invalid");
8184
assert.equal(Array.isArray(invalid.errors), true);
8285
assert.equal(invalid.errors.some((entry) => entry.code === "PIPELINE_TOOL_CONTRACT_INVALID"), true);
86+
assert.equal(invalid.debugState.pipeline.status, "invalid");
87+
assert.equal(invalid.debugState.pipeline.errorCount > 0, true);
8388
assert.equal(invalid.stages.validate.valid, false);
8489
assert.equal(
8590
invalid.stages.validate.issues.some((entry) => entry.includes("sprite-editor: project.assetRefs block is required.")),

tests/tools/DebugVisualizationLayer.test.mjs

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,36 @@ export async function run() {
1919
},
2020
runtimeResult: {
2121
runtimeLoader: { status: "failed", loadedAssets: [], failedAt: "sprite.hero", reports: [{ code: "MISSING_PACKAGED_ASSET", message: "Missing." }] }
22+
},
23+
assetRuntimeState: {
24+
lookup: {
25+
status: "ready",
26+
gameId: "asteroids",
27+
recordCount: 3,
28+
domainCounts: { sprites: 1, tilemaps: 1, parallax: 1, vectors: 0 },
29+
rejectedCount: 1
30+
},
31+
manifest: {
32+
domains: { sprites: [{}], tilemaps: [{}], parallax: [{}], vectors: [] }
33+
},
34+
errors: [{ code: "RUNTIME_BINDING_REJECTED" }]
35+
},
36+
assetPipelineState: {
37+
pipeline: {
38+
status: "ready",
39+
gameId: "asteroids",
40+
recordCount: 4
41+
},
42+
manifest: {
43+
domains: { sprites: [{}], tilemaps: [{}], parallax: [{}], vectors: [{}] }
44+
},
45+
errors: []
2246
}
2347
});
2448
assert.equal(result.debugVisualization.status, "ready");
2549
assert.equal(summarizeDebugVisualizationLayer(result), "Debug view: 2 nodes, 1 edges, 1 findings.");
2650
assert.match(result.debugVisualization.reportText, /\[Runtime Trace\]/);
51+
assert.match(result.debugVisualization.reportText, /\[Asset Runtime State\]/);
52+
assert.match(result.debugVisualization.reportText, /manifestDomains=4/);
53+
assert.match(result.debugVisualization.reportText, /\[Asset Pipeline State\]/);
2754
}

tests/tools/RuntimeAssetLookupConsolidation.test.mjs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,11 @@ export async function run() {
3838
assert.equal(strictCodes.includes("RUNTIME_BINDING_REJECTED"), true);
3939
assert.equal(strictCodes.includes("RUNTIME_VECTOR_METADATA_REQUIRED"), true);
4040
assert.equal(strictCodes.includes("RUNTIME_LOOKUP_MISSING_BINDING"), true);
41+
const strictDebug = strictLookup.getDebugState();
42+
assert.equal(strictDebug.lookup.status, "ready");
43+
assert.equal(strictDebug.lookup.recordCount, 5);
44+
assert.equal(strictDebug.lookup.domainCounts.vectors, 2);
45+
assert.equal(Object.keys(strictDebug.manifest.domains).length, 4);
4146

4247
const fallbackLookup = createRuntimeManifestAssetLookup({
4348
gameId: "TemplateGame",
@@ -55,4 +60,5 @@ export async function run() {
5560
assert.equal(fallbackResolved.file, "tools/templates/vector-native-arcade/assets/data/vectors/template-player.vector.json");
5661
assert.equal(fallbackLookup.binding.domains.vectors.length, 0);
5762
assert.equal(fallbackLookup.getErrors().some((entry) => entry.code === "RUNTIME_BINDING_REJECTED"), true);
63+
assert.equal(fallbackLookup.getDebugState().lookup.rejectedCount > 0, true);
5864
}

0 commit comments

Comments
 (0)