diff --git a/gitnexus/src/core/ingestion/call-processor.ts b/gitnexus/src/core/ingestion/call-processor.ts index 0d2245965..adb63916a 100644 --- a/gitnexus/src/core/ingestion/call-processor.ts +++ b/gitnexus/src/core/ingestion/call-processor.ts @@ -104,8 +104,8 @@ export function buildExportedTypeMapFromGraph( if (!def) return; const typeName = def.returnType ?? def.declaredType; if (!typeName || typeName.length > MAX_TYPE_NAME_LENGTH) return; - // Extract simple type name (strip Promise<>, etc.) - const simpleType = typeName.replace(/^(?:Promise|Observable|Task|Future|CompletableFuture)\s*<\s*/, '').replace(/\s*>\s*$/, '') || typeName; + // Extract simple type name (strip Promise<>, etc.) — reuse shared utility + const simpleType = extractReturnTypeName(typeName) ?? typeName; if (!simpleType) return; let fileExports = result.get(filePath); if (!fileExports) { fileExports = new Map(); result.set(filePath, fileExports); } diff --git a/gitnexus/src/core/ingestion/pipeline.ts b/gitnexus/src/core/ingestion/pipeline.ts index 6db785356..71888192b 100644 --- a/gitnexus/src/core/ingestion/pipeline.ts +++ b/gitnexus/src/core/ingestion/pipeline.ts @@ -537,8 +537,9 @@ export const runPipelineFromRepo = async ( if (!imports) continue; let hasGap = false; for (const [, binding] of imports) { - // E1/E2: upstream file has variable bindings in exportedTypeMap - if (exportedTypeMap.has(binding.sourcePath)) { hasGap = true; break; } + // E1/E2: upstream file has a matching exported binding for this specific import + const upstream = exportedTypeMap.get(binding.sourcePath); + if (upstream?.has(binding.exportedName)) { hasGap = true; break; } // E3: upstream callable has a known return type in SymbolTable const def = ctx.symbols.lookupExactFull(binding.sourcePath, binding.exportedName); if (def?.returnType) { hasGap = true; break; }