Skip to content

chore(deps): zod 4 — one validation major across the fleet's flagship - #857

Merged
github-actions[bot] merged 1 commit into
mainfrom
chore/currency-wave3
Aug 31, 2026
Merged

chore(deps): zod 4 — one validation major across the fleet's flagship#857
github-actions[bot] merged 1 commit into
mainfrom
chore/currency-wave3

Conversation

@catomean

Copy link
Copy Markdown
Collaborator

Fleet currency arc, Wave 3 (first of two OC PRs; the jest→Vitest conversion follows separately). FleetCrown runs zod 4; this repo — whose validation.ts is the SSOT the whole entity system parses through — ran 3. This closes the split, plus the audit's stragglers: dotenv 17, framer-motion 13, @playwright/test aligned to the playwright already in the tree, zod-to-openapi ^9 (the ^7 line is zod-3-only and threw on every schema at spec generation).

Migration surface (all mechanical):

  • .errors alias → .issues (35 files, incl. ZodLikeError in standardResponse)
  • required_error/invalid_type_error/errorMap → v4 error callbacks (finance, projects, social routes)
  • single-arg z.record(V)z.record(z.string(), V) (10 files)
  • .refine fn-form second arg → error callback (usernameSchema, phone)
  • ZodType<T, ZodTypeDef, unknown>ZodType<T, unknown>
  • .uuid().guid() at all 67 id validations: v4's .uuid() is RFC-strict (variant nibble 8/9/a/b) while our ids are whatever Postgres was handed — demo rows included. .guid() is v3's exact behavior; strictness for ids we mint is the DB's job, not the parser's.
  • the schema-drift audit test re-learns v4 internals (_zod.def, refinements-as-checks, catchall-based passthrough)

Also fixes both CLAUDE.md stack tables, which still claimed Tailwind 3.3 / TS 5.8 months after main moved — stale prose that actively misled agents (this audit included, until measured).

Verification: type-check clean, lint clean, 282 suites / 2645 tests green locally.

🤖 Generated with Claude Code

https://claude.ai/code/session_01WqKqMnHQHSmkGFfc5t7Rxn

The fleet audit found the core validation library split across a breaking
major: FleetCrown on zod 4, this repo (whose validation.ts is the SSOT the
whole entity system parses through) on 3. This closes the split, plus the
audit's small stragglers: dotenv 17, framer-motion 13, @playwright/test
aligned to the playwright already installed, zod-to-openapi ^9 (the ^7 line
is zod-3-only and threw on every schema at spec generation).

The migration surface, all mechanical:
- ZodError's .errors alias is gone: 35 files move to .issues (including the
  ZodLikeError shape in standardResponse and the jest suites)
- required_error / invalid_type_error / errorMap params are gone: replaced
  with v4 error callbacks in finance, projects, and the social routes
- single-argument z.record(V) is gone: ten files gain the explicit
  z.record(z.string(), V) key type
- .refine's function-form second argument is gone: usernameSchema and the
  phone validator move the message into an error callback
- ZodType<T, ZodTypeDef, unknown> generics: v4 dropped ZodTypeDef
- .uuid() is RFC-strict in v4 (variant nibble must be 8/9/a/b) while our ids
  are whatever Postgres was handed — demo rows included — so all 67 id
  validations move to .guid(), which is v3's exact behavior. Strictness for
  ids we mint is the DB's job, not the parser's.
- the schema-drift audit test re-learns v4 internals (_zod.def, checks not
  wrappers, catchall-based passthrough)

Also: both CLAUDE.md stack tables stop claiming Tailwind 3.3 / TS 5.8 — main
has been on Tailwind 4 for months and the stale table has actively misled
agents (this audit included, until measured).

type-check clean; lint clean; 282 suites / 2645 tests green.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WqKqMnHQHSmkGFfc5t7Rxn
@github-actions
github-actions Bot merged commit 2914e47 into main Aug 31, 2026
6 checks passed
@github-actions
github-actions Bot deleted the chore/currency-wave3 branch August 31, 2026 11:59
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.

1 participant