Discovered while calibrating prepared CommonJS export queries for #536, under tracker #416. With explicit roots including lib.d.ts, owner.js and app.js, allowJs/checkJs enabled and unchanged strict shared options, both TS 6.0.3 and native TS 7.0.2 reject missing properties on require("./owner") when owner exports new Service(). Home b7b9dd9 silently accepts. Direct, bracket, parenthesized, alias, repeated assignment, comment/string and nested assignment controls are retained in commonjs-query.hyU20d/probe-roots-before.log. The initial probe excluded JS through its TS-only include; that invalid probe is retained separately and is not admission evidence. Fix actual source-owned CommonJS type linkage, including union/reassignment semantics, without permissive any or diagnostic-text inference. Add identical positive and appended-only negative controls for both root orders. This is broader than the class-display query optimization in #536 and must remain an explicit correctness gap; do not add a timed CommonJS workload until its rejection controls pass.
fix(ts): preserve required CommonJS instance types across JavaScript files
#541Audit committed and pushed in d95dfaa. All 66 cases have explicit JS roots, strict allowJs/checkJs options, both root orders, and identical positives with only appended TS2322/TS2339 controls. TS 6.0.3 and native TS 7.0.2 pass 66/66; frozen Home b7b9dd9 passes 22/66 (all positives), missing all 44 negative diagnostics. The benchmark harness has 75 passing tests, including coverage/JS-root/control-integrity guards. Evidence: commonjs-query.hyU20d/audit-before.log. No CommonJS timing row is admitted.
Source inspection localizes missing linkage: ProgramCommonJsExport carries module/name and declaration-privacy flags, but no source-owned whole-value type; collectProgramCommonJsExports records syntax/name metadata. commonJsWholeExportTypeForRequireVariable immediately returns null unless the consumer source has virtual filename sections, so real external owner.js/app.js cannot use that path. Follow-up should transfer actual prepared owner expression/constructor type facts into require consumers (including multiple-assignment unions), not route real files through fabricated virtual text or add a diagnostic-only class-name shortcut. #536 only removes repeated work in the existing display-metadata query.
Current release1cfc33c1a retains Home22/66 (all22 positives, missing all44 rejection controls), while TS6.0.3/nativeTS7.0.2 pass66/66. Full case identities and previous passes were checked; no failures waived. #536 is complete only for prepared query reuse, not this type-transfer gap. README/report707045c73 publishes the unchanged audit result and keeps CommonJS untimed. https://github.com/home-lang/home/blob/main/docs/docs/TS_PERFORMANCE.md#prepared-query-checkpoint-performance
Graph prerequisite #545 is complete on main. Static CommonJS dependency discovery now passes 44/44 for TS 6.0.3, native TS 7.0.2 and Home, including nested/transitive/cyclic/diamond shapes and five excluded decoy families. I reran this issue audit against the immutable after binary: TS 6.0.3 66/66, native TS 7.0.2 66/66, Home still 22/66. All 44 missing TS2322/TS2339 rejections remain open here. The next work remains real checked-owner type transfer, including reassignment/union and nominal identity; graph discovery is not being counted as type linkage or timed admission.
Fixed on main by fb07dea, documented by 2d5859f.
Verified against exact pins TypeScript 6.0.3 and native TypeScript/tsgo 7.0.2 (one TS7 competitor):
- unchanged CommonJS audit: TS6 66/66, TS7 66/66, Home 66/66; 198/198 compiler-case checks, zero failures
- frozen Home baseline: 22/66, so all 44 missing TS2322/TS2339 rejections are restored
- static require discovery retained: 132/132 checks, zero failures
- Program 145/145, benchmark harness 78/78, checker, driver, CLI, and conformance target pass
- conformance summaries: smoke 16/16, named 86/86, baseline-aware 586/586
The implementation projects actual checked owner TypeIds into the existing source-owned schema, preserves reassignment unions and class identity, and checks dependencies before consumers in serial, streaming, and required parallel graphs. It does not guess from source spelling or add diagnostic-only recovery.
Immutable candidate: commonjs-linkage.gyKMKg/release-v2/bin/home-tsc SHA-256: 3cab7afcaf38cb5bef789081bc228ab0a970166c0bbd1f2bd24cd61359e823a5
Documentation: https://github.com/home-lang/home/blob/main/docs/docs/TS_PERFORMANCE.md#checked-commonjs-export-type-transfer-untimed
Sign in to comment on this issue.