flux-pr-4843
Zod (TypeScript) · W2 · GPT-5.1 Codex Mini
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 same core intent: branded primitives are treated like their underlying primitive in `treeifyError` typing, preventing erroneous `properties/items` typing on branded fields. It also adds a targeted test that checks both runtime tree shape and compile-time type behavior for a branded string field. The implementation differs from gold (brand-stripping helper vs primitive-first conditional) but is behaviorally aligned with the task.
Code Review
Patch likely does not fully satisfy the intended branded-primitive tree typing fix; the core type transform is brittle for primitive-brand intersections, and the new test is too weak to prove the targeted behavior.
`$RemoveBrand` uses `Omit` on branded types. For primitive intersections, this can yield a picked structural type rather than the underlying primitive, so `$ZodErrorTreeInternal` may still choose the object branch and preserve the original inconsistency.
The assertions check assignability to `{ errors: string[] }` and test for required `properties`/`items`; both still pass when those fields are optional, so the test does not reliably catch the intended regression.