Metakit / API
@doeixd/metakit/temporal
What a single-step proof cannot cover (@doeixd/metakit/temporal).
Prove.transition shows one step keeps a rule, from any valid state. Two
things lie outside it:
- What the store must do. A rule holds across concurrent writers only
if the store runs them as the proof assumes.
requirementsreads which capability each declared rule needs, and@doeixd/metakit/store'smountthrows where a store that cannot give one is asked to hold the rule. - What the order of events must not change. Two transitions that touch
the same state can be answered in either order.
obligationsnames each such pair as an obligation of kindwalk,walkruns a scenario's steps in seeded orders and checks a property after every step, andundischargedlists the obligations no passing walk covers.
Functions
discharge | Walk scenario for obligation. Throws when the scenario has no step for one of the obligation's over (a pair of one transition needs two steps of it). An… |
discharged | A Discharge of obligation written by hand, for a walk run some other way (@doeixd/metakit/pairs makes its own). |
evidence | One owner's account of its obligations, as a value: what it owed, the walks that ran for them (discharges, any number per obligation) and the pairs it… |
generator | A small seeded generator (mulberry32): the same seed gives the same orders everywhere. |
obligation | A walk obligation a check of your own emits. |
obligations | One walk obligation for each pair of machine's transitions whose order matters: one writes what the other reads or writes (a transition that writes pairs… |
protocol | Define a protocol from its obligations (obligation(...)), so discharge accepts only those: another obligation is a type error, and throws when it is passed… |
report | What evidence shows, together: each obligation is open while a walk of it broke or none closes it, whatever order the walks ran in, and a decided pair whose… |
requirements | The capability each declared rule needs, by the rule's key. |
undischarged | The obligations no walk that held covers: assert it is empty in a test. A discharge naming no obligation of the list is a type error. |
walk | Run scenario's steps in runs seeded orders, each respecting every step's after, asking holds after every step. The first broken order stops the walk. |
walkAsync | walk for steps that must be awaited (an exchange, an IndexedDB transaction): the same seeded orders, each step after the ones it waits on, the property… |
walkEffect | Effect-native walk: runs seeded valid interleavings inside Effect.scoped, checks holds after every step, and shrinks any failing interleaving to a minimal… |
Values
WalkResult | What a walk found. Broken carries the seed whose order broke the property (walk(scenario, { seed, runs: 1 }) runs it again), that order up to the failing… |
Interfaces
AsyncScenario | Scenario for steps that must be awaited: each order runs on a world of its own. |
AsyncStep | One step of an AsyncScenario: a send, an exchange, a transaction, awaited. |
DecidedPair | A pair decided without a test, why, and the walk that checked the decision, if one ran. |
Discharge | A walk run for one obligation, and what it found. answer is set only by a walk that was asked what the order does rather than to show it never matters… |
DischargedObligation | An obligation a walk covers, and what the walk found. |
EffectScenario | Scenario for Effect-native steps: each order runs inside its own Scope for automatic teardown. |
EffectStep | One step of an EffectScenario: an effectful send, exchange, or transaction. |
Evidence | One owner's account of its obligations, as plain data: what it owes, the walks that ran for them, and the pairs it decided without a test. Made by evidence;… |
ObligationReport | What some evidence shows: open and discharged obligations, and the pairs decided without a test. |
OpenObligation | An obligation no walk that held covers, and why it is open. |
PairCoverage | The matched scenario occurrences and which directions the walk exercised. |
Protocol | discharge for the obligations of one application-defined protocol. |
Scenario | Steps a walk orders, and what must hold after each. |
Scope | Where an obligation belongs: owner names the machine or protocol, where the place that declared it. |
Step | One step of a scenario: a send, an answer, a reconnect. |
WalkObligation | Something to show by running steps in several orders: detail says what, over names the Messages or transitions whose order is in question. |
WalkOptions |