|
| 1 | +# PLAN_PR - PR_26124_074-sample-palette-json-audit-and-fix |
| 2 | + |
| 3 | +## Goal |
| 4 | +Audit sample palette JSON files and fix schema violations against the current palette browser swatch contract. |
| 5 | + |
| 6 | +## Scope |
| 7 | +- `samples/**/*.palette.json` |
| 8 | +- Required PR workflow docs and review artifacts. |
| 9 | + |
| 10 | +## Pattern Note |
| 11 | +The requested literal pattern `samples/**/palette.*.*.json` does not match files in this repository. The sample palette files are named `sample.<id>.palette.json`, so this PR audits and fixes only `samples/**/*.palette.json`. |
| 12 | + |
| 13 | +## Boundaries |
| 14 | +- Do not modify tools. |
| 15 | +- Do not modify workspace/toolState/session behavior. |
| 16 | +- Do not modify sample launch code. |
| 17 | +- Do not add fallback/default data. |
| 18 | +- Do not add dependencies. |
| 19 | +- Do not run the full samples smoke test. |
| 20 | +- Avoid broad refactor outside sample palette JSON. |
| 21 | + |
| 22 | +## Implementation Plan |
| 23 | +1. Enumerate all `samples/**/*.palette.json` files. |
| 24 | +2. Parse each JSON file. |
| 25 | +3. Validate top-level palette document shape using the existing `tools/schemas/tools/palette-browser.schema.json` contract. |
| 26 | +4. For each swatch, keep only valid contract properties: |
| 27 | + - required `symbol`, `hex`, `name`; |
| 28 | + - optional `tags`. |
| 29 | +5. Normalize swatch tags to lowercase non-empty strings. |
| 30 | +6. Remove invalid/extra swatch properties. |
| 31 | +7. Detect duplicate swatches by `name`, `hex`, and `symbol` within each palette and preserve the first occurrence. |
| 32 | +8. Preserve intended palette content while making only schema corrections. |
| 33 | + |
| 34 | +## Playwright |
| 35 | +- Default requested gate: `npm run test:workspace-v2`. |
| 36 | +- Expected pass behavior: Workspace V2 validation runs successfully if the script exists. |
| 37 | +- Expected fail behavior: the command reports that the script is unavailable if `package.json` does not define it. |
| 38 | +- No targeted Playwright impact is expected because this PR changes sample palette JSON data only. |
| 39 | + |
| 40 | +## Manual Validation |
| 41 | +1. Open each changed `sample.<id>.palette.json` file. |
| 42 | +2. Confirm the file is valid JSON. |
| 43 | +3. Confirm each swatch has `symbol`, `hex`, and `name`. |
| 44 | +4. Confirm optional tags are lowercase arrays of strings. |
| 45 | +5. Confirm no sample launch code was modified. |
| 46 | +6. Full samples smoke test remains out of scope by instruction. |
0 commit comments