fix(hashline-edit): integrate continuation/merge helpers into expand logic and strengthen tool description

- maybeExpandSingleLineMerge now uses stripTrailingContinuationTokens and
  stripMergeOperatorChars as fallback matching strategies
- Add 'refs interpreted against last read' atomicity clause to tool description
- Add 'output tool calls only; no prose' rule to tool description
This commit is contained in:
YeonGyu-Kim
2026-02-22 14:46:59 +09:00
parent 6ab3dc35b0
commit 434b5fbd5d
2 changed files with 17 additions and 2 deletions
@@ -77,7 +77,21 @@ export function maybeExpandSingleLineMerge(
let offset = 0
let orderedMatch = true
for (const part of parts) {
const idx = merged.indexOf(part, offset)
let idx = merged.indexOf(part, offset)
if (idx === -1) {
const stripped = stripTrailingContinuationTokens(part)
if (stripped !== part) {
idx = merged.indexOf(stripped, offset)
}
}
if (idx === -1) {
const mergeStripped = stripMergeOperatorChars(merged.slice(offset))
const partStripped = stripMergeOperatorChars(part)
const fuzzyIdx = mergeStripped.indexOf(partStripped)
if (fuzzyIdx !== -1) {
idx = offset + fuzzyIdx
}
}
if (idx === -1) {
orderedMatch = false
break