STET

flux-pr-4861

Zod (TypeScript) · W1 · GPT-5.1 Codex Mini

pass_with_warn

Tests passed. 3/3 commands passed. Strength: weak.

run pass rate
Tier
primary equivalencepassedequivalentneeds generated testsweak signal riskcommand source drift
pnpm build
gold passagent pass
find . -name vitest.config.ts -exec sed -i 's/test: {/test: { testTimeout: 30000,/' {} +
gold passagent pass
npx vitest run packages/zod/src/v4/classic/tests/discriminated-unions.test.ts -t "pipes"
gold passagent pass

Partial score: 3/3

Publishable: noWeak signal risk: yesCache: miss

Trajectory

unknown · partial order only

Canonical trajectory missing; showing coarse derived order only.

patch written
Patch captured
#1

Stet captured agent.patch for this trial.

validation
Tests passed
#2
equivalence
Equivalence judgment
#3

equivalent

code review
Code review judgment
#4

unsure

decision
Final decision
#5

pass_with_warn

Quality

equivalence
equivalent
92% confidence
code review
unsure · 61/100
1 finding
footprint
low (0.11)
behavioral
cost
$0.31

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

correctness: 2/4introduced bug risk: 3/4edge case handling: 1/4maintainability idioms: 4/4

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.

1 finding
Discriminated-union option introspection still crashes on missing prop metadata
major

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.

packages/zod/src/v4/core/schemas.ts:2039