import type { MEMOConfig } from '../model/config.js'; import { type DiagnosticDomain, type DiagnosticSeverity } from '../toolchain/diagnostic.js'; import type { ProviderRegistry } from '../toolchain/registry.js'; import { type Corpus, type CorpusProvenance, type CorpusUnit } from './corpus.js'; /** Every domain, always present in a report so a zero is stated, not implied. */ export declare const DIAGNOSTIC_DOMAINS: readonly DiagnosticDomain[]; export type DomainCounts = Record; export type SeverityCounts = Record; export declare function emptyDomainCounts(): DomainCounts; export interface RoleOutcome { role: 'validator' | 'lowering'; provider: string; providerVersion?: string; transport: string; accepted: boolean; exitCode?: number; /** Set when the role could not run at all — a missing tool, a crash. */ failure?: string; } export interface UnitReport { id: string; path: string; kind: CorpusUnit['kind']; /** Sources named to the providers — the count a reader checks first. */ files: number; bytes: number; /** * Diagnostics the run produced about files outside this unit, counted and * excluded from everything below. * * A provider given include paths may load and diagnose them: `syside` * offered the library tree reports the whole tree, so every unit would * otherwise carry the same 1276 findings and the per-unit numbers would be * the same number twelve times. Attribution is by file, and what is not * this unit's is not counted as this unit's. */ outsideUnit: number; /** Files with at least one diagnostic, per domain. */ filesWithDiagnostics: number; byDomain: DomainCounts; bySeverity: SeverityCounts; /** * The most frequent rule codes, or messages where a provider publishes no * code. Capped and sorted, because a baseline is diffed by a human. */ topFindings: { key: string; domain: DiagnosticDomain; count: number; }[]; roles: RoleOutcome[]; } export interface ConformanceReport { /** Format version of this report shape, so a baseline can refuse a mismatch. */ reportVersion: string; memoVersion: string; corpus: CorpusProvenance & { root: string; verified: 'sources' | 'full' | 'skipped'; }; toolchain: { validator: string; lowering: string; }; totals: { units: number; files: number; bytes: number; /** Diagnostics about files outside every unit that provoked them. */ outsideUnit: number; byDomain: DomainCounts; bySeverity: SeverityCounts; }; units: UnitReport[]; } export declare const CONFORMANCE_REPORT_VERSION = "1.0.0"; export interface ConformanceRunOptions { config: MEMOConfig; /** Project whose toolchain settings select the providers. */ projectDir: string; corpusDir?: string; units?: readonly string[]; registry?: ProviderRegistry; memoVersion: string; /** * Checksum scope. `sources` covers what a run actually reads; `full` adds * the 150 MB of XMI, which only `diff-xmi` opens. */ verify?: 'sources' | 'full' | 'skipped'; /** Reports progress per unit. The full sweep takes minutes. */ onUnit?: (unit: CorpusUnit, index: number, total: number) => void; } export declare class CorpusIntegrityError extends Error { readonly mismatches: readonly { path: string; reason: string; }[]; constructor(mismatches: readonly { path: string; reason: string; }[]); } /** Strip quoted literals and digits so positional detail stops splitting counts. */ export declare function normalizeMessage(message: string): string; /** * Run one unit through both roles. * * The unit directory is the "project" the providers are pointed at, and the * file list is passed explicitly — the corpus is a file set, not a project, and * the Kernel libraries are `.kerml`, which no project walker collects. Naming * the files is what stops a run from reporting a clean pass on sources it never * opened. */ export declare function runUnit(unit: CorpusUnit, corpus: Corpus, options: ConformanceRunOptions): Promise; export declare function runConformance(options: ConformanceRunOptions): Promise; export declare function formatConformanceReport(report: ConformanceReport): string; //# sourceMappingURL=run.d.ts.map