Repository navigation
fix(schemas): enforce length limits on rejected product suggestions - #3826
Merged
bokelley merged 1 commit intoNov 29, 2026
Merged
Conversation
There was a problem hiding this comment.
Ladon verdict: Approve
Approve — clean diff, no blocking or medium findings.
Checked:
- Build-time post-process in
scripts/generate-zod-from-ts.tsenforces the published per-suggestion string bounds on GetProductsRejected/GetProductsResponsesuggestionsusing a code-point-counting regex (/^[\s\S]{1,1000}$/u) rather than.min()/.max(), correctly matching JSON Schema code-point semantics (confirmed by astral-char tests). - Fail-closed on malformed bounds;
.meta()carries bounds into JSON Schema output. - Changeset present;
patchis defensible for conformance tightening against already-declared schema cache bounds (no removed export, enum drop, or response-shape change — changeset-vs-wire-impact satisfied). - Witness-not-translator: no fabrication or re-shaping; this tightens validation of what upstream sends.
- Generated file
schemas.generated.tsedit is expected build output.
No findings. Not gated (gated_paths: false), no author team gate, high_risk false. Falls through to row 9.
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.
Read the per-suggestion string bounds from the pinned protocol schemas when generating the rejected-product and general get-products response validators. Both exports enforce 1 to 1,000 Unicode code points per suggestion and expose the bounds in generated JSON Schema.
The tests cover empty and oversized suggestions, supplementary Unicode characters, newlines and the 20-item array limit.
Schema generation, the SDK build, typecheck and all 84 tests in the schema suite passed.
Fixes #3813.