/** * Incident / CI failure capture adapter. * * Reads a structured incident report (JSON or markdown) or a CI failure log * and extracts a FAILED_APPROACH proposal with provenance and applicability * conditions. The proposal lands in the review queue — never directly in memory. */ import type { MemoryStore } from "../db/store.js"; import type { Proposal } from "../types.js"; export interface IncidentReport { title: string; description: string; files?: string[]; failedCommand?: string; ciUrl?: string; ticketRef?: string; commitSha?: string; } export interface IncidentMineResult { proposed: Proposal[]; skippedDuplicates: number; source: string; } /** * Parse a raw CI log (e.g. GitHub Actions, Jenkins, CircleCI output) and extract * a structured IncidentReport. Looks for error lines, failed commands, file * paths, and job/step names. */ export declare function parseCiLog(raw: string): IncidentReport; /** * Parse a JSON incident report file. * Expected shape: { title, description, files?, failedCommand?, ciUrl?, ticketRef?, commitSha? } */ export declare function parseJsonReport(raw: string): IncidentReport; /** * Parse a markdown incident report. Extracts the first heading as the title * and the body as the description. Optional fenced code blocks with `sh` or * `bash` are treated as the failed command. */ export declare function parseMarkdownReport(raw: string): IncidentReport; export declare function parseReport(filePath: string): IncidentReport; /** * Mine an incident report into a FAILED_APPROACH proposal. * If an LLM provider is available, it synthesizes a richer claim; otherwise * falls back to a heuristic claim built from the title and description. */ export declare function mineIncident(store: MemoryStore, report: IncidentReport, opts?: { llm?: boolean; }): Promise;