|
| 1 | +# Level 10.5 Hardcoded Asset Path Audit |
| 2 | + |
| 3 | +## Scope |
| 4 | +- Active first-class tools from `tools/toolRegistry.js` (`getActiveToolRegistry()`). |
| 5 | +- Runtime source files under each active tool folder (`tools/<tool>/**/*.js|*.mjs`). |
| 6 | + |
| 7 | +## Audit Method |
| 8 | +- Static scan for hardcoded JSON asset path coupling: |
| 9 | + - `workspace.asset-catalog.json` |
| 10 | + - hardcoded `/assets/*.json` literals |
| 11 | + - hardcoded sample/demo JSON fetches |
| 12 | + - legacy `searchParams.get("game")` fallback usage |
| 13 | + |
| 14 | +## Findings Before Fix |
| 15 | +- `tools/Asset Browser/main.js` |
| 16 | + - Derived catalog paths from `gameHref`, `gameId`, and inferred `/games/<id>/assets/workspace.asset-catalog.json`. |
| 17 | +- `tools/Asset Pipeline Tool/main.js` |
| 18 | + - Built fallback candidate paths including: |
| 19 | + - `/games/<normalizedGameId>/assets/workspace.asset-catalog.json` |
| 20 | + - `/games/<gameId>/assets/workspace.asset-catalog.json` |
| 21 | +- `tools/Skin Editor/main.js` |
| 22 | + - Derived catalog path using hardcoded `/assets/workspace.asset-catalog.json`. |
| 23 | + - Accepted legacy query fallback `gameId || game`. |
| 24 | + |
| 25 | +## Fix Applied |
| 26 | +- `tools/Asset Browser/main.js` |
| 27 | + - Removed hardcoded catalog filename/path derivation helpers. |
| 28 | + - Catalog loading now accepts explicit JSON catalog paths only (query/manifest/handoff fields). |
| 29 | +- `tools/Asset Pipeline Tool/main.js` |
| 30 | + - Removed hardcoded catalog path candidate derivation from game id/href. |
| 31 | + - Catalog loading now accepts explicit JSON catalog paths only (query/manifest fields). |
| 32 | +- `tools/Skin Editor/main.js` |
| 33 | + - Removed hardcoded catalog path derivation helper. |
| 34 | + - Removed `searchParams.get("game")` fallback in preset query parsing. |
| 35 | + |
| 36 | +## Post-Fix Result |
| 37 | +- `workspace.asset-catalog.json` literals in active first-class tool runtime files: `0` |
| 38 | +- hardcoded `/assets/*.json` literals in active first-class tool runtime files: `0` |
| 39 | +- hardcoded sample/demo JSON fetch literals in active first-class tool runtime files: `0` |
| 40 | +- legacy `searchParams.get("game")` fallback usage in active first-class tool runtime files: `0` |
| 41 | + |
| 42 | +## Verification Command |
| 43 | +- `node -e <active-tool static audit>` (repo-local script execution) |
| 44 | + - `workspace.asset-catalog.json: 0` |
| 45 | + - `hardcoded /assets/*.json literal: 0` |
| 46 | + - `hardcoded sample/demo json fetch: 0` |
| 47 | + - `legacy game query fallback: 0` |
| 48 | + |
| 49 | +## Notes |
| 50 | +- Explicit manifest file loading remains allowed by policy. |
0 commit comments