Repository navigation
test(ai): disposition tables + fidelity corpus for the three tool-schema translators (#1685) - #1723
Merged
Merged
Conversation
…ema translators (#1685)
This was referenced Nov 5, 2026
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.
Closes #1685. Design #1684 phase 1 — tests/tables only, no production changes under
packages/ai/src/.What
One shared fidelity corpus,
packages/ai/test/tool-schema-fidelity-corpus.test.ts, holding a checked-in disposition table per translator — antigravityconvertSchema,GeminiJsonSchema.normalize,ToolSchemaProjection.moonshot— and running every row through its translator, asserting the projected shape the table states. The tables are the named oracle (header comment; model-based testing per design #1684's contract: preserved / approximated-named-with-direction / refused / known-lossy-with-issue-link, never silent).Coverage: every keyword shape exercised by #1548/#1550/#1556/#1573/#1585/#1667 — boolean subschemas, multi-valued
type,allOf/not-only roots, ARRAY without items, mutually recursive$defs, draft-04 bounds, draft-07 tuples — plus the built-in-schema keyword set probed row by row against the current translators.Known-lossy rows (asserted as current behaviour, flip when their issues land)
constdropped by the SCHEMA_FIELDS allowlist -> fix(ai): antigravity convertSchema drops const — a fixed-value parameter is sent upstream unconstrained #1557prefixItemswithitemspresent folds into oneitems:anyOf-> fix(ai): moonshot tool-schema projection dropsprefixItemswhenitemsis also present — position constraints are silently replaced #1574Recorded named approximations include: Gemini loop-cut to
{}(#1585), antigravity anyOf->oneOf for Anthropic targets (#1550, narrowing), MoonshotprefixItemsfold whenitemsis absent (widening).objectRootforcing is recorded in the header note: it lives in the unexportedtools()layer abovemoonshot(), which the corpus asserts directly.Tests
On the laptop worktree (fleet CI-first policy; CI on this PR is the gate):
bun test test/tool-schema-fidelity-corpus.test.ts test/tool-schema-projection.test.ts test/gemini-json-schema.test.ts test/provider/antigravity.test.ts— 139 pass, 0 fail on current main (32f3d6c)git diff packages/ai/src/is empty.🤖 Agent note · queue task 9799 (repo-worker-opencode), phase 1 of #1684.