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

commutesWhether 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…
declaremachine'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…
idempotentWhether 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…
owedThe pairs Pairs.commutes left to a walk, as obligations.
pairsEvery pair of machine's transitions whose footprints overlap (a transition that writes pairs with itself), each with Pairs.commutes' answer. A pair on…
settlemachine'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…
walkPairRun 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

DeclareOptionsWhose pairs they are, and what Pairs.commutes reads claims under (ReaderOptions).
PairOne pair of transitions whose footprints overlap, and what Pairs.commutes says of it.
SettleOptionsWhose pairs they are, what claims are read under, and how hard to walk them.