Skip to content

Incremental rebuild leaves edges.technique NULL for native-engine call edges (full build sets 'ts-native') #1744

Description

@carlos-alm

Summary

Discovered while verifying phase-11 Titan decomposition of src/domain/graph/builder/stages/build-edges.ts (a pure extract-method refactor, unrelated to this bug — reproduces identically on unmodified HEAD).

For the native engine, a call edge's technique column differs depending on whether it was inserted via a full build vs. an incremental rebuild of the same final source state:

  • Full build (codegraph build --engine native or --no-incremental): applyEdgeTechniquesAfterNativeInsert in build-edges.ts backfills technique = 'ts-native' on every natively-inserted calls edge that doesn't already have an explicit technique.
  • Incremental rebuild (codegraph build --engine native after a single-file edit): buildCallEdgesemitIncrementalCallEdges in src/domain/graph/builder/incremental.ts inserts edges via stmts.insertEdge.run(...), which never sets technique at all — it's left NULL.

Repro

  1. Build a small fixture project fully with --engine native.
  2. Make a trivial one-line edit to any file that has a calls edge into it (e.g. append an unrelated comment).
  3. Rebuild incrementally (codegraph build --engine native).
  4. Dump the edges table and compare technique for the affected edges against a fresh --no-incremental full rebuild of the same post-edit state.

Example divergence on tests/fixtures/sample-project:

incremental: {"src":"main","tgt":"Calculator.compute", ..., "technique":null}
full:        {"src":"main","tgt":"Calculator.compute", ..., "technique":"ts-native"}

All other edge fields (source, target, kind, confidence, dynamic) are identical — only technique diverges.

Impact

Any query or feature that filters/groups by edges.technique (e.g. codegraph roles, technique-coverage reporting in the resolution benchmark, coverage dashboards) will undercount native-engine edges that were last touched by an incremental rebuild vs. a full rebuild, even though the edges themselves are correct.

Suggested fix

Mirror applyEdgeTechniquesAfterNativeInsert's backfill behavior in incremental.ts's emitIncrementalCallEdges (or run an equivalent scoped backfill after incremental native inserts), so technique is populated consistently regardless of which rebuild path produced the edge.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions