Skip to main content

gate

Function gate 

Source
pub fn gate(u: &Unit, cand: &Candidate) -> GateVerdict
Expand description

The exact gate: check cand against the file’s three stages.

  1. MARKERS — a conflict-marker line kind neither side has.
  2. PARSE — the candidate must parse (tree-sitter) when every present side does.
  3. WEAVE — weave check’s findings on this file (markers, loss, duplicates, dangling names, duplicate data keys, a data file that no longer loads, modify/delete), minus duplicate/dangling names ours or theirs already trigger when taken as the resolution. A crash is WEAVE_UNVERIFIED, never a pass.
  4. LINES — for a file weave has no grammar for, weave check’s line rules (loss, duplication) alone.
  5. AUTOMERGED — every line git merged automatically outside the conflict blocks, that base does not already have, is still there.
  6. DROPPED — inside the conflict blocks, each side’s change relative to base survives: every line one side added there is still there, and every line one side deleted there has not come back (see [dropped]). A resolution that keeps one side of a block verbatim fails this unless the other side’s change is subsumed by it.