From ec1208e9ef52f820b1410093c9cd8abbd90ae32d Mon Sep 17 00:00:00 2001 From: Gergo Magyar Date: Mon, 20 Apr 2026 11:10:50 +0100 Subject: [PATCH] fix(python-scope): match legacy CALLS reason for import-resolved free calls MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The arity-narrowing test asserts \`rel.reason === 'import-resolved'\` for cross-file free-call edges. Switch the free-call fallback's reason to mirror legacy DAG semantics: - target-file !== source-file → 'import-resolved' - same file → 'local-call' Verification: - Flag-off: 191/191 (identical baseline). - Flag-on: 9 fail / 182 pass (was 10/181; +1 arity-narrowing test). - tsc --noEmit clean. --- gitnexus/src/core/ingestion/python-scope-emit.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/gitnexus/src/core/ingestion/python-scope-emit.ts b/gitnexus/src/core/ingestion/python-scope-emit.ts index c0fefdd9e..06e45a5fa 100644 --- a/gitnexus/src/core/ingestion/python-scope-emit.ts +++ b/gitnexus/src/core/ingestion/python-scope-emit.ts @@ -639,7 +639,9 @@ function emitFreeCallFallback( targetId: tgtGraphId, type: 'CALLS', confidence: 0.85, - reason: 'python-scope: free-call-import', + // Match legacy DAG's reason convention so consumers that + // assert `reason === 'import-resolved'` keep working. + reason: fnDef.filePath !== parsed.filePath ? 'import-resolved' : 'local-call', }); emitted++; }