chore: keep JSON Schema goldens only for model tool inputs

Merged
CH
5d ago
+146-51766

Part of the time-to-merge rollout: delete the JSON Schema goldens, and the rule that records every schema, except for schemas a model is shown as a tool's input. A byte change only costs a prompt-cache prefix when the schema reaches a model, as #4165 notes. The rest made every wire change re-record and explain goldens (≈10% of recent merges touched packages/features/fixtures).

What changed

  • packages/features/src/hosted-wire-schemas.test.ts is gone. It recorded every export of 37 wire modules (exhaustive by type) and checked that the fixture directory held exactly that set. Its replacement, tool-input-schemas.test.ts, records only the 9 schemas below.
  • 412 non-model-facing goldens were deleted from packages/features/fixtures/json-schema/.
  • 8 unchecked goldens were deleted from apps/web/fixtures/json-schema/ (see below).
  • The helper packages/wire/src/testing/json-schema-golden.ts is now one function, settleJsonSchemaGolden(root, name, schema), plus jsonSchemaGoldenRoot. These were removed: settleJsonSchemaGoldenSet, matchJsonSchemaGolden, jsonSchemaOf, RecordedEffectJsonSchemas, and the related types.
  • 72 schemas knip reported as exported only for the old test are no longer exported. Three that nothing used are deleted: inboxBlocksSchema, codingAgentDefaultAnswerSchema, and writtenText. Eight @public chat-wire aliases that only the old test read were dropped. No schema's shape changed.
  • The rule now speaks only of tool-input goldens: packages/AGENTS.md, root AGENTS.md (Testing) (the PR template row went with main's template trim).

Goldens kept, and why

Each is passed whole as a tool's inputSchema:

GoldenTool
chat-wire-postChatAskInputSchemacoder post_chat (coder-host/chat.ts)
chat-wire-readChatInputSchemacoder read_chat
chat-wire-resolveAskInputSchemacoder resolve_ask
chat-wire-editChannelInputSchemacoder edit_channel
inbox-wire-inboxThreadPostInputSchemacoder post_to_inbox (coder-host/inbox.ts)
inbox-wire-inboxWithdrawInputSchemacoder withdraw_ask
inbox-wire-inboxReadInputSchemacoder read_inbox
coding-agent-wire-codingAgentDelegationInputSchemacoder delegate (coder-host/delegation.ts)
coding-agent-wire-codingAgentTodosInputSchemacoder write_todos (coder-host/todos.ts)
apps/web plan-notes-outputbrain edit_plan (brain-host/plan-edit.ts uses planNotesSchema as its input)

Unsure, kept: packages/service/fixtures/json-schema/chapters-answer and chapters-repair-answer. Both reach a model, but as Output.object structured output rather than a declared tool. Depending on the model, the Anthropic provider may send them as a forced tool, so I kept them.

Deleted although model-facing: unchecked files

apps/web/fixtures/json-schema/{coder-bash,draw-on-board,queue-question,read-web-page,run-in-repository,run-on-mac,search-web,show-page}-tool-input.json have had no test reading them since #2420 removed theirs. show-page-tool-input already fails to match today's tool. Because nothing checks them, they pin nothing, so I deleted them rather than restore a test.

Checks

  • ./scripts/repository-checks.sh and pnpm knip pass.
  • Typecheck passes for wire, features, service, host, panel, and web.
  • The features and wire tests pass, along with the plan-notes and chapters golden tests.
  • Locally, src/agents/agent-runtime/prepare-script.test.ts (the claude-agent-sdk install line) fails both with and without this change. This PR doesn't touch it.

Made with Luke


Devin Review