Skip to content

refactor(tools): derive tool inputSchemas from arktype types - #1425

Merged
TheGreatAxios merged 3 commits into
mainfrom
cl-10652-arktype-228-generate-inputschema-via-tojsonschema-delete-ha
Oct 15, 2026
Merged

TheGreatAxios merged 3 commits into
mainfrom
cl-10652-arktype-228-generate-inputschema-via-tojsonschema-delete-ha

Conversation

@TheGreatAxios

@TheGreatAxios TheGreatAxios commented Oct 14, 2026 •

Copy link
Copy Markdown
Collaborator
  • arktype 2.2.3 -> 2.2.8; hand-written JSON Schema for web_fetch/web_search/delete_file deleted in favor of toJsonSchema()-generated schemas from the arktype arg types (single source of truth); descriptions carried as arktype metadata byte-identically; served shape unchanged via dialect: null; generated-vs-hand diffs pinned with full-object assertions.
  • Generated wins on drift: minLength: 1 on required strings the hand JSON dropped; enums lower to anyOf/const (arktype fixed behavior). Timeout intent stays as type metadata; runtime clamping remains the enforcement point (unchanged).
  • One-identity fix: an arktype dual-identity typecheck failure was root-caused into an overrides entry pinning arktype 2.2.8 — note @corbits/openai-responses@0.2.1 declares an exact 2.2.3 pin, so that published dep now validates against 2.2.8 (in-range for its ^2.2.3 consumers elsewhere; flagged here deliberately).
  • Plugin schema REWRITERS (shell-guard, evidence-archive, edit-file-line-range) are not hand-written declarations — untouched.
  • Follow-up candidates (filed for later, not this PR): five src/agent/* tool declarations still hand-write/extend schemas.

Verification

  • bun run check exit 0: full suite 8942 pass / 0 fail across 580 files.
  • Fidelity verified on installed 2.2.8 BEFORE conversion (metadata -> description flow, target/dialect options, union lowering), then three generation-diff tests added.
  • Tool-declaration suites explicit: web-fetch/web-search/delete-file/shell-guard/tool-aliases/exa-alias = 126 pass / 0 fail.
  • Override blast radius: exactly one arktype@2.2.8 package entry in bun.lock; no consumer demands <2.2.8; only the exact 2.2.3 pin is rewritten.

Fixes CL-10652

Hand-written JSON Schema for web_fetch, web_search and delete_file
duplicated the arktype arg types and had already drifted (no minLength,
documented timeout intent living outside the schema). The types are now
the single source via toJsonSchema with descriptions carried as arktype
metadata; served shape keeps its exact key set (dialect: null) and
generated-vs-hand diffs are pinned in tests.

arktype moves 2.2.3 -> 2.2.8; an override keeps the first-party and
vendored consumers on one type identity (two arktype versions in one
program defeat portable type naming).
@linear-code

linear-code Bot commented Oct 14, 2026

Copy link
Copy Markdown

CL-10652

@corbits-triage

corbits-triage Bot commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

Superseded by the comment below.

@corbits-triage

corbits-triage Bot commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

Superseded by the comment below.

@corbits-triage

corbits-triage Bot commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

Triage: Fail

@TheGreatAxios, please address the following:

  • Split out unrelated change: src/session/stream-journal.ts
  • Split out unrelated change: src/session/stream-journal.test.ts

@TheGreatAxios
TheGreatAxios changed the base branch from cl-10654-isomorphic-git-1442-batch-remove-hot-path-perf to main October 15, 2026 19:47
…generate-inputschema-via-tojsonschema-delete-ha

# Conflicts:
#	bun.lock
appendFile creates partial.jsonl before the JSON line is written, so a
reader can observe empty or truncated JSON. Rewrite through a temp file
and rename, and serialize overlapping flushes so one publish cannot
drop the other.
@TheGreatAxios
TheGreatAxios merged commit 495c992 into main Oct 15, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant