Context
Arrays in snapshot state are currently compared atomically via JSON.stringify. A changed array appears as a single changed node with prevValue/nextValue. This works for the common case but hides granular information about array insertions, deletions, and reordering.
Implementation
diffSnapshots.ts is the only file that needs updating. The isPlainObject boundary is the explicit extension point — arrays fall through to the atomic comparison today; upgrading to LCS swaps in at that boundary.
A Longest Common Subsequence algorithm should produce per-element added, removed, and unchanged nodes for changed arrays.
Acceptance criteria
References
- Decision 16 in
CLAUDE.md — atomic array comparison rationale and explicit extension point
Context
Arrays in snapshot state are currently compared atomically via
JSON.stringify. A changed array appears as a singlechangednode withprevValue/nextValue. This works for the common case but hides granular information about array insertions, deletions, and reordering.Implementation
diffSnapshots.tsis the only file that needs updating. TheisPlainObjectboundary is the explicit extension point — arrays fall through to the atomic comparison today; upgrading to LCS swaps in at that boundary.A Longest Common Subsequence algorithm should produce per-element
added,removed, andunchangednodes for changed arrays.Acceptance criteria
diffSnapshotsunit tests passReferences
CLAUDE.md— atomic array comparison rationale and explicit extension point