Skip to main content

Module diff

Module diff 

Source
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§

DiffLine
A single diff line: its kind (+ added, - removed, context) and the line text.
UnifiedDiff
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 old and new (as whole strings). Uses a longest-common-subsequence algorithm over lines; context is the number of unchanged lines to keep around each change (0 = minimal diff).