Skip to main content

Module diff

Module diff 

Source
Expand description

Semantic diff implementation for super::ComparativeQueryDb.

Ported from sqry-mcp::execution::diff_comparator (which in turn adapted sqry-core::graph::diff::GraphComparator) as part of Phase 3C / DB20. The MCP copy diverged from sqry-core’s in three ways, all of which are preserved here so the MCP wire format is byte-for-byte stable:

  1. Qualified names are formatted through sqry_core::graph::unified::resolution::display_graph_qualified_name when a known language is associated with the source file. This lets per-language plugins override the stored qualified name (e.g. Swift inserting Type. for is_static members).
  2. The is_static flag is threaded through the comparator so the above display logic receives the same information the graph node stored.
  3. Line numbers / columns / paths are reported as plain fields on NodeLocation; the MCP handler wraps them in its transport DTO (NodeRefData + fileUri) so the wire format is owned by MCP.

Rename detection heuristics (Levenshtein over signatures weighted 70%, location proximity weighted 30%, 90% confidence threshold) match the previous MCP GraphComparator bit-for-bit.

Structs§

DiffOptions
Options controlling the diff computation.
DiffOutput
Output of compute_diff / super::ComparativeQueryDb::diff.
DiffSummary
Summary counts for a diff.
NodeChange
A single change record.
NodeLocation
Location of a single changed node, reported in sqry-db-owned terms.

Enums§

ChangeType
Kind of change detected between the two snapshots.

Functions§

compute_diff
Entry point: computes the semantic diff between old and new.