Skip to main content

validate_invariants

Function validate_invariants 

Source
pub fn validate_invariants(
    before: &GraphSnapshot,
    after: &GraphSnapshot,
) -> Result<Vec<InvariantCheck>>
Expand description

Validate that refactoring invariants are preserved.

Checks:

  • Reference counts are preserved (same number of incoming/outgoing edges)
  • No orphaned symbols (all symbols remain reachable from entry points)
  • Symbol IDs are stable (no new IDs generated, only name changes)
  • Entry points are preserved (no loss of public API)

§Arguments

  • before - Graph snapshot before refactoring
  • after - Graph snapshot after refactoring

§Returns

A vector of invariant check results, one for each invariant validated.