~/bend-docscommunity

src/lock/plan.bend checks

raw source on the hub · import ezx@1.15.0.0/src/lock/plan.bend as Plan

lock/plan: ez lock as a pure planner. It reads a World (lock/world.bend) and returns either the questions it still needs answered (step) or a Plan: the effects to run and how the command ends (plan). The interpreter (lock/run.bend) loops on step, answering each question by IO, until nothing is left to ask, then executes the plan.

Under --upgrade the upgrade's questions come first (lock/up.bend): what the remote says each selected pin moves to. Once they are answered, the lock is planned exactly as a plain lock is, over the ledger the upgrade leaves rather than ez.toml as it was, and the upgrade's writes go around it in one plan: trees laid, ez.toml written once, .gitignore, the rewritten sources, the committed trees that moved removed, and the lock last.

wants only scans the answers it has for imports; plan checks every package once, so a lock pays for each file's SHA-256 once however deep the import graph is. A package that fails a check may make wants ask for more than the lock needs, which costs a fetch and changes nothing, since plan refuses it.

A named import, import <name>@<version>/..., is a hub package too (laws/NamedImportIsHubDependency.bend). One the project's own sources import must be a dependency ez.toml records by that name, and resolves to the hash ez.toml records beside it; one a package imports resolves the same way when ez.toml names it, then by the lock being rewritten, and only then by asking the hub, once (laws/ResolvedNotAsked.bend). The package it resolves to is walked and checked like any hub package, and the lock records every name it resolved under [names].

What a lock decides depends on a World only through W.inputs: the ledger it is made from, the upgrade's refusal if any, the committed sources, and the verdict on every answer. How a tree arrived only decides whether it is laid under BEND_LIB for the build that follows, which is a cache and not something the lock records.

8 imports
import Base
import ./world.bend as W
import ./up.bend as Up
import ./lock.bend as L
import ../ledger/manifest.bend as M
import ../pkg/pkg.bend as K
import ../pkg/path.bend as Path
import ../share/pin.bend as Pin

Types

type Look source · line 47 · raw

Data

a verdict looked up, or none when nothing has been asked about the hash yet

type Walk source · line 71 · raw

Data

a walk in progress: the hashes still queued, the packages resolved, the hashes still to be asked about, and the first refusal, "" while there is none. The walk is one step, which does not recurse, iterated; so a fact about the walk is a fact about one step, carried by induction on the fuel.

type Doc source · line 594 · raw

Data

what a plain lock decides: the text of ez.lock.toml, or why it refuses

type Place source · line 714 · raw

Data

where a package is laid: .ez/lib, which is committed for a vendored dependency, $BEND_LIB, which is a cache, or <dir>/.ez/lib, the committed trees of the workspace root at dir, where ez add and ez remove in a workspace lay the root lock's (ws/relock.bend)

type Effect source · line 725 · raw

Data

one thing the interpreter does. A Lay writes each file under <place>/<hash>, in order; the manifest comes last, so a tree that has one is a tree that finished. A Drop removes .ez/lib/<hash>, a committed tree an upgrade moved off. A Name writes $BEND_LIB/names/<nv> holding the hash and a newline, the file bend reads a name's hash from before it would ask the hub (laws/NameFilesLaid.bend). A Say is a line a person is told.

type Outcome source · line 733 · raw

Data

how the command ends: exit 0, or exit 1 with the reason

type Plan source · line 738 · raw

Data

the effects, in order, and how the command ends after them

type Query source · line 774 · raw

Data

one of the upgrade's questions, as the upgrade looks its answer up (ask, with the source the ledger records) and as git is asked it (git, with that source anchored at the directory the lock runs in, Up.anchor). The interpreter answers git and records the answer under ask.

type Step source · line 780 · raw

Data

the questions still open, the lock's and the upgrade's, or the plan once there are none. The lock's are about packages, and, apart from them, about names: the lock being rewritten, and what the hub says a name names.

type Wrote source · line 785 · raw

Data

what a plan leaves at one path: nothing written, or this text

Definitions

def look.at source · line 52 · raw

@hit:Bool -> @verdict:0x54c6454e798d1d497bdd6d0af3a8ac92/src/lock/world.Verdict -> @rest:Look -> Look

this verdict when it is the hash asked for, otherwise the rest's

def look source · line 60 · raw

@js:List<&2, 0x54c6454e798d1d497bdd6d0af3a8ac92/src/lock/world.Judged> -> @+hash:String -> Look

the first verdict recorded for a hash

def first source · line 75 · raw

@+bad:String -> @why:String -> String

the first refusal wins

def step.verdict source · line 80 · raw

@verdict:0x54c6454e798d1d497bdd6d0af3a8ac92/src/lock/world.Verdict -> @+ns:List<&2, 0x54c6454e798d1d497bdd6d0af3a8ac92/src/lock/lock.Name> -> @+src:0x54c6454e798d1d497bdd6d0af3a8ac92/src/lock/lock.Src -> @+hash:String -> @rest:List<&2, String> -> @packs:List<&2, 0x54c6454e798d1d497bdd6d0af3a8ac92/src/lock/lock.Pack> -> @asks:List<&2, String> -> @bad:String -> Walk

one package, by its verdict. Its imports are queued by hash, and by the hash the table of names gives each name it imports.

def step.look source · line 100 · raw

@found:Look -> @+ns:List<&2, 0x54c6454e798d1d497bdd6d0af3a8ac92/src/lock/lock.Name> -> @+src:0x54c6454e798d1d497bdd6d0af3a8ac92/src/lock/lock.Src -> @+hash:String -> @rest:List<&2, String> -> @packs:List<&2, 0x54c6454e798d1d497bdd6d0af3a8ac92/src/lock/lock.Pack> -> @asks:List<&2, String> -> @bad:String -> Walk

one package, asked about when nothing has answered for it yet

def step.pick source · line 117 · raw

@seen:Bool -> @+orgs:List<&2, 0x54c6454e798d1d497bdd6d0af3a8ac92/src/lock/lock.Origin> -> @+ns:List<&2, 0x54c6454e798d1d497bdd6d0af3a8ac92/src/lock/lock.Name> -> @+js:List<&2, 0x54c6454e798d1d497bdd6d0af3a8ac92/src/lock/world.Judged> -> @+hash:String -> @rest:List<&2, String> -> @packs:List<&2, 0x54c6454e798d1d497bdd6d0af3a8ac92/src/lock/lock.Pack> -> @asks:List<&2, String> -> @bad:String -> Walk

a hash already resolved, or already asked about, is passed over

def step.pop source · line 135 · raw

@+orgs:List<&2, 0x54c6454e798d1d497bdd6d0af3a8ac92/src/lock/lock.Origin> -> @+ns:List<&2, 0x54c6454e798d1d497bdd6d0af3a8ac92/src/lock/lock.Name> -> @+js:List<&2, 0x54c6454e798d1d497bdd6d0af3a8ac92/src/lock/world.Judged> -> @queue:List<&2, String> -> @+packs:List<&2, 0x54c6454e798d1d497bdd6d0af3a8ac92/src/lock/lock.Pack> -> @+asks:List<&2, String> -> @bad:String -> Walk

the next hash of the queue, or the walk as it is when the queue is empty

def walk.step source · line 152 · raw

@+orgs:List<&2, 0x54c6454e798d1d497bdd6d0af3a8ac92/src/lock/lock.Origin> -> @+ns:List<&2, 0x54c6454e798d1d497bdd6d0af3a8ac92/src/lock/lock.Name> -> @+js:List<&2, 0x54c6454e798d1d497bdd6d0af3a8ac92/src/lock/world.Judged> -> @wk:Walk -> Walk

one step of the walk

def walk.done source · line 157 · raw

@+wk:Walk -> Bool

whether a walk has nothing left in its queue

def walk.spent source · line 162 · raw

@wk:Walk -> Walk

a walk that ran out of fuel with its queue not empty, refused

def walk.more source · line 169 · raw

@done:Bool -> @wk:Walk -> @go:(@_:Walk -> Walk) -> Walk

the walk as it is when it is done, or one step further when it is not. The rest of the walk arrives as a function, since a def may not call itself from another def.

def walk.out source · line 177 · raw

@done:Bool -> @wk:Walk -> Walk

the fuel ran out: refused, unless the walk had just finished

def walk source · line 186 · raw

@fuel:Nat -> @+orgs:List<&2, 0x54c6454e798d1d497bdd6d0af3a8ac92/src/lock/lock.Origin> -> @+ns:List<&2, 0x54c6454e798d1d497bdd6d0af3a8ac92/src/lock/lock.Name> -> @+js:List<&2, 0x54c6454e798d1d497bdd6d0af3a8ac92/src/lock/world.Judged> -> @+wk:Walk -> Walk

every package the queue reaches, each one once. A walk that runs out of fuel with the queue not empty is a refusal, never a lock of what it had so far.

def walk.packs source · line 194 · raw

@wk:Walk -> List<&2, 0x54c6454e798d1d497bdd6d0af3a8ac92/src/lock/lock.Pack>

the packages a walk has resolved

def roots.one source · line 200 · raw

@+src:0x54c6454e798d1d497bdd6d0af3a8ac92/src/lock/world.Source -> List<&2, String>

every hub package one committed source imports. The committed trees under .ez/ are packages, not the project's own sources.

def roots source · line 208 · raw

@fs:List<&2, 0x54c6454e798d1d497bdd6d0af3a8ac92/src/lock/world.Source> -> List<&2, String>

every hub package the committed sources import. Every committed .bend file is a root, so no local import has to be followed, and a file that is not committed is never read.

def roots.named.one source · line 216 · raw

@+src:0x54c6454e798d1d497bdd6d0af3a8ac92/src/lock/world.Source -> List<&2, String>

every name one committed source imports, outside .ez/

def roots.named source · line 223 · raw

@fs:List<&2, 0x54c6454e798d1d497bdd6d0af3a8ac92/src/lock/world.Source> -> List<&2, String>

every name the committed sources import. Each must be one ez.toml records a dependency by.

def table source · line 233 · raw

@+led:0x54c6454e798d1d497bdd6d0af3a8ac92/src/ledger/manifest.Read -> @js:List<&2, 0x54c6454e798d1d497bdd6d0af3a8ac92/src/lock/world.Judged> -> List<&2, 0x54c6454e798d1d497bdd6d0af3a8ac92/src/lock/lock.Name>

the table of names a lock resolves names by: those ez.toml records, each with the hash beside it, first, then those the answers resolve, the lock being rewritten's before the hub's

def fuel.verdict source · line 237 · raw

@verdict:0x54c6454e798d1d497bdd6d0af3a8ac92/src/lock/world.Verdict -> @ns:List<&2, 0x54c6454e798d1d497bdd6d0af3a8ac92/src/lock/lock.Name> -> Nat

how many imports one verdict queues: a package's, or none

def fuel.judged source · line 247 · raw

@js:List<&2, 0x54c6454e798d1d497bdd6d0af3a8ac92/src/lock/world.Judged> -> @+ns:List<&2, 0x54c6454e798d1d497bdd6d0af3a8ac92/src/lock/lock.Name> -> Nat

how many imports every verdict queues between them

def walk.fuel source · line 261 · raw

@queue:List<&2, String> -> @ns:List<&2, 0x54c6454e798d1d497bdd6d0af3a8ac92/src/lock/lock.Name> -> @js:List<&2, 0x54c6454e798d1d497bdd6d0af3a8ac92/src/lock/world.Judged> -> Nat

how many steps the walk may take: one for each hash the queue starts with, one for each import a verdict can queue, since a hash is resolved at most once, and one more to spare. That is a step for every hash the walk can queue, and it is a function of the walk's inputs rather than a fixed number, as the add walk's is: a proof about inputs it does not know leaves it unevaluated, where bend 2.0.33 and 2.0.34 compare a fixed fuel's walk one stack frame a step and overflow the checker past about 10000.

def walk.of source · line 267 · raw

@+led:0x54c6454e798d1d497bdd6d0af3a8ac92/src/ledger/manifest.Read -> @listing:0x54c6454e798d1d497bdd6d0af3a8ac92/src/lock/world.Listing -> @+ns:List<&2, 0x54c6454e798d1d497bdd6d0af3a8ac92/src/lock/lock.Name> -> @+js:List<&2, 0x54c6454e798d1d497bdd6d0af3a8ac92/src/lock/world.Judged> -> Walk

the walk from every committed source: every package they import by hash, and every one they import by a name the table resolves. A listing git could not give is a walk refused before its first step.

def listing.files source · line 277 · raw

@listing:0x54c6454e798d1d497bdd6d0af3a8ac92/src/lock/world.Listing -> List<&2, 0x54c6454e798d1d497bdd6d0af3a8ac92/src/lock/world.Source>

the committed sources a listing holds, none when git could not list them

def pack.srcs source · line 285 · raw

@found:Look -> List<&2, String>

the texts of a package the walk resolved, as its verdict holds them

def packs.named source · line 297 · raw

@+js:List<&2, 0x54c6454e798d1d497bdd6d0af3a8ac92/src/lock/world.Judged> -> @ps:List<&2, 0x54c6454e798d1d497bdd6d0af3a8ac92/src/lock/lock.Pack> -> List<&2, String>

every name the packages a walk resolved import

def needed source · line 307 · raw

@listing:0x54c6454e798d1d497bdd6d0af3a8ac92/src/lock/world.Listing -> @+js:List<&2, 0x54c6454e798d1d497bdd6d0af3a8ac92/src/lock/world.Judged> -> @ps:List<&2, 0x54c6454e798d1d497bdd6d0af3a8ac92/src/lock/lock.Pack> -> List<&2, String>

every name a lock needs resolved: those the committed sources import, then those the packages it reaches import

def need.why source · line 312 · raw

@ledger:0x54c6454e798d1d497bdd6d0af3a8ac92/src/ledger/manifest.Read -> String

why a plain lock cannot copy the ledger's tool pins, or "" when it can. A ledger that does not parse is refused here too.

def char.bad source · line 325 · raw

@+ch:Char -> Bool

a char the lock's TOML cannot carry inside a quoted key or value: eztoml neither writes nor reads escapes

def clean source · line 329 · raw

@text:String -> Bool

whether a key or value can be written as it is

def clean.all source · line 338 · raw

@ss:List<&2, String> -> Bool

whether every string in a list can be written as it is

def src.values source · line 347 · raw

@source:0x54c6454e798d1d497bdd6d0af3a8ac92/src/lock/lock.Src -> List<&2, String>

every value a package's source writes

def file.values source · line 357 · raw

@fs:List<&2, 0x54c6454e798d1d497bdd6d0af3a8ac92/src/pkg/pkg.Item> -> List<&2, String>

every path and sum a package's files write

def pack.values source · line 365 · raw

@pack:0x54c6454e798d1d497bdd6d0af3a8ac92/src/lock/lock.Pack -> List<&2, String>

every hash, key and value a package writes

def path.eqless source · line 374 · raw

@text:String -> Bool

whether a file path holds no =. A path is written as a quoted key, and bootstrap.sh, which reads the lock without ez, cuts a pair line at its first =, so a path holding one would read back there as another path with another sum. eztoml 0.4 reads a quoted key whole; the restriction lifts when bootstrap.sh does too.

def paths.ok source · line 383 · raw

@fs:List<&2, 0x54c6454e798d1d497bdd6d0af3a8ac92/src/pkg/pkg.Item> -> Bool

whether no file path of a package holds =

def packs.ok source · line 392 · raw

@ps:List<&2, 0x54c6454e798d1d497bdd6d0af3a8ac92/src/lock/lock.Pack> -> Bool

whether every package can be written, and no hash is written twice

def tool.values source · line 403 · raw

@pin:0x54c6454e798d1d497bdd6d0af3a8ac92/src/ledger/manifest.Cli -> List<&2, String>

every name, key and value a tool pin writes

def tools.ok source · line 414 · raw

@ts:List<&2, 0x54c6454e798d1d497bdd6d0af3a8ac92/src/ledger/manifest.Cli> -> Bool

whether every tool pin can be written

def lockable source · line 426 · raw

@ps:List<&2, 0x54c6454e798d1d497bdd6d0af3a8ac92/src/lock/lock.Pack> -> @ts:List<&2, 0x54c6454e798d1d497bdd6d0af3a8ac92/src/ledger/manifest.Cli> -> @hub:String -> Bool

whether a lock can be written so that it reads back: every hash is written once, no hash, key or value holds ", \ or a newline, and no file path holds = (eztoml#24, above). The planner refuses a lock that is not, so every lock ez writes is one of these.

def path.eq.pick source · line 431 · raw

@ok:Bool -> @at:String -> @rest:String -> String

the first path among a package's files that holds =, or "" when none does. A path that holds one is not empty, so "" is never such a path.

def path.eq.first source · line 438 · raw

@fs:List<&2, 0x54c6454e798d1d497bdd6d0af3a8ac92/src/pkg/pkg.Item> -> String

def path.eq.why source · line 446 · raw

@+hash:String -> @+at:String -> String

why a package with such a path cannot be locked, naming it and the path

def packs.eq.pick source · line 452 · raw

@none:Bool -> @+hash:String -> @+at:String -> @rest:String -> String

the reason for the first package with such a path, or the rest's

def packs.eq source · line 461 · raw

@ps:List<&2, 0x54c6454e798d1d497bdd6d0af3a8ac92/src/lock/lock.Pack> -> String

why the first package with a path holding = cannot be locked, or "" when no package has one

def lockable.pick source · line 471 · raw

@none:Bool -> @why:String -> String

the reason a lock that is not lockable gives: the package and path when a path holds =, which is the one case a clean-looking lock hides

def lockable.why source · line 478 · raw

@ps:List<&2, 0x54c6454e798d1d497bdd6d0af3a8ac92/src/lock/lock.Pack> -> String

def names.ok source · line 485 · raw

@ns:List<&2, 0x54c6454e798d1d497bdd6d0af3a8ac92/src/lock/lock.Name> -> Bool

whether every name the lock records can be written so that it reads back: a name is written as a quoted key and its hash as a value, the way a package's file is, so it is held to what a file is held to

def lockable.named source · line 490 · raw

@ns:List<&2, 0x54c6454e798d1d497bdd6d0af3a8ac92/src/lock/lock.Name> -> @ps:List<&2, 0x54c6454e798d1d497bdd6d0af3a8ac92/src/lock/lock.Pack> -> @ts:List<&2, 0x54c6454e798d1d497bdd6d0af3a8ac92/src/ledger/manifest.Cli> -> @hub:String -> Bool

whether a lock with names can be written so that it reads back

def lockable.why.pick source · line 494 · raw

@ok:Bool -> @ps:List<&2, 0x54c6454e798d1d497bdd6d0af3a8ac92/src/lock/lock.Pack> -> String

the reason a lock with names that is not lockable gives

def lockable.why.named source · line 501 · raw

@ns:List<&2, 0x54c6454e798d1d497bdd6d0af3a8ac92/src/lock/lock.Name> -> @ps:List<&2, 0x54c6454e798d1d497bdd6d0af3a8ac92/src/lock/lock.Pack> -> String

def names.missing.pick source · line 508 · raw

@gone:Bool -> @+nv:String -> @rest:(@_:Unit -> String) -> String

a name, when it is the first the search wants, or the rest's

def names.ruled source · line 516 · raw

@nvs:List<&2, String> -> String

the first name of a list the hub rules out, or "" when it rules them all in

def names.missing source · line 525 · raw

@+ns:List<&2, 0x54c6454e798d1d497bdd6d0af3a8ac92/src/lock/lock.Name> -> @nvs:List<&2, String> -> String

the first name of a list the table does not resolve, or "" when it resolves them all

def names.open.why source · line 534 · raw

@found:Look -> @+nv:String -> String

why a name nothing resolved stops the lock: what its answer said, or that it was never asked

def names.unledgered.why source · line 546 · raw

@+nv:String -> String

why a name the project imports and ez.toml does not record stops the lock

def why.then.at source · line 551 · raw

@none:Bool -> @why:String -> @rest:(@_:Unit -> String) -> String

a reason, or when there is none the next one, looked at only then

def why.then source · line 558 · raw

@+why:String -> @rest:(@_:Unit -> String) -> String

def why.missing.at source · line 562 · raw

@none:Bool -> @reason:(@_:Unit -> String) -> String

no reason when no name is at fault, and the fault's otherwise

def why.missing source · line 569 · raw

@+nv:String -> @reason:(@_:Unit -> String) -> String

def names.why source · line 576 · raw

@+lns:List<&2, 0x54c6454e798d1d497bdd6d0af3a8ac92/src/lock/lock.Name> -> @+ns:List<&2, 0x54c6454e798d1d497bdd6d0af3a8ac92/src/lock/lock.Name> -> @+js:List<&2, 0x54c6454e798d1d497bdd6d0af3a8ac92/src/lock/world.Judged> -> @+roots:List<&2, String> -> @+need:List<&2, String> -> String

why the names a lock needs stop it, or "" when they do not: a name the hub rules out, as bend refuses it; a name the project imports that ez.toml does not record, which is the lock's own rule, since only a dependency ez.toml records vouches for where a name came from; and a name nothing resolved

def doc.lockable source · line 599 · raw

@ok:Bool -> @+ns:List<&2, 0x54c6454e798d1d497bdd6d0af3a8ac92/src/lock/lock.Name> -> @+hub:String -> @packs:List<&2, 0x54c6454e798d1d497bdd6d0af3a8ac92/src/lock/lock.Pack> -> @ts:List<&2, 0x54c6454e798d1d497bdd6d0af3a8ac92/src/ledger/manifest.Cli> -> Doc

a lock that can be written, written, with the names it resolved

def doc.asks source · line 615 · raw

@asks:List<&2, String> -> @+ns:List<&2, 0x54c6454e798d1d497bdd6d0af3a8ac92/src/lock/lock.Name> -> @+hub:String -> @+packs:List<&2, 0x54c6454e798d1d497bdd6d0af3a8ac92/src/lock/lock.Pack> -> @+ts:List<&2, 0x54c6454e798d1d497bdd6d0af3a8ac92/src/ledger/manifest.Cli> -> Doc

a walk with nothing left to ask is the lock. One that still has a question is a World the interpreter did not finish, and is refused rather than guessed at.

def doc.named source · line 630 · raw

@clean:Bool -> @why:String -> @asks:List<&2, String> -> @+ns:List<&2, 0x54c6454e798d1d497bdd6d0af3a8ac92/src/lock/lock.Name> -> @+need:List<&2, String> -> @+hub:String -> @packs:List<&2, 0x54c6454e798d1d497bdd6d0af3a8ac92/src/lock/lock.Pack> -> @ts:List<&2, 0x54c6454e798d1d497bdd6d0af3a8ac92/src/ledger/manifest.Cli> -> Doc

the names settled: a name that stops the lock stops it, and otherwise the lock records each name it needed with the hash the table gives it

def doc.bad source · line 647 · raw

@clean:Bool -> @+bad:String -> @asks:List<&2, String> -> @+led:0x54c6454e798d1d497bdd6d0af3a8ac92/src/ledger/manifest.Read -> @listing:0x54c6454e798d1d497bdd6d0af3a8ac92/src/lock/world.Listing -> @+ns:List<&2, 0x54c6454e798d1d497bdd6d0af3a8ac92/src/lock/lock.Name> -> @+js:List<&2, 0x54c6454e798d1d497bdd6d0af3a8ac92/src/lock/world.Judged> -> @+packs:List<&2, 0x54c6454e798d1d497bdd6d0af3a8ac92/src/lock/lock.Pack> -> Doc

a refusal wins over everything after it

def doc.walk source · line 668 · raw

@wk:Walk -> @+led:0x54c6454e798d1d497bdd6d0af3a8ac92/src/ledger/manifest.Read -> @listing:0x54c6454e798d1d497bdd6d0af3a8ac92/src/lock/world.Listing -> @+ns:List<&2, 0x54c6454e798d1d497bdd6d0af3a8ac92/src/lock/lock.Name> -> @+js:List<&2, 0x54c6454e798d1d497bdd6d0af3a8ac92/src/lock/world.Judged> -> Doc

the walk's result

def doc.gap source · line 673 · raw

@clean:Bool -> @+gap:String -> @wk:Walk -> @+led:0x54c6454e798d1d497bdd6d0af3a8ac92/src/ledger/manifest.Read -> @listing:0x54c6454e798d1d497bdd6d0af3a8ac92/src/lock/world.Listing -> @+ns:List<&2, 0x54c6454e798d1d497bdd6d0af3a8ac92/src/lock/lock.Name> -> @+js:List<&2, 0x54c6454e798d1d497bdd6d0af3a8ac92/src/lock/world.Judged> -> Doc

a tool pin a plain lock would have to fill stops it before the walk counts

def decide.led source · line 689 · raw

@+led:0x54c6454e798d1d497bdd6d0af3a8ac92/src/ledger/manifest.Read -> @+listing:0x54c6454e798d1d497bdd6d0af3a8ac92/src/lock/world.Listing -> @+js:List<&2, 0x54c6454e798d1d497bdd6d0af3a8ac92/src/lock/world.Judged> -> Doc

plain ez lock over a parsed ledger

def decide.stop source · line 695 · raw

@clean:Bool -> @+stop:String -> @+led:0x54c6454e798d1d497bdd6d0af3a8ac92/src/ledger/manifest.Read -> @listing:0x54c6454e798d1d497bdd6d0af3a8ac92/src/lock/world.Listing -> @+js:List<&2, 0x54c6454e798d1d497bdd6d0af3a8ac92/src/lock/world.Judged> -> Doc

an upgrade that refused, or still asks, stops the lock before anything else

def decide source · line 703 · raw

@ins:0x54c6454e798d1d497bdd6d0af3a8ac92/src/lock/world.Inputs -> Doc

ez lock over what the lock may depend on

def status source · line 745 · raw

@outcome:Outcome -> U32

the status a command exits with (laws/ExitStatusSaysFailure.bend): 0 when it succeeds, 1 when it refuses. Every planner's plan ends with an Outcome, and the interpreter exits with this status of it (Run.end), so this is the one place the mapping lives.

def status.of source · line 753 · raw

@refused:Bool -> U32

the status of a command that refused, or did not

def why source · line 758 · raw

@outcome:Outcome -> String

what a command that ends is said to have ended on: nothing when it succeeded, and the reason when it refused

def code source · line 766 · raw

@pl:Plan -> U32

the status a plan ends with

def lockfile source · line 790 · raw

String

the lock's path, which is fixed

def cloned.how source · line 795 · raw

@how:0x54c6454e798d1d497bdd6d0af3a8ac92/src/lock/world.How -> @+hash:String -> List<&2, String>

every hash a clone answered: those are the trees a lock lays under BEND_LIB for the build that follows

def cloned.one source · line 804 · raw

@+hash:String -> @answer:0x54c6454e798d1d497bdd6d0af3a8ac92/src/lock/world.Answer -> List<&2, String>

def cloned source · line 816 · raw

@rs:List<&2, 0x54c6454e798d1d497bdd6d0af3a8ac92/src/lock/world.Reply> -> List<&2, String>

every hash a clone answered, in the order they were answered

def place.of source · line 825 · raw

@vend:Bool -> Place

where a tree is laid: under .ez/lib, committed, when the ledger the lock is made from vendors its hash, and under BEND_LIB otherwise

def lay.verdict source · line 835 · raw

@verdict:0x54c6454e798d1d497bdd6d0af3a8ac92/src/lock/world.Verdict -> @place:Place -> @+hash:String -> @rest:List<&2, Effect> -> List<&2, Effect>

a checked tree laid, ahead of what follows: its files with their texts, then the manifest of those texts, which is the manifest whose name the verdict checked (W.body.laid)

def lay.pick source · line 846 · raw

@hit:Bool -> @verdict:0x54c6454e798d1d497bdd6d0af3a8ac92/src/lock/world.Verdict -> @place:Place -> @+hash:String -> @rest:List<&2, Effect> -> List<&2, Effect>

def lays source · line 856 · raw

@+cs:List<&2, String> -> @+vs:List<&2, String> -> @js:List<&2, 0x54c6454e798d1d497bdd6d0af3a8ac92/src/lock/world.Judged> -> @rest:List<&2, Effect> -> List<&2, Effect>

every cloned tree that passed its checks, laid ahead of what follows. vs are the hashes committed under .ez/lib; a plain lock has none, and lays every tree in the cache.

def names.lay source · line 871 · raw

@ns:List<&2, 0x54c6454e798d1d497bdd6d0af3a8ac92/src/lock/lock.Name> -> @rest:List<&2, Effect> -> List<&2, Effect>

a names file for every name a lock records, ahead of what follows, so bend reads each name's hash from BEND_LIB and never asks the hub for it

def says.of source · line 879 · raw

@ss:List<&2, String> -> @rest:List<&2, Effect> -> List<&2, Effect>

the lines a person is told, ahead of what follows

def said.in source · line 887 · raw

@es:List<&2, Effect> -> List<&2, String>

the lines a list of effects says, in order

def said source · line 899 · raw

@pl:Plan -> List<&2, String>

the lines a plan says, in order, which is what a person is told

def edits.of source · line 904 · raw

@es:List<&2, 0x54c6454e798d1d497bdd6d0af3a8ac92/src/lock/up.Edit> -> @rest:List<&2, Effect> -> List<&2, Effect>

the files the upgrade writes, in order, ahead of what follows

def drops.of source · line 912 · raw

@ds:List<&2, String> -> @rest:List<&2, Effect> -> List<&2, Effect>

the committed trees the upgrade moved off, removed ahead of what follows

def made source · line 927 · raw

@+nx:0x54c6454e798d1d497bdd6d0af3a8ac92/src/lock/up.Next -> @cs:List<&2, String> -> @js:List<&2, 0x54c6454e798d1d497bdd6d0af3a8ac92/src/lock/world.Judged> -> @doc:Doc -> Plan

the plan for what was decided. A refusal has no effect at all, so a refused lock, plain or upgrade, writes nothing, lays nothing and removes nothing; its reason is how it ends. A lock that is made runs, in order: what a person is told, the trees laid, a names file for every name the lock records (read back from the lock's own text, so the files and the lock never disagree), the upgrade's files (ez.toml once, .gitignore, the rewritten sources), the committed trees removed, and the lock last. A plain lock has only the trees, the names and the lock.

def plan.of source · line 939 · raw

@+nx:0x54c6454e798d1d497bdd6d0af3a8ac92/src/lock/up.Next -> @listing:0x54c6454e798d1d497bdd6d0af3a8ac92/src/lock/world.Listing -> @+replies:List<&2, 0x54c6454e798d1d497bdd6d0af3a8ac92/src/lock/world.Reply> -> Plan

ez lock once the upgrade decided: every package checked once, and the plan

def plan source · line 945 · raw

@world:0x54c6454e798d1d497bdd6d0af3a8ac92/src/lock/world.World -> Plan

ez lock over a World

def refuses.doc source · line 950 · raw

@doc:Doc -> Bool

whether what was decided is a refusal

def refuses source · line 958 · raw

@world:0x54c6454e798d1d497bdd6d0af3a8ac92/src/lock/world.World -> Bool

whether ez lock refuses on a World

def packs.of source · line 962 · raw

@+nx:0x54c6454e798d1d497bdd6d0af3a8ac92/src/lock/up.Next -> @listing:0x54c6454e798d1d497bdd6d0af3a8ac92/src/lock/world.Listing -> @replies:List<&2, 0x54c6454e798d1d497bdd6d0af3a8ac92/src/lock/world.Reply> -> List<&2, 0x54c6454e798d1d497bdd6d0af3a8ac92/src/lock/lock.Pack>

the packages ez lock resolves once the upgrade decided

def packs source · line 969 · raw

@world:0x54c6454e798d1d497bdd6d0af3a8ac92/src/lock/world.World -> List<&2, 0x54c6454e798d1d497bdd6d0af3a8ac92/src/lock/lock.Pack>

the packages ez lock resolves on a World, which are the packages its lock renders when it writes one

def ledger.next source · line 979 · raw

@world:0x54c6454e798d1d497bdd6d0af3a8ac92/src/lock/world.World -> 0x54c6454e798d1d497bdd6d0af3a8ac92/src/ledger/manifest.Read

the ledger model an upgrade renders into ez.toml; ez.toml as it was when the upgrade refuses, still asks, or moves nothing, and for a plain lock. The upgrade's decisions (laws/UpgradeHoldsHub.bend, laws/UpgradeRevMovesForward.bend, laws/UpgradeOnlyNamedPackage.bend and laws/UpgradeTagFollows.bend) are stated over it, and hold of ez.toml's bytes, which read back as it (laws/WrittenLedgerReadsBack.bend).

def put.one source · line 988 · raw

@effect:Effect -> @+path:String -> @rest:Wrote -> Wrote

one effect's part in what a path is left holding, with what the effects after it leave already known. A later write wins.

def put.in source · line 1006 · raw

@es:List<&2, Effect> -> @+path:String -> Wrote

what a list of effects leaves at a path

def put.plan source · line 1014 · raw

@pl:Plan -> @+path:String -> Wrote

what a plan leaves at a path

def put source · line 1020 · raw

@world:0x54c6454e798d1d497bdd6d0af3a8ac92/src/lock/world.World -> @+path:String -> Wrote

the bytes ez lock writes to a path on a World, or Kept when it writes none

def writes.one source · line 1024 · raw

@effect:Effect -> Bool

whether an effect writes, lays or removes anything

def writes.in source · line 1038 · raw

@es:List<&2, Effect> -> Bool

whether a plan writes, lays or removes anything

def writes source · line 1047 · raw

@pl:Plan -> Bool

whether a plan writes, lays or removes anything at all

def front source · line 1057 · raw

@fs:List<&2, 0x54c6454e798d1d497bdd6d0af3a8ac92/src/lock/world.Source> -> List<&2, 0x54c6454e798d1d497bdd6d0af3a8ac92/src/lock/world.Source>

every file of a tree but the last, which a Lay writes as the manifest

def text.of source · line 1069 · raw

@src:0x54c6454e798d1d497bdd6d0af3a8ac92/src/lock/world.Source -> String

a file's text

def last source · line 1074 · raw

@fs:List<&2, 0x54c6454e798d1d497bdd6d0af3a8ac92/src/lock/world.Source> -> String

the last file's text, "" for no file

def lay.named source · line 1088 · raw

@+hash:String -> @+fs:List<&2, 0x54c6454e798d1d497bdd6d0af3a8ac92/src/lock/world.Source> -> Bool

whether a laid tree is named by the manifest of the texts it lays: its last file is the manifest of the others, each weighed by its own text, and its hash is the 0x name of that manifest

def lays.one source · line 1093 · raw

@effect:Effect -> Bool

whether an effect that lays a tree lays a named one

def lays.named source · line 1101 · raw

@es:List<&2, Effect> -> Bool

whether every tree a list of effects lays is named by its manifest

def effects source · line 1110 · raw

@pl:Plan -> List<&2, Effect>

the effects of a plan

def scan.one source · line 1119 · raw

@+hash:String -> @+hub:String -> @answer:0x54c6454e798d1d497bdd6d0af3a8ac92/src/lock/world.Answer -> 0x54c6454e798d1d497bdd6d0af3a8ac92/src/lock/world.Verdict

an answer as far as wants needs it: the texts it may import from, taken as they are and not checked, or the miss

def ask.hub source · line 1131 · raw

@ask:0x54c6454e798d1d497bdd6d0af3a8ac92/src/lock/world.Ask -> String

the hub a question names, "" for the lock's

def scan source · line 1141 · raw

@rs:List<&2, 0x54c6454e798d1d497bdd6d0af3a8ac92/src/lock/world.Reply> -> List<&2, 0x54c6454e798d1d497bdd6d0af3a8ac92/src/lock/world.Judged>

every reply, scanned

def anchor.src source · line 1152 · raw

@+here:String -> @src:0x54c6454e798d1d497bdd6d0af3a8ac92/src/lock/lock.Src -> 0x54c6454e798d1d497bdd6d0af3a8ac92/src/lock/lock.Src

a package's source as git is to read it: a path anchored at the directory the lock runs in (Path.anchor), and a URL or an absolute path as it is. A hub package names no source. The lock records the source as the ledger gives it; only the question carries this.

def asks.of source · line 1163 · raw

@hs:List<&2, String> -> @+here:String -> @+orgs:List<&2, 0x54c6454e798d1d497bdd6d0af3a8ac92/src/lock/lock.Origin> -> @+hub:String -> List<&2, 0x54c6454e798d1d497bdd6d0af3a8ac92/src/lock/world.Ask>

each hash still to ask about, as the question for it, with its source anchored

def wants.bad source · line 1171 · raw

@clean:Bool -> @hs:List<&2, String> -> @+here:String -> @+orgs:List<&2, 0x54c6454e798d1d497bdd6d0af3a8ac92/src/lock/lock.Origin> -> @+hub:String -> List<&2, 0x54c6454e798d1d497bdd6d0af3a8ac92/src/lock/world.Ask>

nothing more is asked once the lock is known to refuse

def wants.walk source · line 1184 · raw

@wk:Walk -> @+here:String -> @+orgs:List<&2, 0x54c6454e798d1d497bdd6d0af3a8ac92/src/lock/lock.Origin> -> @+hub:String -> List<&2, 0x54c6454e798d1d497bdd6d0af3a8ac92/src/lock/world.Ask>

def wants.gap source · line 1188 · raw

@clean:Bool -> @wk:Walk -> @+here:String -> @+orgs:List<&2, 0x54c6454e798d1d497bdd6d0af3a8ac92/src/lock/lock.Origin> -> @+hub:String -> List<&2, 0x54c6454e798d1d497bdd6d0af3a8ac92/src/lock/world.Ask>

def wants.led source · line 1195 · raw

@+here:String -> @+led:0x54c6454e798d1d497bdd6d0af3a8ac92/src/ledger/manifest.Read -> @listing:0x54c6454e798d1d497bdd6d0af3a8ac92/src/lock/world.Listing -> @+js:List<&2, 0x54c6454e798d1d497bdd6d0af3a8ac92/src/lock/world.Judged> -> List<&2, 0x54c6454e798d1d497bdd6d0af3a8ac92/src/lock/world.Ask>

def wants.stop source · line 1200 · raw

@clean:Bool -> @+here:String -> @+led:0x54c6454e798d1d497bdd6d0af3a8ac92/src/ledger/manifest.Read -> @listing:0x54c6454e798d1d497bdd6d0af3a8ac92/src/lock/world.Listing -> @js:List<&2, 0x54c6454e798d1d497bdd6d0af3a8ac92/src/lock/world.Judged> -> List<&2, 0x54c6454e798d1d497bdd6d0af3a8ac92/src/lock/world.Ask>

nothing is asked about packages while the upgrade refuses or still asks

def wants.of source · line 1208 · raw

@+here:String -> @+nx:0x54c6454e798d1d497bdd6d0af3a8ac92/src/lock/up.Next -> @listing:0x54c6454e798d1d497bdd6d0af3a8ac92/src/lock/world.Listing -> @replies:List<&2, 0x54c6454e798d1d497bdd6d0af3a8ac92/src/lock/world.Reply> -> List<&2, 0x54c6454e798d1d497bdd6d0af3a8ac92/src/lock/world.Ask>

the package questions still open once the upgrade decided

def wants source · line 1215 · raw

@world:0x54c6454e798d1d497bdd6d0af3a8ac92/src/lock/world.World -> List<&2, 0x54c6454e798d1d497bdd6d0af3a8ac92/src/lock/world.Ask>

the package questions a World still leaves open: every package the walk reaches that nothing has answered for yet. None once the lock is known to refuse, and none while the upgrade still asks.

def wants.up source · line 1220 · raw

@world:0x54c6454e798d1d497bdd6d0af3a8ac92/src/lock/world.World -> List<&2, 0x54c6454e798d1d497bdd6d0af3a8ac92/src/lock/up.Ask>

the upgrade's questions a World still leaves open; none for a plain lock

def answered source · line 1225 · raw

@world:0x54c6454e798d1d497bdd6d0af3a8ac92/src/lock/world.World -> Bool

whether the upgrade has every answer it needs

def queries source · line 1229 · raw

@+here:String -> @as:List<&2, 0x54c6454e798d1d497bdd6d0af3a8ac92/src/lock/up.Ask> -> List<&2, Query>

each of the upgrade's questions, with the question git is asked for it

def names.once.put source · line 1240 · raw

@dup:Bool -> @+nv:String -> @rest:List<&2, String> -> List<&2, String>

a name kept among the ones to ask about when it is not one already kept

def names.once source · line 1248 · raw

@nvs:List<&2, String> -> @+seen:List<&2, String> -> List<&2, String>

every name of a list once, each where it first stands

def is.absent source · line 1256 · raw

@found:Look -> Bool

whether nothing has answered for a key

def name.open source · line 1266 · raw

@+ns:List<&2, 0x54c6454e798d1d497bdd6d0af3a8ac92/src/lock/lock.Name> -> @+js:List<&2, 0x54c6454e798d1d497bdd6d0af3a8ac92/src/lock/world.Judged> -> @+roots:List<&2, String> -> @+nv:String -> Bool

whether a name is still to be resolved: the hub rules it in, the table does not resolve it, the project does not import it (that one ez.toml must record, and the lock refuses it), and nothing has answered for it yet

def names.open.put source · line 1270 · raw

@open:Bool -> @+nv:String -> @rest:List<&2, String> -> List<&2, String>

def names.open source · line 1278 · raw

@+ns:List<&2, 0x54c6454e798d1d497bdd6d0af3a8ac92/src/lock/lock.Name> -> @+js:List<&2, 0x54c6454e798d1d497bdd6d0af3a8ac92/src/lock/world.Judged> -> @+roots:List<&2, String> -> @nvs:List<&2, String> -> List<&2, String>

every name of a list still to be resolved

def names.asked source · line 1291 · raw

@+hub:String -> @nvs:List<&2, String> -> List<&2, 0x54c6454e798d1d497bdd6d0af3a8ac92/src/lock/world.Ask>

each name as the question the hub is asked about it

def names.ask.lock source · line 1302 · raw

@read:Bool -> @+hub:String -> @nvs:List<&2, String> -> List<&2, 0x54c6454e798d1d497bdd6d0af3a8ac92/src/lock/world.Ask>

the questions for the names still open: none when there are none; the lock being rewritten first, since a name it records is not put to the hub (laws/ResolvedNotAsked.bend); and then each name the lock does not record, once

def names.ask source · line 1309 · raw

@+hub:String -> @+js:List<&2, 0x54c6454e798d1d497bdd6d0af3a8ac92/src/lock/world.Judged> -> @nvs:List<&2, String> -> List<&2, 0x54c6454e798d1d497bdd6d0af3a8ac92/src/lock/world.Ask>

def names.wants.bad source · line 1316 · raw

@clean:Bool -> @+led:0x54c6454e798d1d497bdd6d0af3a8ac92/src/ledger/manifest.Read -> @listing:0x54c6454e798d1d497bdd6d0af3a8ac92/src/lock/world.Listing -> @+ns:List<&2, 0x54c6454e798d1d497bdd6d0af3a8ac92/src/lock/lock.Name> -> @+js:List<&2, 0x54c6454e798d1d497bdd6d0af3a8ac92/src/lock/world.Judged> -> @packs:List<&2, 0x54c6454e798d1d497bdd6d0af3a8ac92/src/lock/lock.Pack> -> List<&2, 0x54c6454e798d1d497bdd6d0af3a8ac92/src/lock/world.Ask>

def names.wants.walk source · line 1333 · raw

@wk:Walk -> @+led:0x54c6454e798d1d497bdd6d0af3a8ac92/src/ledger/manifest.Read -> @+listing:0x54c6454e798d1d497bdd6d0af3a8ac92/src/lock/world.Listing -> @+ns:List<&2, 0x54c6454e798d1d497bdd6d0af3a8ac92/src/lock/lock.Name> -> @+js:List<&2, 0x54c6454e798d1d497bdd6d0af3a8ac92/src/lock/world.Judged> -> List<&2, 0x54c6454e798d1d497bdd6d0af3a8ac92/src/lock/world.Ask>

the name questions of a walk, which ask nothing once the lock is known to refuse

def names.wants.gap source · line 1343 · raw

@clean:Bool -> @+led:0x54c6454e798d1d497bdd6d0af3a8ac92/src/ledger/manifest.Read -> @+listing:0x54c6454e798d1d497bdd6d0af3a8ac92/src/lock/world.Listing -> @+js:List<&2, 0x54c6454e798d1d497bdd6d0af3a8ac92/src/lock/world.Judged> -> List<&2, 0x54c6454e798d1d497bdd6d0af3a8ac92/src/lock/world.Ask>

def names.wants.stop source · line 1351 · raw

@clean:Bool -> @+led:0x54c6454e798d1d497bdd6d0af3a8ac92/src/ledger/manifest.Read -> @listing:0x54c6454e798d1d497bdd6d0af3a8ac92/src/lock/world.Listing -> @+js:List<&2, 0x54c6454e798d1d497bdd6d0af3a8ac92/src/lock/world.Judged> -> List<&2, 0x54c6454e798d1d497bdd6d0af3a8ac92/src/lock/world.Ask>

def names.wants.of source · line 1360 · raw

@+nx:0x54c6454e798d1d497bdd6d0af3a8ac92/src/lock/up.Next -> @listing:0x54c6454e798d1d497bdd6d0af3a8ac92/src/lock/world.Listing -> @replies:List<&2, 0x54c6454e798d1d497bdd6d0af3a8ac92/src/lock/world.Reply> -> List<&2, 0x54c6454e798d1d497bdd6d0af3a8ac92/src/lock/world.Ask>

the name questions still open once the upgrade decided, over the answers scanned as wants scans them

def wants.names source · line 1367 · raw

@world:0x54c6454e798d1d497bdd6d0af3a8ac92/src/lock/world.World -> List<&2, 0x54c6454e798d1d497bdd6d0af3a8ac92/src/lock/world.Ask>

the name questions a World still leaves open: for every name a package the walk reaches imports, that ez.toml does not record and nothing has answered for yet, the lock being rewritten, and once it is read, the hub

def step.names source · line 1373 · raw

@names:List<&2, 0x54c6454e798d1d497bdd6d0af3a8ac92/src/lock/world.Ask> -> @+nx:0x54c6454e798d1d497bdd6d0af3a8ac92/src/lock/up.Next -> @listing:0x54c6454e798d1d497bdd6d0af3a8ac92/src/lock/world.Listing -> @replies:List<&2, 0x54c6454e798d1d497bdd6d0af3a8ac92/src/lock/world.Reply> -> Step

the package questions still open, or the name questions, or the plan once there are none

def step.pkgs source · line 1380 · raw

@asks:List<&2, 0x54c6454e798d1d497bdd6d0af3a8ac92/src/lock/world.Ask> -> @names:List<&2, 0x54c6454e798d1d497bdd6d0af3a8ac92/src/lock/world.Ask> -> @+nx:0x54c6454e798d1d497bdd6d0af3a8ac92/src/lock/up.Next -> @listing:0x54c6454e798d1d497bdd6d0af3a8ac92/src/lock/world.Listing -> @replies:List<&2, 0x54c6454e798d1d497bdd6d0af3a8ac92/src/lock/world.Reply> -> Step

def step.ups source · line 1395 · raw

@ups:List<&2, 0x54c6454e798d1d497bdd6d0af3a8ac92/src/lock/up.Ask> -> @+here:String -> @+nx:0x54c6454e798d1d497bdd6d0af3a8ac92/src/lock/up.Next -> @+listing:0x54c6454e798d1d497bdd6d0af3a8ac92/src/lock/world.Listing -> @+replies:List<&2, 0x54c6454e798d1d497bdd6d0af3a8ac92/src/lock/world.Reply> -> Step

the upgrade's questions first, since the packages the lock reads depend on where the pins move

def step source · line 1411 · raw

@world:0x54c6454e798d1d497bdd6d0af3a8ac92/src/lock/world.World -> Step

what the interpreter does next on a World. The upgrade is decided once per round, and every answer of the round is read from that one decision.