Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

The hashline edit engine

Status: Built. Default edit mode is hashline (edit.mode: hashline in config.yml), implemented in the @veyyon/hashline package.

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

  1. read or grep records a whole-file snapshot and prints [relative/path#TAG] plus LINE:content rows (TAG is a four-hex snapshot id).
  2. The model sends edit with an input string: one or more [PATH#TAG] sections and hashline ops (SWAP N.=M:, DEL N.=M, INS.POST N:, block ops SWAP.BLK / DEL.BLK / INS.BLK.POST, plus INS.HEAD / INS.TAIL).
  3. @veyyon/hashline parses, verifies the tag against the snapshot store, applies ops, and returns a fresh [path#TAG] header plus a compact diff preview.
  4. write can 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

PropertyBehavior
Stale anchorMismatch errors name the tag; snapshot recovery can suggest the current file hash
Line numbers1-indexed; body rows use +TEXT prefix
OrderNon-overlapping hunks; overlapping regions fail loudly
EncodingApplies to normalized content; BOM and dominant line ending preserved on write

Further reading

Spec — not shipped: a veyyon-edit Rust crate, a V4A-only write path, and make_update_patch envelope routing. General schema-based tool-call repair is shipped — see Repair overview.