Skip to content

feat(check): prototype newer TypeScript narrowing and recursion semantics - #160

Closed
vincentkoc wants to merge 2 commits into
claude/check-cli-proof-basefrom
claude/prototype-checker-baseline-upgrade
Closed

vincentkoc wants to merge 2 commits into
claude/check-cli-proof-basefrom
claude/prototype-checker-baseline-upgrade

Conversation

@vincentkoc

@vincentkoc vincentkoc commented Oct 13, 2026 •

Copy link
Copy Markdown
Member

Closed as superseded by oven-sh#45130, now ready for review. The replacement's integrated candidate 0d900695ca54e0caa58aecd3e592f9d5db37ae86 passed Linux and Darwin ARM64 native qualification, including all 61 differential registrations on each platform. Upstream CI and maintainer review remain separate gates. This fork branch preserves historical source and proof; the validation below applies only to the earlier heads it names.

What does this PR do?

This is an experimental baseline-upgrade/backport candidate, not a TypeScript 7.0.2 parity repair. Bun explicitly targets 7.0.2 today; the two reported diagnostics also occur in the official native 7.0.2 compiler and disappear with newer native semantics. The declared version and dependency pins are unchanged. This draft is unqualified and must not be treated as a complete baseline upgrade or release candidate.

Ports two owning checker changes, without changing application source:

  • microsoft/typescript-go#4781, native commit c5ed97d875: equality/switch narrowing of uniform primitive unions returns regular literal types. Mutable object copies retain a narrowed status. Shared union membership checks all intersected unions, and enum mixtures/unique symbols preserve their existing comparison rules.
  • microsoft/typescript-go#4913, native commit ea58062260: indexed accesses and homomorphic mapped types normalize to the target's recursion identity. The native 100-level relation limit becomes indeterminate instead of a false incompatibility; complexity exhaustion and Bun's physical stack guard remain. The existing 64-step circular mapped-alias bound is preserved. Obsolete TS2321 relation state is removed.

Adds four regressions for mutable narrowing, a clean nested-Omit generic assertion, recursive mapped-alias termination, and compatible cyclic relations. Negative cases preserve invalid payload, discriminant, enum, symbol and shallow recursive rejection. Three existing depth tests now expect the newer native behavior, including the release-only 130-comparison case.

Source is frozen at Bun 11b450ca9. The comparison base carries only the fork's existing maintained native workflow and test runner; the PR diff contains the two semantic commits. Production delta: +59 lines; tests: +169 lines.

How did you verify your code works?

  • Published SHA512 integrity and binary versions verified for official Darwin arm64 native TypeScript 7.0.2, August 17/19 development builds, and 7.1.0-dev.20260922.1. No package hooks or system installation.
  • The source-derived nested-Omit reproducer was reduced from the actual input union to seven lines with zero unrelated diagnostics: 7.0.2 and August 17 reject it with TS2352; August 19 and September 22 accept it.
  • The backup/strict equality copy fixture fails 7.0.2 and passes September 22. Its negative guards remain checked.
  • The new cyclic-relation fixture fails 7.0.2 with TS2321 and passes September 22 while rejecting the nearby incompatible payload.
  • Source review, installed-toolchain rustfmt and git diff --check passed.
  • Exact-head native release CI passed on Linux x64 and Darwin arm64 at 9baa579f26d2733c7ba6ec869407768a4e718568. The full test/cli/check/check.test.ts ran on both: Linux 631 pass / 4 skip / 0 fail; Darwin 632 pass / 3 skip / 0 fail. Both ran 635 tests and 366 snapshots. The release builds cover all new positive/negative cases, updated depth expectations, and all 130 repeated deep comparisons. All 14 Linux and 10 Darwin selected test files passed. Rust compilation verifies the mutable recursion-identity receiver changes.
  • Both executable packages were checked against their exact commit and SHA256 manifests. The Darwin candidate also accepts the five original reduced narrowing/mapped/recursive fixtures, including their negative guards.
  • Actual OpenClaw core and UI checks passed on frozen source aed6c05cc43d898daf4c82bf6cb64222e78bde7c, using the verified Linux candidate. A paired run of the immutable upstream 11b450ca9b575b03f95bde209ff4f037fa14b374 executable on the same source and arguments reproduces TS2345 at src/commands/backup-record.ts:39:48 and TS2352 at src/config/sessions/session-transcript-worker-readers.ts:55:18 in core, plus the same TS2352 in UI. The candidate produces zero diagnostics in both graphs. Both compilers retain the deliberate TS2322 negative control. The original failing application modules have no source changes.
  • Baseline Bun, candidate Bun and the repository's native TypeScript compiler list exactly the same application files: 19,189 core (SHA256 57ce530c4b0b9fb9d2d23eed23dc1bc00905331348a1f60f52d5adec4e96f19a) and 18,620 UI (17f57df1c9d599da6e0198c010f46817d2bc5a31f2517f8f7b36ac6efbe93fbc). This prevents a clean result from silently dropping graph scope; it does not claim that standard-library contents are identical.
  • Linux candidate binary SHA256: 093f73c3562739650582e06e807407c9a3dbef6852a8efd445a436e41f7e9697; paired baseline: 8c9d31e9e763706d5b01573ed5f28b5ce1feff70614b69882455891f4f073bad. No application changes, default/pin changes, or performance qualification are part of this experiment.

Before this can become a mergeable baseline change, it still needs coherent declared-version/lib/oracle alignment and the remaining baseline compatibility audit. No performance or release qualification is claimed.

Experimentally port microsoft/typescript-go#4781 (c5ed97d875) with mutable-copy and non-uniform union regression coverage. This does not change the declared TypeScript 7.0.2 baseline or qualify a complete baseline upgrade.
Experimentally port microsoft/typescript-go#4913 (ea58062260), including its explicit indeterminate relation-depth contract while retaining complexity and physical stack safeguards. Add clean nested-Omit overlap, incompatible payload, recursive-alias termination, and cyclic-relation regressions; update the three existing depth expectations to the native 7.1 behavior. Declared 7.0.2 baseline remains unchanged pending full upgrade qualification.
@autofix-troubleshooter

Copy link
Copy Markdown

Hi! I'm the autofix logoautofix.ci troubleshooter bot.

It looks like you correctly set up a CI job that uses the autofix.ci GitHub Action, but the autofix.ci GitHub App has not been installed for this repository. This means that autofix.ci unfortunately does not have the permissions to fix this pull request. If you are the repository owner, please install the app and then restart the CI workflow! 😃

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants