flux-pr-4861
Zod (TypeScript) · W1 · 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/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 propagates `propValues` through `$ZodPipe` internals and lazy metadata, which is the core behavioral fix needed so discriminated unions can introspect discriminator values on piped options. It omits unrelated gold changes (compat enum stub) and a defensive optional-chain tweak, but it still satisfies the stated intent for piped discriminated union options.
Code Review
The patch addresses the primary pipe metadata propagation, but it likely does not fully satisfy the intended robustness because discriminated-union introspection remains non-null-safe for missing `propValues` edge cases.
Union option scanning still dereferences `o._zod.propValues[discriminator]` without guarding `propValues`. If an option does not expose this metadata, behavior can throw before emitting the intended `Invalid discriminated union option` error, so error reporting/branch handling is not fully robust.