Skip to content

fix(schemas): enforce length limits on rejected product suggestions - #3826

Merged
bokelley merged 1 commit into
adcontextprotocol:mainfrom
aleksUIX:fix/rejection-suggestion-bounds
Nov 29, 2026
Merged

bokelley merged 1 commit into
adcontextprotocol:mainfrom
aleksUIX:fix/rejection-suggestion-bounds

Conversation

@aleksUIX

Copy link
Copy Markdown
Contributor

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.

@aao-secretariat aao-secretariat Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ladon verdict: Approve

Approve — clean diff, no blocking or medium findings.

Checked:

  • Build-time post-process in scripts/generate-zod-from-ts.ts enforces the published per-suggestion string bounds on GetProductsRejected/GetProductsResponse suggestions using 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; patch is 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.ts edit is expected build output.

No findings. Not gated (gated_paths: false), no author team gate, high_risk false. Falls through to row 9.

@bokelley
bokelley merged commit f143f53 into adcontextprotocol:main Nov 29, 2026
43 checks passed
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.

GetProductsRejected zod schema drops suggestions item minLength/maxLength

2 participants