Skip to main content

dedup_applied_items

Function dedup_applied_items 

Source
pub fn dedup_applied_items(items: &mut [PlannedUpdateItem])
Expand description

Deduplicates items’ Outcome::Applied edits by span in place, demoting any item whose edit was dropped as an overlap to Outcome::Skipped with reason SkipReason::OverlapsAnotherEdit.

Spec 075 FR-015: plan_updates now calls this itself, after per-occurrence view selection, over its own chosen PlannedUpdates — the correct place for this pass to run (never over both the latest and fallback views’ raw candidates together). Still load-bearing for security::plan_security_updates, which does not dedup its own Applied items (two vulnerable occurrences of one name can share a span), and for main.rs’s own defensive call after either planner returns. Without this, apply_plan’s own dedup pass could silently drop an edit a planner had already reported applied, breaking the “applied implies written” invariant --format json consumers rely on (critic finding M2). Call this on a planner’s output before reporting/rendering it, not after — the whole point is that the reported outcome must match what apply_plan will actually write.