Skip to content

Commit 87af5a3

Browse files
author
DavidQ
committed
PR 8.12: Decouple tool payloads from palette references
- Removed palette fields from sample tool payload files - Preserved separate sample.palette.json objects - Kept tool payload schema consistent with workspace tools[] entries
1 parent 0072c32 commit 87af5a3

39 files changed

Lines changed: 170 additions & 92 deletions

File tree

docs/dev/codex_commands.md

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

44
TASK:
5-
Apply PR 8.11 sample palette strict rule.
5+
Apply PR 8.12: decouple tool payload files from palette references.
66

77
STEPS:
8-
1. Find sample folders containing sample.palette.json.
9-
2. For each folder with sample.palette.json:
10-
- update every sample.<id>.<tool>.json in that folder
11-
- add or preserve: "palette": "./sample.palette.json"
12-
3. Verify every sample.palette.json uses:
13-
- swatches
14-
- single-character symbol
15-
- uppercase hex
16-
4. Ensure no sample folder has more than one palette file.
17-
5. Do not edit runtime files.
18-
6. Do not edit old runtime/docs references to old sample path names in this PR.
19-
7. Do not add validators.
20-
8. Do not modify start_of_day.
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.
2119

2220
ACCEPTANCE:
23-
- All sample tool files in palette folders explicitly reference ./sample.palette.json.
24-
- No duplicate palette files per sample folder.
25-
- Palette schema shape remains valid.
21+
- sample_tool_files_with_palette_field=0
22+
- sample.palette.json files remain separate
23+
- all tool payloads match workspace tools[] payload shape

docs/dev/commit_comment.txt

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
PR 8.11: Enforce explicit sample palette linkage
1+
PR 8.12: Decouple tool payloads from palette references
22

3-
- Required sample tool payloads to reference sample.palette.json when present
4-
- Preserved one-palette-per-sample-folder rule
5-
- Kept palettes separate from tool payload files
6-
- Avoided runtime and start_of_day changes
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
Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
# PR 8.12 — Decouple Tool Payloads From Palette
2+
3+
## Purpose
4+
Correct the sample palette linkage rule.
5+
6+
Tool payload JSON must remain the exact same schema shape used inside workspace/game manifests.
7+
8+
A tool file must not contain a direct `palette` reference.
9+
10+
## Key Correction
11+
12+
### Wrong
13+
```json
14+
{
15+
"$schema": "../../../tools/schemas/tools/sprite-editor.schema.json",
16+
"tool": "sprite-editor",
17+
"version": 1,
18+
"palette": "./sample.palette.json",
19+
"config": {}
20+
}
21+
```
22+
23+
### Correct
24+
```json
25+
{
26+
"$schema": "../../../tools/schemas/tools/sprite-editor.schema.json",
27+
"tool": "sprite-editor",
28+
"version": 1,
29+
"config": {}
30+
}
31+
```
32+
33+
When opening a tool, the launcher passes:
34+
1. the tool payload JSON
35+
2. the palette object JSON
36+
37+
This matches workspace layout.
38+
39+
## Rule
40+
Sample tool payload files must be identical in shape to workspace manifest `tools[]` entries.
41+
42+
## Required Changes
43+
- Remove `palette` from every `sample.<id>.<tool>.json` file.
44+
- Keep `sample.palette.json` as a separate file when colors exist.
45+
- Do not embed palette paths inside tool payload files.
46+
- Do not change the tool schemas to require palette.
47+
- Keep palette object loading separate from tool payload loading.
48+
49+
## Example
50+
51+
Sample folder:
52+
53+
```text
54+
samples/phase-02/0207/
55+
sample.0207.sprite-editor.json
56+
sample.palette.json
57+
```
58+
59+
Tool payload:
60+
61+
```json
62+
{
63+
"$schema": "../../../tools/schemas/tools/sprite-editor.schema.json",
64+
"tool": "sprite-editor",
65+
"version": 1,
66+
"config": {}
67+
}
68+
```
69+
70+
Palette object:
71+
72+
```json
73+
{
74+
"$schema": "../../../tools/schemas/palette.schema.json",
75+
"schema": "html-js-gaming.palette",
76+
"version": 1,
77+
"name": "Sample 0207 Palette",
78+
"source": "generated-from-sample-colors",
79+
"swatches": []
80+
}
81+
```
82+
83+
## Acceptance
84+
- `sample.0207.sprite-editor.json` has no `palette` field.
85+
- No `sample.<id>.<tool>.json` file has a `palette` field.
86+
- Tool schemas remain consistent with workspace `tools[]` entries.
87+
- Palette files remain separate and schema-compliant.
88+
- No runtime logic changes.
89+
- No validators added.
90+
- No `start_of_day` changes.
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Tool Payload / Palette Boundary Rules
2+
3+
## Tool Payload
4+
A tool payload file is the same format as an item in workspace/game manifest `tools[]`.
5+
6+
Allowed top-level fields are defined by that tool's schema only.
7+
8+
Do not add:
9+
- `palette`
10+
- `palettePath`
11+
- `paletteRef`
12+
- sample wrapper fields
13+
14+
## Palette Object
15+
Palette data lives in a separate JSON file:
16+
17+
`sample.palette.json`
18+
19+
The launcher/workspace layer is responsible for passing the palette object alongside the tool payload.
20+
21+
## Why
22+
This keeps tool schemas consistent across:
23+
- samples
24+
- games
25+
- workspace manifests
26+
- direct tool launch

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1071,6 +1071,5 @@
10711071
],
10721072
"currentFrameIndex": 0
10731073
}
1074-
},
1075-
"palette": "./sample.palette.json"
1074+
}
10761075
}

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,5 @@
3333
}
3434
]
3535
}
36-
},
37-
"palette": "./sample.palette.json"
36+
}
3837
}

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -811,6 +811,5 @@
811811
],
812812
"currentFrameIndex": 0
813813
}
814-
},
815-
"palette": "./sample.palette.json"
814+
}
816815
}

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -551,6 +551,5 @@
551551
],
552552
"currentFrameIndex": 0
553553
}
554-
},
555-
"palette": "./sample.palette.json"
554+
}
556555
}

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1071,6 +1071,5 @@
10711071
],
10721072
"currentFrameIndex": 0
10731073
}
1074-
},
1075-
"palette": "./sample.palette.json"
1074+
}
10761075
}

samples/phase-02/0221/sample.0221.3d-json-payload-normalizer.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,5 @@
5151
}
5252
]
5353
}
54-
},
55-
"palette": "./sample.palette.json"
54+
}
5655
}

0 commit comments

Comments
 (0)