Repository navigation
[Spec Change] Unknown fields: strict validation by default, lenient consumption by flag (#107) #108
Replies: 3 comments
|
The draft reference implementation is up: #110 (DO NOT MERGE; it stays a draft until this comment period ends on 2026-10-13). What it does:
Sweep, run in strict mode on that tree:
Two questions from the list above have a default in the PR but are still open:
The PR also flags that §Compatibility Policy says "MUST ... ignoring unknown optional fields" while the reworded §Forward Compatibility says SHOULD. Opinions welcome on which way to align them. |
|
A data point from outside the repo, recorded as promised. @jonathanngiroux-star (maintainer of Proofspan, disclosed in his comment) described what his converters do on langsmith-sdk#3278. I have not run Proofspan; everything below about it is from his comment, not from a test. His field-mapping tables are in
None of this changes the proposal on the table. It is outside support for two of its defaults (keep |
|
One more concrete instance of the gap, from a producer written in a language neither SDK covers, so the only check it has is the JSON Schema itself. The .NET AgentEval adapter (#123,
So a .NET producer that checks against the schema and a Python consumer that checks with the SDK currently disagree about whether the same document conforms, which is the situation this RFC describes. #110 brings the Python SDK into line with the schema and gives a flag for the other behavior; the adapter's own test pins the schema count ( One small observation for the error-path format: the schema library reports Everything above is reproducible: |
Uh oh!
There was an error while loading. Please reload this page.
Comment period: 2 weeks, until 2026-10-13. No normative text changes before then.
Problem
Issue #107 has the details and a reproduction. The short version: the three normative sources give three different answers about a key the spec doesn't define.
spec/schemas/*.json:additionalProperties: falseat every object level, so the document is rejected.@ChelseaKR found this while shipping
gauntlet report --format evalport(ChelseaKR/gauntlet#76). A document her SDK-based tests accepted would be rejected by anyone validating against the published schema. I hit the same thing myself: aconfigkey in my llama-cookbook#1072 sketch got past the SDK and was caught only by the raw schema.Proposal (option 3 in #107)
versionX MUST NOT contain properties outside those defined for X, except undermetadataobjects, which stay open. The schemas already say this. Both SDKs would start rejecting unknown keys with a new code,UNKNOWN_FIELD, at the offending path.versionis a newer minor version than it implements SHOULD ignore properties it does not recognise rather than fail. Both SDKs gain an opt-in (validate_*(doc, allow_unknown=True)/{ allowUnknown: true }/evalport-validate --allow-unknown) for that case.spec/conformancegains fixtures for both modes. The strict mode is the one used for conformance claims.Why not the alternatives
additionalProperties: false. Typos likeconfigvsparams, or a suite-levelthreshold, would pass silently. That silent acceptance is exactly the failure both real integrators hit.metadataalready exists for producer-specific data.Impact
metadatawould start failing strict validation. Before merging, I'll run every adapter inadapters/plus the interop examples in strict mode and fix anything that emits a stray key. fix(sdk): type-check optional fields, RFC 3339 timestamps, and Rule 6 null-score passed in both validators #106 already did the same kind of sweep for type errors, and 17 adapters needed fixes.Questions for reviewers
metadatabe the only open object, or shouldprovider.extrastay open too? It already istype: objectwith no property constraints.UNKNOWN_FIELD, or reuse something existing?allow_unknownthe right knob, or should leniency be automatic when the document'sversionis newer than the validator's?A DO-NOT-MERGE reference PR will follow, per the usual process.
All reactions