Migrate the repo from Zod v3 to Zod v4
Status: closed/done · Impact: high · Complexity: large
The markdown-contract engine the adoption depends on is built on Zod v4, so
the repo had to move off Zod v3 before any contract work could begin. This task
is the foundation PR of the markdown-contract adoption: a whole-repo migration
of the schema layer, op registry, and tests onto Zod v4 so the new dependency
dedupes to a single Zod version.
Acceptance criteria
Section titled “Acceptance criteria”- Entity frontmatter schemas and the op registry generics compile against Zod v4.
-
z.recordcall sites updated for the v4 two-argument arity. - JSON Schema emission switched to
z.toJSONSchema. - Validation error handling updated to the v4 issue-code surface.
- The full test suite passes on Zod v4 (
bunx tsc --noEmitclean,bun testgreen).
Out of scope
Section titled “Out of scope”- Building the markdown-contract substrate itself (the per-entity contracts) — that is the follow-on substrate task.