The hashline edit engine
Default edit mode is hashline (edit.mode: hashline in config.yml), implemented in
@veyyon/hashline.
Veyyon applies file changes through the edit tool (hashline patch language by default). The
model copies [PATH#TAG] anchors from read / search / 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
readorsearchrecords 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.PRE N:/INS.POST N:/INS.HEAD/INS.TAIL, block opsSWAP.BLK/DEL.BLK/INS.BLK.POST, plus whole-fileREMandMV DEST). @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 VEYYON_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 with an error |
| 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/search anchors:
docs/tools/read.md,docs/tools/search.md - Settings:
edit.modeindocs/handbook/src/reference/settings.md
There is no veyyon-edit Rust crate, no V4A-only write path, and no make_update_patch envelope
routing. General schema-based tool-call repair is shipped, see
Repair overview.