ReviewOS

home-lang/home

TypeScript checker parity: eliminate the remaining 30 failures

#69
Closed chris opened this 14 days ago · 717 comments
14 days ago

Parent: #67

Scope

Make ts_checker fully green by porting the remaining TypeScript semantics and exact diagnostic behavior. Do not weaken assertions or encode fixture-specific outcomes.

Current verified state

After fixing distributive-conditional union member ownership:

  • 2,976 / 3,006 pass
  • 30 fail
  • 0 crash (down from 2 crashes)

The crash fix copies union member IDs before recursive conditional evaluation so interner reallocations cannot invalidate a borrowed slice.

Remaining failure clusters

  • Enum/member literal assignment compatibility.
  • Global-script this indexed access diagnostics.
  • Generic defaults, conditional distribution, NonNullable, mapped and template types.
  • Variadic tuple inference and callback arity.
  • Overload diagnostic anchoring and CheckJS/JSDoc arity.
  • Accessor read/write and spread typing.
  • Alias/generic-instance diagnostic rendering.
  • Recursive type depth/circular mapped diagnostics.

Completion gate

  • ./pantry/.bin/zig build test -Dfilter=ts_checker --summary failures reports 3,006 / 3,006.
  • No crash, timeout, or skipped parity assertion replaces a failure.
  • Each semantic cluster lands in a focused conventional commit with regression coverage.
14 days ago

Indexed destructuring flow parity

Pushed 2da841a49 (fix(ts-checker): preserve indexed destructuring flow).

  • Reuses indexed-member flow facts for each array-destructuring source position.
  • Retains the declared tuple-union container for iterator and indexed-property checks.
  • Flips destructuringControlFlow to exact parity and removes 2 residual TS2322 diagnostics.
  • Projected exact parity: 5795/5907; remaining frontier: 112 fixtures.
  • Patch size: 30 insertions, 3 deletions.
  • Verification: focused checker regression, zig fmt --check, git diff --check, and exact upstream fixture run 1/1 passed.

The expensive full checker sweep is intentionally deferred across the next logical batch.

14 days ago

Recovery diagnostic ordering parity

Pushed ed5048309 (fix(ts-parity): scope typedef diagnostic ordering).

  • Restricts TS2300-before-TS1005 ordering to JS-like malformed JSDoc recovery.
  • Restores syntax-first ordering for TypeScript diagnostics sharing a location.
  • Flips typeGuardFunctionErrors to exact parity while preserving typedefTagWrapping.
  • Tracked exact parity: 5796/5907; remaining frontier: 111 fixtures.
  • Patch size: 21 insertions, 6 deletions.
  • Verification: focused conformance test, zig fmt --check, git diff --check, and exact upstream fixtures 2/2 passed.
14 days ago

Contextual async return parity

Pushed 31a01955c (fix(ts-checker): await contextual async returns).

  • Awaits contextual target returns before validating async expression bodies.
  • Prefers Home's explicit promise payload marker during recursive Awaited evaluation.
  • Flips contextuallyTypeAsyncFunctionReturnType to exact parity by removing its final spurious TS2322.
  • Tracked exact parity: 5797/5907; remaining frontier: 110 fixtures.
  • Patch size: 19 insertions, 2 deletions.
  • Verification: focused checker regression, zig fmt --check, git diff --check, and exact upstream fixture 1/1 passed.
14 days ago

Parity progress: pushed 9593737 (fix(ts-checker): preserve cross-file expando errors). The checker now retains TS2339 for a callable expando assignment when the callable declaration belongs to another virtual JS file, while preserving same-file open expando writes. typeFromPropertyAssignment12 is exact (1/1); focused checker regressions passed. This chunk changed 34 lines and removed 1 line. Tracked exact parity is now 5,798/5,907 with 109 failures remaining. Full-suite validation remains deferred until the next batch, per the batching strategy.

14 days ago

Correction to the preceding progress count: 9593737 flips 2 fixtures, not 1. In addition to typeFromPropertyAssignment12, the same cross-file callable/class expando rule makes constructorFunctionMergeWithClass exact by preserving its missing TS2339 on SomeClass.prop. Verified against the pre-change and post-change exact binaries. The corrected tracked state is 5,799/5,907 exact with 108 failures remaining.

14 days ago

Parity progress: pushed 16616e1 (fix(ts-checker): relate narrowed conditional intersections). Extract-like deferred conditional constraints now participate when nested in a narrowed intersection, removing 3 excess diagnostics while retaining all 7 expected conditionalTypes2 errors. conditionalTypes2 is exact (1/1), and its focused checker regression passes. The patch adds 42 lines (the commit body says 43; the Git stat is the authoritative count). Corrected tracked parity is 5,800/5,907 with 107 failures remaining; full-suite validation remains deferred for the batch.

14 days ago

Parity progress: pushed 7c4bc20 (fix(ts-checker): diagnose type-only heritage values). Direct named import-type bindings now report TS1361 when used as class heritage values, with TS1376 import-site related info; interface heritage remains a valid type position. extendsClause is exact (1/1), focused regression passed, and the patch adds 58 lines. Tracked exact parity is 5,801/5,907 with 106 failures remaining. Full-suite validation remains deferred for the current batch.

14 days ago

Pushed ef4801b (fix(ts-checker): preserve namespace re-export origins).

This traces export = namespace-import aliases when formatting missing-member diagnostics, so the diagnostic retains the original virtual module provenance instead of naming the intermediate re-export module. The implementation also centralizes canonical typeof-import display formatting.

Exact movement: importEquals2 now passes 1/1, flipping 1 fixture. The focused checker regression and exact tsgo fixture both pass. Patch size: 62 insertions, 2 deletions. Tracked parity is now 5,802/5,907 exact (105 failures remaining). The broad corpus remains deferred while batching the next fixes.

14 days ago

Pushed 569929014 (fix(ts-checker): follow renamed type re-exports).

This closes the bare imported-type visibility gap and recursively follows named type re-exports with alias spelling preserved. The unresolved-annotation preflight now recognizes scoped import bindings, so successfully resolved imported object types reach normal assignability instead of collapsing to any.

Exact movement: renamed now passes 1/1, flipping 1 fixture. The focused checker regression and exact tsgo fixture both pass. Patch size: 46 insertions, 0 deletions. Tracked parity is now 5,803/5,907 exact (104 failures remaining). Broad corpus execution remains deferred while the next logical fixes are batched.

14 days ago

Pushed a961e1c (fix(ts-checker): resolve bare UMD global types).

This adds the bare type-space counterpart to the existing qualified UMD namespace resolver: an export-as-namespace name now resolves to its export-assignment target in annotations, while value-space use inside an external module still follows the TS2686 path.

Exact movement: umd8 now passes 1/1, flipping 1 fixture. The focused checker regression and exact tsgo fixture both pass. Patch size: 40 insertions, 0 deletions. Tracked parity is now 5,804/5,907 exact (103 failures remaining). The push also included unrelated concurrent runtime commits already on main; this parity commit remains isolated.

14 days ago

Pushed d7dc857 (fix(ts-checker): traverse local type re-exports).

This follows local named exports through imported type roots before runtime-status fallback, covering chains such as import type C followed by export { C as D }. Missing-property elaboration now prefers the originating class name over an unrelated structurally interned alias name.

Exact movement: chained now passes within the 3-fixture substring probe, moving that probe from 1/3 to 2/3 and flipping 1 fixture. chained2 remains the only failing match and is tracked separately. Both focused checker regressions pass. Patch size: 39 insertions, 0 deletions. Tracked parity is now 5,805/5,907 exact (102 failures remaining).

14 days ago

Parity count correction from a fresh targeted audit: exportAssignmentMergedInterface now passes 1/1 exactly. It was still listed in the stale frontier snapshot, so this is one additional verified flip beyond the commit-local counts reported above. The corrected tracked total is 5,806/5,907 exact with 101 failures remaining. No new patch is attributed to this note; the broad census will assign all accumulated movement when it is rerun.

14 days ago

Multisystem exact-parity batch

Pushed four conventional checkpoints to main:

  • 6b01bf320 fix(ts-parser): allow multiline type alias equals
  • 7b05c19e2 fix(ts-driver): require helpers for default re-exports
  • 5bbc44133 fix(ts-checker): align guards and diagnostic anchors
  • bec109c46 fix(ts-resolver): honor module suffix ordering

Verified movement: 7 known exact failures flipped: deferredConditionalTypes, importHelpersWithImportOrExportDefaultNoTslib.2, arrayBufferIsViewNarrowsType, jsFileMethodOverloads3, instanceofWithPrimitiveUnion, moduleResolutionWithSuffixes_one_externalModule, and moduleResolutionWithSuffixes_one_externalModulePath.

Logical ports include multiline type-alias recovery, named JSDoc TS7010 reporting, ArrayBuffer.isView narrowing/definite assignment, statement-parenthesis diagnostic anchoring, CommonJS default re-export helper requirements, and typed end-to-end moduleSuffixes resolution.

Validation: targeted exact corpus 9/9, parser 897/897, driver 166/166, resolver 119/119, and tsconfig 145/145. Patch total across the four commits: 350 insertions, 64 deletions. Parent tracker: #67.

14 days ago

Progress update: five more exact checker fixtures

Pushed 4d5ef39e3 with five tsgo parity fixes across receiver-specialized generic methods, captured generic predicates, conditional array indexed access, and subclass static-side assignability. The change covers 222 lines (213 additions, 9 deletions) and adds five local regressions.

Validation:

  • exact compiler fixtures: 5/5 passing (up from 0/5 at the start of this slice)
  • focused checker regressions: 18/18 passing
  • full checker suite: 4,161/4,174 passing
  • parent comparison at 4c7ac3c2d: the same 13 full-checker failures, confirming zero new suite regressions
  • ts_program: 93/94, unchanged; the existing reverse-mapped inference case remains

Also pushed b9c74ce86, a one-line test-harness repair that replaces a nonexistent diagnostic constant and unlocks execution of all 4,174 checker tests.

Next work continues from the 13 verified baseline checker failures, with reverse-mapped inference and mapped/indexed access forming the largest connected cluster.

14 days ago

Pushed 677214a29 (fix(ts-checker): preserve resolvable indexed binders). This 12-line lowering fix resolves bare indexed operands through active binders or generic-aware alias lowering before preserving a symbolic access. It clears 9 of the 13 known full-checker parity failures: the mapped slice is now 91/91 (up from the original 82/91), with connected contextual-return 2/2 and union-recursion 1/1 checks passing.

14 days ago

Checker parity complete

The authoritative checker gate is now 4,174/4,174 (100%), with no failures, crashes, skips, or weakened assertions.

Closing progression from the last full baseline:

  • 677214a29 cleared 9/13 residual failures and moved the mapped batch 82/91 -> 91/91.
  • 4c28820f6 cleared the final 4/13 through generic binder ownership, complete constructor-overload comparison, truthy-unknown logical assignability, and strict ArrayBuffer.isView definite-assignment parity.
  • Focused verification: 4/4 exact residual tests and 200/200 neighboring tests.
  • Full verification: ./pantry/.bin/zig build test -Dfilter=ts_checker --summary all -> 4,174/4,174 passed in 6 minutes.

The final counts and canonical tsgo main pin are recorded in c507a803a (docs(ts-parity): record full checker parity). Parent tracking remains in #67.

14 days ago

The authoritative no-filter exact survey at 7effc2613 completed with 5,907/5,907 passed, 0 failed, 0 skipped against tsgo 89d5d5b2849a0db0957065889ca58536fa6d2e4a. The full checker gate is 4,185/4,185, and the remaining ts_* package umbrella is green.

The checker child remains correctly closed. The eleven additional regressions added during the final exact-parity wave are included in the 4,185/4,185 total.

Sign in to comment on this issue.