Skip to content

Commit 97e101b

Browse files
author
DavidQ
committed
Enforce full strict schema mode across tool and workspace schemas - PR 11.18
1 parent 26a9a70 commit 97e101b

33 files changed

Lines changed: 1998 additions & 96 deletions

docs/dev/codex_commands.md

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,24 @@
11
# CODEX COMMANDS
22

33
model: gpt-5.3-codex
4-
reasoning: medium
4+
reasoning: high
55

6-
Apply PR_11_14_WORKSPACE_SCHEMA_PALETTE_TOOL_AND_1902_REBUILD.
6+
Apply PR_11_18_FULL_STRICT_SCHEMA_MODE.
77

88
Required:
9-
- Update `tools/schemas/workspace.manifest.schema.json` so Palette is a singular tool payload under `tools.palette`.
10-
- Remove top-level required `palettes` collection from the manifest schema unless migration compatibility is required and documented.
11-
- Rebuild only `samples/phase-19/1902/`.
12-
- Delete/remove `sample.1902.palette.json`.
13-
- Rebuild sample 1902 workspace payload so all tool data is under `tools`, including `tools.palette`.
14-
- Allow only one palette in the workspace manifest.
15-
- Ensure Workspace shows all valid tools, not only Palette.
16-
- Do not modify other samples.
9+
- Enforce `additionalProperties: false` on every object schema under `tools/schemas/**/*.json`.
10+
- No schema object may use `additionalProperties: true`.
11+
- No schema object may omit `additionalProperties`.
12+
- Explicitly define every allowed field instead of allowing loose payloads.
13+
- Complete missing/weak tool schemas rather than bypassing validation.
14+
- Workspace manifest must reference tool schemas via `$ref`.
15+
- Workspace `tools.palette` remains singular and required.
16+
- Workspace `tools.additionalProperties` must be false.
17+
- Validate all `$ref` targets resolve.
18+
- Add tests/checks that unknown fields fail validation.
19+
- Validate/rebuild only sample 1902 as needed.
20+
- Ensure sample 1902 Workspace shows all valid tools, not only Palette.
1721
- Do not add fallback/default/hidden data.
1822
- Do not modify start_of_day folders.
19-
- Add validation report at docs/dev/reports/PR_11_14_WORKSPACE_SCHEMA_PALETTE_TOOL_AND_1902_REBUILD_report.md.
20-
- Return ZIP artifact at tmp/PR_11_14_WORKSPACE_SCHEMA_PALETTE_TOOL_AND_1902_REBUILD_delta.zip.
23+
- Add validation report at docs/dev/reports/PR_11_18_FULL_STRICT_SCHEMA_MODE_report.md.
24+
- Return ZIP artifact at tmp/PR_11_18_FULL_STRICT_SCHEMA_MODE_delta.zip.

docs/dev/commit_comment.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
Make Workspace palette a singular tool payload and rebuild sample 1902 - PR 11.14
1+
Enforce full strict schema mode across tool and workspace schemas - PR 11.18
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
# PR_11_17_SCHEMA_SET_NORMALIZATION_AND_WORKSPACE_REF_ENFORCEMENT Report
2+
3+
## Result
4+
- PASS
5+
6+
## Summary
7+
- The requested schema contract state was already present in `HEAD`, so no schema/sample code edits were required for this PR purpose.
8+
- Execution-focused validation was run to prove the current repo state satisfies PR 11.17 requirements.
9+
10+
## Contract Verification
11+
12+
### Workspace Manifest Schema
13+
File:
14+
- `tools/schemas/workspace.manifest.schema.json`
15+
16+
Verified:
17+
- Top-level `palettes` is removed.
18+
- Top-level `tools` is required.
19+
- `tools.palette` is singular and required.
20+
- `tools.properties` explicitly lists all active workspace-supported registry ids.
21+
- `tools.additionalProperties` is `false`.
22+
- `$ref` entries are used for each declared tool/palette schema target.
23+
24+
### Canonical `$ref` Targets
25+
Verified resolvable and valid JSON:
26+
- `./tools/palette.schema.json`
27+
- `./tools/vector-map-editor.schema.json`
28+
- `./tools/vector-asset-studio.schema.json`
29+
- `./tools/tile-map-editor.schema.json`
30+
- `./tools/parallax-editor.schema.json`
31+
- `./tools/sprite-editor.schema.json`
32+
- `./tools/skin-editor.schema.json`
33+
- `./tools/asset-browser.schema.json`
34+
- `./tools/palette-browser.schema.json`
35+
- `./tools/state-inspector.schema.json`
36+
- `./tools/replay-visualizer.schema.json`
37+
- `./tools/performance-profiler.schema.json`
38+
- `./tools/physics-sandbox.schema.json`
39+
- `./tools/asset-pipeline-tool.schema.json`
40+
- `./tools/tile-model-converter.schema.json`
41+
- `./tools/3d-json-payload-normalizer.schema.json`
42+
- `./tools/3d-asset-viewer.schema.json`
43+
- `./tools/3d-camera-path-editor.schema.json`
44+
45+
## Sample 1902 Validation
46+
File:
47+
- `samples/phase-19/1902/sample.1902.workspace-all-tools.json`
48+
49+
Verified:
50+
- No top-level `palettes`.
51+
- Contains `tools.palette` singleton payload.
52+
- Uses canonical registry-id tool keys plus `palette`.
53+
- No `sample.1902.palette.json` file present.
54+
- No `sample.1902.palette.json` references in sample 1902 payload.
55+
56+
Validation script result:
57+
- `PR_11_17_schema_and_sample_validation PASS`
58+
- `tools_property_count 18`
59+
- `sample_1902_tool_keys vector-map-editor,vector-asset-studio,tile-map-editor,parallax-editor,sprite-editor,skin-editor,asset-browser,palette-browser,state-inspector,replay-visualizer,performance-profiler,physics-sandbox,asset-pipeline-tool,tile-model-converter,3d-json-payload-normalizer,3d-asset-viewer,3d-camera-path-editor,palette`
60+
61+
## Workspace Visibility Validation
62+
Command:
63+
- `npm run test:launch-smoke -- --tools`
64+
65+
Result:
66+
- `PASS=287 FAIL=0 TOTAL=287`
67+
- Includes `sample 1902` PASS and all active tool launches PASS.
68+
- Confirms workspace/tool launch path is not constrained to Palette only.
69+
70+
## Scope and Safety Confirmations
71+
- No changes to other sample folders.
72+
- No `start_of_day` folder changes.
73+
- No fallback/default/hidden data added.
74+
- No `sample.1902.palette.json` introduced.
75+
76+
## Files Changed for PR 11.17
77+
- `docs/dev/reports/PR_11_17_SCHEMA_SET_NORMALIZATION_AND_WORKSPACE_REF_ENFORCEMENT_report.md`
Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
# PR_11_18_FULL_STRICT_SCHEMA_MODE Report
2+
3+
## Result
4+
- PASS (required PR scope met)
5+
6+
## Schemas Changed
7+
- `tools/schemas/workspace.manifest.schema.json`
8+
- `tools/schemas/sample.tool-payload.schema.json`
9+
- `tools/schemas/tool.manifest.schema.json`
10+
- `tools/schemas/tools/3d-asset-viewer.schema.json`
11+
- `tools/schemas/tools/3d-camera-path-editor.schema.json`
12+
- `tools/schemas/tools/3d-json-payload-normalizer.schema.json`
13+
- `tools/schemas/tools/asset-browser.schema.json`
14+
- `tools/schemas/tools/asset-pipeline-tool.schema.json`
15+
- `tools/schemas/tools/palette-browser.schema.json`
16+
- `tools/schemas/tools/palette.schema.json`
17+
- `tools/schemas/tools/parallax-editor.schema.json`
18+
- `tools/schemas/tools/performance-profiler.schema.json`
19+
- `tools/schemas/tools/physics-sandbox.schema.json`
20+
- `tools/schemas/tools/replay-visualizer.schema.json`
21+
- `tools/schemas/tools/skin-editor.schema.json`
22+
- `tools/schemas/tools/sprite-editor.schema.json`
23+
- `tools/schemas/tools/state-inspector.schema.json`
24+
- `tools/schemas/tools/tile-map-editor.schema.json`
25+
- `tools/schemas/tools/tile-model-converter.schema.json`
26+
- `tools/schemas/tools/vector-asset-studio.schema.json`
27+
- `tools/schemas/tools/vector-map-editor.schema.json`
28+
29+
## Sample Updated (allowed scope)
30+
- `samples/phase-19/1902/sample.1902.workspace-all-tools.json`
31+
32+
## Tests/Checks Added
33+
- `tests/tools/ToolSchemaStrictModeValidation.test.mjs`
34+
- `tests/run-tests.mjs` (wired new strict schema validation test)
35+
36+
## Strictness Conversion Counts
37+
- `additionalProperties: true -> false`: 20 object schemas
38+
- missing `additionalProperties` fixed: 22 object schemas
39+
- post-change strictness audit: 0 missing, 0 true
40+
41+
## Fields Explicitly Added
42+
- Workspace manifest top-level explicit fields: `$schema`, `documentKind`, `schema`, `version`, `id`, `name`, `tools`
43+
- Workspace `tools` explicit allowed ids with `additionalProperties: false` and required singular `palette`
44+
- Per-tool strict root fields: `tool`, `version`, `config` (+ explicit tool extras only where required: `sprite-editor.assetRegistry`, `skin-editor.gameId`, `skin-editor.skin`)
45+
- Per-tool strict `config` allowed keys explicitly declared per tool id
46+
- `sample.tool-payload` and `tool.manifest` converted to strict object contracts with explicit fields and strict nested object handling
47+
48+
## Validation Evidence
49+
50+
### 1) Syntax checks
51+
Command:
52+
- `node --check tests/tools/ToolSchemaStrictModeValidation.test.mjs`
53+
- `node --check tests/run-tests.mjs`
54+
55+
Result:
56+
- PASS
57+
58+
### 2) Strict schema + `$ref` + unknown field rejection + sample 1902 conformance
59+
Command:
60+
- `node -e "import { run } from './tests/tools/ToolSchemaStrictModeValidation.test.mjs'; await run(); console.log('PASS ToolSchemaStrictModeValidation');"`
61+
62+
Result:
63+
- PASS
64+
- Includes proof of:
65+
- all schema objects strict (`additionalProperties: false`)
66+
- all `$ref` targets resolve
67+
- unknown field injection rejected (`asset-browser.config.__unknown`)
68+
- sample 1902 manifest validates against strict workspace/tool schema shape
69+
- sample 1902 includes all intended workspace tools
70+
- no `sample.1902.palette.json` sidecar
71+
72+
### 3) Workspace/tool launch validation
73+
Command:
74+
- `npm run test:launch-smoke -- --tools`
75+
76+
Result:
77+
- PASS (`PASS=287 FAIL=0 TOTAL=287`)
78+
- Includes `sample 1902` PASS and all tool entries PASS
79+
80+
### 4) Additional check executed (not required by PR but recorded)
81+
Command:
82+
- `npm run test:sample-standalone:data-flow`
83+
84+
Result:
85+
- FAIL (existing contract mismatch for sample 1902 being a workspace manifest, not standalone sample wrapper)
86+
- Failure details:
87+
- `tool field must match filename tool id (workspace-all-tools)`
88+
- `version must be a non-empty string`
89+
- `payload container must exist (config, payload, or toolState)`
90+
- `wrapper fields not allowed (documentKind, id)`
91+
92+
## Workspace 1902 Tool List Validation
93+
- Verified present under `tools`:
94+
- `vector-map-editor`
95+
- `vector-asset-studio`
96+
- `tile-map-editor`
97+
- `parallax-editor`
98+
- `sprite-editor`
99+
- `skin-editor`
100+
- `asset-browser`
101+
- `palette-browser`
102+
- `state-inspector`
103+
- `replay-visualizer`
104+
- `performance-profiler`
105+
- `physics-sandbox`
106+
- `asset-pipeline-tool`
107+
- `tile-model-converter`
108+
- `3d-json-payload-normalizer`
109+
- `3d-asset-viewer`
110+
- `3d-camera-path-editor`
111+
- `palette`
112+
113+
## start_of_day Confirmation
114+
- No `start_of_day` folders modified.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# REPORT_PR_11_18_FULL_STRICT_SCHEMA_MODE
2+
3+
## Summary
4+
This PR locks schemas into strict mode to stop malformed tool/workspace JSON from passing validation.
5+
6+
## Target
7+
- `additionalProperties: false` everywhere.
8+
- Unknown fields fail.
9+
- Tool schemas become complete.
10+
- Workspace 1902 validates and shows all intended tools.

docs/dev/reports/launch_smoke_report.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Launch Smoke Report
22

3-
Generated: 2026-04-29T01:57:36.705Z
3+
Generated: 2026-04-29T02:30:38.214Z
44

55
Filters: games=true, samples=true, tools=true, sampleRange=all
66

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
# BUILD_PR_11_18_FULL_STRICT_SCHEMA_MODE
2+
3+
## Required Codex Work
4+
5+
### 1. Enforce strict mode globally
6+
Scan all JSON schemas under:
7+
`tools/schemas/`
8+
9+
For every schema object with `"type": "object"`:
10+
- add `"additionalProperties": false` if missing
11+
- change `"additionalProperties": true` to false
12+
- explicitly list every allowed property under `properties`
13+
14+
### 2. Complete incomplete schemas
15+
Do not hide unknown fields by leaving schemas loose.
16+
If existing payloads need fields:
17+
- add those fields explicitly
18+
- define type and required behavior
19+
- add nested object schemas with `additionalProperties: false`
20+
21+
### 3. Workspace schema rules
22+
Workspace must be strict:
23+
- no top-level extra properties
24+
- `tools.additionalProperties: false`
25+
- `tools.palette` required and singular
26+
- tool payloads referenced via `$ref`
27+
- all supported tool keys explicitly listed
28+
29+
### 4. Tool schema rules
30+
Each tool schema must be strict:
31+
- root object additionalProperties false
32+
- nested objects additionalProperties false
33+
- arrays must define item schemas
34+
- metadata/config/style/editorOptions must be explicit objects, not loose catchalls
35+
36+
### 5. Validation
37+
Add/run validation that proves:
38+
- all schemas parse
39+
- all `$ref` targets resolve
40+
- no schema object has missing additionalProperties
41+
- no schema has additionalProperties true
42+
- unknown field injection fails
43+
- sample 1902 validates
44+
- sample 1902 Workspace shows all intended tools
45+
46+
### 6. Validation report
47+
Create:
48+
docs/dev/reports/PR_11_18_FULL_STRICT_SCHEMA_MODE_report.md
49+
50+
Report must include:
51+
- schemas changed
52+
- count of `additionalProperties` changed from true to false
53+
- count of object schemas fixed where property was missing
54+
- fields explicitly added
55+
- unknown-field rejection test result
56+
- sample 1902 validation result
57+
- Workspace 1902 tool list validation
58+
- confirmation no start_of_day changes
59+
60+
## Constraints
61+
- One PR purpose only: strict schema mode.
62+
- No broad UI changes.
63+
- No fallback/default/hidden data.
64+
- No loosening schemas to make validation pass.
65+
- Do not modify unrelated samples.
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# PLAN_PR_11_18_FULL_STRICT_SCHEMA_MODE
2+
3+
## Purpose
4+
Force strict JSON Schema validation across the full tool/workspace schema set until every tool has a good, complete schema.
5+
6+
## Problem
7+
Loose schemas are allowing malformed JSON payloads to pass. This is creating repeated tool/workspace failures, copied garbage JSON, unsupported fields, and payloads that do not match the intended data contracts.
8+
9+
## Decision
10+
For this stabilization phase:
11+
- `additionalProperties` must be `false` on all object schemas.
12+
- Every allowed field must be explicitly declared.
13+
- Unknown fields must fail validation.
14+
- Missing schemas must be created instead of bypassed.
15+
- Later, after all tools are working, selected internals may be relaxed intentionally.
16+
17+
## Scope
18+
- All schemas under `tools/schemas/`
19+
- Workspace schema
20+
- Workspace manifest schema
21+
- All tool schemas
22+
- Sample 1902 only for validation/rebuild if needed
23+
- No other sample changes unless required to fix schema validation for an already-invalid schema fixture
24+
- Do not modify start_of_day folders
25+
26+
## Acceptance
27+
- Every object schema in `tools/schemas/**/*.json` has `additionalProperties: false`
28+
- No schema uses `additionalProperties: true`
29+
- No object schema omits `additionalProperties`
30+
- Workspace manifest references tool schemas via `$ref`
31+
- Unknown fields fail validation
32+
- Sample 1902 validates against strict schemas
33+
- Workspace 1902 shows all valid tools, not only Palette

samples/phase-19/1902/sample.1902.workspace-all-tools.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{
2+
"$schema": "../../../tools/schemas/workspace.manifest.schema.json",
23
"documentKind": "workspace-manifest",
34
"schema": "html-js-gaming.project",
45
"version": 1,

tests/run-tests.mjs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ import { run as runAssetRemediationSystem } from './tools/AssetRemediationSystem
9797
import { run as runToolBoundaryEnforcement } from './tools/ToolBoundaryEnforcement.test.mjs';
9898
import { run as runProjectToolDataContracts } from './tools/ProjectToolDataContracts.test.mjs';
9999
import { run as runToolWorkspaceSchemaManifestBoundaries } from './tools/ToolWorkspaceSchemaManifestBoundaries.test.mjs';
100+
import { run as runToolSchemaStrictModeValidation } from './tools/ToolSchemaStrictModeValidation.test.mjs';
100101
import { run as runAssetPipelineTooling } from './tools/AssetPipelineTooling.test.mjs';
101102
import { run as runAssetOwnershipStrategyCloseout } from './tools/AssetOwnershipStrategyCloseout.test.mjs';
102103
import { run as runAssetErrorHandlingStandard } from './tools/AssetErrorHandlingStandard.test.mjs';
@@ -237,6 +238,7 @@ const tests = [
237238
['ToolBoundaryEnforcement', runToolBoundaryEnforcement],
238239
['ProjectToolDataContracts', runProjectToolDataContracts],
239240
['ToolWorkspaceSchemaManifestBoundaries', runToolWorkspaceSchemaManifestBoundaries],
241+
['ToolSchemaStrictModeValidation', runToolSchemaStrictModeValidation],
240242
['AssetPipelineTooling', runAssetPipelineTooling],
241243
['AssetOwnershipStrategyCloseout', runAssetOwnershipStrategyCloseout],
242244
['AssetErrorHandlingStandard', runAssetErrorHandlingStandard],

0 commit comments

Comments
 (0)