Emit calls edges for top-level function calls, with file node as caller
Fixes #1972
Problem
Calls made at a file's top level (outside any def) have no caller node, so they emit no calls edges. A function invoked only from module scope looks dead in the graph.
Fix
In graphify/extractors/engine.py, after the per-definition walk, walk the file root once more with the file node as caller. walk_calls already returns at every definition boundary, so nothing already covered gets re-emitted.
Two scoping decisions:
- A
_toplevel_calls_onlyflag limits the extra walk to directcalls. Indirect dispatch and PHP-family references have their own passes; emitting them here would duplicate work with empty shadow context. - Java is skipped. It has no top-level statements, field initializers are walked elsewhere, and a root walk would re-create the phantom stubs #1744 removed.
Test
3 new tests: top-level Python call, top-level JS call, and an in-function regression guard. Full suite shows no new failures against the v8 baseline.
One known behavior to flag: class-body statements now get attributed to the file (relevant for Swift field initializers). No test covers that yet, so I left it alone for now.
Still fairly new to this codebase, so if I have the approach or the scoping wrong anywhere, tell me and I will fix it up.