mirror of
https://github.com/bitbaum/kivvi.git
synced 2026-12-05 06:07:29 +01:00
zod 3.25.76 is a direct prod dependency of apps/web, packages/core and
packages/ai, and GHSA-mrhx-c7xc-m3w5 has no 3.x fix.
API changes:
- ZodError.errors was removed: 51 call sites now read .issues.
- z.record() needs a key schema: specs is z.record(z.string(), z.string()).
- errorMap moved to `error`: presenceConfirmed uses { error: "..." }.
Behaviour changes the type checker does not see:
- zod 4 applies .default() inside .partial(), so every update schema
built as createSchema.partial() filled defaults into a partial edit
(updateProductSchema.parse({}) returned shopVisible: false, currency:
"CHF", unit: "piece", ...) and would have reset those columns on save.
New updateSchemaOf() strips defaults before .partial(); all nine
update schemas parse {} to {} again, as on zod 3, and a test pins it.
- The OpenAI-compatible provider built tool JSON Schema from zod 3's
_def.typeName. zod 4 has none, so every tool became { type: "string" }
with no parameters. Both providers now share toolParametersJsonSchema()
over zod 4's native z.toJSONSchema, with a test over every tool.
- The ai-forms drift test read zod 3 internals (_def.shape(), checks,
typeName). It now reads bounds from z.toJSONSchema and asserts that it
compared at least one, so it cannot pass vacuously.
Claude-Session: https://claude.ai/code/session_019MDtmuJhiHPASaR5k8raL9
Co-authored-by: Claude <noreply@anthropic.com>