/** * AI change-risk score. * * Combines memory status, confidence, evidence, file scope, and critical-area * membership into a 0–100 risk score for a set of changed files. The score is * designed to surface changes that need human review before merge. * * Factors: * - Violation severity (fail > warn) * - Memory kind (GUARDRAIL/FAILED_APPROACH > INVARIANT > CONVENTION > other) * - Memory status (REFUTED > STALE > UNVERIFIED > VERIFIED) * - Confidence (lower confidence → higher risk) * - Evidence count (more evidence → lower risk for that memory) * - Critical-area membership (adds a flat risk bonus) * - Number of changed files (broader changes → higher risk) */ import type { CheckReport } from "./check.js"; import type { CriticalAreaViolation } from "./critical-areas.js"; export interface RiskScore { score: number; level: "low" | "medium" | "high" | "critical"; factors: RiskFactor[]; } export interface RiskFactor { label: string; contribution: number; detail?: string; } /** * Compute a risk score for a check report plus any critical-area violations. */ export declare function computeRiskScore(report: CheckReport, areaViolations?: CriticalAreaViolation[]): RiskScore; /** * Render a risk score as a human-readable string for CLI output. */ export declare function renderRiskScore(risk: RiskScore): string;