Skip to content

Commit b2ad89e

Browse files
author
DavidQ
committed
PR 8.14: Normalize palette naming
- Removed tool-specific palette files - Enforced single canonical palette per sample - Preserved palette data via merge PR 8.15: Naming convention standardization - Clarified difference between tool payload and palette data files - Locked naming conventions for future consistency - No file changes required
1 parent 3a73eaa commit b2ad89e

4 files changed

Lines changed: 163 additions & 38 deletions

File tree

docs/dev/codex_commands.md

Lines changed: 14 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,20 @@
11
MODEL: GPT-5.3-codex
2-
REASONING: medium
2+
REASONING: low
33

44
TASK:
5-
Apply PR 8.13 palette naming and deep reference cleanup.
5+
Document-only PR.
66

7-
STEPS:
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.
7+
- Do NOT rename files
8+
- Do NOT modify payloads
9+
- Do NOT modify runtime
10+
11+
Verify:
12+
- sample.<id>.<tool>.json are tool payloads
13+
- sample.<id>.palette.json are palette data files
14+
15+
Ensure:
16+
- no new invalid naming patterns introduced
3217

3318
ACCEPTANCE:
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
19+
- Naming rules clearly documented
20+
- No file changes required

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.13: Clean palette refs and rename palette files
1+
PR 8.15: Naming convention standardization
22

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
3+
- Clarified difference between tool payload and palette data files
4+
- Locked naming conventions for future consistency
5+
- No file changes required
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
# PR 8.14 — Palette Naming Normalization
2+
3+
## Problem
4+
Duplicate palette files exist:
5+
- sample.0213.palette.json
6+
- sample.0213.palette-browser.json
7+
8+
This creates ambiguity and violates the “single palette per sample” rule.
9+
10+
## Decision
11+
12+
### Tool Files
13+
Keep full tool names:
14+
- sample.<id>.<tool>.json (GOOD)
15+
16+
### Palette Files
17+
Palette is NOT tool-specific.
18+
19+
Palette is:
20+
- shared across tools in the sample
21+
- passed separately at runtime
22+
23+
### FINAL RULE
24+
25+
There must be EXACTLY ONE palette file per sample:
26+
27+
```
28+
sample.<id>.palette.json
29+
```
30+
31+
## Required Fix
32+
33+
For every sample folder:
34+
35+
1. KEEP:
36+
sample.<id>.palette.json
37+
38+
2. REMOVE:
39+
any tool-specific palette files:
40+
- sample.<id>.palette-browser.json
41+
- sample.<id>.sprite-editor.palette.json
42+
- any variation with tool name
43+
44+
3. If tool-specific palette contains unique data:
45+
- merge into canonical palette file BEFORE deletion
46+
47+
## Why
48+
49+
- Palette is shared resource
50+
- Tool payloads are isolated
51+
- Matches runtime contract:
52+
open(toolPayload, paletteObject)
53+
54+
## Rules
55+
56+
- One palette per sample
57+
- Palette never includes tool name
58+
- Tool files always include tool name
59+
- No duplicate palette variants
60+
61+
## Acceptance
62+
63+
- Only one palette file per sample folder
64+
- No files matching:
65+
sample.<id>.*palette*.json except canonical
66+
- All palette data preserved via merge if needed
Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
# PR 8.15 — Naming Convention Standardization
2+
3+
## Purpose
4+
Eliminate confusion between:
5+
- tool payload files
6+
- palette data files
7+
8+
Clarify naming so humans can instantly understand file purpose.
9+
10+
## Current State (Valid but Confusing)
11+
12+
- sample.0213.palette-browser.json ✅ (tool payload)
13+
- sample.0213.palette.json ✅ (palette data)
14+
15+
These are BOTH correct, but visually similar.
16+
17+
## Final Naming Model
18+
19+
### Tool Payload Files (UNCHANGED)
20+
```
21+
sample.<id>.<tool>.json
22+
```
23+
24+
Examples:
25+
- sample.0213.palette-browser.json
26+
- sample.0207.sprite-editor.json
27+
28+
### Palette Data Files (UNCHANGED NAME, BUT REDEFINED ROLE)
29+
```
30+
sample.<id>.palette.json
31+
```
32+
33+
This is NOT a tool.
34+
35+
## Key Clarification
36+
37+
"palette-browser" is a TOOL
38+
"palette" is DATA
39+
40+
## New Rule (IMPORTANT)
41+
42+
### Tool Payload Detection Rule
43+
A file is a TOOL PAYLOAD if:
44+
- it contains `"tool": "<tool-name>"`
45+
46+
### Palette File Detection Rule
47+
A file is a PALETTE if:
48+
- `$schema` = palette.schema.json
49+
- contains `"swatches"`
50+
51+
## Human-Readable Rule
52+
53+
If filename has 3 segments:
54+
- sample.0213.X.json → TOOL
55+
56+
If filename has 2 segments:
57+
- sample.0213.palette.json → DATA
58+
59+
## Forbidden Future Patterns
60+
61+
Do NOT create:
62+
- sample.<id>.palette-browser.palette.json
63+
- sample.<id>.palette-data.json
64+
- sample.<id>.colors.json
65+
66+
## Optional (NOT REQUIRED NOW)
67+
68+
Future improvement (DO NOT IMPLEMENT IN THIS PR):
69+
```
70+
sample.<id>.data.palette.json
71+
```
72+
73+
But current naming is ACCEPTED and LOCKED.
74+
75+
## Acceptance
76+
77+
- No renaming required (repo already compliant)
78+
- Naming rules documented
79+
- No ambiguity for future contributors

0 commit comments

Comments
 (0)