feat(hashline): added full-file hash snapshots with 4-hex tags

- Replaced snapshot internals with full-file records and removed contiguous/sparse snapshot APIs.
- Added file-hash normalization, computed `computeFileHash`, and updated grammar/messages to 4-hex tags.
- Simplified recovery by checking whole-file hashes first, then applying merge-replay fallback after mismatches.
- Updated coding-agent tools to use `record`/`recordFileSnapshot` and skip hash headers for unsnapshotted large files.
- Expanded patcher and snapshot tests to verify 4-hex anchors, hash deduplication, and cache-capped behavior.
This commit is contained in:
can1357
2026-05-29 17:57:03 +02:00
parent 2d7cd6d2de
commit 01c34db450
34 changed files with 517 additions and 827 deletions
+1 -1
View File
@@ -240,7 +240,7 @@ describe("computeHashlineDiff", () => {
// fires through computeHashlineDiff but produces identical content.
const text = `${line}\n`;
const snapshotStore = new InMemorySnapshotStore();
const tag = snapshotStore.recordContiguous(sourcePath, 1, text.split("\n"), { fullText: text });
const tag = snapshotStore.record(sourcePath, text);
const input = `${formatHashlineHeader(sourcePath, tag)}\nreplace 1..1:\n+${line}\n`;
const result = await computeHashlineDiff({ input }, tempDir, snapshotStore);
expect("error" in result).toBe(true);