keep legacy IMPORTS for python (heritage needs importMap), scope phase owns CALLS only

Agent-Logs-Url: https://github.com/abhigyanpatwari/GitNexus/sessions/c474dc66-5cf7-445d-8eb4-76501c5e6d67

Co-authored-by: magyargergo <11230420+magyargergo@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot] 2026-04-19 08:19:05 +00:00 committed by GitHub
parent f67061cd66
commit 3e08e73c6a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 6 additions and 19 deletions

View file

@ -5,8 +5,7 @@ import { isLanguageAvailable, loadParser, loadLanguage } from '../tree-sitter/pa
import { getProvider, getProviderForFile, providersWithImplicitWiring } from './languages/index.js';
import type { LanguageProvider } from './language-provider.js';
import { generateId } from '../../lib/utils.js';
import { getLanguageFromFilename, SupportedLanguages } from 'gitnexus-shared';
import { isRegistryPrimary } from './registry-primary-flag.js';
import { getLanguageFromFilename } from 'gitnexus-shared';
import { isVerboseIngestionEnabled } from './utils/verbose.js';
import { yieldToEventLoop } from './utils/event-loop.js';
import type { ExtractedImport } from './workers/parse-worker.js';
@ -43,8 +42,6 @@ function wireImplicitImports(
const grouped = new Map<LanguageProvider, string[]>();
for (const file of files) {
const lang = getLanguageFromFilename(file);
if (lang && isRegistryPrimary(lang)) continue;
const provider = getProviderForFile(file);
if (!provider?.implicitImportWirer) continue;
let list = grouped.get(provider);
@ -285,11 +282,6 @@ export const processImports = async (
// 1. Check language support first
const language = getLanguageFromFilename(file.path);
if (!language) continue;
// Registry-primary gate: when REGISTRY_PRIMARY_<LANG>=1, the
// scope-based pipeline phase (`pythonScopePhase`, etc.) owns
// IMPORTS/CALLS emission for this language. Skip the legacy path
// here so we don't double-emit edges.
if (isRegistryPrimary(language)) continue;
if (!isLanguageAvailable(language)) {
if (skippedByLang) {
skippedByLang.set(language, (skippedByLang.get(language) ?? 0) + 1);
@ -475,10 +467,6 @@ export const processImportsFromExtracted = async (
}
for (const imp of fileImports) {
// Registry-primary gate: skip when the scope-based phase owns
// emission for this language. `imp.language` is set by the parse
// worker; trust it here.
if (isRegistryPrimary(imp.language)) continue;
totalImportsFound++;
const provider = getProvider(imp.language);

View file

@ -179,12 +179,11 @@ export function runPythonScopeResolution(
nodeLookup,
);
// IMPORTS edges: mirror the legacy file-to-file shape so existing
// queries that aggregate by `File → File` continue to work. Done here
// (not in `emit-references.emitScopeGraph`) because that path emits
// scope-to-scope edges, which are a different schema. Keeping the
// legacy shape avoids churn in downstream consumers and tests.
const importsEmitted = emitImportEdges(graph, indexes.imports, indexes.scopeTree);
// IMPORTS edges are emitted by the legacy `processImports` path
// (which heritage resolution depends on for `ctx.resolve` to find
// imported symbols). We intentionally do NOT emit IMPORTS here to
// avoid duplicates and to keep heritage's resolution chain intact.
const importsEmitted = 0;
return {
filesProcessed: parsedFiles.length,