Skip to content

Commit 6c7c4e0

Browse files
author
DavidQ
committed
Move test tool schemas to fixtures and remove inference input paths - PR 11.111
1 parent cecd599 commit 6c7c4e0

24 files changed

Lines changed: 410 additions & 411 deletions

File tree

docs/dev/codex_commands.md

Lines changed: 59 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -4,61 +4,73 @@ Model: GPT-5.3-codex
44
Reasoning: medium
55

66
## PR
7-
BUILD_PR_LEVEL_11_110_SCHEMA_ONLY_VALIDATION_SCREEN_ERRORS
7+
BUILD_PR_LEVEL_11_111_TEST_SCHEMA_RELOCATION_AND_INFER_PATH_REMOVAL
88

99
## Execute
1010

11-
1. Extend the PR 11.109 direct JSON contract:
12-
- JSON is loaded directly.
13-
- The only validation is schema validation.
14-
- Invalid data must show a visible screen error.
11+
1. Move test-only schema files out of runtime tool folders:
12+
- tools/palette-editor/tool.schema.json -> tests/fixtures/tool-schemas/palette-editor/tool.schema.json
13+
- tools/vector-asset-studio/tool.schema.json -> tests/fixtures/tool-schemas/vector-asset-studio/tool.schema.json
14+
- tools/vector-map-editor/tool.schema.json -> tests/fixtures/tool-schemas/vector-map-editor/tool.schema.json
1515

16-
2. Inspect tool input/loading paths only.
16+
2. Update any tests or scripts that referenced the old paths.
1717

18-
3. Remove or bypass custom validation outside schema validation, except:
18+
3. Do not leave duplicate runtime copies at:
19+
- tools/palette-editor/tool.schema.json
20+
- tools/vector-asset-studio/tool.schema.json
21+
- tools/vector-map-editor/tool.schema.json
22+
23+
4. Search focused tool input/loading/shared code for inference and compatibility helpers:
24+
- infer*
25+
- normalize*
26+
- transform*
27+
- convert*
28+
- coerce*
29+
- resolve*Legacy*
30+
- fallback*
31+
- default* when used as hidden input/data injection
32+
- alias/remap helpers
33+
34+
5. Remove the smallest safe set of shared inference/compatibility code that affects tool input/source/payload loading.
35+
36+
6. Keep only allowed pre-schema checks:
1937
- file exists
2038
- JSON parse
2139

22-
4. Ensure every schema validation failure renders a clear UI error.
23-
24-
5. Error must include when available:
25-
- tool id/name
26-
- JSON source path
27-
- schema path/name
28-
- failed field/path
29-
- validation summary
30-
31-
6. Do not:
32-
- normalize
33-
- transform
34-
- convert
35-
- repair
36-
- infer
37-
- inject defaults
38-
- fallback to sample/demo data
39-
- accept aliases
40-
- add custom validation rules outside schema
41-
42-
7. If a validation rule is needed, put it in schema, not runtime code.
43-
44-
8. Preserve compact primitive-array formatting.
45-
46-
9. Validate targeted cases:
47-
- valid JSON input renders
48-
- invalid schema JSON shows screen error
49-
- missing file shows screen error
50-
- malformed JSON shows screen error
51-
- invalid JSON does not fallback to defaults
52-
53-
10. Write reports:
54-
- docs/dev/reports/schema_only_validation_11_110.txt
55-
- docs/dev/reports/screen_error_contract_11_110.txt
56-
- docs/dev/reports/non_schema_validation_paths_11_110.txt
57-
58-
11. Roadmap:
59-
- status-only update if execution-backed
40+
7. Ensure all other input validation is schema-only.
41+
42+
8. Ensure failures render visible screen errors:
43+
- missing file
44+
- malformed JSON
45+
- schema mismatch
46+
47+
9. Preserve direct flow:
48+
explicit JSON file -> schema validation -> render as-is
49+
50+
10. Preserve canonical names:
51+
- palette-browser
52+
- 3d-json-payload
53+
- asset-pipeline
54+
55+
11. Preserve compact primitive-array formatting.
56+
57+
12. Validate targeted paths:
58+
- moved fixture files exist
59+
- old runtime tool.schema.json files are gone
60+
- changed test/script references work
61+
- changed JSON parses
62+
- changed manifests validate
63+
- no removed helper references remain
64+
65+
13. Write reports:
66+
- docs/dev/reports/tool_schema_fixture_relocation_11_111.txt
67+
- docs/dev/reports/inference_path_removal_11_111.txt
68+
- docs/dev/reports/schema_only_runtime_check_11_111.txt
69+
70+
14. Roadmap:
71+
- update status markers only if execution-backed
6072
- do not rewrite roadmap text
6173
- do not delete roadmap text
6274

63-
12. Package Codex output ZIP at:
64-
tmp/PR_11_110_SCHEMA_ONLY_VALIDATION_SCREEN_ERRORS.zip
75+
15. Package Codex output ZIP at:
76+
tmp/PR_11_111_TEST_SCHEMA_RELOCATION_AND_INFER_PATH_REMOVAL.zip

docs/dev/commit_comment.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
Enforce schema-only validation and visible tool input errors - PR 11.110
1+
Move test tool schemas to fixtures and remove inference input paths - PR 11.111
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
PR 11.111 - Inference Path Removal
2+
Date: 2026-04-30
3+
4+
Summary
5+
- Removed a focused set of tool-input compatibility/inference helpers.
6+
- Kept direct input flow: explicit JSON file -> schema validation -> render.
7+
- Did not add fallback/default/demo data.
8+
9+
Removed inference/compatibility helpers
10+
- tools/3D Asset Viewer/main.js
11+
- removed extractAssetPayloadFromPreset
12+
- tools/3D Camera Path Editor/main.js
13+
- removed extractCameraPathFromPreset
14+
- tools/3D JSON Payload/main.js
15+
- removed extractMapPayloadFromPreset
16+
- tools/Asset Pipeline/main.js
17+
- removed extractPipelinePayloadFromPreset
18+
- tools/Palette Browser/main.js
19+
- removed extractPaletteFromSamplePreset
20+
- tools/Performance Profiler/main.js
21+
- removed extractProfileSettingsFromPreset
22+
- tools/Physics Sandbox/main.js
23+
- removed extractPhysicsBodyFromPreset
24+
- tools/Replay Visualizer/main.js
25+
- removed extractReplayEventsFromSamplePreset
26+
- tools/State Inspector/main.js
27+
- removed extractSnapshotFromSamplePreset
28+
- tools/Tile Model Converter/main.js
29+
- removed extractConverterPayloadFromPreset
30+
- tools/Vector Map Editor/editor/VectorMapEditorApp.js
31+
- removed extractVectorMapDocumentFromSamplePreset
32+
33+
Shared compatibility cleanup
34+
- tools/shared/platformShell.js
35+
- readWorkspaceScopedToolDocument no longer falls back to root tool state for documentKey lookups.
36+
- readPaletteFromManifestPayload now accepts only canonical tools["palette-browser"].payload (legacy palette-browser.palette and root source.palette compatibility removed).
37+
- tools/shared/schemaOnlyToolPresetValidation.js
38+
- renamed inferFailedField -> readFailedField (no behavior widening).
39+
40+
Validation
41+
1) Removed helper names are not referenced
42+
- Command scanned tools/tests/src/samples/games for:
43+
extractAssetPayloadFromPreset
44+
extractCameraPathFromPreset
45+
extractMapPayloadFromPreset
46+
extractPipelinePayloadFromPreset
47+
extractPaletteFromSamplePreset
48+
extractProfileSettingsFromPreset
49+
extractPhysicsBodyFromPreset
50+
extractReplayEventsFromSamplePreset
51+
extractSnapshotFromSamplePreset
52+
extractConverterPayloadFromPreset
53+
extractVectorMapDocumentFromSamplePreset
54+
- Result: all REMOVED_OK (no matches).
55+
56+
2) Syntax checks for changed JS/MJS files
57+
- Command: node --check on each changed .js/.mjs file
58+
- Result: PASS for all changed JS/MJS files.
59+
60+
Remaining normalize/infer helpers and why they remain
61+
- normalize* helpers remain where they are input sanitation/formatting (e.g., text/path cleanup) or tool-internal operations (e.g., map/camera normalization actions initiated by user), not hidden compatibility payload inference.
62+
- inferAssetDisplayName and related display helpers in platformShell remain for UI labeling/status presentation only; they do not inject runtime payload data.
63+
- No removed helper references remain.
64+
65+
Canonical naming
66+
- No reintroduction of non-canonical tool ids for this change set.
67+
- Canonical ids in scope remain: palette-browser, 3d-json-payload, asset-pipeline.
68+
69+
Full suite note
70+
- Full samples smoke test skipped (targeted compatibility helper removal; no broad shared loader/framework rewrite).
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
PR 11.111 - Schema-Only Runtime Check
2+
Date: 2026-04-30
3+
4+
Scope
5+
- Verify this PR preserves schema-only tool input validation behavior while removing inference/compatibility paths.
6+
- Confirm allowed pre-schema checks remain limited to file existence + JSON parse in the current loading flow.
7+
8+
Direct-flow checks
9+
1) Schema contract enforcement remains centralized
10+
- tools/shared/toolLoadDiagnostics.js calls enforceToolPresetSchemaOnlyContract at load boundary.
11+
- tools/shared/schemaOnlyToolPresetValidation.js still emits explicit schema validation errors with:
12+
- tool id/name
13+
- source path
14+
- schema path
15+
- failed field/path
16+
- summary
17+
18+
Evidence (search)
19+
- tools/shared/toolLoadDiagnostics.js: import enforceToolPresetSchemaOnlyContract
20+
- tools/shared/toolLoadDiagnostics.js: logToolLoadLoaded -> await enforceToolPresetSchemaOnlyContract(...)
21+
- tools/shared/schemaOnlyToolPresetValidation.js: error format string begins with:
22+
Input validation failed. tool=...; source=...; schema=...; failed=...; summary=...
23+
24+
2) Compatibility fallback paths reduced
25+
- tools/shared/platformShell.js
26+
- readWorkspaceScopedToolDocument no longer reads root fallback document keys.
27+
- readPaletteFromManifestPayload now reads only tools["palette-browser"].payload for palette handoff.
28+
29+
3) Visible error behavior preserved
30+
- Changed tool loaders still report load failures to visible status text ("Preset load failed: ...") and do not restore default/demo payload injection paths removed in this PR.
31+
32+
Targeted validation performed
33+
- node --check on changed JS/MJS files: PASS
34+
- tool schema fixture relocation boundary test:
35+
PASS ToolWorkspaceSchemaManifestBoundaries
36+
- JSON parse check for moved fixture schemas: PASS
37+
- old runtime tool.schema.json paths removed: PASS
38+
- removed helper references absent: PASS
39+
40+
Changed test/script references
41+
- tests/tools/ToolWorkspaceSchemaManifestBoundaries.test.mjs updated to new fixture paths under tests/fixtures/tool-schemas.
42+
- Stale assertion updated to current Palette Browser implementation detail (palette.swatches).
43+
44+
Full samples smoke
45+
- Skipped intentionally.
46+
- Reason: targeted schema/input cleanup only; no broad sample loader/framework rewrite in this PR.
47+
48+
Conclusion
49+
- PR 11.111 maintains direct JSON -> schema validation -> render behavior.
50+
- Removed compatibility/inference helpers are no longer referenced.
51+
- Targeted runtime/schema checks pass.
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
PR 11.111 - Tool Schema Fixture Relocation
2+
Date: 2026-04-30
3+
4+
Summary
5+
- Relocated test-only tool schema fixtures out of runtime tool folders into tests/fixtures.
6+
- Updated targeted test path references.
7+
- Removed duplicate runtime copies.
8+
9+
Files moved
10+
- tools/palette-editor/tool.schema.json -> tests/fixtures/tool-schemas/palette-editor/tool.schema.json
11+
- tools/vector-asset-studio/tool.schema.json -> tests/fixtures/tool-schemas/vector-asset-studio/tool.schema.json
12+
- tools/vector-map-editor/tool.schema.json -> tests/fixtures/tool-schemas/vector-map-editor/tool.schema.json
13+
14+
References updated
15+
- tests/tools/ToolWorkspaceSchemaManifestBoundaries.test.mjs
16+
- toolSchemaFiles now points to:
17+
- tests/fixtures/tool-schemas/palette-editor/tool.schema.json
18+
- tests/fixtures/tool-schemas/vector-asset-studio/tool.schema.json
19+
- tests/fixtures/tool-schemas/vector-map-editor/tool.schema.json
20+
21+
Targeted validation
22+
1) Fixture files exist and parse
23+
- JSON_OK tests/fixtures/tool-schemas/palette-editor/tool.schema.json
24+
- JSON_OK tests/fixtures/tool-schemas/vector-asset-studio/tool.schema.json
25+
- JSON_OK tests/fixtures/tool-schemas/vector-map-editor/tool.schema.json
26+
27+
2) Old runtime copies removed
28+
- MISSING_OK tools/palette-editor/tool.schema.json
29+
- MISSING_OK tools/vector-asset-studio/tool.schema.json
30+
- MISSING_OK tools/vector-map-editor/tool.schema.json
31+
32+
3) Tests/scripts no longer reference old runtime paths
33+
- Command: rg -n "tools/(palette-editor|vector-asset-studio|vector-map-editor)/tool\.schema\.json" tests scripts
34+
- Result: no matches
35+
36+
4) Updated targeted boundary test passes
37+
- Command:
38+
node --input-type=module -e "import { run } from './tests/tools/ToolWorkspaceSchemaManifestBoundaries.test.mjs'; await run(); console.log('PASS ToolWorkspaceSchemaManifestBoundaries');"
39+
- Result: PASS ToolWorkspaceSchemaManifestBoundaries
40+
41+
Notes
42+
- One stale assertion in the same test was updated from palette.entries to palette.swatches to match current Palette Browser implementation.
43+
- Full samples smoke test skipped (targeted fixture/path relocation only; no broad loader/framework change).

docs/dev/restart_notes_11_111.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Restart Notes — PR 11.111
2+
3+
Stay on the current path:
4+
- direct JSON input
5+
- schema-only validation
6+
- visible errors for mismatch
7+
- no normalization
8+
- no transforming
9+
- no inferring
10+
- no fallback/default/preset data
11+
12+
This PR moves test-only `tool.schema.json` files out of runtime tool folders and removes more shared inference paths.

0 commit comments

Comments
 (0)