Skip to content

Commit 08db12b

Browse files
author
DavidQ
committed
Enforce tool payload schema boundaries and route exact child JSON inputs - PR 11.122-123-124
1 parent 0b2f3c0 commit 08db12b

26 files changed

Lines changed: 925 additions & 212 deletions

docs/dev/codex_commands.md

Lines changed: 17 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -1,70 +1,27 @@
11
# CODEX COMMANDS
22

33
Model: GPT-5.3-codex
4-
Reasoning: medium
4+
Reasoning: high
55

6-
## PR
7-
BUILD_PR_LEVEL_11_121_VALIDATE_SSOT_TOOL_RELATIONSHIPS_LOAD_DIRECT_JSON
6+
## EXECUTION MODE: FORCE WRITE
87

9-
## Execute
8+
1. Open:
9+
workspace.manifest.schema.json
10+
palette-browser.schema.json
1011

11-
1. Continue from PR 11.120 where hub counts match.
12+
2. MODIFY FILES DIRECTLY:
13+
- remove palette payload from workspace schema
14+
- simplify palette schema to payload-only
1215

13-
2. Use only this SSoT:
14-
- samples/metadata/samples.index.metadata.json
16+
3. SAVE FILES
1517

16-
3. For every sample/tool relationship in the SSoT:
17-
- identify sample id
18-
- identify tool id
19-
- identify explicit JSON input path
20-
- identify schema path
21-
- verify JSON exists
22-
- verify JSON parses
23-
- verify JSON validates against schema
24-
- verify tool loading path uses JSON directly without fallback/default/preset
18+
4. VERIFY:
19+
- re-open files
20+
- confirm changes exist
2521

26-
4. Fix deterministic issues:
27-
- path typo/casing
28-
- stale schema filename
29-
- stale canonical tool name
30-
- extra invalid fields
31-
- compact primitive-array formatting
32-
- obvious property-name mismatch
22+
5. OUTPUT:
23+
- list of files changed
24+
- before/after diff
3325

34-
5. Remove relationship from SSoT when:
35-
- JSON input missing
36-
- real required data missing
37-
- tool needs defaults to render
38-
- relationship is unrelated to sample
39-
- intent is ambiguous
40-
41-
6. Do not:
42-
- add fake data
43-
- add fallback/default/preset data
44-
- normalize/transform/convert runtime data
45-
- reintroduce duplicate relationship sources
46-
47-
7. Validate after changes:
48-
- changed JSON parses
49-
- SSoT metadata validates
50-
- sample hub count matches SSoT
51-
- tools hub count matches SSoT
52-
- known-bad links remain absent
53-
- no second active source exists
54-
55-
8. Write populated reports:
56-
- docs/dev/reports/ssot_relationship_load_validation_11_121.txt
57-
- docs/dev/reports/relationships_fixed_11_121.txt
58-
- docs/dev/reports/relationships_removed_11_121.txt
59-
- docs/dev/reports/relationships_working_11_121.txt
60-
- docs/dev/reports/validation_after_11_121.txt
61-
62-
9. Reports must include final count.
63-
64-
10. Roadmap:
65-
- status-only update if execution-backed
66-
- do not rewrite roadmap text
67-
- do not delete roadmap text
68-
69-
11. Package Codex output ZIP at:
70-
tmp/PR_11_121_VALIDATE_SSOT_TOOL_RELATIONSHIPS_LOAD_DIRECT_JSON.zip
26+
6. IF NO FILES CHANGED:
27+
FAIL EXECUTION

docs/dev/commit_comment.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
Validate SSoT sample tool relationships load direct JSON - PR 11.121
1+
Force actual schema file changes instead of no-op runs - PR 11.124

docs/dev/reports/file_diff_11_124.txt

Whitespace-only changes.

docs/dev/reports/forced_changes_11_124.txt

Whitespace-only changes.
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
PR 11.122 - Palette Schema Payload Only
2+
3+
PASS
4+
5+
Changed schema
6+
- tools/schemas/tools/palette-browser.schema.json
7+
8+
Direct palette JSON contract
9+
- schema: html-js-gaming.palette
10+
- version: integer >= 1
11+
- name: non-empty string
12+
- swatches: array of swatch objects
13+
- optional: $schema, id, source, sourceId, locked
14+
15+
Removed wrapper acceptance
16+
- oneOf removed.
17+
- $defs.toolPayload removed.
18+
- properties.tool removed.
19+
- properties.payload removed.
20+
- Wrapper object { tool, version, payload } no longer validates as Palette Browser input.
21+
22+
Validation evidence
23+
- node schema-only validation: samples/phase-02/0213/sample.0213.palette.json PASS valid.
24+
- node schema-only validation: wrapper { tool, version, payload } PASS invalid.
25+
- node schema-only validation: samples/phase-19/1902/sample.1902.workspace-all-tools.json PASS invalid against palette-browser schema.
26+
- node schema-only validation: games/Asteroids/game.manifest.json PASS invalid against palette-browser schema.
27+
- node inspection: palette wrapper schema fields remaining: none.
28+
29+
Search evidence
30+
- rg against tools/schemas/tools/palette-browser.schema.json found no oneOf, toolPayload, properties.tool, or properties.payload wrapper contract.
31+
- rg against samples/phase-19/1902/sample.1902.workspace-all-tools.json and palette schema found no palette-browser wrapper tool/payload entry for sample 1902.
32+
33+
Runtime loader change
34+
- tools/Palette Browser/main.js now imports the fetched raw preset as direct palette JSON instead of extracting rawPreset.payload.
35+
- logToolLoadLoaded remains the schema-only gate before Palette Browser imports the data.
36+
37+
Blockers
38+
- None.
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
PR 11.123 - Schema Separation Restore / Revert Review
2+
3+
PASS
4+
5+
Workspace manifest result
6+
- tools/schemas/workspace.manifest.schema.json already uses $ref for Palette Browser:
7+
tools.palette-browser -> ./tools/palette-browser.schema.json
8+
- No swatch, palette symbol, palette hex, palette name, sourceId, locked, or html-js-gaming.palette child details are in the workspace palette-browser node.
9+
- No code revert was required in workspace.manifest.schema.json.
10+
11+
Palette schema result
12+
- tools/schemas/tools/palette-browser.schema.json owns palette details.
13+
- It validates direct palette JSON only.
14+
- It contains the swatch schema and swatch fields.
15+
- It does not accept { tool, version, payload } wrappers.
16+
- It does not accept game, workspace, or sample parent JSON.
17+
18+
Separation decision
19+
- Parent schemas validate parent document structure.
20+
- Workspace manifest references tool schemas instead of duplicating tool internals.
21+
- Tool schemas validate their direct input documents.
22+
- Routing code is responsible for selecting/passing the correct child payload.
23+
24+
Files changed for PR 11.123
25+
- Report files only.
26+
- No implementation changes were needed beyond the already staged valid 11.122 separation work.
27+
28+
Blockers
29+
- None.
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
PR 11.123 - Staged Changes Review
2+
3+
PASS
4+
5+
Command run first
6+
- git diff --staged --stat
7+
- git diff --staged --name-only
8+
- git diff --staged -- schema/routing target files
9+
10+
Staged files inspected
11+
- docs/dev/codex_commands.md
12+
- docs/dev/commit_comment.txt
13+
- docs/dev/reports/palette_schema_payload_only_11_122.txt
14+
- docs/dev/reports/tool_schema_boundary_11_122.txt
15+
- docs/dev/reports/validation_after_11_122.txt
16+
- docs/dev/reports/workspace_tool_payload_routing_11_122.txt
17+
- docs/dev/restart_notes_11_122.md
18+
- docs/pr/BUILD_PR_LEVEL_11_122_TOOL_SCHEMA_BOUNDARY_AND_PAYLOAD_ROUTING.md
19+
- samples/phase-19/1902/sample.1902.workspace-all-tools.json
20+
- scripts/validate-json-contracts.mjs
21+
- tests/tools/ToolSchemaStrictModeValidation.test.mjs
22+
- tools/Palette Browser/main.js
23+
- tools/Workspace Manager/main.js
24+
- tools/schemas/tools/palette-browser.schema.json
25+
- tools/shared/platformShell.js
26+
27+
Schema/routing files staged
28+
- samples/phase-19/1902/sample.1902.workspace-all-tools.json
29+
- scripts/validate-json-contracts.mjs
30+
- tests/tools/ToolSchemaStrictModeValidation.test.mjs
31+
- tools/Palette Browser/main.js
32+
- tools/Workspace Manager/main.js
33+
- tools/schemas/tools/palette-browser.schema.json
34+
- tools/shared/platformShell.js
35+
36+
Workspace manifest staged status
37+
- tools/schemas/workspace.manifest.schema.json was not staged and had no content diff.
38+
- Verification showed tools.palette-browser is { "$ref": "./tools/palette-browser.schema.json" }.
39+
- No palette/swatch internals were present in workspace.manifest.schema.json.
40+
41+
Staged changes preserved
42+
- Palette Browser direct-palette schema change is valid separation of duties.
43+
- Sample 1902 direct tools.palette-browser palette payload is valid because workspace schema references the Palette Browser schema instead of inlining it.
44+
- Workspace Manager direct-palette classification is valid routing support for the referenced child payload.
45+
- platformShell direct-palette routing is valid pass-through support.
46+
- Validation helper updates are valid because they stop assuming every tool schema has a wrapper payload property.
47+
48+
Staged changes reverted
49+
- None. No staged schema/routing file was found to violate separation of duties.
50+
51+
Unrelated staged/modified work
52+
- docs/dev/codex_commands.md and docs/dev/commit_comment.txt were inspected by filename/status only and left untouched.
53+
54+
Blockers
55+
- None.
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
PR 11.122 - Tool Schema Boundary
2+
3+
PASS
4+
5+
Purpose
6+
- Correct the boundary so child tool schemas do not validate parent game/workspace/sample documents.
7+
- Palette Browser is now schema-bound to direct palette JSON only.
8+
9+
Files searched / reviewed
10+
- docs/pr/BUILD_PR_LEVEL_11_122_TOOL_SCHEMA_BOUNDARY_AND_PAYLOAD_ROUTING.md
11+
- tools/schemas/tools/*.schema.json
12+
- tools/schemas/tools/palette-browser.schema.json
13+
- tools/schemas/workspace.manifest.schema.json
14+
- tools/shared/platformShell.js
15+
- tools/Workspace Manager/main.js
16+
- tools/Palette Browser/main.js
17+
- samples/phase-19/1902/sample.1902.workspace-all-tools.json
18+
- samples/metadata/samples.index.metadata.json
19+
20+
Tool schemas reviewed
21+
- 3d-asset-viewer.schema.json
22+
- 3d-camera-path-editor.schema.json
23+
- 3d-json-payload.schema.json
24+
- asset-browser.schema.json
25+
- asset-pipeline.schema.json
26+
- palette-browser.schema.json
27+
- parallax-editor.schema.json
28+
- performance-profiler.schema.json
29+
- physics-sandbox.schema.json
30+
- replay-visualizer.schema.json
31+
- skin-editor.schema.json
32+
- sprite-editor.schema.json
33+
- state-inspector.schema.json
34+
- svg-asset-studio.schema.json
35+
- tile-map-editor.schema.json
36+
- tile-model-converter.schema.json
37+
- vector-map-editor.schema.json
38+
39+
Schemas changed
40+
- tools/schemas/tools/palette-browser.schema.json
41+
42+
Schema decision
43+
- Removed Palette Browser wrapper acceptance from the child tool schema.
44+
- Removed oneOf wrapper mode.
45+
- Removed $defs.toolPayload.
46+
- Removed top-level tool.
47+
- Removed wrapper payload.
48+
- Kept direct palette fields only: $schema, schema, version, id, name, source, sourceId, locked, swatches.
49+
50+
Other tool schema review result
51+
- The remaining tool schemas were reviewed for parent game/workspace/sample document acceptance.
52+
- No other tool schema was changed in this PR.
53+
- Existing tool schemas that use tool/version/payload are the current direct tool JSON contracts for those tools; they do not accept game/workspace/sample parent documents.
54+
- Broadly converting every tool contract from tool/version/payload into inner payload-only shape was intentionally not done because PR 11.122 specifically identified Palette Browser's dual wrapper/direct acceptance as the boundary violation.
55+
56+
Files changed
57+
- samples/phase-19/1902/sample.1902.workspace-all-tools.json
58+
- scripts/validate-json-contracts.mjs
59+
- tests/tools/ToolSchemaStrictModeValidation.test.mjs
60+
- tools/Palette Browser/main.js
61+
- tools/Workspace Manager/main.js
62+
- tools/schemas/tools/palette-browser.schema.json
63+
- tools/shared/platformShell.js
64+
65+
Blockers
66+
- None.
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
PR 11.123 - Tool Schema Payload Review
2+
3+
PASS
4+
5+
Scope reviewed
6+
- tools/schemas/tools/*.schema.json
7+
8+
Review criteria
9+
- Root schema is an object.
10+
- Root schema has additionalProperties: false.
11+
- Schema does not include parent workspace-manifest, game.manifest, samples.index.metadata, or sample metadata terms.
12+
- Palette Browser schema owns palette details directly and rejects wrappers.
13+
14+
Per-schema result
15+
- 3d-asset-viewer.schema.json: PASS
16+
- 3d-camera-path-editor.schema.json: PASS
17+
- 3d-json-payload.schema.json: PASS
18+
- asset-browser.schema.json: PASS
19+
- asset-pipeline.schema.json: PASS
20+
- palette-browser.schema.json: PASS
21+
- parallax-editor.schema.json: PASS
22+
- performance-profiler.schema.json: PASS
23+
- physics-sandbox.schema.json: PASS
24+
- replay-visualizer.schema.json: PASS
25+
- skin-editor.schema.json: PASS
26+
- sprite-editor.schema.json: PASS
27+
- state-inspector.schema.json: PASS
28+
- svg-asset-studio.schema.json: PASS
29+
- tile-map-editor.schema.json: PASS
30+
- tile-model-converter.schema.json: PASS
31+
- vector-map-editor.schema.json: PASS
32+
33+
Notes
34+
- Many non-palette tool schemas currently use tool/version/payload as their direct tool JSON input shape. That is not a parent game/workspace/sample schema and was not changed in this PR.
35+
- No schema was found inlining another tool's payload details.
36+
- Workspace manifest keeps tool details behind $ref entries.
37+
38+
Blockers
39+
- None.
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
PR 11.122 - Validation After Changes
2+
3+
PASS
4+
5+
Commands run and results
6+
- node --check "tools/Palette Browser/main.js"
7+
Result: PASS
8+
- node --check "tools/Workspace Manager/main.js"
9+
Result: PASS
10+
- node --check tools/shared/platformShell.js
11+
Result: PASS
12+
- node --check scripts/validate-json-contracts.mjs
13+
Result: PASS
14+
- node --check tests/tools/ToolSchemaStrictModeValidation.test.mjs
15+
Result: PASS
16+
- JSON parse check for tools/schemas/tools/palette-browser.schema.json, tools/schemas/workspace.manifest.schema.json, samples/phase-19/1902/sample.1902.workspace-all-tools.json, samples/metadata/samples.index.metadata.json
17+
Result: PASS
18+
- Palette schema-only validation using tools/shared/schemaOnlyToolPresetValidation.js
19+
Result: direct palette PASS valid; wrapper PASS invalid; workspace manifest PASS invalid; Asteroids game manifest PASS invalid
20+
- node -e import('./tests/tools/ToolSchemaStrictModeValidation.test.mjs').then(m => m.run())
21+
Result: PASS
22+
- node -e import('./tests/tools/ToolWorkspaceSchemaManifestBoundaries.test.mjs').then(m => m.run())
23+
Result: PASS
24+
- node ./tests/runtime/LaunchSmokeAllEntries.test.mjs --samples --sample-range=1902-1902 --tools
25+
Result: PASS=19 FAIL=0 TOTAL=19
26+
- node metadata relationship count
27+
Result: samples.metadata roundtripToolPresets count 31; missing explicit fields 0
28+
- git diff --check
29+
Result: PASS
30+
31+
Required acceptance evidence
32+
- valid palette JSON passes palette schema: PASS
33+
- { tool, version, payload } wrapper fails palette schema: PASS
34+
- game/workspace JSON fails palette-browser schema: PASS
35+
- sample/tool relationships still point to explicit tool JSON: PASS, 31 relationships and 0 missing explicit fields
36+
- schema-only validation remains active: PASS, logToolLoadLoaded still calls enforceToolPresetSchemaOnlyContract
37+
- no fallback/default/preset data introduced: PASS, changes route existing explicit JSON only
38+
39+
Full samples smoke
40+
- Skipped by PR instruction because this is targeted schema boundary/routing cleanup and full samples smoke takes approximately 20 minutes.
41+
42+
Blockers
43+
- None.

0 commit comments

Comments
 (0)