Repository navigation
fix(ingest): bound JSON flattening rows and expanded bytes - #85
Merged
Merged
Conversation
VibeSWE
marked this pull request as draft
October 26, 2026 15:23
VibeSWE
marked this pull request as ready for review
October 26, 2026 16:30
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
JSON events with multiple arrays can multiply into an unbounded cartesian product before Arrow encoding. Checked, borrowed preflight accounting now rejects an event that would exceed a limit with HTTP 400 before its expanded rows or repeated field names are allocated. Earlier events may have been materialized within the shared budget, but no events or inferred schema from a rejected HTTP request are written. An ingest endpoint may still create an empty dataset before validation.
Changes
docs/json-flattening-limits.md.Compatibility: these intentionally introduce rejection boundaries. The request row cap counts flat objects too: batches above 10,000 rows must be split or the configured limit raised. A single event above 1,000 rows is rejected by default, including wrappers containing large arrays. Input payload bytes and expanded-output bytes are independent limits; deployments with larger input settings may need to raise the output budget too. Rejections truncate nothing; clients that drop HTTP 400 batches should adjust batching before upgrading. Migration guidance is in the docs.
Validation
Revised sources committed as
7fe8a17e73e752493da46f970b63764aa413f016:Fresh independent adversarial reviews by Opus 5.5 (max effort) and Sol 6.1 (high reasoning) both reported CLEAN, with no actionable issues, for exact head
7fe8a17e73e752493da46f970b63764aa413f016. Both reviewed the full diff against04b73b57and the changes since the first review. Earlier Opus findings led to explicit compatibility documentation, streamed statistics, and corrected per-event allocation guarantees. Merge remains conditional on CI passing for this reviewed head.Performance
Three release microbenchmark runs against fixed comparison baseline
547c5118are recorded intools/flatten-bench/RESULTS.md. Flat batches are 41–45% slower at the conversion stage (about 0.13 ms extra per 1,000 rows). The moderate-array case is 3–5% faster and allocates 14% fewer bytes. These figures exclude parsing, Arrow conversion, and I/O; they are not end-to-end throughput measurements. The reviewed corrections leave the measured JSON algorithm files unchanged.This PR has: