Skip to content

[fix] reject malformed schema JSON before caching (LET-34) - #193

Merged
vt128 merged 1 commit into
masterfrom
codex/fix-json-schema-let34
Nov 10, 2026
Merged

vt128 merged 1 commit into
masterfrom
codex/fix-json-schema-let34

Conversation

@vt128

@vt128 vt128 commented Nov 9, 2026 •

Copy link
Copy Markdown
Member

Malformed schema text, including {} null and trailing closing delimiters, could pass the pinned parser and become a cached schema. Preserve the original parser error order, then use the standard library to check the complete caller-owned JSON bytes before compilation or caching. No new parser, cache, dependency, public API, interpreter pin or Go-floor change.

Fresh current-master baseline/candidate build, race tests twice, vet and coverage pass on Go 1.27.3 and Go 1.19.13: all three new statements are covered, with no old covered blocks lost. The full 80-configuration consumer comparison passes (76 active, four archived diagnostics), with 40 exact profiles and classified skips/no-test packages. Four fresh CLI binaries pass eight public examples and the expected old-error/new-success schema boundary checks. Independent source and artifact reviews pass; final-head required/reported checks, both Codecov contexts and checks-watch pass.

On cache misses, complete JSON validation adds a scan proportional to schema text; cache hits skip this scan. Original representative timings remain dispersed, including floor ColdLarge paired median +32.02% (about 23.6 microseconds); other paths also varied. This necessary safety cost is accepted under the current safety-first direction, without a zero-overhead or equivalence claim. The implementation and benchmark bodies match the measured version; no new timing samples were added. Tracks LET-34. No tags, releases or auto-merge.

@codacy-production

codacy-production Bot commented Nov 9, 2026 •

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 11 complexity · 0 duplication

Metric Results
Complexity 11
Duplication 0

View in Codacy

🟢 Coverage 100.00% diff coverage · +0.00% coverage variation

Metric Results
Coverage variation ✅ +0.00% coverage variation (-1.00%)
Diff coverage ✅ 100.00% diff coverage

View coverage diff in Codacy

Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (b8e0c8f) 8437 8024 95.10%
Head commit (3bb73c5) 8441 (+4) 8028 (+4) 95.11% (+0.00%)

Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: <coverage of head commit> - <coverage of common ancestor commit>

Diff coverage details
Coverable lines Covered lines Diff coverage
Pull request (#193) 6 6 100.00%

Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: <covered lines added or modified>/<coverable lines added or modified> * 100%

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@codecov

codecov Bot commented Nov 9, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.98%. Comparing base (b8e0c8f) to head (3bb73c5).

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #193   +/-   ##
=======================================
  Coverage   93.98%   93.98%           
=======================================
  Files          53       53           
  Lines        6752     6755    +3     
=======================================
+ Hits         6346     6349    +3     
  Misses        258      258           
  Partials      148      148           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@vt128
vt128 force-pushed the codex/fix-json-schema-let34 branch from 03cc912 to f0ca33c Compare November 9, 2026 15:04
Reject ignored trailing schema tokens before compilation and caching while
preserving resource-parser errors. Reuse the owned schema bytes for the
standard JSON check and retain the existing data-document boundary guard.

Cover malformed tails, including a second null value, native/byte inputs,
cache isolation, legal whitespace and existing validation outcomes.
@vt128
vt128 force-pushed the codex/fix-json-schema-let34 branch from 3174257 to 3bb73c5 Compare November 10, 2026 04:34
@vt128
vt128 marked this pull request as ready for review November 10, 2026 05:01
@vt128
vt128 merged commit 89f06e1 into master Nov 10, 2026
24 checks passed
@vt128
vt128 deleted the codex/fix-json-schema-let34 branch November 10, 2026 05:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant