Editing and repair
Editing reliably is the core of a coding agent, so it is worth understanding how Veyyon does it. The default edit surface is hashline. In practice that means three things work together: numbered lines that come back from read and search, snapshot tags that identify a known state of a file, and the edit tool with its SWAP, DEL, and INS operations.
For the design behind the edit and repair path, see The hashline edit engine.
Failure modes
Models often emit slightly wrong tool JSON, or line anchors that have gone stale. Hashline catches a stale [path#TAG] tag and returns recovery hints instead of writing the wrong bytes. On top of that, general schema repair runs on every tool call before validation. See Repair overview.
Write path versus edit path
Veyyon keeps surgical edits and whole-file writes separate on purpose.
| Path | Applier | Role |
|---|---|---|
edit | @veyyon/hashline (default) | Surgical edits, anchored on snapshot tags and hashline ops |
write | Whole-file writer | Create or overwrite a file, minting new snapshot tags in hashline mode |
apply_patch, patch, replace | Mode-specific parsers | Compatibility modes selected by edit.mode |
There is one hashline edit applier for anchored edits, and write stays separate for whole-file creation. Both honor the same approval policy.
Tools
| Tool | What the model sends | Use it for |
|---|---|---|
edit | A hashline input (default), or a mode-specific payload | Surgical edits |
write | A path plus the full content | New files or full rewrites |
apply_patch | A V4A envelope | When edit.mode is apply_patch |
You set edit.mode to hashline, apply_patch, patch, or replace in config.yml, or use VEYYON_EDIT_VARIANT for a one-shot override.
Hashline workflow
The loop is short:
read(orsearch) returns[relative/path#TAG]andLINE:textrows.- The model calls
edit, anchoring each section on the sameTAG. - On success, the output includes a fresh
[path#NEW_TAG]and a compact diff.
write strips pasted hashline prefixes when appropriate, and can mint new tags after a whole-file write.
Verification after a mutation
After edit, write, or ast_edit changes a path, Veyyon records the mutation.
If the model tries to finish without a later successful bash, eval, debug,
or browser result, Veyyon gives it one targeted continuation turn. The model
must run the check and report what the result established.
A successful command is execution evidence. It does not prove that the command tested the right behavior. You should still read the final verification claim and confirm that it matches the command or browser scenario that ran.
Safety
Edits honor the approval mode, just as bash does. A tools.approval.<tool>: deny policy keeps the tool in the model’s list but rejects every call at dispatch with an error stating the policy. Tools leave the model’s list via <tool>.enabled: false, harness-profile allowlists, tools.discoveryMode (BM25 hiding), extension or agent tool-set overrides, or agent definitions. Plan mode keeps the list and blocks mutations at approval time.
Hashline is the primary write path, and apply_patch is a compatibility mode. There is no single V4A applier that routes every mutation through a make_update_patch envelope.