Skip to content

Commit 1be23d9

Browse files
author
DavidQ
committed
Make Asset Browser and Import Hub own JSON catalog loading for samples 0204, 1413, and 1505 - PR 10.20
1 parent 1b1f16b commit 1be23d9

28 files changed

Lines changed: 1294 additions & 73 deletions

docs/dev/codex_commands.md

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,16 @@
33
model: gpt-5.3-codex
44
reasoning: medium
55

6-
Apply PR_10_16_FULLSCREEN_EXIT_STATE_RESTORE_FIX.
6+
Apply PR_10_20_TOOL_OWNED_JSON_ASSET_CATALOG_FIX.
77

88
Required:
9-
- Fix Exit Fullscreen so the shell returns to normal browser-window layout.
10-
- Ensure button exit and Escape/browser fullscreenchange exit share the same cleanup path.
11-
- Clear all fullscreen classes, data attributes, cached flags, and compact summary state.
12-
- Restore normal header/details behavior after exit.
13-
- Do not modify tool data, manifests, registry entries, or start_of_day folders.
14-
- Add validation report at docs/dev/reports/PR_10_16_FULLSCREEN_EXIT_STATE_RESTORE_FIX_report.md.
15-
- Return ZIP artifact at tmp/PR_10_16_FULLSCREEN_EXIT_STATE_RESTORE_FIX_delta.zip.
9+
- Fix samples 0204, 1413, and 1505 so Asset Browser / Import Hub reads and writes the JSON catalog directly.
10+
- Fix flash-then-blank behavior where entries briefly show then clear/truncate.
11+
- For 0204, stop using sample-local assetRegistry.js / AssetRegistryScene.js as a bridge or source for tool data.
12+
- Normalize each sample JSON so the full asset list is in the schema-compatible location the tool expects.
13+
- Preserve preset fields only as UI state, not asset source.
14+
- Do not add fallback/default/hidden sample data.
15+
- Do not scrape JS source.
16+
- Do not modify start_of_day folders.
17+
- Add validation report at docs/dev/reports/PR_10_20_TOOL_OWNED_JSON_ASSET_CATALOG_FIX_report.md.
18+
- Return ZIP artifact at tmp/PR_10_20_TOOL_OWNED_JSON_ASSET_CATALOG_FIX_delta.zip.

docs/dev/commit_comment.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
Restore normal shell state after fullscreen exit - PR 10.16
1+
Make Asset Browser and Import Hub own JSON catalog loading for samples 0204, 1413, and 1505 - PR 10.20
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# PR — Fix Asset Browser Sample 1505 (No Data)
2+
3+
## Purpose
4+
Fix Asset Browser sample `1505` where no data is shown.
5+
6+
---
7+
8+
## Problem
9+
Sample `1505` loads with no visible data and no clear explanation.
10+
11+
---
12+
13+
## Required Behavior
14+
Asset Browser must clearly show ONE of:
15+
16+
1. Source exists but empty
17+
2. Source missing
18+
3. Source invalid
19+
4. Load failure
20+
21+
---
22+
23+
## Required Output Example
24+
25+
Missing:
26+
Asset Browser could not find data for sample 1505.
27+
Missing: tools.asset-browser.assets
28+
Next action: add assets or provide assetCatalogPath.
29+
30+
Empty:
31+
Asset Browser found 0 assets for sample 1505.
32+
Next action: import or create assets.
33+
34+
---
35+
36+
## Rules
37+
- No silent fallback
38+
- No blank UI
39+
- Always show source + result + next action
40+
41+
---
42+
43+
## Acceptance Criteria
44+
- Sample 1505 shows explicit message
45+
- No fallback data used
46+
- Message includes next action
47+
48+
---
49+
50+
## Validation
51+
- Launch sample 1505
52+
- Confirm visible message
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
# PR 10.17 Asset Browser / Import Hub Sample 0204 Load Fix Report
2+
3+
PASS
4+
5+
## Files Changed
6+
- tools/Asset Browser/main.js
7+
- docs/dev/reports/PR_10_17_ASSET_BROWSER_IMPORT_HUB_SAMPLE_0204_LOAD_FIX_report.md
8+
- tmp/PR_10_17_ASSET_BROWSER_IMPORT_HUB_SAMPLE_0204_LOAD_FIX_validation.json
9+
10+
## Root Cause
11+
Asset Browser / Import Hub only hydrated approved assets from:
12+
- explicit `assetCatalogPath` query/context candidates, or
13+
- `active-project-manifest.tools.asset-browser.assets`
14+
15+
For sample `0204`, the explicit asset payload lives in the companion roundtrip preset `sample.0204.3d-asset-viewer.json`, but the loader never inspected sample roundtrip companion presets. Result: list remained empty (`No assets loaded`) even though explicit sample data existed.
16+
17+
## Source JSON Path Used
18+
- `/samples/phase-02/0204/sample.0204.3d-asset-viewer.json`
19+
- payload key resolved: `config.asset3d`
20+
- asset id resolved: `sample-0204-registry-node`
21+
22+
## Implementation Summary (Smallest Scoped)
23+
- Added sample metadata lookup in Asset Browser loader (`/samples/metadata/samples.index.metadata.json`).
24+
- Added companion roundtrip resolution for sample launches:
25+
- current tool mapping: `asset-browser`
26+
- companion mapping: `3d-asset-viewer`
27+
- Added companion preset payload extraction (`3d-asset-viewer` / `asset3d` / related keys).
28+
- Mapped explicit companion payload to one approved asset entry (no fabricated fallback data):
29+
- `id`: companion `assetId`
30+
- `path`: companion preset JSON path
31+
- `category`: `Workflow JSON`
32+
- Inserted companion resolution in `loadCatalogEntriesFromContext()` only after existing catalog candidates, preserving existing architecture and precedence.
33+
34+
## Before / After Behavior
35+
- Before:
36+
- Sample `0204` Asset Browser launch used `sample.0204.asset-browser.json` UI preset only.
37+
- No `assetCatalogPath` or manifest assets existed.
38+
- Companion `sample.0204.3d-asset-viewer.json` data was ignored.
39+
- UI showed empty asset state.
40+
- After:
41+
- Same launch now resolves sample `0204` companion roundtrip preset for `3d-asset-viewer`.
42+
- Explicit payload from `sample.0204.3d-asset-viewer.json` is mapped into the asset list.
43+
- First-item auto-selection and control gating remain unchanged (existing shared selection logic).
44+
45+
## Validation Steps
46+
1. Syntax check:
47+
- `node --check tools/Asset Browser/main.js` (PASS)
48+
2. Data-path verification for sample `0204`:
49+
- Read `samples/metadata/samples.index.metadata.json`
50+
- Confirm `roundtripToolPresets` contains:
51+
- `/samples/phase-02/0204/sample.0204.asset-browser.json`
52+
- `/samples/phase-02/0204/sample.0204.3d-asset-viewer.json`
53+
- Read companion preset and confirm `config.asset3d` with `assetId` and vertices (PASS)
54+
3. Loader wiring verification:
55+
- Confirm `loadCatalogEntriesFromContext()` calls `loadCompanionSampleEntries(sampleId, samplePresetPath)`
56+
- Confirm companion success updates `catalogLoadInfo` and returns mapped entries (PASS)
57+
58+
Evidence file:
59+
- `tmp/PR_10_17_ASSET_BROWSER_IMPORT_HUB_SAMPLE_0204_LOAD_FIX_validation.json`
60+
61+
## Empty State Validation (No Explicit Data)
62+
Empty-state behavior is preserved:
63+
- Companion load path requires valid `sampleId` + matching roundtrip mapping.
64+
- If mapping is absent, loader returns `null` and falls through to existing source-missing / source-empty handling.
65+
- No fallback/demo/default asset entries were added.
66+
67+
## Scope / Constraints Confirmation
68+
- No sample asset data files modified.
69+
- No schema files modified.
70+
- No manifest files modified.
71+
- No `start_of_day` folders modified.
72+
- No hardcoded hidden sample paths added.
73+
- Change scope stayed within Asset Browser / Import Hub load/mapping path.
Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
# PR_10_19_SAMPLES_0204_1413_1505_JSON_SSOT_FIX Report
2+
3+
## Scope
4+
Implemented JSON source-of-truth alignment for samples `0204`, `1413`, and `1505`, and updated Asset Browser sample-preset ingestion so paired tools consume explicit JSON data from sample preset files.
5+
6+
## Files Changed
7+
8+
### Sample 0204
9+
- `samples/phase-02/0204/AssetRegistryScene.js`
10+
- `samples/phase-02/0204/main.js`
11+
- `samples/phase-02/0204/sample.0204.asset-browser.json`
12+
13+
### Sample 1413
14+
- `samples/phase-14/1413/AssetImportPipelineScene.js`
15+
- `samples/phase-14/1413/main.js`
16+
- `samples/phase-14/1413/sample.1413.asset-browser.json`
17+
- `samples/phase-14/1413/sample.1413.asset-pipeline-tool.json`
18+
19+
### Sample 1505
20+
- `samples/phase-15/1505/AssetBrowserScene.js`
21+
- `samples/phase-15/1505/main.js`
22+
- `samples/phase-15/1505/sample.1505.asset-browser.json`
23+
24+
### Shared Tool Handoff
25+
- `tools/Asset Browser/main.js`
26+
27+
## Source-of-Truth Migration
28+
29+
### 0204
30+
- Old JS ownership: `sampleAssets` array inside `AssetRegistryScene.js`.
31+
- New JSON SSoT: `samples/phase-02/0204/sample.0204.asset-browser.json` under `config.assetCatalog.entries`.
32+
- Runtime change: sample scene now loads entries from explicit JSON and registers those entries.
33+
- Tool handoff change: Asset Browser now reads `samplePresetPath` JSON `config.assetCatalog.entries` directly.
34+
35+
### 1413
36+
- Old JS ownership: hardcoded import input `{ id: 'hero-sprite', source: 'drop-folder' }` in `AssetImportPipelineScene.js`.
37+
- New JSON SSoT: `samples/phase-14/1413/sample.1413.asset-pipeline-tool.json` under `config.sampleImportInput` (and aligned with `config.pipelinePayload`).
38+
- Runtime change: sample scene import action consumes explicit JSON-backed import input.
39+
- Paired tool alignment: Asset Pipeline Tool already loads the same sample preset path; sample and paired tool now use the same explicit preset source.
40+
41+
### 1505
42+
- Old JS ownership: hardcoded AssetBrowser constructor entries and hardcoded control selection IDs in sample JS.
43+
- New JSON SSoT: `samples/phase-15/1505/sample.1505.asset-browser.json` under `config.assetCatalog.entries`.
44+
- Runtime change: scene and control mapping load explicit JSON entries; no JS-local canonical asset list remains.
45+
- Paired tool alignment: Asset Browser preset path now supplies the same JSON-backed entries for tool-side catalog ingestion.
46+
47+
## Validation
48+
49+
### Commands
50+
1. `node --check samples/phase-02/0204/AssetRegistryScene.js`
51+
2. `node --check samples/phase-02/0204/main.js`
52+
3. `node --check samples/phase-14/1413/AssetImportPipelineScene.js`
53+
4. `node --check samples/phase-14/1413/main.js`
54+
5. `node --check samples/phase-15/1505/AssetBrowserScene.js`
55+
6. `node --check samples/phase-15/1505/main.js`
56+
7. `node --check tools/Asset Browser/main.js`
57+
8. `npm run test:launch-smoke -- --tools`
58+
59+
### Results
60+
- `node --check`: PASS for all changed JavaScript files.
61+
- `launch-smoke -- --tools`: PASS (`PASS=286 FAIL=0 TOTAL=286`) including:
62+
- sample `0204`: PASS
63+
- sample `1413`: PASS
64+
- sample `1505`: PASS
65+
- tool `Asset Browser`: PASS
66+
- tool `Asset Pipeline Tool`: PASS
67+
68+
### JSON Canonical Data Evidence
69+
- `samples/phase-02/0204/sample.0204.asset-browser.json` has `assetCatalog.entries` count: `3`.
70+
- `samples/phase-14/1413/sample.1413.asset-browser.json` has `assetCatalog.entries` count: `3`.
71+
- `samples/phase-15/1505/sample.1505.asset-browser.json` has `assetCatalog.entries` count: `2`.
72+
- `samples/phase-14/1413/sample.1413.asset-pipeline-tool.json` includes `sampleImportInput`.
73+
74+
### Hardcoded Canonical Data Removal Check
75+
- Search for removed canonical literals in affected sample folders: `sampleAssets|hero-texture|menu-theme|hero-sprite|drop-folder`.
76+
- Result: `NO_MATCH`.
77+
78+
## 0204 Sample Preview + Asset Browser / Import Hub Validation
79+
- 0204 sample runtime now loads registry entries from `sample.0204.asset-browser.json`.
80+
- Asset Browser now ingests approved entries from `samplePresetPath` `config.assetCatalog.entries`.
81+
- Empty/missing/invalid source messaging remains explicit and actionable in Asset Browser status/empty state text.
82+
83+
## 1413 Sample Preview + Paired Tool Validation
84+
- 1413 sample import action now consumes explicit JSON `sampleImportInput`.
85+
- Asset Pipeline Tool consumes the same sample preset JSON path for tool payload loading.
86+
- Sample-visible import input and paired-tool payload source are aligned to explicit JSON.
87+
88+
## 1505 Sample Preview + Paired Tool Validation
89+
- 1505 sample runtime and control selections now derive from JSON `assetCatalog.entries`.
90+
- Asset Browser tool-side load from sample preset now uses the same explicit JSON source.
91+
92+
## Empty-State Preservation (No Explicit JSON)
93+
- For all affected sample runtime loaders, missing/invalid/empty JSON paths return empty arrays and explicit status messages.
94+
- Asset Browser `loadSamplePresetCatalogEntries` returns `loadedEmpty`, `sourceMissing`, `sourceInvalid`, or `sourceLoadFailure` with actionable next steps when no explicit JSON entries exist.
95+
- No fallback/default hidden sample data was added.
96+
97+
## Guardrail Confirmation
98+
- No `start_of_day` folders were modified.
99+
- No fallback/default/hidden sample data was introduced.
Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
# PR_10_20_TOOL_OWNED_JSON_ASSET_CATALOG_FIX Report
2+
3+
## Scope
4+
Fix tool-owned JSON asset catalog behavior for samples `0204`, `1413`, and `1505` so Asset Browser / Import Hub keeps full JSON-backed entries loaded (no flash-then-blank/truncate), with preset fields treated as UI state only.
5+
6+
## Changed Files
7+
8+
### Tool
9+
- `tools/Asset Browser/main.js`
10+
11+
### Sample 0204
12+
- `samples/phase-02/0204/sample.0204.asset-browser.json`
13+
- `samples/phase-02/0204/assetRegistry.js` (deleted)
14+
15+
### Sample 1413
16+
- `samples/phase-14/1413/sample.1413.asset-browser.json`
17+
18+
### Sample 1505
19+
- `samples/phase-15/1505/sample.1505.asset-browser.json`
20+
21+
## Root Cause (Flash-Then-Blank / Truncate)
22+
Asset Browser loaded catalog entries from JSON correctly on first pass, then a later preset-apply pass (`assetBrowserPreset.selectedCategory` + `assetBrowserPreset.search`) filtered the visible set down to zero or one entry.
23+
24+
Observed failure pattern from prior evidence:
25+
- `0204`: loaded entries then ended at empty (`No assets loaded`)
26+
- `1413`: loaded entries then truncated to one visible asset
27+
- `1505`: loaded entries then truncated to one visible asset
28+
29+
## Fix Applied
30+
1. Normalized sample preset UI filters so they do not hide catalog content:
31+
- Set `selectedCategory: "All"`
32+
- Set `search: ""`
33+
- Kept preset-only UI fields (selection/import defaults) as UI state only
34+
35+
2. Hardened `applyAssetBrowserPreset` in `tools/Asset Browser/main.js`:
36+
- If JSON catalog is non-empty but preset filters produce zero visible results, revert UI filter state to unfiltered (`All` + empty search).
37+
- Emit a diagnostics warning describing the preset filter reset.
38+
39+
3. Removed sample-local 0204 bridge file:
40+
- Deleted `samples/phase-02/0204/assetRegistry.js`
41+
- Tool catalog loading remains JSON-driven from sample/tool preset JSON only.
42+
43+
## Final JSON Source Files (Canonical for Tool Catalog)
44+
- `0204`: `samples/phase-02/0204/sample.0204.asset-browser.json` -> `config.assetCatalog.entries`
45+
- `1413`: `samples/phase-14/1413/sample.1413.asset-browser.json` -> `config.assetCatalog.entries`
46+
- `1505`: `samples/phase-15/1505/sample.1505.asset-browser.json` -> `config.assetCatalog.entries`
47+
48+
## Asset Counts (Before/After)
49+
50+
### 0204
51+
- Before (visible after second pass): `0`
52+
- After (visible): `3`
53+
- JSON declared entries: `3`
54+
55+
### 1413
56+
- Before (visible after second pass): `1`
57+
- After (visible): `3`
58+
- JSON declared entries: `3`
59+
60+
### 1505
61+
- Before (visible after second pass): `1`
62+
- After (visible): `2`
63+
- JSON declared entries: `2`
64+
65+
## 0204 Bridge Confirmation
66+
- Asset Browser / Import Hub does not read tool data from `AssetRegistryScene.js` or `assetRegistry.js`.
67+
- `samples/phase-02/0204/assetRegistry.js` has been removed.
68+
- Tool catalog remains sourced from JSON via `samplePresetPath` and `config.assetCatalog.entries`.
69+
70+
## Validation
71+
72+
### Commands
73+
1. `node --check tools/Asset Browser/main.js`
74+
2. `node --check samples/phase-02/0204/main.js`
75+
3. `node --check samples/phase-14/1413/main.js`
76+
4. `node --check samples/phase-15/1505/main.js`
77+
5. `node --check samples/phase-02/0204/AssetRegistryScene.js`
78+
6. `node --check samples/phase-14/1413/AssetImportPipelineScene.js`
79+
7. `node --check samples/phase-15/1505/AssetBrowserScene.js`
80+
8. `npm run test:launch-smoke -- --tools`
81+
82+
### Results
83+
- `node --check`: PASS
84+
- `npm run test:launch-smoke -- --tools`: PASS (`PASS=286 FAIL=0 TOTAL=286`)
85+
86+
## Guardrails
87+
- No fallback/default/hidden sample data added.
88+
- No JS scraping used.
89+
- No `start_of_day` folder modifications.
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# REPORT_PR_10_17_ASSET_BROWSER_IMPORT_HUB_SAMPLE_0204_LOAD_FIX
2+
3+
## Bundle Summary
4+
This PR targets the Asset Browser / Import Hub data ingestion issue where sample 0204 has JSON asset data but the tool shows `No assets loaded`.
5+
6+
## Target Behavior
7+
- Valid explicit sample data populates the tool.
8+
- Empty state is reserved for truly absent/empty explicit input.
9+
- No fallback/default/hidden sample data is introduced.
10+
11+
## Expected Codex Output
12+
- Surgical loader/context/mapping fix.
13+
- Validation evidence for sample 0204 and empty-state behavior.
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# REPORT_PR_10_19_SAMPLES_0204_1413_1505_JSON_SSOT_FIX
2+
3+
## Bundle Summary
4+
This PR corrects data ownership for samples 0204, 1413, and 1505 so JSON files are the source of truth.
5+
6+
## Target Behavior
7+
- Sample code consumes JSON.
8+
- Tools consume the same JSON.
9+
- No class-local canonical data remains for these samples.
10+
- No fallback/demo/default data is introduced.
11+
12+
## Expected Codex Output
13+
- Surgical fixes grouped by sample.
14+
- Validation evidence proving sample/tool agreement for 0204, 1413, and 1505.
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# REPORT_PR_10_20_TOOL_OWNED_JSON_ASSET_CATALOG_FIX
2+
3+
## Bundle Summary
4+
This PR corrects asset catalog ownership for samples 0204, 1413, and 1505.
5+
6+
## Evidence Basis
7+
Uploaded 0204 JSON already has `config.assetCatalog.entries`, while 0204 JS still routes through AssetRegistry scene code. The desired rule is tool-owned JSON, not sample-class-owned catalog state.
8+
9+
## Target Behavior
10+
- Full JSON catalog remains visible after load.
11+
- No flash-then-blank.
12+
- No registry JS bridge owns tool data.
13+
- Tools directly read/write JSON catalogs.

docs/dev/reports/launch_smoke_report.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Launch Smoke Report
22

3-
Generated: 2026-04-28T17:34:45.279Z
3+
Generated: 2026-04-28T20:30:23.338Z
44

55
Filters: games=true, samples=true, tools=true, sampleRange=all
66

0 commit comments

Comments
 (0)