Metakit / API
@doeixd/metakit/pairs
Which pairs of a machine's transitions need a test (@doeixd/metakit/pairs).
For each pair whose footprints overlap, commutes asks whether either
order gives the same outcome. True needs no test, and
pairs says which rule decided it; Unknown is an obligation of the kind
walk. walkPair runs both orders from states and inputs generated from
the machine's Schemas and compares what they leave: the state, the records
emitted, and which of the two steps were refused. settle walks all of a
machine's pairs and returns them as Temporal.Evidence: the pairs
commutes decided too, so a rule that decides wrongly turns a walk red.
It is a development and test tool: it carries the checker and the
generators, and no page imports it. The pairs come from the machine's own
footprints, the overlap @doeixd/metakit/temporal already names, not from
@doeixd/metakit/graph: a machine's footprints are paths of its own state, and the
graph adds only the bridges between rows and Model paths that none has.
Functions
commutes | Whether a and b give one state, one set of emitted records and one refusal in either order. Two combines with one operation commute only where its… |
declare | machine's pairs as evidence with no walk: each Unknown pair is an obligation, open until a walk covers it, and each True pair is decided by the rule that… |
idempotent | Whether transition run twice in a row, with the same input and supplied values, leaves the state once leaves, decided from its footprint and the ways its… |
owed | The pairs Pairs.commutes left to a walk, as obligations. |
pairs | Every pair of machine's transitions whose footprints overlap (a transition that writes pairs with itself), each with Pairs.commutes' answer. A pair on… |
settle | machine's pairs as evidence, every pair walked. An Unknown pair is discharged by its walk when it sampled a state: held, the pair commutes over the cases… |
walkPair | Run a and b from generated states in both orders and compare what each order leaves: the state, the records emitted (as a set) and which steps were refused.… |
Interfaces
DeclareOptions | Whose pairs they are, and what Pairs.commutes reads claims under (ReaderOptions). |
Pair | One pair of transitions whose footprints overlap, and what Pairs.commutes says of it. |
SettleOptions | Whose pairs they are, what claims are read under, and how hard to walk them. |