flux-pr-4843
Zod (TypeScript) · W2 · GPT-5.4
Tests passed. 3/3 commands passed. Strength: weak.
pnpm buildfind . -name vitest.config.ts -exec sed -i 's/test: {/test: { testTimeout: 30000,/' {} +npx vitest run packages/zod/src/v4/classic/tests/error-utils.test.ts -t "all\ errors"Partial score: 3/3
Trajectory
unknown · partial order onlyCanonical trajectory missing; showing coarse derived order only.
Quality
Equivalence Reasoning
stylistic
The agent patch addresses the core intent: branded primitives are normalized to their underlying primitive type in `$ZodErrorTree`, so `treeifyError` typing for fields like `z.string().brand()` matches unbranded primitives. It also adds a targeted test confirming both runtime tree shape and type-level behavior for a branded primitive field.
Code Review
The patch likely addresses the intended branded-primitive tree typing issue and adds a relevant regression test, but it does so with tighter coupling to internal branding types than necessary.
The fix couples `$ZodErrorTree` to `core.$brand` via `StripPrimitiveBrand`, which may require follow-up changes if branding internals are refactored. A primitive-first conditional in `$ZodErrorTree` would likely be simpler and less coupled.