From 359c6b6655f5c828d0a162e2c6ee20d070e6b6a5 Mon Sep 17 00:00:00 2001 From: YeonGyu-Kim Date: Mon, 16 Feb 2026 16:42:38 +0900 Subject: [PATCH] fix(hashline): address Cubic review comments - P2: Change replace edit sorting from POSITIVE_INFINITY to NEGATIVE_INFINITY so replace edits run LAST after line-based edits, preventing line number shifts that would invalidate subsequent anchors - P3: Update tool description from SHA-256 to xxHash32 to match actual implementation in hash-computation.ts --- src/tools/hashline-edit/edit-operations.ts | 2 +- src/tools/hashline-edit/tools.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/tools/hashline-edit/edit-operations.ts b/src/tools/hashline-edit/edit-operations.ts index a91863ee..7a6340db 100644 --- a/src/tools/hashline-edit/edit-operations.ts +++ b/src/tools/hashline-edit/edit-operations.ts @@ -62,7 +62,7 @@ function getEditLineNumber(edit: HashlineEdit): number { case "insert_after": return parseLineRef(edit.line).line case "replace": - return Number.POSITIVE_INFINITY + return Number.NEGATIVE_INFINITY default: return Number.POSITIVE_INFINITY } diff --git a/src/tools/hashline-edit/tools.ts b/src/tools/hashline-edit/tools.ts index a4bfab18..8c970582 100644 --- a/src/tools/hashline-edit/tools.ts +++ b/src/tools/hashline-edit/tools.ts @@ -41,7 +41,7 @@ export function createHashlineEditTool(): ToolDefinition { LINE:HASH FORMAT: Each line reference must be in "LINE:HASH" format where: - LINE: 1-based line number -- HASH: First 2 characters of SHA-256 hash of line content (computed with computeLineHash) +- HASH: First 2 characters of xxHash32 hash of line content (computed with computeLineHash) - Example: "5:a3|const x = 1" means line 5 with hash "a3" GETTING HASHES: