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:
can1357
2026-05-03 08:17:09 +02:00
parent 067c8eb8f2
commit 6e8daae059
17 changed files with 270 additions and 175 deletions
+2 -1
View File
@@ -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");