mirror of
https://github.com/vercel-labs/scriptc.git
synced 2026-11-03 07:54:40 +08:00
Compile cost (Hono fixture: 53 s -> 99 s with the overlay before): - The overlay is planned once per program text: a reload that only drops refused annotations renders the cached plan (overlay.ts plan/render split) and reuses the cached structural rewrites, instead of analyzing, reporting and planning again. - The overlay's analyses run without per-call-site clones, which only the constant-graph report uses so far (SCRIPTC_SHAPE_SITE_CLONES opts in). - A failing round also drops what the deferred refusals blame, saving a reload; deferred refusals no longer blame every annotation of their enclosing function (most of them exist without the overlay). - A parameter whose `typeof` tests the proven values never pass stays untyped: the typed parameter would narrow to never in that branch, which the lowering refuses (zod 4's Doc.write). - Deferred refusals in methods blame the arguments of the method's call sites (implicit instantiations), like those in functions. Package JSDoc: the overlay neutralized the package's JSDoc in every overlaid file, so declarations it does not type lost their documented types and the lowering instantiated them per call site instead. In commander, this changed which refusal `--help` reaches: the run passed the refusal the default build stops at and failed later, in Command.helpInformation, at a checked conversion of the package's own documented contract (a help width that is undefined off a TTY). Nothing the analysis proved was contradicted (SCRIPTC_SHAPE_CHECK_LOG logs no inferred-fact failure). Only the leading JSDoc of the declarations the overlay annotates is neutralized now; commander's overlay build fails exactly where its default build does, and the OVERLAY_KNOWN entries go. The overlay npm suite (134 cases), the shape tests, lint and format pass. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>