flux-pr-4861
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/discriminated-unions.test.ts -t "pipes"Partial score: 3/3
Trajectory
unknown · partial order onlyCanonical trajectory missing; showing coarse derived order only.
Quality
Equivalence Reasoning
stylistic
The agent patch preserves `propValues` through `$ZodPipe` (including both input and output sides), which enables discriminated unions to introspect discriminator values for piped options and keeps branch selection/validation behavior working for transform/preprocess-wrapped members, matching the task intent via a different implementation.
Code Review
The patch likely fixes the primary pipe/discriminator metadata loss for common transform/preprocess scenarios, but it appears incomplete because missing `propValues` can still trigger an unguarded discriminated-union lookup crash.
The patch makes `$ZodPipe._zod.propValues` optional and can return `undefined`, but discriminated-union option extraction still directly indexes `o._zod.propValues[discriminator]`. For options where both pipe sides lack prop metadata, this can throw a TypeError instead of producing the expected invalid-option error path.