ReviewOS

home-lang/home

fix(ts): bind exported generic type and factory declarations across modules

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

Follow-up under #487 and tracker #416, building on source-owned generic definitions from #524.

The current Program exported-value collector scans .d.ts lines and retains simple type names; source .ts factories and generic signatures are not carried to consumers. Generic interfaces/type aliases are also absent from the corresponding imported-type environment. The original graph gates still fail 0/2.

Replace this projection with bound declaration identities and shared source-owned annotation graphs. Retain generic function parameters, constraints/defaults, required/rest/receiver metadata and parameterized return types. Resolve aliases/re-exports by owner, not display names. Exercise inferred factory results as well as explicit annotations, invalid arguments/arity, missing/readonly properties, name collisions and root-order independence. Keep unsupported inferred bodies and other unimplemented semantics explicit, never add permissive fallback to manufacture admission. Preserve all existing graph rejection controls unchanged.

Calibrate paired positive/appended-negative controls against TS6.0.3 and native TS7.0.2, verify full regressions, document exact remaining failures and only readmit graph timings after real semantic checks pass. Link implementation and documentation commits here.

8 days ago

Baseline audit dd11247 is pushed: 240 controls across local, named, namespace and two-hop barrel placements, both root orders, with positive/appended-only-negative pairs. TS 6.0.3 and native TS 7.0.2 pass 240/240; frozen Home 3b7f0ea passes 130/240 (local42/48; each imported placement22/48). Six local failures cover dependent generic defaults and factory return rebinding under a same-named nested interface; all failures are retained. Evidence graph-types.4EsbvV/audit-before.log; harness69/69. The implementation is in progress: one bound shared annotation graph for type/value export bindings, parameterized factory signatures and owner-resolved interfaces, replacing line-based .d.ts value collection. Original graph controls remain unchanged and ineligible until verified.

8 days ago

Debug candidate evidence: the unchanged original import_graph and reexport_graph correctness gates now both pass for TS 6.0.3, native TS 7.0.2 and Home. The 240-case factory audit improves from Home 130/240 to 220/240; all 20 remaining failures are dependent-default controls, retained unchanged. Static values remain 84/84; nominal origins remain 44/52 (the same eight inherited private/protected failures). A source-owned default substitution fix is now under verification; 10/10 focused checker tests pass. Full regressions and optimized-build correctness/performance are still pending, so this is not a measured-release claim. Logs: graph-types.4EsbvV/{audit-v2,graphs-v2,static_values-v2,nominal_origins-v2,focus-v3}.log.

8 days ago

The dependent-default fix now passes all 240/240 factory controls in Debug (TS6 and TS7 also 240/240). Frozen ReleaseFast candidate SHA-256 9f5e333beaf9828a9720ce260ae05a872ebcea3bb51bf5785ffa3ccd7b72f1bc passes all 19/19 workload admission gates, including both original graph rejection checks unchanged. Evidence: graph-types.4EsbvV/audit-v3.log and admission-release-v3.log. Program133/133, driver187/187, CLI69/69, focused checker10/10 and harness69/69 pass. Full checker/conformance and expanded Release audits are still running; no new timing claims yet. Profiling follow-up #536 tracks duplicate source compilation during CommonJS export queries; any optimization baseline will use this semantically corrected candidate, not the formerly ineligible binary.

8 days ago

Landed implementation de8fe28 and documentation/README f3740df, pushed as Chris without coauthors. Release factory controls240/240, unchanged graph gates2/2 and full workload admission19/19 all pass. Checker4286, conformance1417, Program133, driver187, CLI69, focus10 and harness69 tests all pass. Complete run20260828T224220Z validates570 rounds/1710 samples; fresh generation matches513 measured corpus files. Graph means: Home33.7ms vs TS7 50.8ms; barrel25.1ms vs41.1ms. Home wins means18/19 overall; large predicates lose1.42x (0/30 paired wins), explicitly published and tracked in #537. Profiled redundant CommonJS queries are tracked separately in #536. All remaining audit failures and historical results are retained in docs/docs/TS_PERFORMANCE.md. This resolves the measured exported-factory contracts, not full TypeScript parity.

8 days ago

Fresh pinned-Zod checkpoint under #548 (Home 4fda2da): the exact Zod 4.5.2 src/v4 corpus still exits 1 with 600 primary diagnostics. The dominant codes are TS2345 212, TS2339 165, TS7006 100 and TS2344 43. A representative general failure is a local interface with multiple heritage clauses—one local base plus one namespace-qualified imported generic base—whose imported inherited members are absent downstream ($ZodStringFormatDef extends $ZodStringDef, checks.$ZodCheckStringFormatDef<Format> loses pattern/abort). The existing two-hop single-base controls pass, so I am reducing this specific multiple-heritage/source-owned projection path with TS 6.0.3 and native TS 7.0.2 positive/negative oracles before changing the checker. No Zod-specific names or permissive fallback will be used; the full corpus stays untimed until it reaches zero diagnostics.

8 days ago

Correction to the immediately preceding checkpoint: the exact primary diagnostic-line count is 602, not 600. rg -c " - error TS[0-9]+:" reports 602, and the per-code totals also sum to 602. The four dominant counts (212 + 165 + 100 + 43) were stated correctly; two less-common diagnostics were omitted from the earlier aggregate. I will use 602 as the immutable before-count.

8 days ago

ReleaseFast correctness checkpoint for the cross-module generic/factory work:

  • Exact recursive indexed-alias member projection reduction: 0 diagnostics.
  • Recursive generic interface heritage reduction: Home 0; TypeScript 6.0.3 0; TypeScript 7.0.2 0.
  • Program suite: 187/187 passed.
  • Checker suite: 4,353/4,353 passed.
  • Pinned Zod 4.5.2 corpus: 602 -> 523 diagnostics. Exact location/code audit: 79 unique baseline keys removed, 0 added.

This removes the newly exposed TS2352, the two to-json-schema.ts:453 TS2345 diagnostics, and the $ZodEnum TS2430 without source-name exceptions or whole-object approximations. Issue remains open because the corpus is not yet at zero.

8 days ago

Pushed the cross-module/generic-owner implementation to main as 197ee07 (fix(ts): resolve inherited generic members (#534)). The companion flow correction is 2e749f7 (#654). The validated corpus checkpoint remains 602 -> 523 diagnostics, 79 unique keys removed, 0 added.

8 days ago

Completed and pushed. The original 240/240 exported-factory controls were already green; 197ee07 now closes the remaining inherited generic/default/member projection gaps exercised by the pinned graph, with checker 4,353/4,353 and Program 187/187. The exact Zod audit is 602 -> 523 diagnostics with 79 unique keys removed and 0 added. Documentation and the README table are on main in 4ef52ad. Further zero-diagnostic work continues under #548 and #416.

Sign in to comment on this issue.