Metakit / @doeixd/metakit/prove
machine
function · packages/metakit/src/prove/machine.ts:93
function machine<State, Transitions extends Readonly<Record<string, unknown>>>(
m: Machine<State, Transitions>,
options?: ProveOptions & {
readonly pin?: ReadonlyArray<NoInfer<ArmOf<Transitions>>>
readonly allowUnknown?: ReadonlyArray<
readonly [NoInfer<ArmOf<Transitions>>, string]
>
readonly strict?: boolean
},
): Effect.Effect<
MachineProofReport<keyof Transitions & string>,
SolverUnavailableError
>Verify every transition in a Machine under strict/pinned CI discipline:
strict(defaulttrue): fails if any transition isrefuted, orundecidedwithout a non-empty reason inallowUnknown.pin: arms ofmthat must remainproved(degrading toundecidedorrefutedfails the report withpinBroken: true).allowUnknown:[arm, reason]pairs, each an arm ofmleft undecided for that reason.
An arm of another machine throws. The report is keyed by tag.
With an Artifact.EvidenceStore provided, an arm whose proof is kept under
its key (the arm's contract hash, the state Schema, the solver's name,
encoding and version, the prover's version and timeoutMs) is not proved
again (reused), and a new proof is kept. Only a proof is kept: an arm
left undecided or refuted is asked again on every run.