Skip to content

Commit ae3234c

Browse files
author
DavidQ
committed
Resolve sprite-editor palette input from manifest SSoT and require canonical palette fetch - PR 10.6K
1 parent 4fe2b21 commit ae3234c

7 files changed

Lines changed: 335 additions & 68 deletions

docs/dev/codex_commands.md

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

3-
Model: GPT-5.4
4-
Reasoning: high
3+
## Model
4+
GPT-5.3-codex
5+
6+
## Reasoning
7+
high
8+
9+
## Command
510

611
```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."
12+
codex --model GPT-5.3-codex --reasoning high "Execute BUILD_PR_LEVEL_10_6K_SPRITE_EDITOR_PALETTE_PATH_RESOLUTION_FROM_MANIFEST. Read docs/pr/BUILD_PR_LEVEL_10_6K_SPRITE_EDITOR_PALETTE_PATH_RESOLUTION_FROM_MANIFEST.md. Make the smallest scoped implementation change so sprite-editor resolves and requires the canonical palette input from the sample manifest, fetches the canonical sample palette JSON, does not use palette-browser wrapper JSON, preserves diagnostics, runs the listed tests, updates only roadmap status if execution-backed, writes a validation report under docs/dev/reports, writes the final artifact ZIP to tmp/BUILD_PR_LEVEL_10_6K_SPRITE_EDITOR_PALETTE_PATH_RESOLUTION_FROM_MANIFEST.zip, and do not modify start_of_day folders."
813
```

docs/dev/commit_comment.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
Require sprite-editor palette input and classify palette load failures - PR 10.6J
1+
Resolve sprite-editor palette input from manifest SSoT and require canonical palette fetch - PR 10.6K
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
# BUILD_PR_LEVEL_10_6K_SPRITE_EDITOR_PALETTE_PATH_RESOLUTION_FROM_MANIFEST_V2 Validation Report
2+
3+
## Scope
4+
- BUILD executed as diagnostic + loader-path scope only.
5+
- No start_of_day folders modified.
6+
- No palette normalization or fallback data added.
7+
8+
## Files Changed
9+
- `tools/Sprite Editor/modules/spriteEditorApp.js`
10+
- `samples/metadata/samples.index.metadata.json`
11+
12+
## Implementation Summary
13+
- Sprite-editor palette input resolution now uses sample manifest SSoT (`/samples/metadata/samples.index.metadata.json`) via `sampleId + samplePresetPath + toolId=sprite-editor` mapping lookup.
14+
- Query-driven and string-derived palette fallback resolution was removed from sprite-editor launch loading.
15+
- Palette input now fails visibly with `tool-input:missing.palettePath` when manifest mapping is missing/invalid.
16+
- Canonical palette parsing was tightened to canonical top-level object only (no palette-browser wrapper payload extraction), and now requires:
17+
- `schema`
18+
- `version`
19+
- `name`
20+
- `source`
21+
- `swatches`
22+
- Sprite preset extraction now accepts `config.spriteProject` so valid sample preset payloads do not trigger false missing-sprite-project warnings.
23+
- Sprite load diagnostics now provide `receivedTopLevelKeys` based on extracted sprite project shape, allowing correct expected-vs-actual classification.
24+
25+
## Diagnostic Evidence (Sample 0219 -> Sprite Editor)
26+
Evidence capture file:
27+
- `tmp/build-10-6k-sprite-editor-tool-load-evidence.json`
28+
29+
Observed tool-load boundary logs include:
30+
- `[tool-load:request]`
31+
- `[tool-load:fetch]` for sprite preset
32+
- `[tool-load:loaded]` for sprite preset
33+
- `[tool-load:classification]` for sprite preset with `classification: success`
34+
- `[tool-load:fetch]` for palette dependency
35+
- `[tool-load:loaded]` for palette dependency
36+
- `[tool-load:classification]` for palette dependency with `classification: success`
37+
38+
Observed network fetches include:
39+
- `/samples/phase-02/0219/sample.0219.sprite-editor.json`
40+
- `/samples/phase-02/0219/sample.0219.palette.json`
41+
42+
Observed network fetches exclude:
43+
- any `*.palette-browser.json` URL
44+
45+
## Required Tests
46+
### `npm run test:launch-smoke:games`
47+
- Result: PASS
48+
- Summary: `PASS=12 FAIL=0 TOTAL=12`
49+
50+
### `npm run test:sample-standalone:data-flow`
51+
- Result: PASS
52+
- Contract failures: none
53+
- Roundtrip path failures: none
54+
- Schema failures: none
55+
56+
## Roadmap Status
57+
- No roadmap content edited in this BUILD.
58+
59+
## Artifact
60+
- `tmp/BUILD_PR_LEVEL_10_6K_SPRITE_EDITOR_PALETTE_PATH_RESOLUTION_FROM_MANIFEST.zip`

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:47:39.988Z
3+
Generated: 2026-04-27T19:02:18.016Z
44

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

Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
# BUILD_PR_LEVEL_10_6K_SPRITE_EDITOR_PALETTE_PATH_RESOLUTION_FROM_MANIFEST_V2
2+
3+
## Purpose
4+
Make sprite-editor resolve its required palette path from the sample manifest and fetch the canonical `*.palette.json` file as a hard dependency.
5+
6+
## Scope
7+
- Sprite editor launch/load path only.
8+
- Palette path resolution only.
9+
- Diagnostics may remain in place if already present.
10+
- No repo-wide refactor.
11+
- No start_of_day changes.
12+
- No implementation fallback data.
13+
14+
## Problem Signal
15+
Current diagnostics show:
16+
- sprite-editor receives `samplePresetPath`
17+
- sprite-editor fetches only `sample.0219.sprite-editor.json`
18+
- no palette file is fetched
19+
- classification reports `missing` then `wrong-shape`
20+
- runtime warning says preset payload did not include a sprite project
21+
22+
This means the tool is not resolving all required manifest inputs before loading.
23+
24+
## Required Behavior
25+
Codex must implement the smallest executable change so:
26+
27+
1. The sample manifest is the source of truth for tool input paths.
28+
2. `sprite-editor` requires a palette input.
29+
3. The palette input must resolve to the canonical sample palette file:
30+
- `samples/**/sample.NNNN.palette.json`
31+
4. The deprecated duplicate wrapper file must not be used:
32+
- `sample.NNNN.palette-browser.json`
33+
5. If the manifest does not provide a palette path, the tool must fail visibly with a clear diagnostic classification:
34+
- `missing`
35+
6. If the palette fetch fails, classify it as:
36+
- `wrong-path`
37+
7. If the fetched palette is not the canonical palette schema, classify it as:
38+
- `wrong-shape`
39+
8. If the palette is fetched and valid, classify it as:
40+
- `success`
41+
42+
## Explicit Normalization Rule
43+
Do not pass palette data through a `palette-browser` wrapper.
44+
45+
The loaded palette object must be the canonical object with:
46+
- `schema`
47+
- `version`
48+
- `name`
49+
- `source`
50+
- `swatches`
51+
52+
Allowed metadata:
53+
- `$schema`
54+
55+
Disallowed required shape:
56+
- `tool`
57+
- `config.palette`
58+
- nested palette browser contract
59+
60+
## Expected Diagnostic Evidence
61+
When launching sample `0219` into `sprite-editor`, console logs must show:
62+
63+
- `[tool-load:request]`
64+
- expected includes required inputs:
65+
- `spriteProject`
66+
- `palette`
67+
- `[tool-load:fetch]`
68+
- one fetch for the sprite-editor preset/project input
69+
- one fetch for the canonical palette JSON
70+
- `[tool-load:loaded]`
71+
- loaded sprite input
72+
- loaded palette input
73+
- `[tool-load:classification]`
74+
- sprite input classified correctly
75+
- palette input classified correctly
76+
77+
## Files Codex Should Inspect First
78+
- `samples/phase-02/0219/`
79+
- the sample manifest for 0219
80+
- `tools/sprite-editor/`
81+
- existing tool-load diagnostics utility
82+
- existing sample/tool launch resolver
83+
- any schema or manifest helper already used by other tools
84+
85+
## Guardrails
86+
- Do not add silent fallback palettes.
87+
- Do not hardcode sample 0219.
88+
- Do not infer paths by string replacement unless the manifest already exposes enough data and no resolver exists.
89+
- Do not preserve use of `*.palette-browser.json`.
90+
- Do not change unrelated tools unless the shared resolver must be corrected for sprite-editor to work.
91+
- Do not rewrite roadmap text.
92+
- Roadmap update, if any, must be status-only.
93+
94+
## Acceptance Tests
95+
Run:
96+
97+
```powershell
98+
npm run test:launch-smoke:games
99+
npm run test:sample-standalone:data-flow
100+
```
101+
102+
Then manually launch:
103+
- `samples/phase-02/0219` into `sprite-editor`
104+
105+
Confirm:
106+
- palette fetch is visible in browser console
107+
- no `palette-browser` JSON is fetched
108+
- no warning says preset payload did not include a sprite project unless the sprite payload is genuinely invalid
109+
- diagnostics show expected vs actual for both sprite project and palette
110+
111+
## Commit Comment
112+
Resolve sprite-editor palette input from manifest SSoT and require canonical palette fetch - PR 10.6K

samples/metadata/samples.index.metadata.json

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1834,7 +1834,8 @@
18341834
"roundtripToolPresets": [
18351835
{
18361836
"toolId": "sprite-editor",
1837-
"presetPath": "/samples/phase-02/0219/sample.0219.sprite-editor.json"
1837+
"presetPath": "/samples/phase-02/0219/sample.0219.sprite-editor.json",
1838+
"palettePath": "/samples/phase-02/0219/sample.0219.palette.json"
18381839
}
18391840
]
18401841
},
@@ -2190,7 +2191,8 @@
21902191
"roundtripToolPresets": [
21912192
{
21922193
"toolId": "sprite-editor",
2193-
"presetPath": "/samples/phase-03/0301/sample.0301.sprite-editor.json"
2194+
"presetPath": "/samples/phase-03/0301/sample.0301.sprite-editor.json",
2195+
"palettePath": "/samples/phase-03/0301/sample.0301.palette.json"
21942196
}
21952197
]
21962198
},
@@ -2256,7 +2258,8 @@
22562258
"roundtripToolPresets": [
22572259
{
22582260
"toolId": "sprite-editor",
2259-
"presetPath": "/samples/phase-03/0302/sample.0302.sprite-editor.json"
2261+
"presetPath": "/samples/phase-03/0302/sample.0302.sprite-editor.json",
2262+
"palettePath": "/samples/phase-03/0302/sample.0302.palette.json"
22602263
}
22612264
]
22622265
},
@@ -5893,7 +5896,8 @@
58935896
"roundtripToolPresets": [
58945897
{
58955898
"toolId": "sprite-editor",
5896-
"presetPath": "/samples/phase-09/0905/sample.0905.sprite-editor.json"
5899+
"presetPath": "/samples/phase-09/0905/sample.0905.sprite-editor.json",
5900+
"palettePath": "/samples/phase-09/0905/sample.0905.palette.json"
58975901
}
58985902
]
58995903
},
@@ -8179,7 +8183,8 @@
81798183
"roundtripToolPresets": [
81808184
{
81818185
"toolId": "sprite-editor",
8182-
"presetPath": "/samples/phase-14/1414/sample.1414.sprite-editor.json"
8186+
"presetPath": "/samples/phase-14/1414/sample.1414.sprite-editor.json",
8187+
"palettePath": "/samples/phase-14/1414/sample.1414.palette.json"
81838188
}
81848189
]
81858190
},

0 commit comments

Comments
 (0)