Skip to main content

Module patch

Module patch 

Source

Structs§

Patch
Represents a complete patch comprised of multiple operations.
PatchChunk
Represents a chunk of changes within an update operation.

Enums§

PatchError
Errors produced while parsing or applying agent patches.
PatchLine
Represents a single diff line inside a patch hunk.
PatchOperation
Represents a patch operation.

Functions§

looks_like_unified_diff
Cheap shape check: does this text look like a standard unified diff (diff --git header, or a paired --- /+++ file-header block)? Used to produce actionable error guidance when a model submits a git-style diff to apply_patch (which requires the *** Begin Patch envelope). VT Code patch format never uses --- /+++ markers, so this will not false-positive on valid VTE patches.
looks_like_vte_patch
Cheap shape check: does this text begin with the VT Code patch envelope (*** Begin Patch) or a bare file-operation header (*** Update File:, *** Add File:, *** Delete File:)? Used by tool routing and source-field selection to distinguish a real patch from raw file contents or a unified diff. Intentionally cheap (prefix-only) — it does not validate the full patch.
render_patch_update_content

Type Aliases§

PatchHunk