Parent: #548. Related: #668 (the imported Extract and mapped-handler transfer fix already landed and closed).
Reproducible gap
The unchanged pinned Zod 4.5.2 21-file core proxy still has a Home-only core/visit.ts:34:21 TS2571: Object is of type 'unknown'. at:
const h = (fnOrHandlers as VisitHandlers)[node._zod.def.type] as
| ((n: AnyZod, rewritten: boolean) => AnyZod)
| undefined;Here VisitHandlers = { [K in Kind]?: (node: SchemaOfKind<K>, rewritten: boolean) => AnyZod }, with SchemaOfKind<K> using Extract over Zod's $ZodTypes union. TypeScript 6.0.3 and native TypeScript 7.0.2 do not report TS2571. The proxy's shared TS2307 for omitted locales is unrelated.
A strict two-kind, two-file reproduction of the same Extract + optional mapped handler + assertion + computed key was run under both TypeScript controls and Home. All three accept the handler expression and report only TS2322 for a deliberately wrong VisitFn return. Therefore importing the alias or using this syntax alone is not sufficient to reproduce the remaining failure; the larger Zod type graph or its instantiation/transfer path matters. Do not re-open #668 as a presumed cause without evidence.
Acceptance
- Minimize the full-graph trigger while retaining a positive handler lookup and negative controls for an invalid handler/return or key.
- Fix the general type-evaluation or transfer cause so the frozen core proxy loses
core/visit.ts:34:21 TS2571with zero new exact diagnostic identities; preserve both controls' behavior. - Add focused checker and Program regressions, run full relevant suites and a guarded optimized
home-tscbuild, document the exact normalized before/after set, and link the checkpoint to #548. - Keep the full 106-file Zod graph and benchmark timing gated on separate complete admission.
No source-name special cases, unknown/any casts inserted in the corpus, suppressed diagnostics, skips, or fixture edits.