Skip to content

Commit 0072c32

Browse files
author
DavidQ
committed
PR 8.11: Enforce explicit sample palette linkage
- Required sample tool payloads to reference sample.palette.json when present - Preserved one-palette-per-sample-folder rule - Kept palettes separate from tool payload files - Avoided runtime and start_of_day changes
1 parent 4975fc2 commit 0072c32

39 files changed

Lines changed: 195 additions & 58 deletions

docs/dev/codex_commands.md

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

44
TASK:
5-
Refactor samples to multi-file tool payload model.
5+
Apply PR 8.11 sample palette strict rule.
66

77
STEPS:
8-
1. Remove any "tools" arrays inside sample JSON files.
9-
2. For each tool used in a sample:
10-
- Create file: sample.<id>.<tool>.json
11-
3. Ensure each file:
12-
- references tool schema via $schema
13-
- matches EXACT structure of workspace manifest tool payload
14-
4. Remove wrapper fields:
15-
- documentKind
16-
- id
17-
- type
18-
5. Keep palette as separate file if exists.
19-
6. Do NOT modify runtime.
20-
7. Do NOT add validators.
21-
8. Do NOT modify start_of_day.
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.
2221

2322
ACCEPTANCE:
24-
- Each sample tool is its own file
25-
- File format matches workspace tool payload
26-
- No arrays or wrappers remain
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.

docs/dev/commit_comment.txt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
PR 8.10: Sample multi-file tool payload alignment
1+
PR 8.11: Enforce explicit sample palette linkage
22

3-
- Converted samples to one-file-per-tool model
4-
- Removed tools arrays from sample files
5-
- Aligned sample payloads with workspace tool payload structure
6-
- Standardized naming convention
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
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
# PR 8.11 — Sample Palette Strict Rule
2+
3+
## Purpose
4+
Tighten sample palette handling after the multi-file tool payload refactor.
5+
6+
Samples now use one tool payload per file:
7+
8+
`sample.<id>.<tool>.json`
9+
10+
Palette handling must be explicit and deterministic.
11+
12+
## Current Repo Reality
13+
- Sample tool payload files are manifest-style:
14+
- `$schema`
15+
- `tool`
16+
- `version`
17+
- `config`
18+
- Palette files are separate:
19+
- `sample.palette.json`
20+
- Runtime/docs references to old sample paths were intentionally not edited in the prior PR.
21+
22+
## Required Rule
23+
24+
If a sample uses colors, that sample folder MUST contain exactly one:
25+
26+
`sample.palette.json`
27+
28+
## Required Linkage
29+
30+
Each `sample.<id>.<tool>.json` file in that sample folder MUST reference the palette when the palette exists.
31+
32+
Use this field:
33+
34+
```json
35+
{
36+
"palette": "./sample.palette.json"
37+
}
38+
```
39+
40+
## Payload Shape
41+
42+
Sample tool payload files may contain:
43+
44+
```json
45+
{
46+
"$schema": "../../../tools/schemas/tools/<tool>.schema.json",
47+
"tool": "<tool>",
48+
"version": 1,
49+
"palette": "./sample.palette.json",
50+
"config": {}
51+
}
52+
```
53+
54+
## Rules
55+
- One palette per sample folder.
56+
- Palette file name must be exactly `sample.palette.json`.
57+
- Palette must use `swatches`, not `entries`.
58+
- Each swatch must use a single-character `symbol`.
59+
- Each swatch must use uppercase `hex`.
60+
- If `sample.palette.json` exists, every tool payload file in that folder must reference it.
61+
- If no colors exist in the sample, do not create a palette.
62+
63+
## Forbidden
64+
- Do not embed palette swatches inside tool payload files.
65+
- Do not create multiple palette files in one sample folder.
66+
- Do not use `entries`.
67+
- Do not use multi-character symbols like `s001`.
68+
- Do not add validators.
69+
- Do not modify runtime logic.
70+
- Do not modify `start_of_day`.
71+
72+
## Acceptance
73+
- Every colored sample has exactly one `sample.palette.json`.
74+
- Every sample folder with `sample.palette.json` has all `sample.<id>.<tool>.json` files referencing `./sample.palette.json`.
75+
- No sample folder has duplicate palette files.
76+
- Palette schema remains `swatches` + single-character `symbol`.
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Sample Palette Linkage Rules
2+
3+
## Palette File
4+
Use:
5+
6+
`sample.palette.json`
7+
8+
## Tool Payload Reference
9+
Every tool payload file in the same folder must include:
10+
11+
```json
12+
"palette": "./sample.palette.json"
13+
```
14+
15+
when the palette file exists.
16+
17+
## No Palette Case
18+
If the sample has no color data:
19+
- no `sample.palette.json`
20+
- no `palette` field required
21+
22+
## Audit Rules
23+
For each sample folder:
24+
1. Check for `sample.palette.json`.
25+
2. If present, check every `sample.<id>.<tool>.json`.
26+
3. Each tool payload must include `palette: "./sample.palette.json"`.
27+
4. Ensure there are no other palette files in the folder.

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

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

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

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

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

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

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

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

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

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

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

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

0 commit comments

Comments
 (0)