feat(coding-agent): added HASHLINE_BIGRAMS-based hashline/chunk handling

- Aligned hashline and chunk token handling to `HASHLINE_BIGRAMS` in `computeLineHash` and parsing regexes.
- Removed hashline file-level `move`/`delete` options from schemas and execution so edits are in-place updates only.
- Hardened hashline prefix parsing to reject non-bigram IDs, preventing false stripping of `#` comment lines.
- Updated `read()`/prompt wording so raw reads skip prefixes and examples now show anchors like `123#th`.
- Updated hashline chunk tests for new `HASHLINE_BIGRAMS` IDs and replaced stale hash constants.
This commit is contained in:
can1357
2026-04-25 23:51:34 +02:00
parent 5c1b8eaaaa
commit 6d154a17f5
12 changed files with 220 additions and 502 deletions
@@ -380,23 +380,6 @@ describe("computeHashlineDiff", () => {
expect(result.diff).toContain("second");
}
});
test("allows move-only operation when content is unchanged", async () => {
const sourcePath = path.join(tempDir, "source.txt");
await Bun.write(sourcePath, "unchanged content\n");
const result = await computeHashlineDiff(
{ path: sourcePath, edits: [], move: path.join(tempDir, "moved", "target.txt") },
tempDir,
);
expect("error" in result).toBe(false);
if ("diff" in result) {
expect(result.diff).toBe("");
expect(result.firstChangedLine).toBeUndefined();
}
});
test("returns a handled error when the source path is a local URL", async () => {
const result = await computeHashlineDiff({ path: "local://PLAN.md", edits: [] }, tempDir);