Skip to content

test(ai): disposition tables + fidelity corpus for the three tool-schema translators (#1685) - #1723

Merged
dezren39 merged 1 commit into
mainfrom
queue/9799-1685-schema-fidelity-corpus
Nov 5, 2026
Merged

dezren39 merged 1 commit into
mainfrom
queue/9799-1685-schema-fidelity-corpus

Conversation

@dezren39

@dezren39 dezren39 commented Nov 5, 2026

Copy link
Copy Markdown

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 — antigravity convertSchema, 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)

Recorded named approximations include: Gemini loop-cut to {} (#1585), antigravity anyOf->oneOf for Anthropic targets (#1550, narrowing), Moonshot prefixItems fold when items is absent (widening). objectRoot forcing is recorded in the header note: it lives in the unexported tools() layer above moonshot(), 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)
  • Corpus alone: 99 pass. Formatted with the repo's prettier config.
  • git diff packages/ai/src/ is empty.

🤖 Agent note · queue task 9799 (repo-worker-opencode), phase 1 of #1684.

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.

test(ai): disposition tables + one fidelity corpus for the three tool-schema translators (design #1684, phase 1)

1 participant