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:
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user