ReviewOS

home-lang/home

fix(ts): transfer inherited cyclic generic callables

#657
Closed chris opened this 8 days ago ·
8 days ago

Follow-up under #548 and #416 after #656.

Home now projects scalar members through unsupported owner schemas, but still loses an inherited callable when that member's own signature references a generic payload imported through a module cycle. The strict two-file reduction extends the #656 oracle with RemoteBase<T>.check(payload: LocalPayload<T>): T | Promise<T>, where LocalPayload<T> is owned by the importing module. TypeScript 6.0.3 and native TypeScript 7.0.2 report zero diagnostics; current ReleaseFast Home reports one TS2339 on Child.check. Removing only the generic cyclic callable makes the graph clean.

Preserve the requested callable from its source-owned declaration graph, including generic substitution, parameter type, return union, optional/method flags, contextual callback typing, cycle identity, and root-order independence. Retain unsupported unrelated leaves as ineligible for whole-object publication. Do not synthesize any, special-case member names, suppress diagnostics, or admit approximate owner schemas.

Add paired positive/appended-negative Program controls calibrated against TS6.0.3 and native TS7.0.2, run full checker/Program suites, and compare every pinned Zod 4.5.2 diagnostic identity against the 489-current and immutable 602 baselines. Keep timing gated on zero under #548.

Provenance: #656 implementation ab86dad; documentation 6763779.

8 days ago

Implementation candidate is now at the release gate.

Semantic change:

  • Program schemas now retain a parameterized standard-library reference as an identity plus source-owned type arguments.
  • The first certified family is Promise<T> / PromiseLike<T>, rebuilt through the consuming checker's existing canonical constructors.
  • Lossless requested-member projection, contextual-only callable preservation, and conservative whole-declaration substitution remain distinct support modes.
  • Local declarations still win: a user-defined Promise<T> remains a declaration reference rather than a built-in reference.

Fair oracle:

  • exact cyclic two-file positive reduction: Home ReleaseFast 0, TypeScript 6.0.3 0, native TypeScript 7.0.2 0;
  • appended negative control: all three report exactly 3x TS2322 plus 1x TS2339 (wrong format, wrong string | Promise<string> return assignment, wrong payload, genuinely missing member);
  • normal and reverse Program root order are both covered;
  • Program: 189/189 pass;
  • checker: 4,353/4,353 pass;
  • scoped Pickier and git diff --check: pass.

Pinned Zod 4.5.2 audit:

  • #656 checkpoint: 489 primary diagnostics / 484 unique keys;
  • candidate: 489 / 484;
  • delta: 0 removed, 0 added;
  • versus immutable 602-diagnostic baseline: 113 unique keys removed, 0 added.

I explicitly rejected two broader support modes during the audit because they introduced new corpus diagnostics. The final mode preserves the existing contextual-only contract and does not certify unrelated collection families or whole declarations that the Program relation path cannot yet reproduce exactly.

8 days ago

Pushed directly to origin/main as 5f31fc7f1 (fix(ts): transfer parameterized builtin callables (#657)). The pushed tree is exactly aligned with origin/main; author/committer is Chris Breuer and there is no coauthor trailer. Closing with the calibrated evidence above.

8 days ago

Documentation is now on origin/main as 2143a4623: detailed parameterized built-in callable audit plus the linked compact README table. The docs retain the accepted 489/484 result and both rejected regression-producing probes.

Sign in to comment on this issue.