Skip to content

feat(parser): resolve tsconfig-path aliases and Loadable/lazy wrappers (6F.3)#45

Merged
officialCodeWork merged 1 commit into
developmentfrom
build/phase-6f/step-6f.3-instance-resolution
Jul 15, 2026
Merged

feat(parser): resolve tsconfig-path aliases and Loadable/lazy wrappers (6F.3)#45
officialCodeWork merged 1 commit into
developmentfrom
build/phase-6f/step-6f.3-instance-resolution

Conversation

@officialCodeWork

Copy link
Copy Markdown
Owner

Summary

The field validation linked only 563 of 1,982 instances (28%) to their definitions — the root cause capping blast_radius and the render graph. This PR closes the two diagnosed causes:

  1. scanReact honors the scanned app's own tsconfig.json (tsConfigFilePath; file discovery unchanged) — baseUrl/paths make alias imports like @ui resolvable through multi-hop rename barrels. Before, such usages produced no instance node at all.
  2. Loadable(lazy(() => import())) unwrap — a JSX tag naming a module-scope lazy-wrapped variable resolves through the dynamic import to the target module's default export. The new PreviewPane fixture component names the variable differently from the definition, so only the unwrap can link it.

Result on the field-patterns fixture

  • Both 6F.3 expectedFail marks removed: DataGrid instances = 2 and blast radius DataGrid → {UsersPage, InvoicesPage} now pass unmarked (field regression was 0 dependents)
  • 100% of the fixture's component usages resolve

Verification

  • pnpm test: 201 tests green (2 new parser tests)
  • pnpm eval: 283 pass · 0 fail · 7 xfail (all owned by 6F.4–6F.5) · 0 unexpected-pass, gate OK, metrics 1.000
  • pnpm typecheck: clean

🤖 Generated with Claude Code

…s to definitions (6F.3)

The field run linked only 28% of JSX instances to definitions. Two scanner
changes close the diagnosed causes:

1. scanReact honors the scanned app's own tsconfig.json (tsConfigFilePath;
   file discovery unchanged), so baseUrl/paths make alias imports like "@ui"
   resolvable through multi-hop rename barrels. Before, such usages produced
   no instance node at all.

2. New lazyDefinition resolution: a JSX tag naming a module-scope
   const X = Loadable(lazy(() => import("./Page"))) (or bare React.lazy)
   unwraps to the dynamic import and resolves the target module's default
   export. Exercised by a new PreviewPane fixture component whose variable
   name differs from the definition name, so only the unwrap can link it.

Fixture golden: both 6F.3 expectedFail marks removed — DataGrid instances = 2
and blast radius DataGrid → {UsersPage, InvoicesPage} now pass unmarked; 100%
of the fixture's component usages resolve.

2 new parser unit tests (121 total). Eval 283 pass / 0 fail / 7 xfail (all
owned by 6F.4–6F.5) / 0 unexpected-pass, gate OK, metrics 1.000.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@officialCodeWork
officialCodeWork merged commit 21d8150 into development Jul 15, 2026
1 check passed
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