/** * Learned Rule Catalog — stores, loads, and queries auto-generated formal rules. * * Rules are stored as JSON in the `learned/` subdirectory alongside * hand-crafted rules in check-catalog.ts. This separation ensures * auto-generated rules are clearly distinguishable. * * Storage structure: * .assay/learned/ * rules.json — all learned rules * stats.json — catalog statistics over time */ import type { LearnedRule, LearnedRuleStatus } from './types.js'; export interface CatalogStats { totalRules: number; byStatus: Record; byCategory: Record; bySeverity: Record; totalFires: number; totalTruePositives: number; totalFalsePositives: number; overallPrecision: number; lastUpdated: string; } /** * Load all learned rules from the project's catalog, * merged with the bundled starter catalog. * * Local rules (from .assay/learned/rules.json) take precedence over * starter rules when IDs collide. Starter rules provide out-of-the-box * coverage even when no local catalog exists. */ export declare function loadRules(projectPath: string): Promise; /** * Save all learned rules to the project's catalog. */ export declare function saveRules(projectPath: string, rules: LearnedRule[]): Promise; /** * Add a new rule to the catalog. * Returns the updated rule list. */ export declare function addRule(projectPath: string, rule: LearnedRule): Promise; /** * Update a rule in the catalog by ID. */ export declare function updateRule(projectPath: string, ruleId: string, updater: (rule: LearnedRule) => LearnedRule): Promise; /** * Get all promoted rules (ready to run in the formal verifier). */ export declare function getPromotedRules(projectPath: string): Promise; /** * Get all candidate rules (awaiting validation). */ export declare function getCandidateRules(projectPath: string): Promise; /** * Get rules by category. */ export declare function getRulesByCategory(projectPath: string, category: string): Promise; /** * Load catalog statistics. */ export declare function loadStats(projectPath: string): Promise;