import { type Event, type PropertyInfo } from "../spec/index.ts"; /** What a trace sees of a step: who took it, which step, what it sent, and whether it failed. */ export type TraceStep = Pick; export interface Remembered { /** What the properties remember of the path: paths that remember the same are one state. */ memory: string; /** The properties the path breaks. */ nevers: string[]; /** How each property read the path: the calls it made, in order (see `memoryOf`). */ shapes: Map; } /** * A `never` property judges the whole path, so two paths to one world are one state only if * the property remembers the same of both. It sees the path through `count` and `some`, each * over single events, so the answers those calls give are all it can remember: they go in the * fingerprint. Judging the path this way also says which of them it breaks. * * That holds while the property asks the same questions of every path. One that asks a * question only sometimes (`t.some(a) && t.count(b) > 1` never counts b before an a) has not * said what it would remember of the paths where it did not ask: two of them that differ in * how many b they hold would be merged, and one of the two never judged. So each property's * calls are its shape, reported here; the search reads them, and a property whose shape varies * is run again as `whole` (the search starts over). A property in `whole`, or one that reads * `trace.events` itself, could remember anything: the whole path goes in, and no two paths * are merged. A predicate built from an earlier answer is beyond what the shape can see. */ export declare function memoryOf(nevers: PropertyInfo[], events: readonly TraceStep[], whole?: ReadonlySet): Remembered; /** An event as a trace sees it. */ export declare function traceStep(e: Event): TraceStep;