flux-commit-7af773c0
Zod (TypeScript) · W2 · GPT-5.1 Codex Mini
Tests failed. 1/6 commands passed. Strength: strong.
python3 -c "import json; c=json.load(open('jestconfig.json')); c['globals']={'ts-jest':{'diagnostics':False}}; json.dump(c,open('jestconfig.json','w'),indent=2)"npx jest --config jestconfig.json --testPathPattern 'codegen|function|refine'pytest -q tests/behavior/test_codegen_api_surface_behavior.pypytest -q tests/behavior/test_codegen_optional_object_behavior.pypytest -q tests/behavior/test_userpost_schema_behavior.pypytest -q tests/behavior/test_index_and_tozod_behavior.pyPartial score: 1/5
Trajectory
unknown · partial order onlyCanonical trajectory missing; showing coarse derived order only.
Quality
Equivalence Reasoning
behavioral
The patch covers part of the intent (adds `void` type file, new exports, and a codegen class), but it misses core behavior needed for the new test paths. Key gaps include: `toZod` object typing was not updated to the stronger `ZodObject<..., ..., T>` form (and `ZodObject` itself was not extended with the extra generic), which is important for recursive schema typing; `codegen.dump()` returns internal objects instead of TypeScript declarations (different generator surface/behavior); and optionality logic for intersections differs (`||` vs expected `&&`), which can produce incorrect generated TS shapes.
Code Review
The patch partially addresses exports and void support, but it likely does not satisfy the intended change end-to-end due to mismatched codegen output behavior, incorrect optionality for intersections, and incomplete recursive/object typing alignment.
The implementation returns `this.seen` directly, while the intended flow requires emitting TS alias text for generated types. This likely breaks codegen usage tests that expect string output suitable for compilation or snapshot comparison.
For intersections, optionality is computed with `||`; the intended behavior requires both sides to be optional. Current logic can incorrectly mark required properties as optional in object generation.
The recursive `User`/`Post` schemas are declared without `z.toZod<...>` annotations, reducing the intended compile-time guarantees for recursive typing examples exercised by tests.
The `toZod` object branch keeps the older `ZodObject<{...}>` form instead of the stricter object signature that carries the concrete target type through generics. This can break recursive/object inference paths targeted by the task.