/** * Decoded-`revision` sanitization for {@link import('./validation.ts').decodeWorkflowState}. * Split out of `validation.ts`, which has no headroom under the repository's * 500-line implementation-file ceiling. * * @module core/engine/decode-revision */ import type { WorkflowState } from '../types.ts'; /** * Normalize a decoded `revision` that is present but not a non-empty, * bounded string. * * Deliberately NEVER drops a present-but-malformed value to `undefined` — * `revision` is engine-derived (never user-supplied at the API surface), so * an invalid value here indicates storage corruption or tampering, and * `undefined` is the SAME signal a genuinely missing `revision` carries * (a legitimate pre-revision-pinning record). Recovery treats an * `undefined` pin as unambiguous for an eager type or a dynamic source with * at most one registered candidate — silently executing that sole * candidate against a checkpoint whose true originating revision is * actually unknown, rather than rejecting the damaged identity. Instead, * a malformed value is replaced with a deterministic, distinctly-prefixed * marker derived from the workflow id: still a valid, bounded `string`, but * virtually guaranteed not to match any real registered candidate, so the * ordinary `resolveExecutableRegistrationForRevision()` "not-registered" * path rejects it explicitly (an `unavailable` recovery outcome, isolated * to that one run) instead of silently downgrading it to "legacy." * * Only a genuinely absent `revision` (never persisted at all) returns * early, unchanged, above. */ export declare function sanitizeDecodedRevision(state: WorkflowState): void;