Expand description
Unified diff — “diff before apply” (M1.3).
A dependency-free, renderer-agnostic unified diff over lines. The edit flow compares the live object’s YAML against the edited manifest and shows what would change; this is the semantic “before/after” the frontend renders (additions, removals, context). It is deliberately small — the full three-way merge lives in Phase 2 with GitOps.
Structs§
- Diff
Line - A single diff line: its kind (
+added,-removed,context) and the line text. - Unified
Diff - A complete unified diff, split into hunks.
Functions§
- render_
unified - Render the diff as a string in unified-diff format (for the CLI).
- unified_
diff - Compute a unified diff between
oldandnew(as whole strings). Uses a longest-common-subsequence algorithm over lines;contextis the number of unchanged lines to keep around each change (0 = minimal diff).