/** * IO wrapper around {@link buildDeployPlan}: fetches each changed stack's live * template via the CloudFormation read surface, parses it, and delegates the * pure diff/classification to the builder. A stack that does not yet exist * contributes an empty baseline (every resource is a creation). */ import { type Result } from "@fjall/generator"; import type { ManifestCapacityAlias } from "@fjall/util/manifest"; import type { CloudFormationError, StackResourceSummaryRow } from "../../../services/infrastructure/CloudFormationService.js"; import type { CfnRegistrySummaryReader } from "../../../services/infrastructure/CfnRegistryService.js"; import type { ChangeSetProbeRunner } from "../../../services/infrastructure/changeSetProbe.js"; import type { DeployPlan } from "./types.js"; /** The narrow CFN read surface the gate needs — CloudFormationService satisfies it. */ export interface CfnTemplateReader { getTemplate(stackName: string, abortSignal?: AbortSignal, region?: string): Promise>; /** * Optional live resource-listing capability for the rename-detection * overlay's physical-ID anchoring. Absent on adapters that only read * templates (the domain-deploy reader); rename detection then runs * structurally — findings carry no physical IDs and matcher (b) cannot * fire, but detection itself still happens. */ listStackResources?(stackName: string, abortSignal?: AbortSignal, region?: string): Promise>; } export interface ComputeDeployPlanStack { stackName: string; /** The synthesised cdk.out template, already parsed from JSON. */ newTemplate: unknown; /** The stack's own region when not the reader's — the `UsEast1*` stacks. */ region?: string; } export interface ComputeDeployPlanParams { cfnService: CfnTemplateReader; stacks: ComputeDeployPlanStack[]; assemblyDigest: string; /** * Registry oracle for replacement-verdict recomputation. Optional — without * it the plan carries raw cloudformation-diff verdicts (no `verdictSource`). */ registry?: CfnRegistrySummaryReader; /** * Change-set escalation probe [G4]. Optional — without it conditional * verdicts stay worst-cased into the ceremony (the sanctioned D2 fallback). */ changeSetProbe?: ChangeSetProbeRunner; /** * The synthesised manifest's capacity-identity aliases, for the * rename-detection overlay's matcher (a). Optional — absent (pre-emitter * assemblies, missing manifest) detection degrades to matchers (b)–(d). */ identityAliases?: readonly ManifestCapacityAlias[]; abortSignal?: AbortSignal; } export declare function computeDeployPlan(params: ComputeDeployPlanParams): Promise>;