/** * Content-addressed step identity (Design Law 1). * * step_key = hash(step_kind, step_name)[:16] + ':' + occurrence_index * * where occurrence_index is the count of prior calls with the same * (kind, name) pair in this execution. A memoized result may be returned * only if the stored key matches the key computed at the call site — * a mismatch means workflow control flow drifted between runs, and the * cached output belongs to a different call site. */ /** Step-kind identifiers used in key hashing (aligned with proto StepType names). */ export type StepKind = 'ACTIVITY' | 'TIMER' | 'SIGNAL_WAIT' | 'SIDE_EFFECT'; /** First 16 hex chars of sha256("\n"). */ export declare function stepKeyHash(stepKind: StepKind, stepName: string): string; /** * Tracks per-(kind, name) occurrence counts for one workflow execution and * produces the full step_key for each durable call in program order. */ export declare class StepKeyTracker { private occurrences; next(stepKind: StepKind, stepName: string): string; } /** * Thrown when a checkpointed step's identity does not match the step the * workflow code is executing at that sequence position — i.e. control flow * up to the first pending step was not reproducible. The workflow is failed * loudly rather than silently returning the wrong memoized value. */ export declare class NonDeterminismError extends Error { readonly stepSeq: number; readonly storedKey: string; readonly computedKey: string; constructor(stepSeq: number, storedKey: string, computedKey: string, detail?: string); } /** * Validate a stored checkpoint against the call site's computed identity. * * - Stored key present → must equal the computed key exactly. * - Stored key absent (checkpoint written before step_key existed) → * fall back to step_name equality and warn, per the P0.1 back-compat rule. */ export declare function validateStepKey(args: { stepSeq: number; storedKey: string | undefined; storedName: string | undefined; computedKey: string; stepKind: StepKind; stepName: string; }): void;