/** * The stale-generation and compatibility refusal gates * `WorkflowCatalog.activateCandidate()` checks before ever attempting its * CAS write — split out of `workflow-catalog.ts` to protect that file's * size against the repository's 500-line implementation-file ceiling, * mirroring how `storage-io.ts`/`codec.ts`/`removal.ts` already sit * alongside it rather than inline. * * @module core/catalog/activation-guards */ import { type WorkflowCompatibilityPolicy } from '../contract/compatibility.ts'; import type { WorkflowRevisionManifest } from '../contract/types.ts'; import type { WorkflowCatalogActivationResult, WorkflowCatalogActivePointer, WorkflowRevisionRecord } from './types.ts'; /** Options accepted by {@link import('./workflow-catalog.ts').WorkflowCatalog.activateCandidate}. */ export type ActivateCandidateOptions = { /** The generation this caller last observed; refused with `stale-generation` if it disagrees with the durable pointer. */ expectedGeneration?: number; /** Compatibility policy; defaults to {@link DEFAULT_WORKFLOW_COMPATIBILITY_POLICY}. */ policy?: WorkflowCompatibilityPolicy; }; /** * The stale-generation and compatibility gates `activateCandidate` checks * before ever attempting a write. Returns the refusal result when the * candidate should be rejected, or `undefined` when it may proceed to the * CAS write. `resolveEntry` is threaded through rather than a `WorkflowCatalog` * instance, so this module never needs to import the class itself. */ export declare function refuseIncompatibleOrStaleCandidate(resolveEntry: (name: string, revision: string) => Promise, name: string, candidateManifest: WorkflowRevisionManifest, currentPointer: WorkflowCatalogActivePointer | null, options?: ActivateCandidateOptions): Promise;