Skip to content

Commit 3caef93

Browse files
author
DavidQ
committed
Enforce auto-fix of deterministic JSON/schema issues - PR 11.114
1 parent a651b0f commit 3caef93

12 files changed

Lines changed: 262 additions & 166 deletions

docs/dev/codex_commands.md

Lines changed: 44 additions & 118 deletions
Original file line numberDiff line numberDiff line change
@@ -4,124 +4,50 @@ Model: GPT-5.3-codex
44
Reasoning: medium
55

66
## PR
7-
BUILD_PR_LEVEL_11_113_CODEX_REPAIR_OR_REPORT_ENFORCEMENT
7+
BUILD_PR_LEVEL_11_114_ENFORCE_JSON_FIX_ON_FAILURE
88

99
## Execute
1010

11-
This PR exists because the previous run applied no changes and left reports empty.
12-
13-
### Mandatory Rule
14-
15-
Do not finish with empty reports.
16-
17-
For every requested item, do one:
18-
1. Fix it.
19-
2. Prove no fix is needed with file/path evidence.
20-
3. Report a precise blocker with file/path/line evidence and the next required action.
21-
22-
### Repair Loop
23-
24-
For each issue:
25-
1. Search.
26-
2. Record search scope and pattern.
27-
3. If found, fix if in scope.
28-
4. Re-run targeted validation.
29-
5. If not fixed, report exact blocker.
30-
6. Repeat until fixed or explicitly blocked.
31-
32-
### Revisit all active cleanup requests
33-
34-
1. Direct JSON only:
35-
- no presets
36-
- no normalizers
37-
- no transformers
38-
- no converters
39-
- no default/demo/fallback data
40-
41-
2. Schema-only validation:
42-
- allowed pre-schema checks: file exists, JSON parse
43-
- all other validation belongs in schema
44-
- invalid input renders visible screen error
45-
46-
3. Move test-only schema files:
47-
- tools/palette-editor/tool.schema.json
48-
- tools/vector-asset-studio/tool.schema.json
49-
- tools/vector-map-editor/tool.schema.json
50-
into:
51-
- tests/fixtures/tool-schemas/<tool-id>/tool.schema.json
52-
Remove runtime duplicates.
53-
54-
4. Remove/report shared/tool input code:
55-
- infer*
56-
- normalize*
57-
- tryLoadPreset*
58-
- buildPreset*
59-
- input-mutation replace*
60-
- legacy remappers
61-
- alias acceptance
62-
- fallback/default data injection
63-
64-
5. Enforce canonical names:
65-
- palette-browser
66-
- 3d-json-payload
67-
- asset-pipeline
68-
69-
6. Remove stale names:
70-
- palette as a tool key/name
71-
- palette-editor
72-
- 3d-json-payload-normalizer
73-
- Asset Pipeline Tool
74-
- asset-pipeline-tool
75-
76-
7. Enforce sample/tool truthfulness:
77-
- if sample cannot load in aligned tool, remove the tool reference
78-
- do not add fake data
79-
80-
8. Restore compact primitive arrays:
81-
- primitive arrays must be compact grouped
82-
- do not expand simple arrays one value per line
83-
84-
### Validation
85-
86-
Run targeted validation and include command/result in reports:
87-
- changed JSON parses
88-
- changed manifests validate
89-
- helper references removed or justified
90-
- moved files exist
91-
- old files removed
92-
- invalid input shows visible screen error if affected path changed
93-
94-
### Reports
95-
96-
Write populated reports:
97-
- docs/dev/reports/repair_or_report_summary_11_113.txt
98-
- docs/dev/reports/json_schema_repair_loop_11_113.txt
99-
- docs/dev/reports/shared_code_cleanup_11_113.txt
100-
- docs/dev/reports/tool_binding_truthfulness_11_113.txt
101-
- docs/dev/reports/blockers_11_113.txt
102-
103-
Each report must include:
104-
- files searched
105-
- matches found
106-
- files changed
107-
- skipped items
108-
- exact reason skipped
109-
- validation command used
110-
- validation result
111-
- remaining blockers
112-
113-
If zero matches:
114-
- report the exact search pattern
115-
- report the scope searched
116-
- state that zero matches were found
117-
118-
### Roadmap
119-
120-
- status-only update if execution-backed
121-
- do not rewrite roadmap text
122-
- do not delete roadmap text
123-
124-
### Output
125-
126-
Package Codex output ZIP at:
127-
tmp/PR_11_113_CODEX_REPAIR_OR_REPORT_ENFORCEMENT.zip
11+
1. Continue from PR 11.113
12+
13+
2. For each validation failure:
14+
classify:
15+
- FIXABLE
16+
- NON-FIXABLE
17+
18+
3. FIXABLE:
19+
- apply fix directly in JSON
20+
- revalidate
21+
- confirm schema passes
22+
23+
4. NON-FIXABLE:
24+
- record blocker with:
25+
file
26+
field
27+
reason
28+
required action
29+
30+
5. Auto-fix:
31+
- schema mismatches
32+
- invalid keys
33+
- naming issues
34+
- extra fields
35+
- array formatting
36+
- canonical names
37+
38+
6. DO NOT:
39+
- invent missing data
40+
- use defaults
41+
- use presets
42+
- normalize at runtime
43+
44+
7. Validate:
45+
- JSON parses
46+
- schema passes after fix
47+
48+
8. Reports:
49+
docs/dev/reports/fixes_applied_11_114.txt
50+
docs/dev/reports/fix_blockers_11_114.txt
51+
52+
9. Output ZIP:
53+
tmp/PR_11_114_ENFORCE_JSON_FIX_ON_FAILURE.zip

docs/dev/commit_comment.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
Require repair-or-report execution for direct JSON cleanup lane - PR 11.113
1+
Enforce auto-fix of deterministic JSON/schema issues - PR 11.114
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
PR 11.114 - Fix Blockers
2+
Date: 2026-04-30
3+
4+
Detection scope
5+
- Validation source: node ./scripts/validate-json-contracts.mjs --details
6+
- Files considered: sample JSON rows validated by tools/schemas/* plus tool schema files in tools/schemas/tools/*.
7+
8+
NON-FIXABLE classification results
9+
- No NON-FIXABLE validation failures remained after deterministic schema fixes.
10+
- Count: 0 blockers.
11+
12+
Why no blockers remain
13+
- All observed failures were deterministic oneOf conflicts and were resolved by schema correction.
14+
- No missing external files were required for schema pass.
15+
- No ambiguous intent decision was needed for the fixed cases.
16+
17+
Explicit blocker format (none)
18+
- file: n/a
19+
- field: n/a
20+
- reason: n/a
21+
- required action: n/a
22+
23+
Validation command used
24+
- node ./scripts/validate-json-contracts.mjs --details
25+
26+
Validation result
27+
- tool_payload_schema_validation: total=17 invalid=0
28+
- sample_json_schema_validation: total=63 invalid=0
29+
- game_manifest_schema_validation: total=12 invalid=0
30+
31+
Remaining blockers
32+
- None for this PR scope.
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
PR 11.114 - Fixes Applied (ENFORCE_JSON_FIX_ON_FAILURE)
2+
Date: 2026-04-30
3+
4+
Validation failure detection
5+
- Command: node ./scripts/validate-json-contracts.mjs --details
6+
- Before result:
7+
- tool_payload_schema_validation: total=17 invalid=0
8+
- sample_json_schema_validation: total=63 invalid=26
9+
- game_manifest_schema_validation: total=12 invalid=0
10+
- Before failure groups:
11+
- 9 x $.payload.spriteProject: value must satisfy exactly one oneOf branch
12+
- 6 x $.payload.tileMapDocument: value must satisfy exactly one oneOf branch
13+
- 4 x $.payload.parallaxDocument: value must satisfy exactly one oneOf branch
14+
- 3 x $.payload.vectorMapDocument: value must satisfy exactly one oneOf branch
15+
- 2 x $.skin: value must satisfy exactly one oneOf branch
16+
- 1 x $.payload.pipelinePayload: value must satisfy exactly one oneOf branch
17+
- 1 x $.payload.tileMapDocument + $.payload.parallaxDocument: oneOf branch errors
18+
19+
Classification
20+
- All detected failures classified as FIXABLE.
21+
- Reason: deterministic schema ambiguity from overlapping oneOf branches in jsonValue (`number` + `integer`) caused valid integer values to match multiple branches.
22+
23+
Fixes applied
24+
1) File: tools/schemas/tools/sprite-editor.schema.json
25+
- Change made: removed redundant `{ "type": "integer" }` from `$defs.jsonValue.oneOf`.
26+
- Before: jsonValue.oneOf included both `number` and `integer`.
27+
- After: jsonValue.oneOf includes `number` only for numeric branch.
28+
- Validation result: PASS.
29+
30+
2) File: tools/schemas/tools/tile-map-editor.schema.json
31+
- Change made: removed redundant `{ "type": "integer" }` from `$defs.jsonValue.oneOf`.
32+
- Before: jsonValue.oneOf included both `number` and `integer`.
33+
- After: numeric branch is `number` only.
34+
- Validation result: PASS.
35+
36+
3) File: tools/schemas/tools/parallax-editor.schema.json
37+
- Change made: removed redundant `{ "type": "integer" }` from `$defs.jsonValue.oneOf`.
38+
- Before: jsonValue.oneOf included both `number` and `integer`.
39+
- After: numeric branch is `number` only.
40+
- Validation result: PASS.
41+
42+
4) File: tools/schemas/tools/vector-map-editor.schema.json
43+
- Change made: removed redundant `{ "type": "integer" }` from `$defs.jsonValue.oneOf`.
44+
- Before: jsonValue.oneOf included both `number` and `integer`.
45+
- After: numeric branch is `number` only.
46+
- Validation result: PASS.
47+
48+
5) File: tools/schemas/tools/skin-editor.schema.json
49+
- Change made: removed redundant `{ "type": "integer" }` from `$defs.jsonValue.oneOf`.
50+
- Before: jsonValue.oneOf included both `number` and `integer`.
51+
- After: numeric branch is `number` only.
52+
- Validation result: PASS.
53+
54+
6) File: tools/schemas/tools/asset-pipeline.schema.json
55+
- Change made: removed redundant `{ "type": "integer" }` from `$defs.jsonValue.oneOf`.
56+
- Before: jsonValue.oneOf included both `number` and `integer`.
57+
- After: numeric branch is `number` only.
58+
- Validation result: PASS.
59+
60+
No-fix-needed checks (reported, no change)
61+
- Canonical names (`palette-browser`, `3d-json-payload`, `asset-pipeline`) were already active in runtime/sample/schema scope for affected validations.
62+
- No array-formatting failure was emitted by current schema validation run.
63+
- No invalid keys/extra fields remained after schema fix for scanned sample JSON rows.
64+
65+
Post-fix validation
66+
- Command: node ./scripts/validate-json-contracts.mjs --details
67+
- After result:
68+
- tool_payload_schema_validation: total=17 invalid=0
69+
- sample_json_schema_validation: total=63 invalid=0
70+
- game_manifest_schema_validation: total=12 invalid=0
71+
- Generated evidence file updated: docs/dev/reports/sample_json_schema_validation.csv
72+
73+
Additional validation
74+
- JSON parse/syntax covered by validator run (no invalid-json rows reported).
75+
- No runtime defaults/presets/normalization behavior was introduced.

0 commit comments

Comments
 (0)