Skip to content

[BUG] Incremental scan does not populate graph tables (only full scan does) #25

Description

@Wolfvin

Discovered during #8 verification

PR #24 (graph data model) populates graph_nodes + graph_edges only during full scan. Incremental scan (scan --incremental) skips graph population entirely, so the graph tables become stale after incremental scans.

Reproduction

codelens scan /workspace                  # graph: {nodes: N, edges: M} populated
codelens scan /workspace --incremental    # graph field absent, tables NOT updated
# trace --use-graph now returns stale data

Expected

Incremental scan should update graph tables for changed files only:

  1. Detect changed files (existing incremental logic)
  2. Delete graph_nodes + graph_edges where file IN (changed_files)
  3. Re-parse changed files, INSERT new nodes + edges
  4. This keeps graph in sync without full re-population

Workaround (current)

Run codelens scan (full) after incremental scans to refresh graph. Or use trace --no-graph to force flat backend.

Priority

Medium — not blocking Phase 1 (full scan works), but agents using --incremental (the recommended post-edit workflow) will have stale graph data. Should be fixed before Phase 1 is declared done.

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingenhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions