|
| 1 | +# PR_11_19_SCHEMA_CLEANUP_TOOL_PAYLOADS_AND_PALETTE_CANONICALIZATION Report |
| 2 | + |
| 3 | +## Result |
| 4 | +- PASS |
| 5 | + |
| 6 | +## Palette Schema Canonicalization |
| 7 | + |
| 8 | +### Palette schema files found (pre-change) |
| 9 | +- `tools/schemas/palette.schema.json` |
| 10 | +- `tools/schemas/tools/palette.schema.json` |
| 11 | +- `tools/schemas/tools/palette-browser.schema.json` |
| 12 | + |
| 13 | +### Palette schema files deleted |
| 14 | +- `tools/schemas/palette.schema.json` |
| 15 | +- `tools/schemas/tools/palette.schema.json` |
| 16 | + |
| 17 | +### Final canonical palette schema path |
| 18 | +- `tools/schemas/tools/palette-browser.schema.json` |
| 19 | + |
| 20 | +### Canonical palette schema contract |
| 21 | +- strict root with `additionalProperties: false` |
| 22 | +- required: `tool`, `version`, `payload` |
| 23 | +- `tool` const: `palette-browser` |
| 24 | +- `payload` strict object with required `schema`, `version`, `name`, `swatches` |
| 25 | +- `swatches[].symbol|hex|name` explicit and strict |
| 26 | +- no object schema uses `additionalProperties: true` |
| 27 | + |
| 28 | +## Tool Payload Schema Cleanup |
| 29 | + |
| 30 | +### `sample.tool-payload.schema.json` handling |
| 31 | +- Kept file path but demoted/narrowed its role to **sample wrapper only**. |
| 32 | +- Added explicit description that runtime tool payloads must validate against `tools/schemas/tools/*.schema.json`. |
| 33 | +- Added strict guard (`not` requiring `tool` + `payload`) so it cannot be used as tool payload schema. |
| 34 | +- Kept strict mode (`additionalProperties: false`) while allowing sample wrapper document keys via `patternProperties` + strict JSON value defs. |
| 35 | + |
| 36 | +### `config` replacement choice |
| 37 | +- Chosen field: `payload` |
| 38 | +- Applied consistently across tool schemas and sample 1902 tool entries. |
| 39 | + |
| 40 | +### generic `gameId` replacement choice |
| 41 | +- Chosen generic field: `projectId` |
| 42 | +- Replaced generic schema-level usage in `tools/schemas/tools/skin-editor.schema.json` (root field now `projectId`). |
| 43 | +- Updated sample 1902 generic payload usage: |
| 44 | + - `tools.skin-editor.projectId` |
| 45 | + - `tools.asset-pipeline-tool.payload.pipelinePayload.projectId` |
| 46 | +- Kept game-specific `gameId` only inside game-specific skin document section (`games.pong.skin/1`) in sample 1902. |
| 47 | + |
| 48 | +## Workspace `$ref` Integration |
| 49 | +- Updated workspace manifest palette ref: |
| 50 | + - `tools/schemas/workspace.manifest.schema.json` |
| 51 | + - `tools.properties.palette -> $ref: ./tools/palette-browser.schema.json` |
| 52 | +- `tools.additionalProperties` remains `false`. |
| 53 | +- tool refs remain explicit by tool id. |
| 54 | + |
| 55 | +## Schemas Updated |
| 56 | +- `tools/schemas/workspace.manifest.schema.json` |
| 57 | +- `tools/schemas/sample.tool-payload.schema.json` |
| 58 | +- `tools/schemas/tools/3d-asset-viewer.schema.json` |
| 59 | +- `tools/schemas/tools/3d-camera-path-editor.schema.json` |
| 60 | +- `tools/schemas/tools/3d-json-payload-normalizer.schema.json` |
| 61 | +- `tools/schemas/tools/asset-browser.schema.json` |
| 62 | +- `tools/schemas/tools/asset-pipeline-tool.schema.json` |
| 63 | +- `tools/schemas/tools/palette-browser.schema.json` |
| 64 | +- `tools/schemas/tools/parallax-editor.schema.json` |
| 65 | +- `tools/schemas/tools/performance-profiler.schema.json` |
| 66 | +- `tools/schemas/tools/physics-sandbox.schema.json` |
| 67 | +- `tools/schemas/tools/replay-visualizer.schema.json` |
| 68 | +- `tools/schemas/tools/skin-editor.schema.json` |
| 69 | +- `tools/schemas/tools/sprite-editor.schema.json` |
| 70 | +- `tools/schemas/tools/state-inspector.schema.json` |
| 71 | +- `tools/schemas/tools/tile-map-editor.schema.json` |
| 72 | +- `tools/schemas/tools/tile-model-converter.schema.json` |
| 73 | +- `tools/schemas/tools/vector-asset-studio.schema.json` |
| 74 | +- `tools/schemas/tools/vector-map-editor.schema.json` |
| 75 | + |
| 76 | +## Sample 1902 Validation/Rebuild |
| 77 | +- Updated only: |
| 78 | + - `samples/phase-19/1902/sample.1902.workspace-all-tools.json` |
| 79 | +- Changes include: |
| 80 | + - tool entry `config` -> `payload` |
| 81 | + - `tools.palette` migrated to canonical palette-browser payload shape |
| 82 | + - `tools.palette-browser` given explicit strict payload |
| 83 | + - generic `projectId` replacements |
| 84 | + - removed nested tile payload `$schema` reference to `sample.tool-payload.schema.json` |
| 85 | + |
| 86 | +## Unknown Field Rejection Result |
| 87 | +- Test injects `root.tools.asset-browser.payload.__unknown = true`. |
| 88 | +- Validation rejects injection (PASS). |
| 89 | + |
| 90 | +## Validation Commands and Results |
| 91 | +- `node --check tests/tools/ToolSchemaStrictModeValidation.test.mjs` -> PASS |
| 92 | +- `node --check tests/tools/ToolWorkspaceSchemaManifestBoundaries.test.mjs` -> PASS |
| 93 | +- strict object audit across `tools/schemas/**/*.json` -> PASS (`issues: 0`) |
| 94 | +- `node -e "import { run } from './tests/tools/ToolSchemaStrictModeValidation.test.mjs'; await run();"` -> PASS |
| 95 | +- `npm run test:launch-smoke -- --tools` -> PASS (`PASS=287 FAIL=0 TOTAL=287`, includes sample `1902` PASS) |
| 96 | + |
| 97 | +## Scope Confirmations |
| 98 | +- No samples changed outside `samples/phase-19/1902/`. |
| 99 | +- No `start_of_day` folders modified. |
| 100 | +- No fallback/default/hidden data added. |
0 commit comments