import { type ResourceEvent } from "./cloudformationTypes.js"; import { type DriftSuspectEvent } from "./driftSuspects.js"; import { type FailureAnalysisCategory } from "./failureAnalysisCategories.js"; export interface RootCause { resource: ResourceEvent; reason: string; category: FailureAnalysisCategory; isDirectCause: boolean; } export interface FailureAnalysis { rootCause: RootCause; affectedResources: ResourceEvent[]; dependencyChain: string[]; summary: string; remediation: string[]; errorPattern?: string; /** * Resources whose failure carries the out-of-band-deletion shape (Class 1 * drift): CloudFormation still tracks them but the service reported * NotFound. Suspects only — confirmation requires the deploy-core drift * probe. Absent when no failure event matches the NotFound anchors. */ driftSuspects?: DriftSuspectEvent[]; } /** * CloudFormationFailureAnalyser provides intelligent analysis of deployment failures * It identifies root causes, dependency chains, and provides actionable remediation */ export declare class CloudFormationFailureAnalyser { private knownErrorPatterns; /** * `stackName` opts the drift scan into current-operation bounding: the * monitor's event history is seeded with the stack's FULL retained event * history (~90 days), so an unbounded scan would resurrect suspects from * long-past operations that were since cured. Callers whose history is * already operation-scoped (callback-fed collections) omit it. */ analyseFailure(eventHistory: Map, stackName?: string): FailureAnalysis | null; /** * Scans EVERY failed event, not failedResources: a wedged resource's * UPDATE_FAILED is superseded by its rollback event, so latest-per-resource * semantics would drop exactly the wedge. When `stackName` is given, the * scan is bounded to events at/after the current operation's opening event; * if no opening event is visible the scan yields nothing rather than risk * classifying a stale prior-operation failure (fail-safe: a missed hint is * recoverable via `fjall drift detect`, a stale suspect self-reinforces * through the journal). */ private classifyDriftSuspects; private findFailedResources; private findRootCause; private categoriseError; private isDirectCause; private buildDependencyChain; private generateRemediation; private generateSummary; private simplifyResourceType; private isFailedStatus; }