feat(coding-agent): added inline hashline parse with conflict checks
- Added inline hashline parse and apply support for `<` prepend and `+` append operations with prefix+suffix edits. - Added fail-fast behavior to reject inline modify ops combined with delete or replace on same line. - Renamed HASHLINE_* and mode symbols to HL_* in prompt tooling, read/search checks, and prompt templates. - Standardized separators to `PI_HL_SEP`/`HL_EDIT_SEP` and fixed `HL_BODY_SEP='|'`, updating parser formatting behavior. - Updated benchmark subtype constants and python cleanup test setup to use HL_* values and AgentRegistry mock failure injection.
This commit is contained in:
@@ -9,6 +9,7 @@ import {
|
||||
DEFAULT_FUZZY_THRESHOLD,
|
||||
findMatch,
|
||||
} from "@oh-my-pi/pi-coding-agent/edit";
|
||||
import { HL_EDIT_SEP } from "@oh-my-pi/pi-coding-agent/edit/line-hash";
|
||||
|
||||
describe("findMatch", () => {
|
||||
describe("exact matching", () => {
|
||||
@@ -245,7 +246,7 @@ describe("computeHashlineDiff", () => {
|
||||
const sourcePath = path.join(tempDir, "source.txt");
|
||||
await Bun.write(sourcePath, "first\n");
|
||||
|
||||
const result = await computeHashlineDiff({ input: `@${sourcePath}\n+ EOF\n|second` }, tempDir);
|
||||
const result = await computeHashlineDiff({ input: `@${sourcePath}\n+ EOF\n${HL_EDIT_SEP}second` }, tempDir);
|
||||
expect("diff" in result).toBe(true);
|
||||
if ("diff" in result) {
|
||||
expect(result.diff).toContain("second");
|
||||
|
||||
Reference in New Issue
Block a user