Skip to main content

Module land

Module land 

Source
Expand description

weave land — land a merge, and say for every file git could not merge how much is known about the result.

Three labels, strongest first:

  • PROVEN — weave merged the file cleanly AND the independent merge certificate (weave-certify, which shares no merge code with weave) shows the result is the three-way selection of base, ours and theirs.
  • VERIFIED — the file’s answer passed the exact gate, and it came from one of two places: an external resolver (any program; see Resolver) wrote it, or weave’s element union did — a clean merge whose both-changed regions the certificate admits only with the elem_union check (UNION_ALLOWANCES). No resolver is called for the second; see land_unit for why it is VERIFIED and not PROVEN.
  • REFUSED — nothing above holds. The file keeps its conflict markers and stays unmerged in the index; the resolver’s answer is never written.

In a blind evaluation, a cheap model’s accepted merges behind this gate were wrong 9.5% of the time, against 22.0% without it — plus one rule added since, DROPPED, after an answer that kept only one side of a conflict block passed it. Every check that reads weave check is asked of weave’s own verifier here (crate::worktree::check) rather than restated.

Scope: the files git’s line merge conflicts on (content, add/add, modify/delete), and every other file both sides changed whose merge — the answer in the tree, else git’s line merge — is not git’s line merge or fails weave’s own merge check (weave_core::verify::verify: a line both kept lost, a line or a case label / map key stated twice). The rest are counted as not_examined: git merged them line-cleanly and the check passed. An answer the tree already holds (a file the merge driver resolved; --result’s file) is judged before any resolver. Each file is checked on its own three stages, as the gate was measured; a cross-file effect (a caller in another file) is outside it.

Structs§

FileReport
One file’s line in the report.
GateFinding
One reason the gate gave, in the words fed back to a resolver.
GateVerdict
The gate’s answer: it passes iff reasons is empty.
Landing
What a run decided.
Plan
The merge to land, read out of git.
Resolver
Run
A non-publishing landing in dir: the merge weave land (without --onto/--queue) runs, shared by the CLI and the MCP server.
Unit
One file git could not merge: its three stages (absent = None) and git’s own line merge of it, conflict markers and all.

Enums§

Answer
What the resolver said.
Candidate
A proposed resolution of one file.
Kind
How git’s merge left the file.
Landed
What to leave in the working tree for a file.
Present
Where the answer already in the tree is read, for plan.
Status

Constants§

DEFAULT_RESOLVER_TIMEOUT_SECS
An external resolver: a shell command run once per attempt.
PROOF_ALLOWANCES
The certificate’s rule set, v2: a both-changed region is certified only by one of these allowances. v1 had imp_strict where v2 has imp_used — imp_strict plus a check that every import line one side added that the merge keeps binds a name the merged file uses.
SCHEMA
Version tag of the JSON report / certificate document.
UNION_ALLOWANCES
What else may admit a both-changed region of weave’s clean merge, for a VERIFIED landing (never PROVEN): elem_union, the certificate’s own check of an element union (weave_certify::elem), and nest_eu, nest with children it admits. Not in the proof rule set, so a file that needs one of these must also pass the gate.

Functions§

document
The whole run, as --json prints it and --certificate writes it.
gate
The exact gate: check cand against the file’s three stages.
land_unit
Land one file: weave, then the certificate, then the resolver behind the gate. Err only for a failure of the whole run (the resolver cannot be started at all).
plan
Read the merge base × ours × theirs (each defaulting as weave check does: HEAD, the operation in progress, their merge base) and classify every file both sides changed.
render
The human summary.
run
Plan the merge in dir, land every unit, and in the working tree write the PROVEN and VERIFIED files back.
write_back
Write every file’s outcome into the working tree and index at dir: PROVEN / VERIFIED files are written and staged (a verified DELETE is removed); a REFUSED file keeps its conflict markers and is put back to unmerged, so git commit refuses until someone resolves it.