STET

flux-pr-5575

Zod (TypeScript) · W2 · GPT-5.4

pass_with_warn

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

69.2% run pass rate
Tier 1
primary equivalencepassednon equivalentdecision conflictfailneeds generated testsweak signal riskcommand source drift
pnpm build
gold passagent pass
npx vitest run packages/zod/src/v4/classic/tests/refine.test.ts packages/zod/src/v4/mini/tests/refine.test.ts -t "type\ guard\ narrows\ output\ type|non\-type\-guard\ refine\ does\ not\ narrow|type\ guard\ narrows\ output\ type|non\-type\-guard\ refine\ does\ not\ narrow"
gold passagent pass

Partial score: 2/2

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

non_equivalent

code review
Code review judgment
#4

fail

decision
Final decision
#5

pass_with_warn

Quality

equivalence
non_equivalent
86% confidence
code review
fail · 30/100
4 findings
footprint
low (0.31)
behavioral
100.0%
cost
$0.59 · 919K

Equivalence Reasoning

behavioral

The patch adds type-predicate narrowing only to `v4/classic` `refine`, but it does not implement the same behavior for `v4/mini` (which the intended change covers). It also omits the shared narrowing utility/type-level wiring used to make this consistently available across schema variants. So the core intent is only partially implemented.

Code Review

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

The agent patch partially implements classic type-guard narrowing but misses key parts of the intended cross-variant/type-system update and weakens related test coverage, so it likely does not satisfy the task end-to-end.

4 findings
Refine narrowing added only for classic schema surface
major

The change introduces predicate narrowing overloads in `packages/zod/src/v4/classic/schemas.ts` only; the task scope expects predicate-aware refine behavior across relevant schema variants (notably mini), so coverage is incomplete.

packages/zod/src/v4/classic/schemas.ts:92
Type-guard overload excludes async predicate form
major

The predicate overload is restricted to `(arg) => arg is RefinedOutput`, while existing refine usage allows async checks; narrowing is therefore not modeled for predicate-like async refinements.

packages/zod/src/v4/classic/schemas.ts:92
Ad-hoc local narrowing type risks type-model divergence
major

A file-local `ZodTypeWithOutput` helper modifies both `_output` and `_zod.output` shape in one place, rather than using a shared core utility, which increases the chance of inconsistent behavior and typing drift.

packages/zod/src/v4/classic/schemas.ts:20
Regression tests for chained and superRefine narrowing were removed
minor

The patch uncomments one type-refinement test but removes broader narrowing scenarios, reducing confidence that mixed/chained refinement typing remains correct.

packages/zod/src/v4/classic/tests/refine.test.ts:434