import type { IDeploymentPreflightRuntimeTask, IOciPlatformDescriptorSummary } from './deploymentpreflight.js'; import type { IDeployment } from './deployment.js'; import type { IImageRolloutStatus, IImmutableImageDeploymentPlan, IImmutableRolloutReportEnvelope, IImmutableImageTargetScope, TOciManifestMediaType, TSha256Digest } from './immutableimage.js'; import type { IRegistryTarget } from './registry.js'; export type TServiceDeploymentAdoptionDecision = 'GO' | 'NO-GO'; /** * Canonical sha256 hash of the complete adoption preflight snapshot. It is a * state/TOCTOU fence and must never be substituted with the OCI image digest. */ export type TServiceDeploymentAdoptionDigest = TSha256Digest & { readonly __serviceDeploymentAdoptionDigest: unique symbol; }; export type TServiceDeploymentAdoptionBlockerCode = 'INVALID_REQUEST' | 'AUTHORIZATION_MISSING' | 'SERVICE_NOT_FOUND' | 'SERVICE_OWNERSHIP_MISMATCH' | 'SERVICE_ALREADY_IMMUTABLE' | 'SERVICE_STATE_CONFLICT' | 'REGISTRY_TARGET_MISSING' | 'REGISTRY_REFERENCE_INVALID' | 'REGISTRY_DIGEST_MISSING' | 'OCI_INDEX_REQUIRED' | 'OCI_PLATFORM_MISSING' | 'RELEASE_NOT_FOUND' | 'RELEASE_TAG_AMBIGUOUS' | 'TARGET_SCOPE_UNAVAILABLE' | 'RUNTIME_ATTESTATION_INCOMPLETE' | 'RUNTIME_DIGEST_MISMATCH'; export interface IServiceDeploymentAdoptionBlocker { code: TServiceDeploymentAdoptionBlockerCode; message: string; } export interface IServiceDeploymentAdoptionPreflightInput { requestId: string; organizationId: string; serviceId: string; } export interface IServiceDeploymentAdoptionInput extends IServiceDeploymentAdoptionPreflightInput { idempotencyKey: string; expectedAdoptionDigest: TServiceDeploymentAdoptionDigest; } export interface IServiceDeploymentAdoptionImagePromotionInput extends IServiceDeploymentAdoptionPreflightInput { targetReleaseTag: string; expectedSourceImageDigest?: TSha256Digest; idempotencyKey: string; } export interface IServiceDeploymentAdoptionImagePromotionResult { status: 'promoted' | 'already-promoted'; organizationId: string; serviceId: string; sourceTag: string; releaseTag: string; registryHost: string; repository: string; digest: TSha256Digest; mediaType: 'application/vnd.oci.image.index.v1+json' | 'application/vnd.docker.distribution.manifest.list.v2+json'; platforms: IOciPlatformDescriptorSummary[]; releaseId: string; digestPinnedImageReference: string; } export interface IServiceDeploymentAdoptionRolloutInput extends IServiceDeploymentAdoptionPreflightInput { releaseTag: string; expectedTargetImageDigest: TSha256Digest; idempotencyKey: string; } export interface IServiceDeploymentAdoptionRolloutResult { status: 'rollout-started' | 'rollout-in-progress' | 'rollout-succeeded' | 'rollout-failed'; idempotentReplay: boolean; operationId: string; organizationId: string; serviceId: string; registryHost: string; repository: string; releaseTag: string; digest: TSha256Digest; releaseId: string; plan: IImmutableImageDeploymentPlan; rolloutStatus: IImageRolloutStatus; } interface IServiceDeploymentAdoptionReportBase { schemaVersion: 1; mutationPerformed: false; requestId: string; generatedAt: number; runtimeAttestation: { requiredReplicaCount: number; observedReplicaCount: number; healthyReplicaCount: number; observedDigestReplicaCount: number; observedDigestConsistent: boolean; }; } interface IServiceDeploymentAdoptionServiceSnapshot { organizationId: string; serviceId: string; serviceName: string; imageId: string; deployOnPush: boolean; immutableImageRequired: boolean; configuredReference: string; /** Hash of the complete persisted pre-adoption service configuration. */ configurationDigest: TSha256Digest; registryTarget: IRegistryTarget; } interface IServiceDeploymentAdoptionRegistrySnapshot { tag?: string; digest?: TSha256Digest; mediaType?: TOciManifestMediaType; platforms: IOciPlatformDescriptorSummary[]; releaseId?: string; releaseTag?: string; } export interface IServiceDeploymentAdoptionGoReport extends IServiceDeploymentAdoptionReportBase { decision: 'GO'; service: IServiceDeploymentAdoptionServiceSnapshot & { deployOnPush: true; immutableImageRequired: false; }; registry: IServiceDeploymentAdoptionRegistrySnapshot & { tag: string; digest: TSha256Digest; mediaType: 'application/vnd.oci.image.index.v1+json' | 'application/vnd.docker.distribution.manifest.list.v2+json'; platforms: [IOciPlatformDescriptorSummary, ...IOciPlatformDescriptorSummary[]]; releaseId: string; releaseTag: string; }; runtimeTasks: [IDeploymentPreflightRuntimeTask, ...IDeploymentPreflightRuntimeTask[]]; targetScope: IImmutableImageTargetScope; adoptionDigest: TServiceDeploymentAdoptionDigest; blockers: []; } export interface IServiceDeploymentAdoptionNoGoReport extends IServiceDeploymentAdoptionReportBase { decision: 'NO-GO'; service?: IServiceDeploymentAdoptionServiceSnapshot; registry: IServiceDeploymentAdoptionRegistrySnapshot; runtimeTasks: IDeploymentPreflightRuntimeTask[]; targetScope?: IImmutableImageTargetScope; adoptionDigest?: never; blockers: [IServiceDeploymentAdoptionBlocker, ...IServiceDeploymentAdoptionBlocker[]]; } export type IServiceDeploymentAdoptionReport = IServiceDeploymentAdoptionGoReport | IServiceDeploymentAdoptionNoGoReport; export interface IServiceDeploymentAdoptionResult { adoptionId: string; adoptionDigest: TServiceDeploymentAdoptionDigest; idempotentReplay: boolean; plan: IImmutableImageDeploymentPlan; } export type TServiceDeploymentAdoptionRetentionPhase = 'prepare' | 'commit'; /** * A session-bound Coreflow assertion that its local live runtime can be * retained for the exact adoption plan without mutating the Docker service. */ export interface IServiceDeploymentAdoptionRetentionAttestation { schemaVersion: 1; phase: TServiceDeploymentAdoptionRetentionPhase; retainedWithoutMutation: true; serviceId: string; operationId: string; adoptionConfigurationDigest: TSha256Digest; immutableReport: IImmutableRolloutReportEnvelope; deployments: IDeployment[]; attestedAt: number; } export declare const validateServiceDeploymentAdoptionRetentionAttestation: (attestationArg: unknown) => string[]; export declare const normalizeServiceDeploymentAdoptionReleaseTag: (tagArg: unknown) => string | undefined; export declare const validateServiceDeploymentAdoptionPreflightInput: (inputArg: unknown) => string[]; export declare const validateServiceDeploymentAdoptionInput: (inputArg: unknown) => string[]; export declare const validateServiceDeploymentAdoptionImagePromotionInput: (inputArg: unknown) => string[]; export declare const validateServiceDeploymentAdoptionImagePromotionResult: (resultArg: unknown) => string[]; export declare const validateServiceDeploymentAdoptionRolloutInput: (inputArg: unknown) => string[]; export declare const validateServiceDeploymentAdoptionRolloutResult: (resultArg: unknown) => string[]; export declare const validateServiceDeploymentAdoptionReport: (reportArg: unknown) => string[]; export {};