/** * Corpus integrity / submission-risk scan (#1506). TS-native port of section9 * `scripts/corpus/llm_artifact_scan.py`. * * Conservative triage: flags artifacts carrying LLM residue, placeholder/ * template markers, unresolved citation markers, or non-final experiment * language so they get human review before induction/scoring/synthesis. It * does NOT decide misconduct. Reports by default; `--quarantine` writes a * per-REF report under `.aiwg/research/quarantine/` (source files untouched). * * The regex catalog is externalized (epic #1496 principle #3): the built-in * `DEFAULT_INTEGRITY_PATTERNS` is overridable per-corpus via * `documentation/integrity-patterns.yaml`. * * @source historical: corpus/llm_artifact_scan.py * @tests @test/unit/artifacts/integrity-scan.test.ts */ export type Severity = 'none' | 'low' | 'medium' | 'high' | 'critical'; export interface IntegrityPattern { category: string; severity: Severity; weight: number; /** Case-insensitive source (compiled with the `i` flag). */ regex: string; description: string; } export interface Finding { ref: string; path: string; line: number; category: string; severity: Severity; weight: number; description: string; excerpt: string; } export interface RefSummary { ref: string; score: number; highestSeverity: Severity; findingCount: number; categories: Record; recommendation: 'pass' | 'review' | 'quarantine'; } export interface ScanResult { findings: Finding[]; summary: Record; } /** Built-in pattern catalog. Ports the section9 PATTERNS list. */ export declare const DEFAULT_INTEGRITY_PATTERNS: IntegrityPattern[]; interface CompiledPattern extends IntegrityPattern { re: RegExp; } /** Load the pattern catalog (corpus override → built-in default), compiled. */ export declare function loadIntegrityPatterns(root: string): CompiledPattern[]; export interface ScanOptions { /** Limit to paths containing this REF id (e.g. "REF-888"). */ ref?: string; /** Explicit target files/dirs (relative to root or absolute). Defaults to the corpus text dirs. */ targets?: string[]; } export declare function scanCorpus(root: string, opts?: ScanOptions): ScanResult; export declare function renderScan(result: ScanResult): string; /** Write per-REF quarantine reports for `quarantine`-recommended REFs. Returns relative paths written. */ export declare function writeQuarantineReports(root: string, result: ScanResult): string[]; /** True if any REF reaches the fail threshold (quarantine, or review+quarantine when threshold=review). */ export declare function failsThreshold(result: ScanResult, threshold: 'review' | 'quarantine'): boolean; export {}; //# sourceMappingURL=integrity-scan.d.ts.map