Skip to content

Fix #107: flag error-any from unresolvable imports (never a silent 'a); bump blend beta pin to 0.0.37-beta.8 - #132

Merged
jagguji merged 2 commits into
mainfrom
fix/107-error-any-flag
Jul 10, 2026
Merged

Fix #107: flag error-any from unresolvable imports (never a silent 'a); bump blend beta pin to 0.0.37-beta.8#132
jagguji merged 2 commits into
mainfrom
fix/107-error-any-flag

Conversation

@jagguji

@jagguji jagguji commented Jul 10, 2026

Copy link
Copy Markdown
Collaborator

Fixes #107.

Error-any from unresolvable imports (#107)

A broken import in a package's .d.ts (blend beta.5's ThemeType through the shadowed ../tokens path) makes the checker's error type masquerade as any. The #31 implicit-generic salvage then emitted a silent type variable — ThemeProvider's ~foundationTokens: 'a=? with defects=0 — violating both contract rules at once ('a is reserved for round-trip generics; nothing may degrade unflagged).

  • Detection: the checker's error intrinsic, checked before the salvage — so an author-written any in the source can never false-positive (legitAny: ('a) keeps the implicit generic; all 89 pre-existing goldens byte-identical).
  • Emission: a 🛑-flagged string placeholder with actionable wording ("declared type DOES NOT RESOLVE — broken import in the package's .d.ts; fix the upstream import or hand-match") across all four surfaces: component props, function params/returns, record fields, class members.
  • Report: the Broken bucket explains the type likely EXISTS upstream and the declaration column names the failing reference (ThemeType) — hand-matching is a seconds-long fix. react-rating's itemShapes now carries the precise cause.

Fixture: error-any-unresolved (blend's exact shadowed-module shape + author-any contrast).

Benchmark: blend beta pin 0.0.37-beta.50.0.37-beta.8

Tracks the beta dist-tag. Upstream fixed the shadowed ../tokens import between the two, so foundationTokens and the getAvatarTokens family now bind their real types (TokensTypes.foundationTokenType) with zero generator changes — exactly the self-correction path this fix's flags point at. Blend beta.8 scores 222/222 usable, 0 broken / 0 review / 0 loose, compiles clean. (The #1576 typeof-statics duplicates remain — not yet fixed upstream.)

Also removes the stray test/sandbox/src/probe/ files accidentally committed in #131.

Verification

🤖 Generated with Claude Code

…in to 0.0.37-beta.8

An unresolvable type reference (broken import in a package's .d.ts) yields the
checker's error type, which masquerades as `any` — the implicit-generic salvage
turned it into a silent 'a (ThemeProvider's ~foundationTokens: 'a=?, defects=0).
Error-any is now detected via the checker's `error` intrinsic before the salvage
and emits a flagged placeholder naming the broken-import cause across props,
function signatures, record fields, and class members; the report explains the
type likely exists upstream. Author-written `any` is unchanged.

Benchmark: blend beta pin beta.5 -> beta.8 (tracks the `beta` dist-tag) —
upstream fixed the shadowed ../tokens import, so foundationTokens & the
getAvatarTokens family now bind their real types; beta.8 scores 222/222 usable.
Also removes stray sandbox probe files committed in #131.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

Benchmark: ✅ PASS

Package Compile Diff vs baseline usable review broken Verdict
@juspay/blend-design-system@0.0.36 identical 107 0 0 ✅ PASS
@juspay/blend-design-system@0.0.37-beta.8 identical 222 0 0 ✅ PASS
react-day-picker@10.0.1 identical 26 0 0 ✅ PASS
react-tooltip@6.0.7 identical 1 0 0 ✅ PASS
react-markdown@10.1.0 identical 0 2 0 ✅ PASS
@smastrom/react-rating@1.5.0 identical 1 0 0 ✅ PASS
clsx@2.1.1 identical 0 0 0 ✅ PASS
hono@4.12.25 identical 0 0 0 ✅ PASS
@base-ui-components/react@1.0.0-rc.0 identical 195 0 0 ✅ PASS

@pkg-pr-new

pkg-pr-new Bot commented Jul 10, 2026

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/@juspay/rescript-bindgen@132

commit: f58df71

…mplete-sanitization)

The three markdown-table cell sites in report.mjs escaped `|` but not a
preexisting `\`, which could eat the added escape and break the row. One
shared mdCell helper escapes backslash first, then pipe. No output changes
on any golden or benchmark baseline.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@jagguji
jagguji merged commit 3a46994 into main Jul 10, 2026
12 checks passed
@jagguji
jagguji deleted the fix/107-error-any-flag branch July 10, 2026 20:45
jagguji added a commit that referenced this pull request Jul 10, 2026
…follow-up) (#134)

Follow-up from the #132 review (finding 2).

TypeScript has a second any-flavored intrinsic — `unresolvedType`
(`intrinsicName === 'unresolved'`) — used by some unresolvable-reference
paths. The #107 detection now matches both `error` and `unresolved`, so
a sibling path reaching classify gets the same 🛑-flagged placeholder
instead of the silent `'a` salvage.

No author-written `any` carries either intrinsic, so there is no
false-positive risk: all 90 goldens and all 9 benchmark baselines are
byte-identical. The `error-any-unresolved` fixture remains the
executable contract; `docs/TYPE_MAPPING.md`'s ERROR-`any` row now names
both intrinsics.

For the other #132 review findings: the report.mjs escaping (finding 1)
was already fixed in #132 itself (`mdCell`, CodeQL green pre-merge); the
report-bucket blindness reminder (finding 3) is now tracked as #133.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
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.

Error-any from unresolvable imports silently becomes 'a / string — must flag (ThemeProvider.foundationTokens)

1 participant