/** * Deterministic postmortem generation. * * No model call. The narrative is assembled from the Analysis by templates chosen * on the evidence, which buys three things an LLM summary can't: it is identical * on every run over the same data, it costs nothing, and it never invents a fact * that isn't in the trace. * * The firewall section is not prose. It compiles the same Findings into concrete * `settings.json` permission rules and hook descriptions, so arming them later is * a config change rather than a rewrite. */ import type { Analysis } from "./analyze/index.js"; import { type Label, type Run, type Severity } from "./model.js"; export declare const GENERATOR = "flightrec.postmortem/1.0 (deterministic, no LLM)"; export type Confidence = "high" | "medium" | "low"; export interface FirewallRule { rule: string; kind: string; priority: Severity; because: string; fromFinding: string; implementation: string | null; settingsJson: { permissions?: Record; } | null; /** This release only proposes. Nothing is armed. */ enforced: false; } export interface Postmortem { runId: string; generatedAt: string; generator: string; label: Label; labelReason: string; confidence: Confidence; confidenceNotes: string[]; headline: string; sections: { goal: string; whatHappened: string; whatChanged: string; whatFailed: string; cost: string; risks: string; shouldHaveStopped: string; }; firewall: FirewallRule[]; settingsSnippet: { permissions: Record; } | null; markdown: string; } export declare function generate(run: Run, a: Analysis): Postmortem; export declare function renderMarkdown(run: Run, a: Analysis, pm: Postmortem): string;