STET

flux-pr-4843

Zod (TypeScript) · W2 · GPT-5.4

pass

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

69.2% run pass rate
Tier 1
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/error-utils.test.ts -t "all\ errors"
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

pass

decision
Final decision
#5

pass

Quality

equivalence
equivalent
92% confidence
code review
pass · 70/100
1 finding
footprint
low (0.21)
behavioral
100.0%
cost
$0.28 · 349K

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

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

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.

1 finding
Error-tree typing now depends on internal `$brand` representation
minor

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.

packages/zod/src/v4/core/errors.ts:2