|
| 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. |
0 commit comments