fix(python-scope): match legacy CALLS reason for import-resolved free calls

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.
This commit is contained in:
Gergo Magyar 2026-04-20 11:10:50 +01:00
parent a201861c71
commit ec1208e9ef

View file

@ -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++;
}