import { J as Journal } from '../index-_evnHmXt.js'; import * as fc from 'fast-check'; import { b as Cmd, c as Sub, M as Machine, j as Reducer, l as Transitions, U as UpdateForm } from '../core-sEWVgnpI.js'; import { S as Step } from '../laws-I-3KrM0I.js'; export { F as Fold, L as LawBreak, f as foldEvents, l as lawInvariant, a as lawTerminates, b as lawTrace } from '../laws-I-3KrM0I.js'; import '@standard-schema/spec'; type KitCase$1 = "K1" | "K2" | "K3" | "K4" | "K5" | "K6" | "K7" | "K8"; /** Physical controls belong to the fixture, never to a journal driver. */ interface JournalKitFixture$1 { open(): Promise; interruptAt(point: number | undefined): void; writePoints(records: readonly string[]): readonly number[]; dispose(): Promise; readonly byteFile: boolean; tearTail?(stream: string): Promise; readStoredBytes?(stream: string): Promise; } type JournalKitFactory$1 = () => Promise; type KitResult$1 = { readonly id: KitCase$1; readonly status: "passed" | "failed" | "skipped"; readonly detail?: string; }; type KitOptions$1 = { readonly records: number; readonly now: () => number; readonly seed?: number; /** Generated histories per case; defaults to 100. */ readonly runs?: number; readonly repeats?: number; readonly replay?: { readonly id: KitCase$1; readonly path: string; }; }; declare function journalConformance$1(make: JournalKitFactory$1, options: KitOptions$1): Promise; /** * Build a Ctx value whose every property access throws. Use as the `ctx` * argument to PBT runners when the reducer under test is pure (does not * read from ctx). Accidental ctx access during property generation * surfaces as a labelled error instead of a silent `undefined` or * downstream type-error. * * Returns a typed `Ctx` (via `as unknown as Ctx`) — the proxy satisfies the * type-shape requirement at the call site; the runtime contract is * "throw on first read." The `as unknown` cast is the one boundary cast * this helper requires; the proxy is structurally a `Ctx` for every * property accessor. * * @example * ```ts * import type { Machine } from "@demlik/tea"; * import { * arbMsgSequence, * propertyTerminates, * stubCtxThrowingProxy, * } from "@demlik/tea/pbt"; * import type * as fc from "fast-check"; * * type State = { _tag: "idle" } | { _tag: "done" }; * type Msg = { _tag: "go" }; * interface MyCtx { readonly someField: string } * declare const machine: Machine; * declare const msgArb: fc.Arbitrary; * * const ctx = stubCtxThrowingProxy(); * propertyTerminates(machine, ctx, arbMsgSequence(msgArb), (s) => s._tag === "done"); * // If anything reads ctx.someField during the run, an Error throws: * // "@demlik/tea/pbt: ctx access denied (PBT operates on the pure * // reducer; ctx field 'someField' was read)" * ``` */ declare function stubCtxThrowingProxy(): Ctx; /** * Strict per-variant Msg arbitrary table. Mapped type: every key in * `M["_tag"]` MUST have an arbitrary entry whose `T` is the narrowed * variant. Adding a new Msg variant without an entry is a compile error * (same load-bearing discipline as `Reducer` in the substrate). * * @example * ```ts * import { * arbConstantMsg, * arbRecordMsg, * type MsgArbitraryTable, * } from "@demlik/tea/pbt"; * import * as fc from "fast-check"; * * type Msg = { _tag: "start" } | { _tag: "tick"; now: number }; * const table: MsgArbitraryTable = { * start: arbConstantMsg("start"), * tick: arbRecordMsg("tick", { now: fc.integer({ min: 0 }) }), * }; * ``` */ type MsgArbitraryTable = { [K in M["_tag"]]: fc.Arbitrary>; }; /** * Build a single `fc.Arbitrary` from a `MsgArbitraryTable`. Picks one * variant per generation via `fc.oneof`; optional per-variant `weights` * bias the distribution (default uniform). * * @param table Per-variant arbitrary table (strict — every variant required). * @param opts Optional bias: `weights` is a `Partial>`. * Variants without an explicit weight default to 1. * * @example * ```ts * import { arbConstantMsg, arbMsg, arbRecordMsg } from "@demlik/tea/pbt"; * import * as fc from "fast-check"; * * type Msg = { _tag: "start" } | { _tag: "tick"; now: number } | { _tag: "stop" }; * const msgArb = arbMsg({ * start: arbConstantMsg("start"), * tick: arbRecordMsg("tick", { now: fc.integer() }), * stop: arbConstantMsg("stop"), * }, { weights: { tick: 5, start: 1, stop: 1 } }); * ``` */ declare function arbMsg(table: MsgArbitraryTable, opts?: { weights?: Partial>; }): fc.Arbitrary; /** * Build a payload-free Msg variant arbitrary. Sugar for * `fc.constant({ _tag: type })` that narrows the result to `{ _tag: T }` literal. * * @example * ```ts * import { arbConstantMsg } from "@demlik/tea/pbt"; * import type * as fc from "fast-check"; * * const stop: fc.Arbitrary<{ _tag: "stop" }> = arbConstantMsg("stop"); * ``` */ declare function arbConstantMsg(type: T): fc.Arbitrary<{ _tag: T; }>; /** * Build a record-shaped Msg variant arbitrary. Sugar for * `fc.record({ _tag: fc.constant(type), ...fields })` that stamps the * discriminator literal and combines with the per-field arbitraries. * * @example * ```ts * import { arbRecordMsg } from "@demlik/tea/pbt"; * import * as fc from "fast-check"; * * const tick: fc.Arbitrary<{ _tag: "tick"; now: number }> = * arbRecordMsg("tick", { now: fc.integer({ min: 0 }) }); * ``` */ declare function arbRecordMsg(type: T, fields: { [K in keyof R]: fc.Arbitrary; }): fc.Arbitrary<{ _tag: T; } & R>; /** * Build an arbitrary of Msg sequences over a per-Msg arbitrary. Optionally * bounded in length and / or prefixed with a fixed sequence. * * - `minLength` (default 0) and `maxLength` (default 30) bound the random * array length. `prefix` is prepended AFTER the random tail is built; the * final length is `prefix.length + tail.length`. `size` decides how much of * that bound the draws actually use. * - `prefix` is the load-bearing escape hatch for "the first msg is the * one that exercises the cell I care about" (e.g. Test A's * `[{ _tag: "ws:client:hello" }]` prefix to land in the * `auditing.ws:client:hello` cell on the first transition). * * @example * ```ts * import { arbMsgSequence } from "@demlik/tea/pbt"; * import type * as fc from "fast-check"; * * type Msg = { _tag: "ws:client:hello" } | { _tag: "tick" }; * declare const msgArb: fc.Arbitrary; * * arbMsgSequence(msgArb, { minLength: 1, maxLength: 30 }); * arbMsgSequence(msgArb, { prefix: [{ _tag: "ws:client:hello" }], maxLength: 20 }); * arbMsgSequence(msgArb, { maxLength: 60, size: "max" }); * ``` */ declare function arbMsgSequence(msgArb: fc.Arbitrary, opts?: { readonly minLength?: number; readonly maxLength?: number; readonly prefix?: readonly NoInfer[]; /** * Forwarded to `fc.array`. Left out, fast-check's default size applies: * `"small"` unless `fc.configureGlobal` changed it, which draws at most * `2 * minLength + 10` Msgs however large `maxLength` is. So `maxLength: 60` * comes out about 10 long, and a state that takes more steps than that is * never reached. Pass `"max"` to draw up to `maxLength`. */ readonly size?: fc.SizeForArbitrary; }): fc.Arbitrary; /** * How one type of Cmd gets answered. `draw` runs before the fold, so a shrink * can shrink its value, and it cannot see the state. `make` runs in the fold and * gets the Cmd really sent, so an answer is `make: (cmd, v) => fetch.ok(cmd, v)`. * To draw both outcomes, have `draw` choose between them. */ interface AnswerCell { readonly draw: fc.Arbitrary; readonly make: (cmd: K, value: V) => NoInfer; } /** * What {@link arbGuidedSequence} draws from. `outside` holds the Msgs nothing * sends a Cmd for, by Msg type. `answers` holds an {@link AnswerCell} by Cmd type, * and `A` is the value each one draws, inferred from its `draw`. A Cmd type with no * cell is never answered. A Msg type in neither table is never drawn. */ interface GuidedCells { readonly outside?: { readonly [K in M["_tag"]]?: fc.Arbitrary>; }; readonly answers?: { readonly [K in keyof A]: K extends C["_tag"] ? AnswerCell, A[K], M> : never; }; } /** * Draw Msg lists in which every answer answers a Cmd that was sent and not yet * answered, so a law that something must happen can be checked on random lists. * The result is a plain list for any runner, such as `propertyTerminates`. * * It draws blind events, then folds them through the machine. An answer event * holds a pick and one value per answer cell, and the fold reads the pick modulo * the Cmds waiting at that point. With nothing waiting, the event is dropped. * * **Refusals.** An event whose Msg the state at that point has no cell for is * dropped too, in either update form, so a transitions machine can leave a Msg out * of a state and no list holds it there. A Cmd whose answer was refused keeps * waiting, and a later event can still answer it. A list therefore never tests * that a state refuses a Msg: send that Msg by hand for that. * * **Waiting** holds every Cmd that `init` and the steps have sent, that has a cell * in `answers`, and that has no answer yet. A Cmd sent twice waits twice. The fold * reads it off what the reducer returned, not `machine.cmds`, so a machine with no * `cmds` field gets the same lists, and a hand-written Cmd is answered like a * defined one. No answer is matched by its `cmd` field: the pick names the Cmd. * * A shrink deletes events and shrinks picks and values, and the fold reads what * is left, so a shrunk list holds to the same rule. Blind picks find a narrow * order less often than a guided draw would, which more runs pay for. * * A step that throws ends its list on the Msg that threw, so a runner's fold meets * the same throw and reports it as that list's failure. * * A `machine.cmds` that names one Cmd twice throws `CmdNameCollisionError`, as it * does in `run` and `drive`. The answers here come from the cells' keys, so a * repeat would not change them; the rule holds on every entry that draws or runs a list. * * - `maxLength` (default 60) caps the events drawn, and dropped ones count, so a * list comes out shorter. `size` (default `"max"`) is forwarded to `fc.array`: * with most answers dropped, fast-check's `"small"` rarely gets a run anywhere. * - `loaded` starts the fold from a saved state. Give a runner the same one, or * its fold reads the list from a different start. * * Throws when `cells` has no cell at all, since that could only draw empty lists. * * @example * ```ts * import type { Machine } from "@demlik/tea"; * import { * arbConstantMsg, * arbGuidedSequence, * propertyTrace, * stubCtxThrowingProxy, * } from "@demlik/tea/pbt"; * import * as fc from "fast-check"; * * type Merge = { readonly _tag: "merge"; readonly pr: number }; * type State = { _tag: "idle" } | { _tag: "merging" } | { _tag: "landed" }; * type Msg = { _tag: "start" } | { _tag: "merged"; cmd: Merge; sha: string }; * declare const machine: Machine; * const ctx = stubCtxThrowingProxy(); * * const lists = arbGuidedSequence(machine, ctx, { * outside: { start: arbConstantMsg("start") }, * answers: { * merge: { * draw: fc.string(), * make: (cmd, sha) => ({ _tag: "merged", cmd, sha }), * }, * }, * }); * * propertyTrace( * machine, * ctx, * lists, * (steps, final) => * !steps.some((step) => step.msg._tag === "merged") || * final._tag === "landed", * ); * ``` */ declare function arbGuidedSequence(machine: Machine, ctx: NoInfer, cells: GuidedCells, opts?: { readonly maxLength?: number; readonly size?: fc.SizeForArbitrary; readonly loaded?: NoInfer | null; }): fc.Arbitrary; /** What a property run's lists did with one Msg type. */ interface MsgCount { /** How many of this Msg type the run's lists held. */ readonly drawn: number; /** * How many of those acted: the step's `next` differs from its `prev` by * `structuralHash`, or the step sent a Cmd. */ readonly acted: number; } /** * What every property runner takes: the saved state to start from, the two checks * below, and fast-check's `Parameters` (`numRuns` defaults to 200 here). Five of * those settings are left out, each because it would break what a runner promises: * * - `reporter` and `asyncReporter` stop a failing run from throwing. One set * through `fc.configureGlobal` still applies, as it does for `fc.assert`. * - `examples` has the shape of the drawn tuple, which an arbitrary `loaded` * changes. * - `timeout` applies only to async properties, and these runners are sync. * `interruptAfterTimeLimit` with `markInterruptAsFailure` is the limit that * works here. * - `plugins` is left out on every fast-check. Only the newest 4s have it, so a * call using it would compile and run on some of the versions tea promises and * not on others. `fc.timeout`, which it can carry, has the same limit as * `timeout`. fast-check 4.10.2 marks `interruptAfterTimeLimit`, * `markInterruptAsFailure`, `skipEqualValues`, `ignoreEqualValues` and `unbiased` * as deprecated in favor of plugins, and they still work on every version tea * promises, so they stay. */ interface PropertyOpts extends Omit { /** * Saved state passed to `machine.init(loaded, ctx)`. Default `null`. An * arbitrary draws one per run, and a failure's counterexample shows the drawn * state beside the shrunk list. It can draw `null` as well, the nothing storage * hands back on a fresh start, which boots the machine fresh. */ readonly loaded?: S | null | fc.Arbitrary; /** * Fail a run whose laws all held when a Msg type never acted, naming each such * type, so a cut path can't stay green. Default `false`. * * A deep path needs a `maxLength` well past its depth as well as `size: "max"` * on `arbMsgSequence`. Lists too short to reach a healthy machine's deep state * name that healthy path as never acted, in the same report a cut path gives. At * the default `maxLength` of 30, a state 20 steps deep on 6 Msg types drawn evenly * fails this way, since only one draw in 6 climbs. Allow about the depth times the * number of Msg types, here `maxLength: 120`. * * This stays out of any run with a non-empty `path`, so drop `path` to have it * check again. A path with a colon, such as `"0:0"`, replays one shrunk failure. A * path with no colon, such as `"3"`, is what a failure with no shrinks reports, and * it is no replay once that failure is gone: fast-check draws a full `numRuns` of * lists starting from that one, and a cut path reads green. `path: ""` is no path * to fast-check, so this applies there. * * A value `structuralHash` refuses (a `Date`, a `Map`, a class instance) leaves * "acted" unreadable when a step's comparison reaches it, so this fails the run * saying so. The comparison stops at the first difference and doesn't look inside * an object `prev` and `next` share, so a refused value stays unread, and fails * nothing, when it sits in a shared object or past a difference. The answer is * right either way: a shared object didn't change, and a difference means the * step acted. Fields are compared in the order the state's keys were set. */ readonly failOnNeverActed?: boolean; /** * Fail a run when `init` or a step sends a Cmd whose `_tag` isn't in * `machine.cmds`, naming that Cmd. Default `false`, because tea lets a machine * keep a hand-written Cmd beside its defined ones. A machine with no `cmds` field * has no list to check against, so this adds nothing there. `cmds: []` is a list * with nothing on it, so every Cmd fails. * * A value with no string `_tag` is never a Cmd, so it fails with this off too, on * every machine. */ readonly failOnUndeclaredCmd?: boolean; } /** * What a property run did. A passing runner returns it, and a failing one throws * it on {@link PropertyFailure.run}, so a caller reads one shape on both arms and * never parses error text. */ interface PropertyRun { /** Lists tried. On a failure, this counts up to and including the failing one. */ readonly numRuns: number; /** Shrink steps a failure took. `0` on a pass. */ readonly numShrinks: number; /** The seed this run drew from. Pass it back as `seed` to draw the same lists. */ readonly seed: number; /** * Where the shrunk failure sits. Pass it back as `path`, with `seed`, to replay * that one failure. `null` when no list failed: on a pass, on an interrupt * marked as a failure, when too many `fc.pre` skips fail the run, or when * `failOnNeverActed` fails it. */ readonly path: string | null; /** * What the run's lists did, per Msg type: every type the machine has a cell for, * then any other that was drawn. A type never drawn reads zero. On a failure this * stops at the failing list, so shrinking adds nothing, and a list skipped with * `fc.pre` adds nothing either. A list whose reducer threw adds nothing as well, * though `numRuns` includes it: its fold hands back no steps to count. * * A step counts as acted when its comparison reaches a value `structuralHash` * refuses (a `Date`, a `Map`, a class instance). One in an object `prev` and `next` * share, or past a difference, is never reached, so it changes no count. */ readonly msgCounts: ReadonlyMap; } /** * Raised when a property fails. The message is fast-check's report, and * {@link PropertyFailure.run} holds the same {@link PropertyRun} a pass returns. * What the check threw sits where `fc.assert` puts it on the installed fast-check: * on 4, in `cause` by default and in the message with `includeErrorInReport`; on 3, * in the message by default and in `cause` with `errorWithCause`, on the 3s that have * that setting. A reason the check returned is always in the message: when it went to * `cause`, the message is the report plus a `reason:` line. A run that `failOnNeverActed` fails broke no list, * so fast-check has no report: the message names the Msg types instead. * * @example * ```ts * import type { Machine } from "@demlik/tea"; * import { PropertyFailure, propertyInvariant } from "@demlik/tea/pbt"; * import type * as fc from "fast-check"; * * type State = { _tag: "idle" } | { _tag: "done" }; * type Msg = { _tag: "finish" }; * declare const machine: Machine; * declare const seqArb: fc.Arbitrary; * * try { * propertyInvariant(machine, {}, seqArb, ({ next }) => next._tag === "idle"); * } catch (error) { * if (error instanceof PropertyFailure) { * // Replay this one failure with `{ seed, path }`. * const { numShrinks, seed, path } = error.run; * console.log(numShrinks, seed, path); * } * } * ``` */ declare class PropertyFailure extends Error { /** The run that failed. */ readonly run: PropertyRun; readonly name = "PropertyFailure"; readonly _tag: "PropertyFailure"; constructor(report: string, /** The run that failed. */ run: PropertyRun, options?: ErrorOptions); } /** * Assert every generated Msg sequence ends in a terminal state. `terminal` * is the predicate that names the acceptable final states (often * `(s) => s._tag === "done" || s._tag === "idle"`). * * The "every sequence" property catches stuck states (machine gets to a * non-terminal state and no further msg can escape) AND silent loops * (every msg variant is a noop from a given state). * * `terminal` also gets the Cmds `init` sent on that list's start. * * A `machine.cmds` that names one Cmd twice throws `CmdNameCollisionError`, before * any list is folded. * * @example * ```ts * import type { Machine } from "@demlik/tea"; * import { * arbMsgSequence, * propertyTerminates, * stubCtxThrowingProxy, * } from "@demlik/tea/pbt"; * import type * as fc from "fast-check"; * * type State = { _tag: "idle" } | { _tag: "auditing" } | { _tag: "done" }; * type Msg = { _tag: "start_audit" } | { _tag: "ws:audit:done" }; * interface BackgroundCtx { readonly tabId: number } * declare const auditBackgroundMachine: Machine; * declare const msgArb: fc.Arbitrary; * const auditingState: State = { _tag: "auditing" }; * * propertyTerminates( * auditBackgroundMachine, * stubCtxThrowingProxy(), * arbMsgSequence(msgArb, { minLength: 1, maxLength: 30 }), * (s) => s._tag === "done" || s._tag === "idle", * { loaded: auditingState, numRuns: 500 }, * ); * ``` */ declare function propertyTerminates(machine: Machine, ctx: NoInfer, seqArb: fc.Arbitrary[]>, terminal: (state: NoInfer, initCmds: readonly NoInfer[]) => boolean, opts?: NoInfer>): PropertyRun; /** * Assert a predicate holds on EVERY transition step in a generated * sequence. The predicate sees `{ prev, msg, next, cmds }` per step. Return * `true` or `null` to accept. Return `false`, or a string saying why, to fail: the * thrown error's message names that string. An empty string fails too. A throw * still fails with its own message. * * The predicate's second argument is the Cmds `init` sent on that list's start. It * runs once per step, so an empty list never shows them to it: use `propertyTrace` * for a rule about `init` alone. * * Use to pin a "when X happens in state Y, cmd Z must be emitted" rule. * The shrinker minimizes the offending sequence to the smallest Msg list * that still violates the predicate. * * A `machine.cmds` that names one Cmd twice throws `CmdNameCollisionError`, before * any list is folded. * * @example * ```ts * import type { Machine } from "@demlik/tea"; * import { arbMsgSequence, propertyInvariant } from "@demlik/tea/pbt"; * import type * as fc from "fast-check"; * * type State = { _tag: "idle" } | { _tag: "auditing" }; * type Msg = { _tag: "start_audit" } | { _tag: "ws:client:hello" }; * type Cmd = { _tag: "send_ws"; msg: { _tag: "client:ready" } }; * interface BackgroundCtx { readonly tabId: number } * declare const auditBackgroundMachine: Machine; * declare const ctx: BackgroundCtx; * declare const msgArb: fc.Arbitrary; * const auditingState: State = { _tag: "auditing" }; * * // Pin the resume-handshake fix: `ws:client:hello` in auditing must * // emit `send_ws { client:ready }`. * propertyInvariant( * auditBackgroundMachine, ctx, * arbMsgSequence(msgArb, { prefix: [{ _tag: "ws:client:hello" }] }), * ({ prev, msg, cmds }) => * !(prev._tag === "auditing" && msg._tag === "ws:client:hello") || * cmds.some((c) => c._tag === "send_ws" && c.msg._tag === "client:ready"), * { loaded: auditingState, numRuns: 200 }, * ); * ``` */ declare function propertyInvariant(machine: Machine, ctx: NoInfer, seqArb: fc.Arbitrary[]>, invariant: (step: Step, NoInfer, NoInfer>, initCmds: readonly NoInfer[]) => boolean | string | null, opts?: NoInfer>): PropertyRun; /** * Assert a predicate over the full trace plus the final state. Use when * the property is "some Msg appeared in the trace before reaching the * final state" or "no two consecutive steps had the same state._tag" — * predicates that need the full sequence, not a single step. * * Return `true` or `null` to accept. Return `false`, or a string saying why, to * fail: the thrown error's message names that string. An empty string fails too. * A throw still fails with its own message. The last argument is the Cmds `init` * sent on that list's start. * * A `machine.cmds` that names one Cmd twice throws `CmdNameCollisionError`, before * any list is folded. * * @example * ```ts * import type { Machine } from "@demlik/tea"; * import { propertyTrace } from "@demlik/tea/pbt"; * import type * as fc from "fast-check"; * * type State = { _tag: "auditing" } | { _tag: "done" }; * type Msg = { _tag: "ws:audit:progress" } | { _tag: "ws:audit:done" }; * interface Ctx { readonly tabId: number } * declare const machine: Machine; * declare const ctx: Ctx; * declare const seqArb: fc.Arbitrary; * const auditingState: State = { _tag: "auditing" }; * * propertyTrace( * machine, ctx, seqArb, * (steps, final) => * final._tag !== "done" || * steps.some((step) => step.msg._tag === "ws:audit:done"), * { loaded: auditingState, numRuns: 500 }, * ); * ``` */ declare function propertyTrace(machine: Machine, ctx: NoInfer, seqArb: fc.Arbitrary[]>, predicate: (steps: readonly Step, NoInfer, NoInfer>[], finalState: NoInfer, initCmds: readonly NoInfer[]) => boolean | string | null, opts?: NoInfer>): PropertyRun; /** * Extract the Msg discriminant set at runtime from a machine. Useful for * asserting that a user-supplied `MsgArbitraryTable` covers every variant * the reducer can handle. * * Takes the MACHINE (not the bare `update` record) so the reducer-vs- * transitions branch honors the authoritative `__form` tag via `msgKeysOf` — * the same classification production `run` uses (#275). * * - **Reducer form** — keys of the top-level record ARE the Msg variants. * - **Transitions form** — keys of any single state's inner record. Every * state's inner record must cover every Msg variant (mapped-type * discipline), so reading the first state's keys is equivalent to reading * the union. * * @example * ```ts * import type { Machine } from "@demlik/tea"; * import { msgTypeKeys } from "@demlik/tea/pbt"; * * type State = { _tag: "idle" } | { _tag: "auditing" }; * type Msg = { _tag: "start_audit" } | { _tag: "stop_audit" } | { _tag: "window_created" }; * declare const auditBackgroundMachine: Machine; * * msgTypeKeys(auditBackgroundMachine); * // → ["start_audit", "stop_audit", "window_created"] * ``` */ declare function msgTypeKeys(machine: { update: Reducer | ([S] extends [{ _tag: string; }] ? Transitions : never); __form?: UpdateForm; }): readonly string[]; /** * @packageDocumentation * @demlik/tea/pbt — Property-based testing primitives for `@demlik/tea` machines. * * The sibling-package shape to `@demlik/tea/testing`. Where the testing subpath * ships example-based assertions over `replay`, this package ships * arbitrary-driven fold-and-check primitives over the same pure substrate: * * - `arbMsg` / `arbMsgSequence` — build `fc.Arbitrary` and `Arbitrary` * from a strict, mapped-type Msg-variant table. * - `arbGuidedSequence` — draw Msg lists whose answers each fit a Cmd really * sent, by folding blind picks through the machine. * - `propertyTerminates` / `propertyInvariant` / `propertyTrace` — wrap * `fc.check(fc.property(...))` with a TEA-shaped fold over Msg sequences, * returning a `PropertyRun` and throwing a `PropertyFailure` that carries one. * - `lawTerminates` / `lawInvariant` / `lawTrace` — the laws those runners * judge each fold by, as plain check functions over one `foldEvents` result. * They import no `fast-check`, so `@demlik/tea/testing/effect` exports them * too, for Effect's `Arbitrary.checkEffect`. Experimental. * - `stubCtxThrowingProxy()` — type-shaped Ctx value whose every access * throws (PBT runs the reducer; Ctx must never be touched). * - `journalConformance` — check a host-written journal driver against K1–K8 * through a fixture that owns interruption and storage controls. Experimental. * * Resolves the decoupling target: PBT * lives as a sibling package, never inside the substrate. * * Machine checks exercise the pure reducer surface; `interpret` and subscription * handlers are never invoked. Journal checks exercise the fixture's driver I/O. */ /** Check a journal driver against K1–K8 and return passed, failed or skipped cases. * @experimental */ declare const journalConformance: typeof journalConformance$1; /** A fixture's fresh driver handles and physical interruption controls. * @experimental */ type JournalKitFixture = JournalKitFixture$1; /** Create isolated storage and controls for one conformance history. * @experimental */ type JournalKitFactory = JournalKitFactory$1; /** The outcome of one named journal conformance case, with diagnostic detail. * @experimental */ type KitResult = KitResult$1; /** The K1–K8 journal contract case identifiers. * @experimental */ type KitCase = KitCase$1; /** Scale, clock, generation and replay options for journal conformance. * @experimental */ type KitOptions = KitOptions$1; export { type AnswerCell, type GuidedCells, type JournalKitFactory, type JournalKitFixture, type KitCase, type KitOptions, type KitResult, type MsgArbitraryTable, type MsgCount, PropertyFailure, type PropertyOpts, type PropertyRun, Step, arbConstantMsg, arbGuidedSequence, arbMsg, arbMsgSequence, arbRecordMsg, journalConformance, msgTypeKeys, propertyInvariant, propertyTerminates, propertyTrace, stubCtxThrowingProxy };