Skip to content

Phase 2: Wire code graph to blast radius — replace regex scan with graph query for callers/callees #457

Closed

Description

@ajianaz

Goal

Replace regex-based blast radius scan (file-system walk + pattern matching, 400 file limit) with code graph queries (find_callers, find_callees).

Context

  • Current: resolve_callers() in context chain scans source code with ignore::WalkBuilder + regex per defined symbol (capped at 400 files)
  • find_callers() already exists in src/index/graph.rs — reverse call graph traversal via SQLite edges table
  • Only used in cora query and MCP server, not wired to review/scan pipeline

Scope

  1. Add resolve_callers_via_graph() in engine/context/resolver.rs
  2. Query index::graph::find_callers(conn, project_id, name, max) instead of file-system scan
  3. If graph unavailable (no index), fall back to existing regex scan
  4. Leverage IndexBridge from Phase 1 (Phase 1: Wire symbol index to context chain — replace regex-based resolution with SQLite queries #456)

Files

  • src/engine/context/resolver.rs — add graph-based caller resolution
  • src/index/graph.rs — existing find_callers (already implemented)

Benefits

  • Accurate blast radius (graph has real call edges, no regex misses)
  • No 400-file limit (graph query is instant)
  • Catches indirect calls via traits/interfaces

Dependencies

Effort: 1-2 days

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

    enhancementNew feature or requestphase-2Phase 2: Parallelismpriority:highscope:code-intelCode intelligence — indexing, graph, impact analysisscope:coreCore review engine

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions