/** * Breaking-Change Classification Engine * * Takes an IRDiffReport (from ir-diff.ts) and classifies each change as: * - compatible: backward-compatible (e.g., adding optional properties) * - deprecated: may change runtime behavior but not type-level contract * - breaking: breaks existing consumers (e.g., removing entities, changing types) * * Also produces consumer impact analysis (which commands, routes, projections are * affected) and supports acknowledgment filtering for CI integration. * * Design notes: * - Deterministic: same IRDiffReport always produces same output (sorted, no random). * - IR is the authority -- classifications derive from IR diffs, never from source. * - Pure function: no I/O, no side effects. */ import type { IRDiffReport } from './ir-diff'; export type ChangeSeverity = 'compatible' | 'deprecated' | 'breaking'; export interface ClassifiedChange { /** Dot-separated path to the changed element, e.g. "User.email", "createUser.parameters.email" */ path: string; /** Severity classification */ severity: ChangeSeverity; /** Machine-readable category, e.g. "property-removed", "entity-added" */ category: string; /** Human-readable description */ description: string; /** Which consumers are affected, e.g. ["command:createUser", "route:/api/users"] */ consumerImpact: string[]; } export interface AcknowledgmentEntry { /** Dot-separated path matching ClassifiedChange.path */ path: string; /** Category matching ClassifiedChange.category */ category: string; /** ISO timestamp of acknowledgment */ acknowledgedAt: string; /** Human-readable reason */ reason: string; } export interface AcknowledgmentsFile { version: 1; acknowledged: AcknowledgmentEntry[]; } export interface ConsumerImpactSummary { commands: string[]; routes: string[]; projections: string[]; } export interface BreakingChangeReport { /** All classified changes, sorted by path */ classified: ClassifiedChange[]; /** Counts by severity */ summary: { compatible: number; deprecated: number; breaking: number; total: number; }; /** Breaking changes NOT found in the acknowledgments file */ unacknowledged: ClassifiedChange[]; /** Breaking changes found in the acknowledgments file */ acknowledged: ClassifiedChange[]; /** Aggregated consumer impact */ consumerImpact: ConsumerImpactSummary; } /** * Classify all changes in an IR diff report by severity. * * @param report - Output of diffIR(oldIR, newIR) * @param acks - Optional parsed acknowledgments file * @returns Classified and analyzed breaking change report */ export declare function classifyBreakingChanges(report: IRDiffReport, acks?: AcknowledgmentsFile): BreakingChangeReport; //# sourceMappingURL=breaking-change.d.ts.map