/** * In-session post-failure repair offer (drift-remediation plan § 8 Phase 6): * when a stack deploy step fails, the engine re-probes that stack in the SAME * session through the bounded [G2] pipeline (the failure analysis has just * journalled any NotFound-classified suspects). A CONFIRMED out-of-band * deletion upgrades the returned error to the typed * `DriftRepairAvailableError` — the interactive surface defers on the class * (the `BuildxUnavailableInteractive` shape) while the non-interactive * surface reads the same offer from the message text. * * Best-effort by contract: any probe failure, abort, or empty verdict returns * the ORIGINAL error untouched — the offer must never mask the deploy's true * root cause. * * Messages are pre-masked at construction: the original analysed error is * masked at the monitor boundary, and the appended offer lines are * identifier-only (stack, logical ID, resource type, physical ID). The * command teaches the flag SHAPE with a placeholder name, never a filled * consent [G5]. */ import type { AwsProvider } from "../../aws/AwsProvider.js"; import type { CloudFormationService } from "../../services/infrastructure/CloudFormationService.js"; import type { DriftFinding } from "../../types/drift.js"; import type { DriftJournalOptions } from "../drift/driftSuspectJournal.js"; import { type RemediationJournalOptions } from "./remediationJournal.js"; export declare class DriftRepairAvailableError extends Error { readonly findings: readonly DriftFinding[]; constructor(message: string, findings: readonly DriftFinding[]); } /** Identifier-only offer block appended beneath the analysed deploy error. */ export declare function formatDriftRepairOffer(findings: readonly DriftFinding[], appName?: string, repairTarget?: string): string; /** One confirmed finding covered by an in-flight recreate journal [G1]. */ export interface RecreateCoveredFinding { finding: DriftFinding; opId: string; appName?: string; } /** * [G1] Identifier-only notice for confirmed deletions COVERED by an in-flight * recreate operation. The `=forget` offer must never be taught for these — * the forget arm's verb guard fails closed on the recreate journal, whose * teach names the deploy, whose failure re-offers `=forget`: a circular teach * loop. The two-cure block is the only terminating exit. */ export declare function formatRecreateCoveredNotice(covered: readonly RecreateCoveredFinding[], fallbackAppName?: string): string; export interface ComposePostFailureRepairOfferParams { /** The stack(s) whose deploy step just failed. */ stackNames: readonly string[]; /** Names the repair command's target in the offer. */ appName?: string; /** * Overrides the repair command's target fragment in the offer (e.g. * "--stack Account" for a single-component deploy, whose stack is not * addressable by app name). `appName` still names the recreate cures — * those teach 'fjall deploy', where a flag fragment would be wrong. */ repairTarget?: string; originalError: Error; cfnService: Pick; journal?: DriftJournalOptions; /** Remediation-journal root override — tests point this at a temp dir. */ remediationJournal?: RemediationJournalOptions; abortSignal?: AbortSignal; } /** * Upgrade a failed deploy's error with the in-session repair offer when the * post-failure probe CONFIRMS an out-of-band deletion on the failed stack. * Returns the original error on every other outcome. * * [G1] Findings covered by an in-flight RECREATE journal never receive the * `=forget` offer (circular teach — see `formatRecreateCoveredNotice`): a * covered-only verdict returns a PLAIN Error carrying the two-cure notice * (never `DriftRepairAvailableError`, whose interactive drift-repair offer * would walk the same loop), and a mixed verdict offers `=forget` for the * uncovered findings only, with the covered notice appended. */ export declare function composePostFailureRepairOffer(aws: AwsProvider, params: ComposePostFailureRepairOfferParams): Promise;