Expand description
The repo-scope binding pass — weave’s answer to the per-file driver’s one structural blind spot.
A git merge driver is invoked once per file, with exactly three blobs, so it only ever sees one file’s contents. A rename in one file whose caller lives in another can merge cleanly per file and still leave the program broken:
a.pyrenamesfetch_user→get_user;b.py— untouched by that side, edited by the other — still callsfetch_user(1). Both files merge cleanly. The program is broken. No per-file driver can see it, because neither invocation is given both files.
This module closes that gap by running the same def/use evidence rules
(weave_core::binding — literally the same functions the per-file pass
calls, not a restatement of them) over the whole repo instead of one file.
It changes nothing about the rule; it only gives it the domain it always
assumed. One owner for that evidence is what makes the two passes’
verdicts comparable at all.
What it does not do: it never resolves, rewrites or merges anything. It
is a read-side pass and emits findings only — DANGLING (a use lost its
definition), SHADOW (a use may rebind to a different definition) and
ARITY (a use still passes the argument count a definition no longer
takes; see [crate::arity]).
DUP and ORDER need a module/import model this pass does not have,
so it does not emit them.
Functions§
- check
- Run the repo-scope binding pass over a merge triple of whole trees.
- read_
dir_ tree - Convenience: the merge triple as directory trees on disk.
- total_
findings - Total finding count across documents — the exit-code decision.
Type Aliases§
- Tree
- One version of the repository: path → content. Only files that survived into that version appear.