Skip to content

Feature: Elevate calls_out_to into a First-Class Function Dependency Graph #3265

Closed
7 of 7 issues completed

Description

@squid-protocol

Right now, calls_out_to is only used for mapping unit tests to production code. We are severely underutilizing this data. By wiring calls_out_to into network_risk_sensor.py, we can build a 'Layer 2' Function-Level topology graph alongside the existing File-Level import graph.

Features to implement:

  1. Micro-PageRank: Calculate PageRank at the function level. Identify the most heavily relied-upon methods in the repository, not just the host files.
  2. Implicit Dependency Edges: If File A calls a global function defined in File B, but lacks an explicit import statement, the current file-level graph misses the connection. We can use the function graph to synthesize missing file-to-file edges (critical for C, PHP, Ruby, and Mainframes).
  3. Blast Radius Analysis: Allow queries that traverse the function graph to see exactly which downstream functions are impacted by a structural change.

Note on AST equivalence: This will act as a heuristic, AST-free approximation of a true Call Graph. It will suffer from namespace collisions (e.g. all save() calls pooling together), but it will run in milliseconds across 46 languages, even on uncompilable or broken code.

Sub-issues

Sub-issues

7 of 7 Issues completed
Loading 7 sub-issues

Activity

  1. added
    enhancement
    core-engine
    on Sep 22, 2026
  2. squid-protocol commented on Sep 23, 2026

    @squid-protocol
    OwnerAuthor

    Closing as done. All 7 sub-issues are closed by merged PRs, and all three features from the original proposal have shipped.

    Proposal → delivered

    1. Micro-PageRank. function_data now has func_pagerank, func_fan_in and func_fan_out columns, auto-healed for old DBs (#3265 step 3: function-level PageRank, fan-in and fan-out as new columns #3330, PR Engine: function-level PageRank, fan-in and fan-out (#3330) #3376).
    2. Implicit dependency edges. Resolved calls now add file-to-file edges to the dependency graph even where there is no import. PageRank, popularity, betweenness and closeness include them. On cpython, Objects/object.c rises to Bump actions/checkout from 4 to 6 #2. Popularity and blast radius change on 218 files (#3265 step 6: call-derived file edges in the dependency graph (blast radius, PageRank) #3333, PR Engine: confident function calls join the dependency graph (#3333) #3388).
    3. Blast radius. File-level blast radius includes call edges (PR Engine: confident function calls join the dependency graph (#3333) #3388). Function-level traversal is available with tests/tools/function_blast_radius.py <db> <function> [--file] [--depth] [--downstream] (PR Engine: function-level PageRank, fan-in and fan-out (#3330) #3376).

    Groundwork

    Still open, tracked separately

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    core-engineenhancement

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions