STET

flux-pr-4843

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

pass_with_warn

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

61.5% run pass rate
Tier 1
primary equivalencepassedneeds generated testsweak signal riskcommand source driftequivalentfail
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

fail

decision
Final decision
#5

pass_with_warn

Quality

equivalence
equivalent
88% confidence
code review
fail
2 findings
footprint
low (0.21)
behavioral
100.0%
cost
$0.82 · 2.2M

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

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

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.

2 findings
Branded primitive normalization may still resolve to object-like tree nodes
major

`$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.

packages/zod/src/v4/core/errors.ts:298
Type test can pass even if branded primitive still has object-branch shape
major

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.

packages/zod/src/v4/classic/tests/error-utils.test.ts:442