Skip to content

fix(graph): incremental update drops inbound CALLS from unchanged callers into a changed file #532

Description

@vitali87

Problem

The incremental updater (GraphUpdater._process_files in codebase_rag/graph_updater.py) now scopes work to changed files: when a file changes it calls _delete_module_entities(file_key), which DETACH-deletes that file's Module subtree, including the CALLS edges attached to its functions.

This correctly removes outbound calls from the changed file. But it also removes inbound CALLS edges, i.e. calls from unchanged files into the changed file's functions. Those caller files are not reprocessed during the incremental run, so the inbound CALLS edges are deleted and never rebuilt until either:

  • the caller file itself changes later, or
  • a full re-index (--clean / forced) is run.

The result is that, after an incremental update to a callee, the graph can under-report who calls it.

Expected

After an incremental update to file A, CALLS edges from unchanged callers into A's (re-created) functions should be preserved or rebuilt.

Notes

  • Spun off from Optimize realtime updater #86, which asked for tailored incremental updates instead of wiping all CALLS. That broader optimization is done; this is the remaining correctness edge case.
  • Possible approaches: re-resolve inbound callers of the changed file's symbols, or recompute calls for files that reference symbols defined in the changed file.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working correctly

    Projects

    Status
    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions