import type { RuleSetT } from "./schema.js"; /** * Coverage matrix: how many rules apply to each (jurisdiction × use_case) * combination, summed across all channels. Higher counts mean better coverage; * empty cells are gaps the rule set doesn't yet address. * * Returned data is plain JSON. Renderers (markdown, csv, etc.) live in the CLI. */ export interface CoverageCell { /** Number of rules in the bundle that match this (jurisdiction × use_case). */ count: number; /** The severity badges present, deduplicated. */ severities: Array<"mandatory" | "recommended" | "best-practice">; /** Rule ids that contribute to this cell. */ rule_ids: string[]; } export interface CoverageMatrix { jurisdictions: string[]; use_cases: readonly string[]; /** matrix[jurisdiction][use_case] = CoverageCell */ matrix: Record>; totals: { rules: number; jurisdictions: number; use_cases: number; }; } /** * Computes the coverage matrix from a rule set. A rule "covers" * (jurisdiction, use_case) iff: * - its jurisdiction equals the row jurisdiction, AND * - its use_cases list includes the column use_case (or the universal `general`). * * NOTE: this matrix uses *exact* jurisdiction equality, NOT the parent-prefix * cascading that `lookup()` does. The reason: the matrix is meant to show where * rules ORIGINATE, not where they apply via inheritance. To see where a query * for `us-ny-nyc` would land (which inherits us-ny and us rules), use `lookup()`. */ export declare function computeCoverageMatrix(rules: RuleSetT): CoverageMatrix; /** * Renders the coverage matrix as a markdown table. Cells show rule count; * `.` means zero coverage. A short legend below names the channels (which * the matrix collapses across). */ export declare function renderCoverageMarkdown(m: CoverageMatrix): string; /** Renders as CSV; same shape as markdown but machine-friendly. */ export declare function renderCoverageCsv(m: CoverageMatrix): string; //# sourceMappingURL=coverage.d.ts.map