The hashline edit engine
Status: Built. Default edit mode is hashline (
edit.mode: hashlineinconfig.yml), implemented in the@veyyon/hashlinepackage.
Veyyon applies file changes through the edit tool (hashline patch language by default). The
model copies [PATH#TAG] anchors from read / grep / write output, then emits SWAP, DEL,
and INS operations against numbered lines. Snapshot tags detect stale anchors and drive recovery.
Alternate modes (apply_patch, patch, replace) exist for compatibility; hashline is the
default and the path Veyyon optimizes for.
How a hashline edit works
readorgreprecords a whole-file snapshot and prints[relative/path#TAG]plusLINE:contentrows (TAGis a four-hex snapshot id).- The model sends
editwith aninputstring: one or more[PATH#TAG]sections and hashline ops (SWAP N.=M:,DEL N.=M,INS.POST N:, block opsSWAP.BLK/DEL.BLK/INS.BLK.POST, plusINS.HEAD/INS.TAIL). @veyyon/hashlineparses, verifies the tag against the snapshot store, applies ops, and returns a fresh[path#TAG]header plus a compact diff preview.writecan create or overwrite whole files; in hashline display mode it also mints snapshot headers for the next edit.
edit.mode and PI_EDIT_VARIANT select among hashline, apply_patch, patch, and replace.
Invariants
| Property | Behavior |
|---|---|
| Stale anchor | Mismatch errors name the tag; snapshot recovery can suggest the current file hash |
| Line numbers | 1-indexed; body rows use +TEXT prefix |
| Order | Non-overlapping hunks; overlapping regions fail loudly |
| Encoding | Applies to normalized content; BOM and dominant line ending preserved on write |
Further reading
- User guide: Editing and repair
- Tool contract:
docs/tools/edit.md - Read/grep anchors:
docs/tools/read.md,docs/tools/grep.md - Settings:
edit.modeindocs/settings.md
Spec — not shipped: a
veyyon-editRust crate, a V4A-only write path, andmake_update_patchenvelope routing. General schema-based tool-call repair is shipped — see Repair overview.