feat(type-resolution): cross-file binding propagation#397
Conversation
Add ExportedTypeMap infrastructure to propagate resolved type bindings across file boundaries. When file A exports `const user = getUser()` (resolved to `User`), file B importing `user` now gets seeded with `user → User`, enabling `user.save()` to produce CALLS edges. Key components: - `importedBindings` option on BuildTypeEnvOptions with scopeEnv seeding AFTER walk() to respect first-writer-wins (local declarations win) - `collectExportedBindings()` in call-processor using graph node isExported flag (no SymbolDefinition changes needed) - Inline Kahn's algorithm topological sort with level grouping for parallel-safe file ordering and cycle detection - Re-resolution pass in pipeline.ts: topological order, 3% skip threshold, path validation, per-file export caps (500) - 32 new tests: 11 topological sort, 6 seeding, 15 integration (simple cross-file, re-export chain, circular imports) All 3454 tests pass (32 net new, 0 regressions).
Critical fixes: - Re-resolution pass now actually re-resolves CALLS edges by calling processCalls with importedBindingsMap (was building typeEnv but discarding it without producing edges) - Worker path populates ExportedTypeMap via buildExportedTypeMapFromGraph using graph node isExported + SymbolTable returnType/declaredType (was dead parameter in processCallsFromExtracted) Important fixes: - Skip threshold denominator uses totalFiles (was exportedTypeMap.size + filesWithGaps which made threshold nearly useless) - processCalls accepts importedBindingsMap parameter to thread cross-file bindings into buildTypeEnv during re-resolution All 3454 tests pass.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
CI Report✅ All checks passed Pipeline
Tests
✅ All 3551 tests passed across 1018 files 20 test(s) skipped
Coverage
📋 Full run · Coverage from Ubuntu · Generated by CI |
…arjan's SCC, cross-file return types E0: Fix AST cache thrashing in re-resolution loop (was creating size-1 cache per file), batch file reads per topological level, add MAX_CROSS_FILE_REPROCESS=2000 cap for adversarial repos. E1: seedCrossFileReceiverTypes() — enrich ExtractedCall.receiverTypeName from ExportedTypeMap+namedImportMap in O(1) Map lookups, eliminating re-parse for ~80-90% of single-hop cross-file receiver types. E2: computeImportCycleSCCs() — iterative Tarjan's SCC on cycle subgraph from Kahn's output. Dev-mode diagnostic logging of individual import cycle components. E3: buildImportedReturnTypes() + ReturnTypeLookup extension — cross-file return type propagation with corrected local-first priority (SymbolTable checked first, cross-file fallback only on 0 matches, ambiguous 2+ returns undefined). E4: PARALLEL_RE_RESOLUTION_THRESHOLD constant, timing metrics, worker parallelization design comments (deferred implementation). 24 new tests (6 E1 + 6 E2 + 7 E3 unit + 5 E3 integration). All 3478 tests pass.
1. Replace fragile regex in buildExportedTypeMapFromGraph with extractReturnTypeName() for consistent generic unwrapping. 2. Fix gap detection precision: check upstream.has(binding.exportedName) instead of exportedTypeMap.has(binding.sourcePath) to avoid over-counting files that import only unrelated symbols.
…er fixes Add cross-file binding propagation integration tests for 6 languages (Python, JavaScript, Java, PHP, C#, Kotlin) with fixture repos and HAS_METHOD edge assertions. Fix 3 language resolver issues uncovered by tests: - Kotlin: class methods now labeled Method (not Function) via shared isKotlinClassMethod() utility; non-aliased imports create NamedImportMap entries; 2-segment package-directory fallback for top-level function imports - PHP: namespace-directory fallback for use-function imports; SuffixIndex preferred over linear scan; path traversal rejection; PSR-4 sort cached - JVM: root-level package path matching; indexOf→lastIndexOf for correctness Address code review findings: - Extract runCrossFileBindingPropagation() from 810-line pipeline function - Replace (importCtx as any) casts with typed dispose() method - Remove Tarjan's SCC (dev-only YAGNI, ~85 lines) - Remove dead PARALLEL_RE_RESOLUTION_THRESHOLD constant - Fix constructor handling divergence in getLabelFromCaptures - Optimize gap pre-scan with early exit once threshold exceeded - Fix findEnclosingFunction any→SyntaxNode type
|
@claude ultra-think while identifying per-language gaps for all of our supported languages (except swift). Perfom this analysis on this pull request and verify those findings. Act as a senior compiler font-end engineer and expert with static analysis tools and review this change from that perpective and architectural fit. Also check out the previous comments. You must also cross-reference it with our type-resolution-roadmap.md and see if we need to update type-resolution-system.md after this change. |
|
Claude finished @magyargergo's task in 7m 2s —— View job Cross-File Binding Propagation — Deep ReviewPer-Language Gap AnalysisLanguages with Full or Strong Phase 14 CoverageTypeScript / JavaScript — Full coverage. All three mechanisms work: E1 ( Python — Strong coverage. Kotlin — Strong coverage. Languages with Limited Phase 14 CoverageJava — Two significant gaps:
Net: Phase 14 adds zero new resolution capability for Java. Existing Phase 9 SymbolTable lookup covers the tested scenarios. The benefit would only appear in multi-ambiguous- C# — Very limited. PHP — Partial. Class imports ( Rust — Named bindings extracted correctly ( Kotlin (class member imports) — Languages Where Phase 14 Is Entirely InertGo — Package-level imports ( Ruby — C / C++ — Architecture Assessment (Compiler Front-End Perspective)Seeding placement (AFTER walk, BEFORE fixpoint) is the single most important correctness decision, and it's right. From the code at walk(tree.rootNode, FILE_SCOPE);
// Phase 14: AFTER walk, local declarations already in env
if (options?.importedBindings && options.importedBindings.size > 0) {
seedImportedBindings(env, options.importedBindings);
}
resolveFixpointBindings(pendingItems, env, returnTypeLookup, symbolTable, parentMap);This ordering guarantees local declarations always shadow imported bindings (first-writer-wins in Worker path quality asymmetry — This is the most significant architectural concern. The sequential path ( Topological sort (Kahn's BFS) is correctly implemented. The in-degree calculation handles the
if (callables.length === 1) return extractReturnTypeName(callables[0].returnType);
if (callables.length > 1) return undefined; // conservative
// Only 0 results → cross-file fallback
return options?.importedReturnTypes?.get(callee);This correctly refuses to cross-file propagate when local SymbolTable is ambiguous. This is the right conservatism for a static analysis tool that prefers false negatives over false positives.
Idempotent re-resolution — Security hardening — Path validation ( Findings Summary by Language
¹ Java Actionable Gaps1. Java static method imports not captured (Fix this →) // named-binding-extraction.ts:379 — the lowercase guard is too broad
// `import static models.UserFactory.getUser` should produce {local: 'getUser', exported: 'getUser'}
if (className[0] && className[0] === className[0].toLowerCase()) return undefined; // blocks all method imports2. Worker path ExportedTypeMap misses fixpoint-inferred exports — Large repos (worker pool active) only get Tier 0 (explicitly annotated) exports in the ExportedTypeMap. Small repos get full TypeEnv fixpoint results. This creates a silent quality split. Consider whether 3. Rust cross-file test missing — There is no 4. C# non-alias Roadmap Cross-Referencetype-resolution-roadmap.md needs these updates:
type-resolution-system.md needs these updates:
VerdictThe architecture is sound. The seeding-after-walk placement is the correct invariant. Kahn's BFS is correctly implemented. E1/E2/E3 are well-separated concerns. The conservatism decisions (local-first, no cross-cycle propagation, 3% skip threshold) are appropriate for a static analysis tool. The main risks are:
The |
There was a problem hiding this comment.
Pull request overview
This PR introduces a Phase 14 “cross-file type binding propagation” pass to improve call receiver/type resolution across module boundaries by collecting exported type bindings, processing files in topological import order, and re-resolving downstream files with seeded bindings.
Changes:
- Added
ExportedTypeMapcollection + a second re-resolution pass inpipeline.ts, using a Kahn topological-level sort to order propagation. - Extended
buildTypeEnvto acceptimportedBindings(seeded into file scope) andimportedReturnTypes(cross-file return-type fallback). - Improved language import/label handling (notably Kotlin method/function labeling + JVM/Kotlin import resolution) and added extensive unit/integration fixtures and tests.
Reviewed changes
Copilot reviewed 48 out of 48 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| gitnexus/src/core/ingestion/type-env.ts | Adds imported binding/return-type options, seeding logic, and SymbolTable-vs-cross-file precedence rules. |
| gitnexus/src/core/ingestion/call-processor.ts | Introduces ExportedTypeMap, export collection helpers, cross-file receiver seeding, and new params for call processing. |
| gitnexus/src/core/ingestion/pipeline.ts | Adds topological level sort + orchestrates Phase 14 re-resolution pass and related thresholds/caps. |
| gitnexus/src/core/ingestion/import-processor.ts | Adds dispose() to release import-resolution structures and improves Kotlin top-level function import resolution. |
| gitnexus/src/core/ingestion/named-binding-extraction.ts | Refines Kotlin named binding extraction to support top-level function imports while avoiding class-member collisions. |
| gitnexus/src/core/ingestion/parsing-processor.ts | Aligns Kotlin class-body function_declaration labeling to Method for consistent IDs/labels. |
| gitnexus/src/core/ingestion/workers/parse-worker.ts | Adjusts label detection (constructor-without-name) and Kotlin function-vs-method labeling in worker extraction. |
| gitnexus/src/core/ingestion/utils.ts | Adds isKotlinClassMethod + ensures extractFunctionName labels Kotlin class methods consistently. |
| gitnexus/src/core/ingestion/resolvers/php.ts | Caches sorted PSR-4 mappings and adds function-import fallback behavior with path traversal guard. |
| gitnexus/src/core/ingestion/resolvers/jvm.ts | Improves JVM wildcard resolution for both nested and root-level package paths. |
| gitnexus/test/unit/type-env.test.ts | Adds unit tests for importedBindings seeding and importedReturnTypes precedence behavior. |
| gitnexus/test/unit/topological-sort.test.ts | Adds unit coverage for topologicalLevelSort behavior (DAGs, diamonds, cycles, disconnected graphs). |
| gitnexus/test/unit/call-processor.test.ts | Adds tests for seedCrossFileReceiverTypes enrichment behavior. |
| gitnexus/test/integration/resolvers/helpers.ts | Adds CROSS_FILE_FIXTURES path constant used by new integration tests. |
| gitnexus/test/integration/resolvers/javascript.test.ts | Adds JS cross-file binding propagation integration scenario. |
| gitnexus/test/integration/resolvers/python.test.ts | Adds Python cross-file binding propagation integration scenario. |
| gitnexus/test/integration/resolvers/php.test.ts | Adds PHP cross-file binding propagation integration scenario. |
| gitnexus/test/integration/resolvers/java.test.ts | Adds Java cross-file binding propagation integration scenario. |
| gitnexus/test/integration/resolvers/csharp.test.ts | Adds C# cross-file binding propagation integration scenario. |
| gitnexus/test/integration/resolvers/kotlin.test.ts | Updates Kotlin expectations from Function→Method and adds Kotlin cross-file binding propagation scenario. |
| gitnexus/test/integration/cross-file-binding.test.ts | Adds Phase 14 integration coverage for TS simple, TS re-export, TS return-type propagation, and TS cycles. |
| gitnexus/test/fixtures/cross-file-binding/ts-simple/src/models.ts | Fixture for TS simple cross-file propagation (User/getUser). |
| gitnexus/test/fixtures/cross-file-binding/ts-simple/src/service.ts | Fixture exporting user = getUser() for downstream import seeding. |
| gitnexus/test/fixtures/cross-file-binding/ts-simple/src/app.ts | Fixture consuming imported user and calling methods. |
| gitnexus/test/fixtures/cross-file-binding/ts-return-type/src/api.ts | Fixture for return-type propagation (getConfig(): Config). |
| gitnexus/test/fixtures/cross-file-binding/ts-return-type/src/consumer.ts | Fixture consuming imported callable and calling method on returned value. |
| gitnexus/test/fixtures/cross-file-binding/ts-reexport/src/core.ts | Fixture for re-export chain source module. |
| gitnexus/test/fixtures/cross-file-binding/ts-reexport/src/index.ts | Fixture re-export barrel. |
| gitnexus/test/fixtures/cross-file-binding/ts-reexport/src/app.ts | Fixture consuming re-exported callable. |
| gitnexus/test/fixtures/cross-file-binding/ts-circular/src/a.ts | Fixture for circular TS imports. |
| gitnexus/test/fixtures/cross-file-binding/ts-circular/src/b.ts | Fixture for circular TS imports. |
| gitnexus/test/fixtures/cross-file-binding/py-cross-file/src/models.py | Fixture for Python cross-file callable return type → receiver resolution. |
| gitnexus/test/fixtures/cross-file-binding/py-cross-file/src/app.py | Fixture consuming Python import and calling methods on returned instance. |
| gitnexus/test/fixtures/cross-file-binding/php-cross-file/composer.json | Fixture composer PSR-4 mapping for PHP import resolution. |
| gitnexus/test/fixtures/cross-file-binding/php-cross-file/app/Models/User.php | Fixture for PHP class/method targets. |
| gitnexus/test/fixtures/cross-file-binding/php-cross-file/app/Models/UserFactory.php | Fixture for PHP function export returning User. |
| gitnexus/test/fixtures/cross-file-binding/php-cross-file/app/Main.php | Fixture consuming use function import and calling methods on returned value. |
| gitnexus/test/fixtures/cross-file-binding/kotlin-cross-file/models/User.kt | Fixture for Kotlin top-level function returning User. |
| gitnexus/test/fixtures/cross-file-binding/kotlin-cross-file/app/App.kt | Fixture consuming Kotlin import and calling methods. |
| gitnexus/test/fixtures/cross-file-binding/js-cross-file/src/models.js | Fixture for JS exported function returning User. |
| gitnexus/test/fixtures/cross-file-binding/js-cross-file/src/app.js | Fixture consuming JS import and calling methods. |
| gitnexus/test/fixtures/cross-file-binding/java-cross-file/models/User.java | Fixture for Java target methods. |
| gitnexus/test/fixtures/cross-file-binding/java-cross-file/models/UserFactory.java | Fixture for Java static export returning User. |
| gitnexus/test/fixtures/cross-file-binding/java-cross-file/app/App.java | Fixture consuming Java static import and calling methods. |
| gitnexus/test/fixtures/cross-file-binding/csharp-cross-file/CrossFile.csproj | Fixture project file for C# resolution context. |
| gitnexus/test/fixtures/cross-file-binding/csharp-cross-file/Models/User.cs | Fixture for C# target methods. |
| gitnexus/test/fixtures/cross-file-binding/csharp-cross-file/Models/UserFactory.cs | Fixture for C# static export returning User. |
| gitnexus/test/fixtures/cross-file-binding/csharp-cross-file/App/Program.cs | Fixture consuming C# static import and calling methods. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…nding-propagation
xkonjin
left a comment
There was a problem hiding this comment.
Code Review: Cross-File Binding Propagation (Type Resolution)
This is a substantial feature addition. The core idea — propagating resolved type bindings across file boundaries using topological import ordering — is architecturally sound and addresses a real limitation in single-file type inference.
Positives
- Topological level sort (
topologicalLevelSortvia Kahn's algorithm) is correct and handles cycles gracefully by dumping them into a final group. This ensures upstream bindings are resolved before downstream consumers. - Guard rails are well-calibrated:
MAX_EXPORTS_PER_FILE(500),MAX_TYPE_NAME_LENGTH(256),MAX_CROSS_FILE_REPROCESS(2000), andCROSS_FILE_SKIP_THRESHOLD(3%) prevent runaway processing on pathological repos. seedCrossFileReceiverTypesmutating in-place is pragmatic for performance; the function signature makes the mutation intent clear.ImportResolutionContext.dispose()is a nice addition — nulling the suffix index and clearing caches will meaningfully reduce memory pressure on large repos.- Kotlin improvements (top-level function import resolution, class method detection via
isKotlinClassMethod) are well-scoped fixes that correctly distinguishimport models.getUserfromimport util.OneArg.writeAudit.
Issues
-
Potential quadratic behavior in
runCrossFileBindingPropagation: For each level, you callreadFileContentsthenprocessCallsper file.processCallsbuilds a fresh TypeEnv per file which re-parses ASTs. With the AST cache capped at 50, a level with 500+ files will thrash the cache. Consider batching files within a level into the existingprocessCallsmulti-file path rather than calling it once per file. -
buildExportedTypeMapFromGraphfallback: This runsgraph.forEachNodewhen the worker path leftexportedTypeMapempty. On a 230K-node graph, this is a full scan. The function only checksisExported+lookupExactFull, but the scan itself could be expensive. Consider filtering by node type (Function/Method/Class) before the SymbolTable lookup. -
buildImportedReturnTypes— SymbolTable coupling:lookupExactFullis called per import per file. If SymbolTable uses a linear scan internally, this could be slow for files with many imports. Worth verifying the lookup is O(1) or O(log n). -
suffixIndexnullability: Afterdispose(),suffixIndexbecomesnull, butresolveLanguageImportaccesses it without null checks (theindexparameter). If any code path calls import resolution after disposal, this will throw. The type change (SuffixIndex | null) is correct, but downstream consumers should be audited. -
Test coverage gap: The diff adds significant new logic but I don't see corresponding test files for
seedCrossFileReceiverTypes,buildExportedTypeMapFromGraph,topologicalLevelSort, orbuildImportedReturnTypes. These are testable pure functions — unit tests would prevent regressions in edge cases (empty maps, self-imports, cycles, max-cap behavior). -
Minor:
extractReturnTypeNameis referenced but not defined in this diff. If it's new, its behavior with complex generics (Map<string, Promise<User[]>>) should be tested.
Summary
Strong architectural direction. The topological ordering approach is the right call for cross-file resolution. Main concerns are the per-file processCalls loop performance and missing unit tests for the new pure functions. Would recommend adding tests before merge and benchmarking the re-resolution pass on a large repo (10K+ files).
- Enhance C++ tree-sitter queries to support inline class method declarations and return types. - Introduce `importedRawReturnTypes` in `BuildTypeEnvOptions` for cross-file raw return type handling. - Add `FileTypeEnvBindings` interface to capture file-scope type bindings for exported symbols. - Implement logic in `parse-worker.ts` to extract and serialize file-scope type bindings for cross-file type resolution. - Create test fixtures for C++, Go, Ruby, and Rust to validate cross-file binding propagation. - Update integration tests to verify correct resolution of method calls across files for C++, Go, Ruby, and Rust. - Document Phase 14: Cross-File Binding Propagation in the type resolution roadmap and system documentation.
xkonjin
left a comment
There was a problem hiding this comment.
Code Review: Cross-file Binding Propagation (Phase 14)
Overall: This is a substantial and architecturally sound addition. The topological-level-sort approach for dependency-ordered re-resolution is the right design, and the local-first principle is correctly enforced throughout. Several items worth attention:
Bugs / Correctness:
-
topologicalLevelSort puts all cycle files in a single final group with no ordering guarantees. Within a cycle, file A may import from file B and vice versa. Since seedImportedBindings uses first-writer-wins, the propagation result for cycle files is non-deterministic (depends on iteration order). This is documented implicitly but worth an explicit comment at the call site, or consider running a second fixpoint pass over cycle files.
-
buildExportedTypeMapFromGraph iterates ALL graph nodes via forEachNode. For large repos (200k+ nodes), this could be slow. Consider filtering by node type (Function, Method, Property) before checking isExported, or maintaining an exported-nodes index during parsing.
-
In seedCrossFileReceiverTypes, the enrichedCount is incremented for every call record enriched, but multiple call records in the same file may share the same receiver. The log message 'Seeded N cross-file receiver types' is slightly misleading - it is call-site enrichments, not unique type resolutions.
Memory:
-
The ImportResolutionContext.dispose() method is a good improvement over the previous unsafe cast. However, dispose() clears resolveCache but keeps allFilePaths and allFileList alive. If allFilePaths is the largest allocation, consider nulling it too (or documenting why it is retained).
-
The AST cache is re-created per topological level (astCache = createASTCache(AST_CACHE_CAP) before the loop, then astCache.clear() after). Files in adjacent levels that share imports may benefit from cache hits. Consider clearing only at the end of the full propagation pass.
Security:
- resolvePhpImport now includes a path-traversal check (normalized.includes('..')). Good defensive addition.
Tests: The fixture files for Java, C#, Kotlin, and PHP cross-file binding scenarios are well-structured and test the actual pipeline end-to-end. Consider adding a test for the cycle-detection path (two files importing each other).
|
@claude ultra-think while identifying per-language gaps for all of our supported languages (except swift). Perfom this analysis on this pull request and verify those findings. Act as a senior compiler font-end engineer and expert with static analysis tools and review this change from that perpective and architectural fit. Also check out the previous comments. You must also cross-reference it with our type-resolution-roadmap.md and see if we need to update type-resolution-system.md after this change. |
|
Claude finished @magyargergo's task in 5m 14s —— View job Cross-File Binding Propagation — Deep Review
TL;DRThe previous deep review from the CI claude job was accurate at that moment in time, but the author had already addressed every critical finding before this review was requested. The architecture is sound. One stale line in Verification of Previous Review FindingsEvery issue cited by the prior review was checked against the actual current branch code:
Per-Language Gap Analysis — Verified State
PHP correction from previous review: Architecture Review (Compiler Front-End Perspective)What's RightSeeding placement (
This is identical to what a real compiler's module-level environment threading looks like. The comment "local declarations from walk() take precedence" accurately reflects the invariant. Topological sort is correctly implemented. Kahn's BFS at
Worker TypeEnv enrichment ( New Concerns (Not Caught by Previous Review)1. Worker enrichment uses hard-coded node ID prefixes ( const nodeId = `Function:${filePath}:${name}`;
const varNodeId = `Variable:${filePath}:${name}`;
const constNodeId = `Const:${filePath}:${name}`;
const node = graph.getNode(nodeId) ?? graph.getNode(varNodeId) ?? graph.getNode(constNodeId);
2. const gapThreshold = Math.max(1, Math.ceil(totalFiles * CROSS_FILE_SKIP_THRESHOLD));In asset-heavy repos (many JSON/image/YAML files), 3. Cycle propagation is non-deterministic at file-granularity (documented implicitly, not at call site): Files in cycles share a final BFS level with no ordering guarantees. Documentation Status
This directly contradicts line 12 ("Per-file with cross-file seeding"), lines 125-131 ("It now does (Phase 14):"), and line 448 ("cross-file binding propagation across all 13 languages"). Fix committed locally to this branch but push was blocked by bot permissions: - no general cross-file propagation of inferred bindings
+ cross-file propagation has per-language gaps: C# non-alias `using NS;` (namespace import) not
+ supported; Java has no file-scope exports (relies on Phase 9 SymbolTable); PHP class-method
+ exports are class-scoped (not file-scope), so E1/E2 are inert for class methodsPlease apply this manually (or grant write permissions to apply the committed diff VerdictApprove. The implementation is architecturally correct and the previous review's concerns have been comprehensively addressed. The topological ordering, seeding placement, fixpoint integration, and cycle handling are all production-grade. The two new concerns (hard-coded node label prefixes, threshold denominator) are low-severity and can be addressed in a follow-up. The one mandatory action is applying the |
…npatwari#397) Merge origin/main into pr/performance-lod-rendering, resolving 22 conflict files across backend (8), frontend (13), and tests (1). Key resolution decisions: - LOD endpoints, hooks, and components: kept our branch additions - Language dispatch unification (abhigyanpatwari#409): kept main's exhaustive Record types, added COBOL entries to all dispatch tables (import-resolution, framework- detection, call-routing, entry-point-scoring, tree-sitter-queries, parser-loader) - Cross-file binding propagation (abhigyanpatwari#397): kept our branch's Phase 14 code - Neptune DB backend: kept main's Neptune dispatch paths in api.ts, local-backend - LLM providers: merged minimax (ours) + custom/bedrock (main) into all provider lists, types, and settings - arm64 Mac safety: preserved sequential query execution in local-backend impact analysis, updated to use this.runQuery for Neptune compatibility - Schema test: updated SCHEMA_QUERIES count to 29 (28 node + 1 rel, Section added) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Summary
ExportedTypeMap— resolved bindings from upstream files seed downstream files'scopeEnv, enabling cross-file receiver resolution (e.g.,import { user } from './service'; user.save()→ CALLS edge toUser#save)ExportedTypeMap; Pass 2 re-resolves affected files with seeded bindings in topological orderbuildExportedTypeMapFromGraph— collects exports from graph + SymbolTable when TypeEnv isn't available in main threadallPathSet, per-file export cap (500), type name length limit (256 chars)namedImportMapsupport)Key Design Decisions
isExportedon SymbolDefinition — uses graph node lookup, keeps SymbolTable leanprocessCallsre-used for re-resolution — same call resolution logic, samegenerateIdfor idempotent edge overwriteFiles Changed
type-env.tsimportedBindingsonBuildTypeEnvOptions,seedImportedBindings()call-processor.tsExportedTypeMaptype,collectExportedBindings(),buildExportedTypeMapFromGraph(),importedBindingsMapparampipeline.tstopologicalLevelSort(), re-resolution pass orchestrationTest plan
Post-Deploy Monitoring & Validation
No additional operational monitoring required: this is a build-time static analysis enhancement with no runtime component. The feature runs during
npx gitnexus analyzeand produces additional CALLS edges in the knowledge graph. Dev-mode logging (🔗 Cross-file re-resolution: N files re-processed in Xms) provides diagnostic output.