Function: rawDiff()
ts
function rawDiff(
store: PlanStore,
planId: string,
a: number | "current",
b: number | "current",
): Promise<PlanDiff>;Defined in: src/batteries/orchestration/raw.ts:119
A STRUCTURAL delta between two folded states of a plan.
Parameters
| Parameter | Type | Description |
|---|---|---|
store | PlanStore | The plan store to read from. |
planId | string | The plan to diff. |
a | number | "current" | The "from" side: a revision number or 'current'. |
b | number | "current" | The "to" side: a revision number or 'current'. |
Returns
Promise<PlanDiff>
The structural delta between the two folded states.
Remarks
rawDiff(a, b) compares two folded states, NOT an event log. It resolves each side to a revision ('current' means the plan's present revision), folds both prefixes, and compares the resulting content structurally:
nodesAdded/nodesRemovedare keyed by node id.nodesChangednames the CHANGED FIELD PATHS with before/after values, typedArgValue— a changed field may hold aNodeRef, so a narrower type would make a legitimate change unrepresentable.edgesAdded/edgesRemovedare keyed by edge id; an edge whose endpoints or handle changed counts as removed-then-added, since its identity is its id.- Both digests are carried so a UI can label either side.
Because this is a FINAL-STATE diff, a node edited and then reverted across the compared span produces NO row — the two states are identical at that node, and there is nothing to report.