Skip to main content

Module syntax

Module syntax 

Source
Expand description

Parsing and Phase-1 safety checks for the hashline patch language.

This module deliberately separates a patch’s requested coordinates from execution. Every address is resolved against the retained snapshot before a caller plans a mutation, and exact verification compares that snapshot with one caller-owned baseline. That keeps later operations in the same patch from silently renumbering the coordinates of earlier input.

Structs§

Baseline
A complete Phase-1 baseline owned by one patch and one canonical path.
BaselineCache
A per-patch cache that makes the one-baseline-per-canonical-path contract explicit. Calling load_once again returns the original byte buffer rather than silently replacing the evidence used by another section.
CutOperation
HashlineRejection
Transport-neutral details for a Phase-1 rejection.
HashlineRequest
The hashline edit entry point accepts exactly one argument field, patch, while hashline validation is enabled.
LineSpan
A fully resolved inclusive span in pre-request coordinates.
MvOperation
Patch
A parsed patch. Section order is patch order and must be retained by later planning and execution stages.
PatchSection
A per-file patch unit headed by the requested path and its snapshot tag.
PutOperation
RecoveryPlan
The exact records from the old addressed span that a recovery plan can use to remap the operation.
RemOperation
ResolvedGap
A gap resolves to adjacent snapshot rows rather than a current live-file offset. None anchors name BOF/EOF facts retained in the snapshot.
ResolvedOperation
ResolvedPatchSection
Resolve all sections against their snapshot handles before any later apply stage can mutate a path. A canonical path may appear in several sections, but all of those sections must use equivalent verification evidence.
SectionHeader
The lossless path spelling paired with a normalized tag.

Enums§

Address
One parsed pre-request address.
GapSide
HashlineRejectionCode
A stable pre-execution rejection code.
LineReference
A reference whose value is resolved solely from Snapshot::total_lines.
Operation
One hashline operation. Body-bearing PUTs retain logical body lines so the apply layer can select the target file’s terminator policy after verification.
PutSource
RegisterRef
Named registers are durable only for the life of the session; the anonymous register is represented explicitly so it cannot collide with an empty name.
RejectionStage
The one canonical Phase-1 adjudication stage enum.
ResolvedAddress
The result of resolving one parsed address against its retained snapshot.
VerificationOutcome
The result of exact verification. An addressed-span mismatch is deliberately not a rejection: the recovery planner receives its exact old records. An anchor mismatch remains a loud verification-stage rejection because moving a gap or boundary insertion would change its meaning.

Functions§

check_eligibility
Prove that the retained snapshot authorizes every record and boundary fact an address will use. This is deliberately separate from exact verification: an unread row is never eligible merely because current bytes happen to match.
expand_block
Substitute an authoritative language-aware block span for a parsed block anchor. The supplied span is still constrained to pre-request coordinates.
parse_address
Parse line, range, gap, block, and EOF-relative forms without consulting a live file. Resolution happens later against a snapshot’s recorded line count.
parse_hashline_patch
Parse a complete patch after raw tool arguments selected the hashline path. Accept an optional *** Begin Patch / *** End Patch envelope, but reject any other preamble or trailing content instead of ignoring it.
parse_section_header
Parse one recognizable header and distinguish absent and malformed tags.
resolve_address
Resolve an address against the snapshot that minted its handle. This function never reads filesystem state, including for $ and EOF-relative forms.
resolve_patch_sections
resolve_snapshot
Normalize and resolve one case-insensitive four-hex snapshot tag using the snapshot store’s recorded result for the requested canonical path.
validate_raw_arguments
Validate raw tool arguments before any legacy edit normalization can run.
verify_exact
Verify an already-resolved address against one common baseline. Anchor rows are checked before addressed rows so a stale gap cannot be auto-remapped.