ReviewOS

home-lang/home

fix(ts): collect imported classes from bound declarations and preserve export aliases

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

Parent #521; imported-type tracking #487; overall tracker #416.

Program currently scans source text for exported classes. This mistakes static fields for instance members, can collect text in comments/strings, and does not link re-exported class bindings to their actual declarations.

Replace class discovery/member collection with traversal of already-bound HIR. Retain declaration path/position separately from the importing module/exported binding name, resolve aliases through the existing declaration-origin query, and propagate star-export candidates with a visited worklist rather than a fixed depth limit. Preserve currently supported namespace augmentations while keeping unsupported typed member/heritage linkage visible.

Add fair paired controls against pinned TS 6.0.3/native TS 7.0.2, including static versus instance access, alias identity, comments and keyword member names. Run checker, Program, driver and conformance regressions. Document counts and remaining failures, with no timing claim until correctness gates pass.

8 days ago

Fair audit checkpoint pushed as 79f43d1. All 44 cases are retained in the default run: aliases, cyclic/star barrels, static versus instance domains, comments, keyword property names, explicit shadowing and namespace export visibility. Pinned TS 6.0.3 and native TS 7.0.2 pass 44/44; frozen pre-change Home passes 18/44. The 47 Python harness tests pass. Evidence: bench/vs_tsgo/results/bound-classes.8s4Xq1/bindings-before-final.log. Bound-HIR collection and declaration-origin integration are implemented locally; verification is in progress, with failures retained in the log directory. No new timing claim.

8 days ago

Bound-declaration collector checkpoint shipped to origin/main as Chris Breuer, without coauthors:

  • cce3286: type-only class alias controls (original audit: 79f43d1).
  • 226da38: retain namespace declaration context in HIR.
  • b45b038: collect class exports from bound owners and preserve declaration identity through aliases; exclude non-public members from keyof.
  • 3567e26: detailed results and README table.

Pinned compiler versions verified: TS 6.0.3 and native TS 7.0.2. Final 52-case class audit improves 22/52 -> 48/52; nominal identity 36/52 -> 40/52. Both baselines pass 52/52 in both audits. The four remaining class audit failures are imported static-value and merged-namespace consumer failures, explicitly tracked in #523. This is not full checked-type transfer; complex members, constraints and heritage remain under #521/#487.

Verification: checker 4271/4271; conformance 1417/1417; Program 119/119; driver 187/187; CLI 69/69; parser 897/897; HIR 12/12; harness 47/47. Existing discovery/export-origin and callable audits retain all passes. Full admission remains Home 16/18, baseline compilers 18/18; original graph gates remain 0/2. No new timings claimed. Formatting passes; Pickier has no errors and one pre-existing README fragment warning.

Evidence: bench/vs_tsgo/results/bound-classes.8s4Xq1; final binary home-v1 SHA-256 7f71d18f3a1648032b346183267382573f02475b824f5db8c30e0cc463568bd2. Documentation: https://github.com/home-lang/home/blob/main/docs/docs/TS_PERFORMANCE.md#bound-class-declarations-and-export-aliases-untimed

Sign in to comment on this issue.