STET

flux-pr-5574

Zod (TypeScript) · W2 · GPT-5.3 Codex

pass_with_warn

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

69.2% run pass rate
Tier 1
primary equivalencepassedneeds generated testsweak signal riskcommand source driftequivalentfail
pnpm build
gold passagent pass
npx vitest run packages/zod/src/v4/classic/tests/registries.test.ts -t "re\-registering\ same\ id\ silently\ overwrites|toJSONSchema\ throws\ on\ duplicate\ id\ across\ different\ schemas|toJSONSchema\ allows\ same\ schema\ with\ same\ id"
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

equivalent

code review
Code review judgment
#4

fail

decision
Final decision
#5

pass_with_warn

Quality

equivalence
equivalent
85% confidence
code review
fail
2 findings
footprint
medium (0.49)
behavioral
100.0%
cost
$2.05 · 751K

Equivalence Reasoning

stylistic

The patch removes registry-time duplicate-ID rejection and shifts duplicate detection to JSON Schema conversion when multiple registry entries are emitted together. It allows duplicate IDs at registration, and conversion now throws when the same ID maps to different schemas, matching the task intent via a different internal design (`Map<string, Set<Schema>>` + conversion-time check).

Code Review

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

The patch partially meets the goal (registration no longer rejects duplicate IDs and registry conversion now checks for duplicates), but it appears narrower than intended and introduces a concrete edge-case bug in ID cleanup logic.

2 findings
Duplicate-ID enforcement added only for registry conversion path
major

The new duplicate check is scoped to `toJSONSchema` when input is a registry (`registry._idmap` pass). This does not implement duplicate-ID detection in the shared multi-schema extraction flow, so distinct schemas with the same ID can still evade this guard outside that specific path.

packages/zod/src/v4/core/json-schema-processors.ts:606
Falsy-ID cleanup bug in registry bookkeeping
major

Re-registration/removal cleanup uses truthy checks (`if (prevId)` and `if (id)`), so an empty-string ID is not removed from `_idmap`/`_schemaIdMap`. This can leave stale mappings and produce incorrect conversion behavior.

packages/zod/src/v4/core/registries.ts:38