src/ez/prove.bend relies on unsafe/foreign
raw source on the hub · import ezx@1.17.0.0/src/ez/prove.bend as Prove
ez/prove: the proof gate. Every PROOF.bend in the tree is run through bend,
all of them at once, and a proof passes only when the first line bend prints
is exactly ALL PROOFS CHECK. Nothing is cached: a gate CI leans on answers
for the tree in front of it, not for one it saw before.
The line is the verdict, never the exit status. Since bend 2.0.32 a file
with no main is answered ALL PROOFS CHECK or SOME PROOFS FAIL, and a
proof that reaches an @unsafe def or foreign code, imports included, fails
and exits 1 rather than passing with a note as 2.0.31 did. The gate reads
the line all the same: a status says nothing about what was checked, and
only that first line says every term was proved outright.
Trusted, not proved: ez prove runs bend on every PROOF.bend in the
tree and passes only on an exact ALL PROOFS CHECK first line. It is ez
code run by mkProofs, not a law. CI builds from a clean tree, so nothing
is cached.
11 imports
import Base import snap@1.4.0.0/main.bend as R import ../share/args.bend as Args import ../share/env.bend as Env import ../share/cap.bend as Cap import ../share/capped.bend as Capped import ./quiet.bend as Q import ./sorted.bend as Sort import ./verdict.bend as V import ../ez/ends.bend as E import ../lock/run.bend as Run
Definitions
def find.at source · line 33 · raw
@+what:String -> @+how:String -> IO(List<&2, String>)
every file of a kind in the tree, sorted, so a run's report is the same twice
over. Base has no readdir, so this is find. .claude is skipped along with
.ez: an agent's worktree is a whole second copy of the repo living inside
it, and running its files would double the gate to check nothing new.
def find.proofs source · line 41 · raw
IO(List<&2, String>)
every proof file
def width source · line 48 · raw
IO(String)
how many bend runs may be in flight at once. Empty is the usual answer and
means the effect works it out: cores, but never more of them than the memory
cap divides the machine into, since each one of these may claim the whole
cap. EZ_JOBS overrides it for a machine that knows better.
def fresh.dir source · line 53 · raw
@+at:String -> IO(Unit)
a directory emptied and made again, so nothing a run reads was written by the run before it
def out.at source · line 60 · raw
String
where the jobs of this run write what they print
def say source · line 66 · raw
@ok:Bool -> @+path:String -> @+text:String -> IO(Unit)
one proof's line. A proof that held says so in one line; one that did not names itself and then prints what bend said, since that is where the law that failed is named.
def one source · line 75 · raw
@+path:String -> @+gigs:String -> @+output:String -> @+passed:Nat -> IO(Nat)
one proof against its answer: the run's first line, with a memory kill turned into a sentence in front of what it printed
def short source · line 85 · raw
@ps:List<&2, String> -> IO(Unit)
every proof the answers ran out before. The two lists are the same length by construction and this should never have one to report, but the alternative to saying so is a green count over fewer proofs than the tree holds.
def report source · line 95 · raw
@ps:List<&2, String> -> @as:List<&2, String> -> @+gigs:String -> @+passed:Nat -> IO(Nat)
every proof, in the tree's order however the run happened to interleave
def done source · line 109 · raw
@+passed:Nat -> @+total:Nat -> IO(Unit)
the count, and the exit status it implies. A run's last line is its verdict,
and anything that failed fails the command (E.counted), or a script around
it learns nothing.
def run source · line 117 · raw
IO(Unit)
ez prove: every PROOF.bend in the tree, run at once and reported in the
tree's order. There is no budget: a proof that takes long is still a proof,
and one that never finishes is stopped by whatever runs the gate.