pub struct MergePlan {
pub into_id: Uuid,
pub from_id: Uuid,
pub rewires: Vec<PlanPredicate>,
pub lifecycle: Vec<PlanStatement>,
}Expand description
Write plan for a merge op (deduplicate two entities). Rewires and
lifecycle writes are split into separate fields precisely so a guard is
never ambiguous between them: the edge rewire is predicate-based
(ADR-099 D1 rule 1) and may touch zero or many rows depending on earlier
in-file writes, so it is never guarded; the from/into entity
lifecycle write assumes both rows exist, so it always is.
Fields§
§into_id: Uuid§from_id: Uuid§rewires: Vec<PlanPredicate>Predicate-based edge-rewire statement(s)
(UPDATE graph_edges SET source_id = :into WHERE source_id = :from-
shaped), evaluated inside the transaction so they structurally see
any earlier op’s edge writes in the same file (ADR-099 acceptance
criteria: “merge rewires see earlier in-file writes”). Never
guarded — a rewire touching zero rows is a legitimate outcome.
lifecycle: Vec<PlanStatement>The from entity’s soft-delete/tombstone DML (and any other
lifecycle write prepare assumed a target row exists for). Always
guarded — prepare validated into/from both exist.