refactor(hashline-edit): stabilize hashes and tighten prefix stripping

Switch line hashing to significance-aware seeding so meaningful lines stay stable across reflows while punctuation-only lines still disambiguate by line index.

Also narrow prefix stripping to hashline/diff patterns that reduce accidental content corruption during edit normalization.

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
YeonGyu-Kim
2026-02-23 18:51:25 +09:00
parent afec1f2928
commit ab768029fa
3 changed files with 20 additions and 6 deletions
@@ -1,5 +1,5 @@
const HASHLINE_PREFIX_RE = /^\s*(?:>>>|>>)?\s*\d+#[A-Z]{2}:/
const DIFF_PLUS_RE = /^[+-](?![+-])/
const HASHLINE_PREFIX_RE = /^\s*(?:>>>|>>)?\s*\d+\s*#\s*[ZPMQVRWSNKTXJBYH]{2}:/
const DIFF_PLUS_RE = /^[+](?![+])/
function equalsIgnoringWhitespace(a: string, b: string): boolean {
if (a === b) return true