Skip to content

Commit 3a73eaa

Browse files
author
DavidQ
committed
PR 8.13: Clean palette refs and rename palette files
- Renamed sample palettes to sample.<id>.palette.json - Removed embedded palette refs from sample tool payloads - Moved locked/source metadata into palette JSON - Allowed palette sourceId and locked metadata in schema
1 parent 87af5a3 commit 3a73eaa

41 files changed

Lines changed: 306 additions & 338 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

docs/dev/codex_commands.md

Lines changed: 31 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,38 @@ MODEL: GPT-5.3-codex
22
REASONING: medium
33

44
TASK:
5-
Apply PR 8.12: decouple tool payload files from palette references.
5+
Apply PR 8.13 palette naming and deep reference cleanup.
66

77
STEPS:
8-
1. Scan all sample tool payload files matching:
9-
- samples/**/sample.*.*.json
10-
2. Remove top-level palette fields from those tool payload files.
11-
3. Specifically ensure:
12-
- sample.0207.sprite-editor.json has no palette reference.
13-
4. Keep sample.palette.json files unchanged.
14-
5. Keep palette.schema.json unchanged unless it already violates swatches/symbol rules.
15-
6. Keep tool schemas consistent with workspace manifest tools[] entries.
16-
7. Do NOT add runtime code.
17-
8. Do NOT add validators.
18-
9. Do NOT modify start_of_day.
8+
1. Rename all sample palette files:
9+
- from sample.palette.json
10+
- to sample.<id>.palette.json
11+
where <id> matches the sample folder id.
12+
2. Remove all sample.palette.json files after rename.
13+
3. Update palette JSON $schema relative paths only if needed after rename.
14+
4. Move lock/source metadata from tool payloads into the matching palette JSON:
15+
- paletteRef.source -> palette.source
16+
- paletteRef.id -> palette.sourceId
17+
- paletteRef.locked -> palette.locked
18+
5. Remove palette-related fields from every sample tool payload file:
19+
- palette
20+
- paletteRef
21+
- assetRefs.paletteId
22+
6. If assetRefs becomes empty after paletteId removal, remove assetRefs.
23+
7. Specifically fix:
24+
- samples/phase-02/0207/sample.0208.sprite-editor.json
25+
and audit whether the 0208 file name in 0207 folder is a mismatch. Correct to sample.0207.sprite-editor.json if repo conventions confirm it.
26+
8. Update tools/schemas/palette.schema.json to allow optional top-level:
27+
- sourceId
28+
- locked
29+
9. Do NOT add runtime logic.
30+
10. Do NOT add validators.
31+
11. Do NOT modify start_of_day.
1932

2033
ACCEPTANCE:
21-
- sample_tool_files_with_palette_field=0
22-
- sample.palette.json files remain separate
23-
- all tool payloads match workspace tools[] payload shape
34+
- sample_tool_files_with_palette_key=0
35+
- sample_tool_files_with_paletteRef_key=0
36+
- sample_tool_files_with_paletteId_key=0
37+
- sample.palette.json files remaining=0
38+
- all palette files named sample.<id>.palette.json
39+
- locked/sourceId live only in palette JSON

docs/dev/commit_comment.txt

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
PR 8.12: Decouple tool payloads from palette references
1+
PR 8.13: Clean palette refs and rename palette files
22

3-
- Removed palette fields from sample tool payload files
4-
- Preserved separate sample.palette.json objects
5-
- Kept tool payload schema consistent with workspace tools[] entries
3+
- Renamed sample palettes to sample.<id>.palette.json
4+
- Removed embedded palette refs from sample tool payloads
5+
- Moved locked/source metadata into palette JSON
6+
- Allowed palette sourceId and locked metadata in schema
Lines changed: 138 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,138 @@
1+
# PR 8.13 — Palette File Naming and Reference Cleanup
2+
3+
## Purpose
4+
Finish the palette/tool payload separation correctly.
5+
6+
Tool payload files must not contain embedded palette data, palette references, or palette asset reference fields.
7+
8+
Palette lock metadata belongs in the palette JSON file.
9+
10+
Palette file names must follow the same sample naming convention as tool payload files.
11+
12+
## Corrections
13+
14+
### Palette File Naming
15+
16+
#### Old
17+
```text
18+
sample.palette.json
19+
```
20+
21+
#### New
22+
```text
23+
sample.<id>.palette.json
24+
```
25+
26+
Examples:
27+
```text
28+
sample.0207.palette.json
29+
sample.0305.palette.json
30+
```
31+
32+
This matches:
33+
```text
34+
sample.0207.sprite-editor.json
35+
sample.0305.vector-map-editor.json
36+
```
37+
38+
## Required Tool Payload Cleanup
39+
40+
Remove palette-related fields from all sample tool payload files, including nested config fields.
41+
42+
Specifically remove occurrences like:
43+
44+
```json
45+
"palette": []
46+
```
47+
48+
```json
49+
"paletteRef": {
50+
"source": "engine/paletteList",
51+
"id": "crayola008",
52+
"locked": true
53+
}
54+
```
55+
56+
```json
57+
"assetRefs": {
58+
"paletteId": "",
59+
"spriteId": ""
60+
}
61+
```
62+
63+
If `assetRefs` contains only palette-related fields, remove `assetRefs`.
64+
65+
If `assetRefs` contains non-palette asset references, remove only palette-related keys and preserve the rest.
66+
67+
## Specific Known File
68+
Fix the remaining issue in:
69+
70+
```text
71+
samples/phase-02/0207/sample.0208.sprite-editor.json
72+
```
73+
74+
Remove:
75+
- `palette`
76+
- `paletteRef`
77+
- `assetRefs.paletteId`
78+
79+
Note: verify whether the file name `sample.0208.sprite-editor.json` belongs in folder `0207`. If it is a sample id mismatch, correct the file naming only if repo naming conventions confirm it should be `sample.0207.sprite-editor.json`.
80+
81+
## Palette Lock Rule
82+
83+
Palette lock metadata belongs in the palette file, not the tool payload.
84+
85+
Example:
86+
87+
```json
88+
{
89+
"$schema": "../../../tools/schemas/palette.schema.json",
90+
"schema": "html-js-gaming.palette",
91+
"version": 1,
92+
"name": "Sample 0207 Palette",
93+
"source": "engine/paletteList",
94+
"sourceId": "crayola008",
95+
"locked": true,
96+
"swatches": []
97+
}
98+
```
99+
100+
## Schema Update
101+
102+
Update `tools/schemas/palette.schema.json` to allow optional top-level metadata:
103+
104+
```json
105+
"sourceId": {
106+
"type": "string",
107+
"minLength": 1
108+
},
109+
"locked": {
110+
"type": "boolean"
111+
}
112+
```
113+
114+
Do not add these fields to swatches.
115+
116+
## Rules
117+
- Tool payload files must match workspace `tools[]` item shape.
118+
- Tool payload files must not contain palette object data.
119+
- Tool payload files must not contain palette path refs.
120+
- Tool payload files must not contain palette lock metadata.
121+
- Palette files use `sample.<id>.palette.json`.
122+
- Palette files own `locked` and source metadata.
123+
- Palette files remain separate JSON objects passed beside the tool payload when opening a tool.
124+
125+
## Non-Goals
126+
- No runtime changes.
127+
- No validators.
128+
- No `start_of_day` changes.
129+
- No broad sample gameplay edits.
130+
131+
## Acceptance
132+
- No sample tool payload file contains `palette`.
133+
- No sample tool payload file contains `paletteRef`.
134+
- No sample tool payload file contains `assetRefs.paletteId`.
135+
- Palette files are named `sample.<id>.palette.json`.
136+
- No `sample.palette.json` files remain.
137+
- Locked palette metadata is present in the renamed palette JSON where applicable.
138+
- Palette schema allows top-level `locked` and `sourceId`.
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# Palette Cleanup Audit Rules
2+
3+
## Find Tool Payload Files
4+
Match:
5+
6+
```text
7+
samples/**/sample.*.*.json
8+
```
9+
10+
Exclude:
11+
12+
```text
13+
sample.*.palette.json
14+
```
15+
16+
## Forbidden Keys in Tool Payload Files
17+
Search recursively for:
18+
- `palette`
19+
- `paletteRef`
20+
- `paletteId`
21+
22+
These must not appear anywhere inside tool payload files.
23+
24+
## assetRefs Rule
25+
If `assetRefs` only contains palette references, remove `assetRefs`.
26+
27+
If `assetRefs` contains useful non-palette references, preserve it and remove only palette-related keys.
28+
29+
## Palette Naming Rule
30+
Every sample palette file must be:
31+
32+
```text
33+
sample.<folder-id>.palette.json
34+
```
35+
36+
## Folder/File ID Rule
37+
A sample file inside:
38+
39+
```text
40+
samples/phase-02/0207/
41+
```
42+
43+
should normally use:
44+
45+
```text
46+
sample.0207.<tool>.json
47+
sample.0207.palette.json
48+
```
49+
50+
If a file is named `sample.0208.sprite-editor.json` inside folder `0207`, audit for mismatch and fix if it is not intentional.

samples/phase-02/0207/sample.palette.json renamed to samples/phase-02/0207/sample.0207.palette.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"schema": "html-js-gaming.palette",
44
"version": 1,
55
"name": "Sample 0207 Palette",
6-
"source": "generated-from-sample-colors",
6+
"source": "engine/paletteList",
77
"swatches": [
88
{
99
"symbol": "!",
@@ -50,5 +50,7 @@
5050
"hex": "#FF7538",
5151
"name": "color-009"
5252
}
53-
]
53+
],
54+
"sourceId": "crayola008",
55+
"locked": true
5456
}

samples/phase-02/0207/sample.0207.sprite-editor.json

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,7 @@
1212
"showGrid": true,
1313
"onionSkin": false,
1414
"activeColor": "#1CAC78FF",
15-
"palette": [],
16-
"paletteRef": {
17-
"source": "engine/paletteList",
18-
"id": "crayola008",
19-
"locked": true
20-
},
2115
"assetRefs": {
22-
"paletteId": "",
2316
"spriteId": ""
2417
},
2518
"recentColors": [

samples/phase-02/0213/sample.0213.palette-browser.json

Lines changed: 1 addition & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -2,36 +2,5 @@
22
"$schema": "../../../tools/schemas/tools/palette-browser.schema.json",
33
"tool": "palette-browser",
44
"version": "1",
5-
"config": {
6-
"palette": {
7-
"name": "sample-0213-sprite-layer",
8-
"entries": [
9-
{
10-
"symbol": "A",
11-
"hex": "#1E1B4B",
12-
"name": "Backdrop Violet"
13-
},
14-
{
15-
"symbol": "B",
16-
"hex": "#1CAC78",
17-
"name": "Sprite Accent Green"
18-
},
19-
{
20-
"symbol": "C",
21-
"hex": "#FF7538",
22-
"name": "Sprite Warm Orange"
23-
},
24-
{
25-
"symbol": "D",
26-
"hex": "#FCE883",
27-
"name": "Highlight Yellow"
28-
},
29-
{
30-
"symbol": "E",
31-
"hex": "#1F75FE",
32-
"name": "UI Blue"
33-
}
34-
]
35-
}
36-
}
5+
"config": {}
376
}

samples/phase-02/0213/sample.palette.json renamed to samples/phase-02/0213/sample.0213.palette.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"schema": "html-js-gaming.palette",
44
"version": 1,
55
"name": "Sample 0213 Palette",
6-
"source": "generated-from-sample-colors",
6+
"source": "engine/paletteList",
77
"swatches": [
88
{
99
"symbol": "!",
@@ -70,5 +70,7 @@
7070
"hex": "#FF7538",
7171
"name": "color-013"
7272
}
73-
]
73+
],
74+
"sourceId": "crayola008",
75+
"locked": true
7476
}

samples/phase-02/0213/sample.0213.sprite-editor.json

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,7 @@
1212
"showGrid": true,
1313
"onionSkin": false,
1414
"activeColor": "#1CAC78FF",
15-
"palette": [],
16-
"paletteRef": {
17-
"source": "engine/paletteList",
18-
"id": "crayola008",
19-
"locked": true
20-
},
2115
"assetRefs": {
22-
"paletteId": "",
2316
"spriteId": ""
2417
},
2518
"recentColors": [

samples/phase-02/0214/sample.palette.json renamed to samples/phase-02/0214/sample.0214.palette.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"schema": "html-js-gaming.palette",
44
"version": 1,
55
"name": "Sample 0214 Palette",
6-
"source": "generated-from-sample-colors",
6+
"source": "engine/paletteList",
77
"swatches": [
88
{
99
"symbol": "!",
@@ -40,5 +40,7 @@
4040
"hex": "#FF7538",
4141
"name": "color-007"
4242
}
43-
]
43+
],
44+
"sourceId": "crayola008",
45+
"locked": true
4446
}

0 commit comments

Comments
 (0)