Skip to content

Commit 9c79fe9

Browse files
author
DavidQ
committed
Classify complex JSON usage (palette + indirect loaders) - PR 11.47
1 parent c5dfafc commit 9c79fe9

6 files changed

Lines changed: 187 additions & 141 deletions

docs/dev/codex_commands.md

Lines changed: 20 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -2,69 +2,31 @@ MODEL: GPT-5.3-codex
22
REASONING: high
33

44
TASK:
5-
Apply PR 11.46.
5+
Apply PR 11.47.
66

7-
Continue targeted sample JSON cleanup from PR 11.41, PR 11.43, and PR 11.44.
7+
Classify complex JSON files from the audit (especially palette.json and tile-map docs).
88

9-
Use the current audit output from:
10-
docs/dev/reports/sample_json_js_reference_audit.csv
11-
and/or the console output from scripts/PS/audit-sample-json-js-references.ps1.
12-
13-
Focus ONLY on a small high-confidence batch of non-palette, non-tile-map JSON payloads.
14-
15-
Preferred candidates:
16-
1. samples/phase-02/0221/sample.0221.3d-json-payload-normalizer.json
17-
2. samples/phase-05/0510/sample.0510.asset-pipeline-tool.json
18-
3. samples/phase-05/0512/sample.0512.performance-profiler.json
19-
4. samples/phase-07/0708/sample.0708.replay-visualizer.json
9+
Do NOT change code or JSON in this PR.
2010

2111
For each selected JSON:
22-
- inspect the sample executable JS under the same sample subtree
23-
- inspect the related tool behavior if needed
24-
- decide:
25-
KEEP + WIRE
26-
MOVE / REHOME
27-
DELETE
28-
CREATE / UPDATE CORRECT SAMPLE
29-
DEFER
30-
- apply only safe, obvious changes
31-
32-
Do NOT:
33-
- touch palette JSON files
34-
- touch tile-map-editor-document JSON files
35-
- touch sample 1902
36-
- force JSON into a mismatched sample
37-
- add hidden/default fallback data
38-
- run full samples smoke by default
39-
- undo SVG Asset Studio rename
40-
- rename tools
41-
- change unrelated logic
42-
- touch start_of_day folders
43-
44-
Testing policy:
45-
Full samples smoke takes about 20 minutes.
46-
Skip it unless this PR changes shared sample launch infrastructure.
12+
- determine if it is loaded indirectly (manifest/workspace/tool loader)
13+
- confirm visible effect in UI
14+
- classify as:
15+
INDIRECTLY USED
16+
UNUSED
17+
UNCERTAIN
4718

48-
Run targeted validation only:
49-
- syntax checks for changed JS files
50-
- the PowerShell audit script
51-
- targeted sample/tool tests for changed samples only, if available
19+
Focus areas:
20+
- samples/**/sample.*.palette.json
21+
- samples/**/sample-*-tile-map-editor-document.json
5222

53-
Reports:
54-
Write:
55-
docs/dev/reports/PR_11_46_cleanup_batch_3.md
56-
docs/dev/reports/PR_11_46_validation.txt
23+
Do NOT:
24+
- delete or move files
25+
- modify tools
26+
- run full samples test
5727

58-
Cleanup report must include:
59-
- selected JSON files
60-
- classification/action for each
61-
- files changed
62-
- coverage preserved statement
63-
- deferred items and reasons
64-
- note that palette/tile-map/1902 were intentionally excluded
28+
Validation:
29+
No runtime changes expected.
6530

66-
Validation report must include:
67-
- targeted tests run
68-
- full samples smoke skipped/run
69-
- reason for skip/run
70-
- result
31+
Output:
32+
docs/dev/reports/PR_11_47_complex_json_classification.md

docs/dev/commit_comment.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
Resolve targeted non-palette sample JSON ownership cleanup batch - PR 11.46
1+
Classify complex JSON usage (palette + indirect loaders) - PR 11.47
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
# PR 11.47 Complex JSON Classification
2+
3+
## Scope
4+
Focused audit/classification only (no code/JSON changes) for:
5+
- `samples/**/sample.*.palette.json`
6+
- `samples/**/sample-*-tile-map-editor-document.json`
7+
8+
Classification values:
9+
- `INDIRECTLY USED`
10+
- `UNUSED`
11+
- `UNCERTAIN`
12+
13+
## Method
14+
1. Used `docs/dev/reports/sample_json_js_reference_audit.csv` (direct JS references baseline).
15+
2. Traced indirect load paths through sample metadata and tool launch wiring:
16+
- `samples/shared/sampleDetailPageEnhancement.js` (`roundtripToolPresets` -> `samplePresetPath` query)
17+
- tool loaders that fetch `samplePresetPath` and update visible UI status:
18+
- `tools/Palette Browser/main.js`
19+
- `tools/Tile Model Converter/main.js`
20+
3. Traced tile-map document references from tile-model-converter preset JSON (`config.candidate.path`).
21+
4. Did not run full sample suite; classification is structural/path-based.
22+
23+
## Key Indirect Load Evidence
24+
- Sample page -> tool launch wiring:
25+
- `samples/shared/sampleDetailPageEnhancement.js` builds `Open <tool>` links with `samplePresetPath` from `roundtripToolPresets.presetPath` and fetches status text for those preset paths.
26+
- Palette Browser indirect load and visible UI effect:
27+
- `tools/Palette Browser/main.js` reads `samplePresetPath`, fetches JSON, imports palette payload, and sets visible status text (`Loaded preset...`) plus swatch/preview UI state.
28+
- Tile Model Converter indirect load and visible UI effect:
29+
- `tools/Tile Model Converter/main.js` reads `samplePresetPath`, fetches preset JSON, hydrates converter input text area, and sets visible status text (`Loaded preset...`).
30+
- Tile-map doc path chaining:
31+
- `sample.*.tile-model-converter.json` stores `config.candidate.path` pointing to `sample-*-tile-map-editor-document.json`.
32+
33+
## Classification Table
34+
| File | Indirect load path found | Visible UI effect confirmed | Classification |
35+
|---|---|---|---|
36+
| `samples/phase-02/0207/sample.0207.palette.json` | none found in metadata/loader chain | no | `UNUSED` |
37+
| `samples/phase-02/0213/sample.0213.palette.json` | mapped via `roundtripToolPresets` (`palette-browser` presetPath) | yes (Palette Browser preset loaded/status/swatch preview) | `INDIRECTLY USED` |
38+
| `samples/phase-02/0214/sample.0214.palette.json` | none found in metadata/loader chain | no | `UNUSED` |
39+
| `samples/phase-02/0219/sample.0219.palette.json` | mapped via `sprite-editor.palettePath` and `palette-browser` presetPath | yes (Sprite Editor required palette dependency + Palette Browser preset UI) | `INDIRECTLY USED` |
40+
| `samples/phase-02/0221/sample-0221-tile-map-editor-document.json` | referenced by `sample.0221.tile-model-converter.json` candidate path; converter preset is metadata-mapped | yes (Tile Model Converter loaded preset/input/status) | `INDIRECTLY USED` |
41+
| `samples/phase-02/0221/sample.0221.palette.json` | none found in metadata/loader chain | no | `UNUSED` |
42+
| `samples/phase-02/0224/sample-0224-tile-map-editor-document.json` | no references found | no | `UNUSED` |
43+
| `samples/phase-02/0224/sample.0224.palette.json` | none found in metadata/loader chain | no | `UNUSED` |
44+
| `samples/phase-03/0301/sample.0301.palette.json` | mapped via `sprite-editor.palettePath` and `palette-browser` presetPath | yes | `INDIRECTLY USED` |
45+
| `samples/phase-03/0302/sample.0302.palette.json` | mapped via `sprite-editor.palettePath` and `palette-browser` presetPath | yes | `INDIRECTLY USED` |
46+
| `samples/phase-03/0305/sample-0305-tile-map-editor-document.json` | referenced by `sample.0305.tile-model-converter.json` candidate path; converter preset is metadata-mapped | yes | `INDIRECTLY USED` |
47+
| `samples/phase-03/0305/sample.0305.palette.json` | none found in metadata/loader chain | no | `UNUSED` |
48+
| `samples/phase-03/0308/sample.0308.palette.json` | mapped via `roundtripToolPresets` (`palette-browser` presetPath) | yes | `INDIRECTLY USED` |
49+
| `samples/phase-03/0313/sample.0313.palette.json` | mapped via `roundtripToolPresets` (`palette-browser` presetPath) | yes | `INDIRECTLY USED` |
50+
| `samples/phase-09/0901/sample.0901.palette.json` | mapped via `roundtripToolPresets` (`palette-browser` presetPath) | yes | `INDIRECTLY USED` |
51+
| `samples/phase-09/0905/sample.0905.palette.json` | mapped via `sprite-editor.palettePath` and `palette-browser` presetPath | yes | `INDIRECTLY USED` |
52+
| `samples/phase-12/1204/sample.1204.palette.json` | mapped via `roundtripToolPresets` (`palette-browser` presetPath) | yes | `INDIRECTLY USED` |
53+
| `samples/phase-12/1205/sample.1205.palette.json` | none found in metadata/loader chain | no | `UNUSED` |
54+
| `samples/phase-12/1208/sample.1208.palette.json` | mapped via `roundtripToolPresets` (`palette-browser` presetPath) | yes | `INDIRECTLY USED` |
55+
| `samples/phase-12/1209/sample-1209-tile-map-editor-document.json` | referenced by `sample.1209.tile-model-converter.json` candidate path; also referenced in `sample.1902.workspace-all-tools.json` payload | yes (Tile Model Converter preset UI path; workspace reference present) | `INDIRECTLY USED` |
56+
| `samples/phase-12/1209/sample.1209.palette.json` | none found in metadata/loader chain | no | `UNUSED` |
57+
| `samples/phase-12/1210/sample-1210-tile-map-editor-document.json` | no references found | no | `UNUSED` |
58+
| `samples/phase-12/1210/sample.1210.palette.json` | none found in metadata/loader chain | no | `UNUSED` |
59+
| `samples/phase-12/1211/sample-1211-tile-map-editor-document.json` | no references found | no | `UNUSED` |
60+
| `samples/phase-12/1211/sample.1211.palette.json` | none found in metadata/loader chain | no | `UNUSED` |
61+
| `samples/phase-14/1414/sample.1414.palette.json` | mapped via `sprite-editor.palettePath` and `palette-browser` presetPath | yes | `INDIRECTLY USED` |
62+
63+
## Summary
64+
- `INDIRECTLY USED`: 14
65+
- `UNUSED`: 12
66+
- `UNCERTAIN`: 0
67+
68+
## Notes
69+
- This PR intentionally performed no code or JSON modifications.
70+
- Files can be marked `UNUSED` in current executable wiring while still being potential future assets; this report classifies current wired usage only.
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# PR 11.47 Complex JSON Classification
2+
3+
| JSON Path | Sample | Tool/Use Case | Load Mechanism | Visible Effect | Classification | Notes |
4+
|---|---|---|---|---|---|---|
5+
6+
## Summary
7+
- INDIRECTLY USED:
8+
- UNUSED:
9+
- UNCERTAIN:
10+
11+
## Recommended Next PR
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# PR 11.47 — Complex JSON Classification (Palette + Indirect Usage)
2+
3+
## Purpose
4+
Classify JSON files that appear "unreferenced" by string search but are likely used indirectly
5+
(e.g., palette.json, tile-map documents, manifest/workspace-driven payloads).
6+
7+
## Problem
8+
The audit script flags many JSON files as missing references, but some are loaded via:
9+
- manifest mappings
10+
- workspace payload aggregation
11+
- tool-specific loaders
12+
- implicit conventions (palette, tileset, document formats)
13+
14+
## Required Work
15+
Produce a classification-only report for complex JSON:
16+
17+
For each candidate (focus on palette and tile-map docs):
18+
- JSON path
19+
- owning sample
20+
- intended tool/use case
21+
- loading mechanism:
22+
- direct JS import/reference
23+
- manifest-driven
24+
- workspace-driven
25+
- tool loader (name-based)
26+
- visible effect in UI/tool
27+
- classification:
28+
- INDIRECTLY USED (valid)
29+
- UNUSED (candidate for delete/rehome)
30+
- UNCERTAIN (needs follow-up)
31+
32+
## Scope
33+
- Analysis/report only
34+
- No code changes
35+
- No JSON moves/deletes in this PR
36+
37+
## Acceptance
38+
- Report clearly distinguishes indirect usage vs true unused
39+
- Provides next-step recommendations for cleanup PRs

0 commit comments

Comments
 (0)