fix: load JSON streams with integers larger than float64 #1
All Vouch review confidence checks passed
Residual risk 0.05 = Change Risk (0.24) × (1 − Review Confidence (0.81)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.24 · 24 lines diff across 2 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.72 · 2 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 50%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.193
Real PR Conversation Timeline
6 items
Approved
Approved these changes.
Approved
Approved these changes.
Approved
super sus usecase but 👍
manually merging to fix test coverage
v0.4.1
jklaw90
a7i
Summary
LoadResourcescrashed on a JSON stream once an integer larger thanfloat64appeared after two successfully decoded objects.YAMLOrJSONDecoder's JSON path usesencoding/jsonwithoutUseNumber. After two objects it does not fall back to YAML, so the next overflow fails withjson: cannot unmarshal number ... into Go value of type float64.json.RawMessage(same idea as kubectl'sruntime.RawExtension), then parse that one document withutilyaml.Unmarshal. Overflowing integers are kept as strings.Example
A stream of three JSON objects, with a 705-digit integer on the third:
Before:
kapt: resources.json: json: cannot unmarshal number 999... into Go value of type float64After: all three objects load.
data.valueonbis the original digit string.A single JSON object with the same number already worked, because the decoder could still switch to YAML. Multi-document YAML was also fine. The failure is JSON streams after two objects.
Test plan
go test ./...LoadResources: JSON stream with two small objects, then a 705-digit integer