import type { FlowExpect, FlowFile } from './flow-types.js'; /** * Whether one flow may be replayed straight after another. * * Replaying journeys back to back only works when the state one leaves is the state the next * expects. Two flows that each pass alone can fail composed, and the reverse, and the red looks * like a regression — the most expensive kind, because it sends somebody to read product code that * is fine. * * It answers over DECLARATIONS, not over a running app: a pure comparison of what B says it needs * against what A says it leaves, so it can be asked before either flow runs. * * SILENCE IS PERMISSIVE. A flow that declares neither `requires` nor `ensures` says nothing, and * unknown means unchecked rather than unsafe; `unmet` names the claims that could not be * discharged, so the answer is never a bare boolean. * * NOT ENFORCED AT REPLAY TIME. An unmet precondition reported as a step result would read as a * FAILURE — `FlowStepResult` has `ok: boolean` and no third state — and honestly it is `unknown`: * nothing ran, so nothing was proved. */ export interface CompositionCheck { /** True when nothing B requires is left undischarged by A. Vacuously true when either is silent. */ readonly ok: boolean; /** The claims B requires that A does not ensure. Empty when `ok`. */ readonly unmet: readonly FlowExpect[]; /** True when neither flow declared anything, so the answer is "unchecked" rather than "safe". */ readonly unchecked: boolean; } /** Can `next` be replayed immediately after `previous`? */ export declare function canFollow(previous: FlowFile, next: FlowFile): CompositionCheck;