/** * Rule Codifier — converts extracted patterns into executable formal checks. * * Takes an ExtractedPattern and produces a LearnedRule that can run * alongside hand-crafted rules in the formal verifier. * * Current implementation: regex-based rules only. * Future: AST patterns (tree-sitter), type constraints (ts-morph). */ import type { ExtractedPattern, LearnedRule, PatternExtractionInput } from './types.js'; /** Reset counter (for testing). */ export declare function resetRuleCounter(start?: number): void; /** * Create a new learned rule from an extracted pattern and its source finding. * * The rule starts in 'candidate' status and must pass validation * before being promoted to 'validated' and then 'promoted'. */ export declare function codifyRule(pattern: ExtractedPattern, input: PatternExtractionInput): LearnedRule; /** * Execute a learned rule against a code string. * * Returns true if the rule fires (detects a potential issue). */ export declare function executeRule(rule: LearnedRule, code: string, language: string): { fires: boolean; matches: string[]; }; /** * Merge a new source finding into an existing rule. * This happens when the same pattern is extracted from a different finding. */ export declare function mergeSourceFinding(rule: LearnedRule, input: PatternExtractionInput): LearnedRule; /** * Update rule status through the lifecycle. */ export declare function updateRuleStatus(rule: LearnedRule, status: LearnedRule['status']): LearnedRule; /** * Record that a rule fired and was confirmed/rejected by a human or auto-confirmation. */ export declare function recordRuleFire(rule: LearnedRule, wasCorrect: boolean): LearnedRule;