Generalize the cross-instance type check into a portability matrix - #6201
Closed
candrewlee14 wants to merge 2 commits into
Closed
Generalize the cross-instance type check into a portability matrix#6201candrewlee14 wants to merge 2 commits into
candrewlee14 wants to merge 2 commits into
Conversation
Strip implementation-only query-builder details from published declarations, infer decoder results structurally, and compile two physical package copies to prevent regressions.
The single SQL assignment only guarded one type. Replace it with a table of public types probed in one tsc program, asserting both directions: a portable type regressing fails, and a known leak becoming portable fails too, prompting the flag to be flipped. Records the measured state of the surface, annotating each known leak with the private/protected member responsible. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Qd99Mmmi1fZkKQiV3u1jXy
This was referenced Aug 29, 2026
candrewlee14
marked this pull request as draft
August 29, 2026 18:19
This was referenced Aug 29, 2026
Author
|
Consolidated into #6200. The whole change is 244 lines across 16 files, and because a fork PR cannot base itself on another fork branch, every PR in the stack was already showing all of its ancestors' commits — so the split bought no review isolation, just six merges and five rebases. It is now one PR with these commits intact, plus #6205 for the single change that touches observable API. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
#6200 fixes
SQLand guards it with a single hardcoded assignment. That guards exactly one type. This replaces it with a table.Why
The underlying bug is not specific to
SQL: any class whoseprivate/protectedmembers survive into the emitted.d.tsis compared nominally, and so is non-portable between two installs of the package. That is a property of the whole published surface, and it moves in both directions — a refactor can introduce a leak, and an unrelated@internalcan quietly remove one.A single assertion catches neither. The matrix asserts both:
Shape
PORTABILITY_MATRIXlists each probed type with its subpath, any needed type arguments, and whether it currently survives crossing between installs. Everyportable: falseentry carries ablockedBynaming the member responsible, so the table doubles as the work queue. All probes compile in onetscprogram — the whole test runs in ~1.4s, comparable to the single assertion it replaces.The recorded state is measured, not aspirational: it is exactly what the current published declarations do.
Follow-ups
Later PRs in this stack flip rows to
portable: trueas the underlying members are stripped.