You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit cd6c745
Browse filesBrowse the repository at this point in the historyBrowse files
feat(extract): validator.array bounds are enforced, in every port
An array field's validator.array (@min/@max) was declared and ignored: the
extract engine never saw it and the TypeScript generated parse schema emitted a
bare z.array(...). Two cold agent sessions both declared "exactly three tags" in
the model and then re-checked the count by hand.
The bound now travels on FieldSpec (minItems/maxItems) in TS, Java, Python and
C# (Kotlin drives the Java engine), built from the field's array validator by
each port's metadata-driven schema builder. Semantics, identical everywhere:
- more than @max: NORMAL/LOOSE keep the first @max and record a "truncate"
coercion, the array analogue of a numeric clamp; STRICT is MALFORMED;
- fewer than @min: MALFORMED under every tolerance, so orThrow fails on a
@required one and malformedRequired() names it.
The TypeScript generated parse/safeParse schema carries the same bounds.
The extract-conformance corpus gains three cases (48), a minItems/maxItems key,
scalar arrays in the runners, and an optional per-case tolerance; every port's
runner reads them. Each port also has a metadata-driven test (validator.array ->
schema -> extract -> strict gate). Local CI green: gates, ts, java-fast, python,
csharp.
This is a behaviour change: a reply outside the bounds that used to pass now
truncates or fails. The CHANGELOG says so up front.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01M1mRRB1K2WdYy82kntMQdx
0 commit comments