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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user