|
| 1 | +# BUILD_PR_LEVEL_10_1A_PALETTE_STANDALONE_SINGLETON_CORRECTION |
| 2 | + |
| 3 | +## Objective |
| 4 | +Fix the palette model. |
| 5 | + |
| 6 | +## Wrong Current Shape |
| 7 | + |
| 8 | +```json |
| 9 | +{ |
| 10 | + "tools": { |
| 11 | + "primitive-skin-editor": { |
| 12 | + "palettes": { |
| 13 | + "palette.gravitywell.classic": { |
| 14 | + "schema": "html-js-gaming.palette", |
| 15 | + "swatches": [] |
| 16 | + } |
| 17 | + } |
| 18 | + } |
| 19 | + } |
| 20 | +} |
| 21 | +``` |
| 22 | + |
| 23 | +## Correct Shape |
| 24 | + |
| 25 | +```json |
| 26 | +{ |
| 27 | + "palette": { |
| 28 | + "schema": "html-js-gaming.palette", |
| 29 | + "version": 1, |
| 30 | + "name": "Gravity Well Palette", |
| 31 | + "source": "manifest-and-runtime-color-scan", |
| 32 | + "swatches": [] |
| 33 | + }, |
| 34 | + "tools": { |
| 35 | + "primitive-skin-editor": { |
| 36 | + "skins": [] |
| 37 | + } |
| 38 | + } |
| 39 | +} |
| 40 | +``` |
| 41 | + |
| 42 | +## Rules |
| 43 | + |
| 44 | +### Palette |
| 45 | +- Root-level `palette`. |
| 46 | +- Exactly one per game/workspace. |
| 47 | +- Actual JSON data, not a reference. |
| 48 | +- No `palettes` collection. |
| 49 | +- No tool-owned palette copies. |
| 50 | + |
| 51 | +### Primitive Skin Editor |
| 52 | +Primitive Skin Editor owns: |
| 53 | +- skins |
| 54 | +- HUD skins |
| 55 | +- primitive style groups |
| 56 | +- skin mappings |
| 57 | + |
| 58 | +Primitive Skin Editor does NOT own: |
| 59 | +- palette singleton |
| 60 | +- palette browser data |
| 61 | + |
| 62 | +### Palette Browser |
| 63 | +Palette Browser may open/read/edit the root `palette`, but does not own a duplicate copy. |
| 64 | + |
| 65 | +### Other Tools |
| 66 | +Sprite Editor, Vector Asset Studio, Tile Map Editor, Parallax Editor, etc. consume the same root `palette`. |
| 67 | + |
| 68 | +## Required Migration |
| 69 | +For every `games/*/game.manifest.json`: |
| 70 | + |
| 71 | +1. Find: |
| 72 | +```json |
| 73 | +tools["primitive-skin-editor"].palettes |
| 74 | +``` |
| 75 | + |
| 76 | +2. If exactly one palette exists: |
| 77 | +- move it to root `palette` |
| 78 | +- remove `tools["primitive-skin-editor"].palettes` |
| 79 | + |
| 80 | +3. If multiple palettes exist: |
| 81 | +- merge into one root `palette` |
| 82 | +- dedupe swatches by `hex` |
| 83 | +- preserve unique swatch symbols |
| 84 | +- if duplicate symbol conflict exists, reassign deterministic single-character symbols |
| 85 | +- record merge in report |
| 86 | + |
| 87 | +4. Normalize: |
| 88 | +- `#RRGGBBFF` -> `#RRGGBB` |
| 89 | +- uppercase hex |
| 90 | +- single-character symbol |
| 91 | + |
| 92 | +5. Ensure no: |
| 93 | +- root `palettes` |
| 94 | +- tool-owned `palettes` |
| 95 | +- duplicate palette objects |
| 96 | + |
| 97 | +## Required Report |
| 98 | +Create: |
| 99 | + |
| 100 | +```text |
| 101 | +docs/dev/reports/level_10_1a_palette_singleton_correction_report.md |
| 102 | +``` |
| 103 | + |
| 104 | +Report per game: |
| 105 | +- palette found under primitive-skin-editor |
| 106 | +- palettes moved |
| 107 | +- palettes merged |
| 108 | +- final swatch count |
| 109 | +- duplicate swatches removed |
| 110 | +- symbol conflicts fixed |
| 111 | + |
| 112 | +## Roadmap Movement |
| 113 | +Update roadmap status only: |
| 114 | +- Phase 10 palette singleton correction `[ ] -> [.]` or `[.] -> [x]` |
| 115 | + |
| 116 | +## Acceptance |
| 117 | +- Each game manifest has exactly one root `palette`. |
| 118 | +- No `tools.*.palettes` remain. |
| 119 | +- No root `palettes` collections remain. |
| 120 | +- Primitive Skin Editor has no palette ownership. |
| 121 | +- Palette Browser has no duplicate palette ownership. |
| 122 | +- No new palette JSON files. |
| 123 | +- No validators. |
| 124 | +- No `start_of_day` changes. |
0 commit comments