/** * Rule Generalizer — Uses LLM to generalize PR diff hunks into reusable * code quality rules for the Assay catalog. * * Given a before/after diff hunk (and optional reviewer comment), the LLM * produces a GeneralizedRule with detection regex, fix description, severity, * and provenance. The rule is then mapped to an ExtractedPattern for catalog * ingestion. */ import type { DiffHunk, GeneralizedRule } from '../learned-rules/types.js'; import type { ExtractedPattern } from '../learned-rules/types.js'; /** * Build the user prompt for the LLM generalization call. */ export declare function buildGeneralizationPrompt(hunk: DiffHunk, repo: string, prNumber: number, prTitle: string, reviewComment?: string): string; /** * Call the LLM to generalize a diff hunk into a reusable rule. * Returns null if the hunk is too context-specific, parse fails, * or all retries are exhausted. */ export declare function generalizeHunk(hunk: DiffHunk, repo: string, prNumber: number, prTitle: string, reviewComment?: string): Promise; /** * CVE-specific generalization: more aggressive about extracting patterns * since every CVE fix represents a confirmed, generalizable vulnerability class. */ export declare function generalizeCVEHunk(hunk: DiffHunk, repo: string, cveId: string, summary: string, cwes: string[], reviewComment?: string): Promise; /** * Map a GeneralizedRule to an ExtractedPattern for catalog ingestion. */ export declare function mapToExtractedPattern(rule: GeneralizedRule, patternId: string): ExtractedPattern;