4 Commits

Author SHA1 Message Date
can1357 01c34db450 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.
2026-05-29 18:12:08 +02:00
can1357 7c64576524 feat(hashline): replaced file-hash anchors with opaque snapshot-store tags
- Replaced 4-hex content-derived file hashes with 3-hex opaque tags minted by InMemorySnapshotStore, making tags session-bound pointers rather than content fingerprints.
- Removed lru-cache dependency; replaced LRU-bounded per-path rings with a flat 4096-slot global ring using a scrambled permutation to prevent LLM tag extrapolation.
- Made SnapshotStore required in Patcher (was optional); tag resolution now drives stale-anchor detection instead of recomputing hashes at apply time.
- Changed literal payload sigil from `|` to `+` and accepted `^A` shorthand for `^A-A`; added lenient recovery for bare bodies, lone `-` rows, and overlapping bare/concrete block pairs.
2026-05-28 01:00:23 +02:00
oldschoola 60bfc375c4 bench(hashline): fix accept regime measuring 3-way-merge success instead of replay path
Anchor configs placed rewrittenLine at floor(size/2) while anchors sat 8-1875 lines away. With Diff.structuredPatch using context=3, no hunk's context overlapped the rewrite, so applyEditsToSnapshot's 3-way merge succeeded on the first try and replaySessionChainOnCurrent (the path the bench claims to pin) was never invoked for the 6 accept cases. The sanity probe only checked probe !== null, which both branches satisfy, so the misalignment was silent.

Move rewrittenLine to anchors[0]-1 for accept cases so the first hunk's context actually spans the rewrite, forcing applyPatch failure and replay invocation. Strengthen the sanity check to require RECOVERY_SESSION_REPLAY_WARNING (only emitted past verifyAnchorContent) on every accept case so a future regression fails loudly instead of silently measuring the wrong path.
2026-05-27 18:55:48 +02:00
oldschoola 68a0fb61f9 bench(hashline): added recovery session-chain replay throughput bench
Pins the hot path PR #1422 hardened: Recovery.tryRecover → applyEditsToSnapshot (3-way merge fails) → replaySessionChainOnCurrent → verifyAnchorContent. Two regimes (accept/reject) × three file sizes (50/500/5000 lines) × two anchor counts (1/8). Sanity-probes each case once before timing so the numbers measure the right branch.

Surfaces the four-split-per-replay cost in the gated path; dedup is an obvious follow-up at large file sizes but out of scope here.
2026-05-27 18:55:48 +02:00