ReviewOS

home-lang/home

fix(ts): project inherited members through unsupported owner schemas

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

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

A cross-module interface can have exact, representable inherited properties while an unrelated member makes its complete serialized schema unsupported. Home currently loses every inherited property when a local generic interface extends that imported owner and a second local interface extends the first. TypeScript 6.0.3 and native TypeScript 7.0.2 accept the strict two-file cyclic reduction with zero diagnostics; current Home reports four TS2339 diagnostics for pattern, abort, format, and attach. Removing only the unrelated recursive Record-bearing callback makes Home pass, isolating the all-or-nothing owner-schema gate.

Implement declaration-identity, requested-member projection through local and qualified heritage even when the owner declaration cannot be lowered as a whole. Preserve generic substitutions, cycles, visibility, optionality, callback signatures, invalid-member controls, root-order independence, and existing private/protected union rules. Do not synthesize any, special-case names, suppress diagnostics, or approximate the complete object.

Calibrate positive and appended-negative Program controls against TS 6.0.3 and native TS 7.0.2, run full checker/Program suites, and compare the unchanged pinned Zod 4.5.2 corpus against the immutable 602-diagnostic baseline by exact path/line/column/code keys. Keep #548 untimed until the graph reaches zero diagnostics.

Provenance: #534 implementation 197ee07, #654 flow fix 2e749f7, documentation 4ef52ad.

8 days ago

ReleaseFast candidate validation:

  • Exact two-file cyclic reduction: Home 0 diagnostics; TypeScript 6.0.3 0; native TypeScript 7.0.2 0.
  • Positive Program control adds the non-generic child layer and unrelated recursive Record leaf; appended negative control still emits exactly TS2322 + TS2339.
  • Program suite: 187/187 passed.
  • Checker suite: 4,353/4,353 passed.
  • Pinned Zod 4.5.2: 523 -> 489 diagnostics. Exact current-parent identity diff: 34 removed, 0 added; every removed key is TS2339. Against the immutable 602 baseline: 113 unique keys removed, 0 added.
  • Scoped Pickier and git diff --check pass.

The implementation recovers the exact visible local interface declaration from the receiver's registered type identity, then reuses declaration-backed inherited-member projection. It does not change whole-schema admission or add a permissive fallback.

8 days ago

Fixed on main by ab86dad. ReleaseFast two-file oracle matches TS6.0.3 and native TS7.0.2 at zero diagnostics; checker 4,353/4,353 and Program 187/187 pass. Pinned Zod improves 523 -> 489 with 34 TS2339 identities removed and 0 added. README and detailed evidence are published in 6763779.

Sign in to comment on this issue.