Skip to content

Commit 4fe2b21

Browse files
author
DavidQ
committed
Require sprite-editor palette input and classify palette load failures - PR 10.6J
1 parent f7947bd commit 4fe2b21

7 files changed

Lines changed: 475 additions & 24 deletions

File tree

docs/dev/codex_commands.md

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,8 @@
1-
# Codex Commands — BUILD_PR_LEVEL_10_6I_TOOL_LOAD_EXPECTED_VS_ACTUAL_CLASSIFICATION_V3
1+
# Codex Command - BUILD_PR_LEVEL_10_6J_SPRITE_EDITOR_REQUIRED_PALETTE_INPUT
22

3-
## Model
4-
GPT-5.3-codex
3+
Model: GPT-5.4
4+
Reasoning: high
55

6-
## Reasoning
7-
high
8-
9-
## Command
10-
```text
11-
Implement BUILD_PR_LEVEL_10_6I_TOOL_LOAD_EXPECTED_VS_ACTUAL_CLASSIFICATION_V3 from docs/pr/BUILD_PR_LEVEL_10_6I_TOOL_LOAD_EXPECTED_VS_ACTUAL_CLASSIFICATION_V3.md. Keep the change diagnostics-only. Add expected-vs-actual dependency classification to existing tool-load diagnostics. Do not normalize palette files in this PR. Do not add fallback data or hardcoded paths. Run npm run test:launch-smoke:games and npm run test:sample-standalone:data-flow. Put results in docs/dev/reports/level_10_6i_tool_load_expected_vs_actual_classification_report.md. Return a ZIP artifact at tmp/BUILD_PR_LEVEL_10_6I_TOOL_LOAD_EXPECTED_VS_ACTUAL_CLASSIFICATION_V3.zip.
6+
```powershell
7+
codex --model gpt-5.4 --reasoning high "Execute BUILD_PR_LEVEL_10_6J_SPRITE_EDITOR_REQUIRED_PALETTE_INPUT exactly as documented in docs/pr/BUILD_PR_LEVEL_10_6J_SPRITE_EDITOR_REQUIRED_PALETTE_INPUT.md. Make the smallest valid change. Do not add implementation outside sprite-editor launch/input loading and shared diagnostics needed for required palette input. Do not recreate palette-browser JSON wrappers. Do not use fallback palettes or hardcoded sample paths. Run npm run test:launch-smoke:games and npm run test:sample-standalone:data-flow. Place the result ZIP at tmp/BUILD_PR_LEVEL_10_6J_SPRITE_EDITOR_REQUIRED_PALETTE_INPUT.zip."
128
```

docs/dev/commit_comment.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
Add expected-vs-actual tool-load diagnostics classification - PR 10.6I
1+
Require sprite-editor palette input and classify palette load failures - PR 10.6J

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-27T18:30:35.400Z
3+
Generated: 2026-04-27T18:47:39.988Z
44

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

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
# Level 10.6J Expected Results
2+
3+
## Files changed
4+
5+
- `tools/Sprite Editor/modules/spriteEditorApp.js`
6+
- `tools/shared/toolLoadDiagnostics.js`
7+
- `docs/dev/reports/level_10_6J_expected_results.md`
8+
- `docs/dev/reports/launch_smoke_report.md` (test-generated refresh)
9+
10+
## Sprite-editor palette input expectation
11+
12+
- `sprite-editor` now resolves required palette input before applying sample preset load.
13+
- Palette input resolution order is launch-input based:
14+
1. `palettePath` query parameter
15+
2. palette-related query path keys in normalized requested data paths
16+
3. canonical derivation from `samplePresetPath` (`*.sprite-editor.json` -> `*.palette.json`)
17+
- If no palette path can be resolved, load fails visibly and diagnostics emit a palette warning/error path.
18+
19+
## Palette request path source
20+
21+
Manual sample `0219` launch observed:
22+
23+
- `pathSource`: `tool-input:derived.samplePresetPath`
24+
- resolved `palettePath`: `/samples/phase-02/0219/sample.0219.palette.json`
25+
26+
## Palette fetch URL
27+
28+
Manual sample `0219` launch observed:
29+
30+
- `fetchUrl`: `http://127.0.0.1:<port>/samples/phase-02/0219/sample.0219.palette.json`
31+
- fetch response status: `200`
32+
33+
## Palette loaded shape summary
34+
35+
Manual sample `0219` launch observed from `[tool-load:loaded]` for dependency `palette`:
36+
37+
- `loaded.loadedSchema`: `html-js-gaming.palette`
38+
- `loaded.topLevelKeys`: `[$schema, schema, version, name, source, swatches, sourceId, locked]`
39+
- `loaded.palette.swatchCount`: `8`
40+
- `expected.contractMatch`: `true`
41+
42+
## Palette classification
43+
44+
Manual sample `0219` launch observed:
45+
46+
- `[tool-load:classification] dependencyId=palette classification=success`
47+
- expected/actual contract blocks include canonical palette expectations and actual top-level keys/array counts.
48+
49+
Additional observed classification in same launch (unchanged from prior behavior):
50+
51+
- `dependencyId=sprite-project classification=wrong-shape` (top-level wrapper remains `$schema/tool/version/config`)
52+
53+
## Validation results
54+
55+
1. `npm run test:launch-smoke:games`
56+
- PASS
57+
- Summary: `PASS=12`, `FAIL=0`, `TOTAL=12`
58+
59+
2. `npm run test:sample-standalone:data-flow`
60+
- PASS
61+
- Summary arrays:
62+
- `schemaFailures: []`
63+
- `contractFailures: []`
64+
- `roundtripPathFailures: []`
65+
- `genericFailures: []`
66+
67+
## Roadmap status-only update result
68+
69+
- No `10.6J` status marker was found in `docs/dev/roadmaps/MASTER_ROADMAP_ENGINE.md`.
70+
- No roadmap edits were applied.
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# BUILD_PR_LEVEL_10_6J_SPRITE_EDITOR_REQUIRED_PALETTE_INPUT
2+
3+
## Purpose
4+
Make `sprite-editor` require a palette as an explicit tool input so sample launches show the full expected data contract and fail visibly when palette input is missing.
5+
6+
## Scope
7+
- Target only `sprite-editor` launch/input loading and shared tool-load diagnostics needed for this contract.
8+
- Do not restore `*.palette-browser.json` wrappers.
9+
- Do not introduce fallback palettes or hidden sample paths.
10+
- Do not modify `start_of_day` folders.
11+
- Keep one palette SSoT: `*.palette.json`.
12+
13+
## Problem Evidence
14+
Current logs show:
15+
- `sprite-editor` receives `samplePresetPath`.
16+
- `sprite-editor` fetches only `sample.0219.sprite-editor.json`.
17+
- diagnostics classify initial expected data as `missing`.
18+
- loaded preset is classified `wrong-shape` because the payload did not include the expected sprite project.
19+
- no palette fetch appears in the browser fetch list.
20+
21+
This means the tool boundary does not yet require/resolve palette input as part of its expected contract.
22+
23+
## Codex Tasks
24+
1. Locate the smallest `sprite-editor` launch/input path that reads query or manifest data into the tool.
25+
2. Add `palettePath` / canonical palette input to the expected data contract for `sprite-editor`.
26+
3. Require palette resolution from manifest/tool launch input, not from hardcoded sample paths.
27+
4. Fetch the canonical `*.palette.json` when present in requested data paths.
28+
5. Log diagnostics for palette at request, fetch, loaded, and classification stages.
29+
6. If palette is missing, classify as `missing` and show a clear visible warning/error.
30+
7. If palette is fetched but malformed, classify as `wrong-shape` with top-level keys.
31+
8. If palette is valid, classify as `success` and include swatch count in diagnostics.
32+
9. Preserve existing behavior for valid sprite project loading except for requiring palette.
33+
10. Update the Level 10.6 report with execution results only.
34+
11. Update `docs/dev/roadmaps/MASTER_ROADMAP_ENGINE.md` status markers only if execution-backed.
35+
36+
## Acceptance
37+
- Launching sample 0219 into `sprite-editor` logs an expected palette requirement.
38+
- Browser fetch list includes the canonical sample palette JSON when the sample manifest provides it.
39+
- Missing palette is not silent.
40+
- No duplicate `*.palette-browser.json` files are created or required.
41+
- No fallback palette data is used.
42+
- `npm run test:sample-standalone:data-flow` passes or reports only explicit classified failures.
43+
- Roadmap change, if any, is status-only.
44+
45+
## Validation Commands
46+
Run:
47+
```powershell
48+
npm run test:launch-smoke:games
49+
npm run test:sample-standalone:data-flow
50+
```
51+
52+
Then manually launch:
53+
```text
54+
samples/phase-02/0219
55+
```
56+
Open sprite-editor and confirm console diagnostics include palette expected/fetch/loaded/classification.

0 commit comments

Comments
 (0)