Skip to main content

Module native_memory_diff

Module native_memory_diff 

Source
Expand description

The line diff Memory’s history views show, for Personal and Global Memory alike (native_memory_handlers, app_api::global_memory).

Constants§

MAX_DIFF_CELLS 🔒
Cap on the LCS table’s cell COUNT (from_lines.len() * to_lines.len()), not on either side’s line count independently — reagent P1: the original per-side-only cap (20,000 lines each) bounded neither dimension against the other, so two files each under that cap could still produce a ~3.2GB usize table (20_000 * 20_000 * 8 bytes) in the shared agentmux-srv process. 4,000,000 cells keeps the table under ~32MB (* size_of::<usize>()) regardless of how the two side lengths are distributed — generous for memory files (markdown notes, not logs) while still bounded for any combination of sizes.

Functions§

line_diff 🔒
A minimal unified-diff-style line comparison: longest-common-subsequence based, output lines prefixed " " (context), "- " (removed, from only), or "+ " (added, to only). No @@ hunk headers or context trimming in v1 — every line is included, which is fine for memory files.