SEMANTIC AST COMPARISON, JSON PATCH (RFC 6902) & KEY-INDEPENDENT DIFFING
Technical architecture for Abstract Syntax Tree parsing, RFC 6902 mutation operations, and order-agnostic JSON comparison.
1. Line Diffing vs Semantic Tree Diffing
Standard text diff algorithms (such as Myers' diff or Git diff) evaluate sequential textual lines. In JSON, however, object keys are mathematically unordered sets per RFC 8259. A naive line diff marks two documents as completely diverged simply if a serializer alphabetized keys:
Our engine builds recursive object graphs, isolating genuine property changes regardless of formatting or serialization quirks.
2. RFC 6902 Operation Semantics
Divergences are cataloged according to standard JSON Patch operations:
- add (+): Injected property paths not present in the reference payload.
- remove (-): Deprecated property paths deleted in the target payload.
- replace (~): Mutated values, scalar shifts, or type alterations (e.g. integer to string).
"12" mutated into number 12).