import type { LLMProvider } from '../adapter/llm-provider.js'; import { Classifier } from '../pipeline/classifier.js'; import type { KnowledgeEntry, KnowledgeSource } from '../types/index.js'; export type RulePriority = 'low' | 'medium' | 'high' | 'critical'; export interface RuleEntry { id: string; scene: string; directive: string; priority: RulePriority; source: KnowledgeSource; confidence: number; tags: string[]; createdAt: Date; updatedAt: Date; } export type RuleLLMProvider = LLMProvider; export interface RuleExtractorOptions { llmProvider?: RuleLLMProvider; classifier?: Classifier; minConfidence?: number; } export interface RuleChangeEvent { type: 'added' | 'modified' | 'removed'; rule: RuleEntry; previousRule?: RuleEntry; } export interface RuleConflict { ruleA: RuleEntry; ruleB: RuleEntry; reason: string; } export declare class RuleExtractor { private readonly llmProvider?; private readonly classifier; private readonly minConfidence; constructor(options?: RuleExtractorOptions); extract(text: string, source: KnowledgeSource): Promise; toKnowledgeEntries(rules: RuleEntry[]): KnowledgeEntry[]; /** * Heuristic fallback extraction — LLM extraction preferred. * Used only when llmProvider is not configured. * Confidence is capped at 0.4 to reflect lower reliability vs LLM. */ private extractHeuristically; private toRuleEntry; private inferScene; private inferPriority; /** * Heuristic fallback: infer confidence from text pattern. * When used without LLM, confidence is capped at 0.4 to reflect lower reliability. * LLM extraction preferred — this is a heuristic fallback path. */ private inferConfidence; /** * FR-A03 AC2: Detect changes between old and new rule sets. * Compares by scene+directive to identify added, modified, and removed rules. */ detectChanges(oldRules: RuleEntry[], newRules: RuleEntry[]): RuleChangeEvent[]; /** * FR-A03 AC3: Detect conflicts and override relationships between rules. * Two rules conflict if they apply to the same scene but have contradictory directives. */ detectConflicts(rules: RuleEntry[]): RuleConflict[]; } //# sourceMappingURL=rule-extractor.d.ts.map