ReviewOS

home-lang/home

fix(ts): retain local declaration facts for external import diagnostics

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

Follow-up from export-list audit #538, tracker #416. The parser/index candidate passes all32 positive and32 wrong-type controls, and correctly rejects all hidden imports. However16 direct hidden-import controls produce TS2305 instead of TS2459; both TS6.0.3 and native TS7.0.2 produce TS2459. Two-hop barrel controls correctly use TS2305. All96 audit cases and exact expected codes remain unchanged; candidate score80/96 versus baseline0/96.

Cause found in check.zig: virtualRelativeModuleLocalImportStatus refines missing exports to TS2459/TS2460 using virtual same-HIR sections only. Real external modules provide export facts but not the corresponding owner-local declaration/renamed-export status. Carry those facts from the prepared source owner through the external resolver, preserving alias status and diagnostic provenance. Do not reread source text in the consumer or relax audit diagnostics. Add direct/barrel, alias, shadowing and type/value-space controls; verify no false local-name visibility is introduced. Evidence export-index.NVcIdu/export_lists-v3.log.

8 days ago

The retained 16/96 external hidden-binding diagnostic mismatches are now documented in README/report commit 24a34f4. Parser ownership is fixed in d6878e8 (#538); b7b9dd9 retains bound-owner indexing and all expected diagnostic codes. Every hidden import is rejected, but direct imports still report TS2305 rather than TS2459. Both TS 6.0.3 and native TS 7.0.2 pass 96/96; Home 80/96. https://github.com/home-lang/home/blob/main/docs/docs/TS_PERFORMANCE.md#indexed-export-checkpoint-performance

8 days ago

Implementation is ready on the exact 078363fa4 base and stays within the prepared-owner boundary:

  • ts_program now reports module-scope declaration and renamed-export facts from the already bound compilation; repeated-query tests blank the source and prove no reparse/check occurs.
  • CLI and conformance resolver adapters copy the borrowed alias into their long-lived arenas.
  • The checker refines only trusted missing exports: direct local -> TS2459, renamed local -> TS2460, non-owning barrel -> TS2305.
  • The audit was expanded fairly from 96 to 128 cases with renamed direct/barrel controls. TS 6.0.3, native TS 7.0.2, and the candidate each pass 128/128 (384/384 compiler checks); pristine base Home passes 80/128, with 48 exact-code failures.
  • Focused ts_program, full ts_checker, full ts_cli, and the new conformance adapter test pass. README and TS_PERFORMANCE.md now record the untimed admission separately from performance.

I am completing the final landing verification and will attach the main commit here.

8 days ago

Landed on main as three small, issue-linked commits:

  • b87db62c6 — fix(ts): retain external local import facts (#540)
  • 1743ca880 — test(ts): expand export list diagnostic audit (#540)
  • e53d7e845 — docs(ts): record external import admission (#540)

The resolved-module path now matches the existing virtual-module diagnostic precedence without source recovery: prepared module bindings supply owner-local declaration and renamed-export facts, resolver adapters preserve their lifetime, and the checker consumes them only after a trusted export-table miss. Direct hidden names produce TS2459, direct renamed hidden names produce TS2460, and non-owning two-hop barrels remain TS2305. The adjacent export-membership bug that treated both sides of export { hidden as public } as public is fixed at the HIR query.

Final evidence:

  • Expanded fair audit: TS 6.0.3 128/128, native TS 7.0.2 128/128, Home 128/128; 384/384 compiler checks, 0 failures.
  • Pristine 078363fa4 Home baseline: 80/128, 48 failures.
  • Two candidate audit runs are byte-identical, SHA-256 2f911dc51b73577f69c7c729f000a2b030b32dc5308660fc3775fee1008c8c70.
  • ts_program, full ts_checker, full ts_cli, and the focused prepared-owner conformance adapter test pass.
  • Targeted pickier lint passes. The full-tree lint remains blocked by the repository's pre-existing vendored/corpus findings.

The untimed admission matrix and frozen binary/log hashes are documented in docs/docs/TS_PERFORMANCE.md, with a concise linked table in README.md. No timing claim was added or changed.

Sign in to comment on this issue.