fix(javascript): retain compiler-dependent module resolution facts

Compare import and require outcomes for static TypeScript references when compiler options are unknown. Preserve branch facts through worker IR and both graph projections; retain declaration fallbacks as candidates without changing explicitly selected paths.

Validation: 210 focused resolver and semantic tests; 21 production-boundary and source-extension tests. A bounded 2,000-reference probe adds about 16–17 ms wall time for dual resolution; full task token costs and real compiled application behavior remain unmeasured.
This commit is contained in:
morluto committed 2026-10-13 15:58:25 +08:00
1 parent ded199abcd
commit c923fb0dc9
18 files changed
+503 -100

No files matched your search

@@ -1,4 +1,4 @@
import { moduleKindForJavaScriptReference } from "../application/javascript/JavaScriptArtifactPathResolution.js";
import { moduleResolutionModeForJavaScriptReference } from "../domain/javascript/javascriptModuleResolutionMode.js";
import { parseJavaScriptSource } from "../domain/javascript/javascriptSourceParser.js";
import { analyzeParsedJavaScriptStaticSourceSteps } from "../domain/javascript/javascriptStaticAnalysis.js";
import {
@@ -56,7 +56,7 @@ const analyze: JavaScriptSourceWorkerAnalyzer = async (
const ir = await completeJavaScriptAnalysisSteps(
analyzeParsedJavaScriptSemanticsSteps(
parsed,
moduleKindForJavaScriptReference(file.path, "static-import"),
moduleResolutionModeForJavaScriptReference(file.path, "static-import"),
),
);
parsed = null;