/** * Synthesis Validator * * Validates LLM synthesis output against multiple sources of truth: * 1. Cross-source consensus - Do multiple sources agree? * 2. Regex vs LLM comparison - Does LLM match regex extraction? * 3. Temporal validation - Are dates reasonable? * 4. Numerical sanity checks - Are numbers in expected ranges? * * Returns validation results with adjusted confidence and flags. */ export interface ValidationIssue { field: string; type: 'consensus_mismatch' | 'regex_llm_conflict' | 'temporal_invalid' | 'numerical_outlier' | 'future_date'; severity: 'warning' | 'error'; message: string; llmValue: unknown; alternativeValue?: unknown; sources?: string[]; } export interface ValidationResult { isValid: boolean; adjustedConfidence: number; issues: ValidationIssue[]; /** Recommended data after validation (may differ from LLM output) */ validatedData: Record; /** Fields that should be treated as low confidence */ lowConfidenceFields: string[]; } export interface SourceExtraction { url: string; domain: string; authorityScore: number; extractedData?: Record; } export interface ValidationContext { /** Original research scope/query */ scope: string; /** Schema being extracted */ schema: Record; /** LLM synthesis output */ llmData: Record; /** LLM confidence score */ llmConfidence: number; /** Regex-extracted data (before LLM) */ regexData?: Record; /** Per-source extractions for consensus checking */ sourceExtractions: SourceExtraction[]; /** Current date for temporal validation */ currentDate?: Date; } /** * Validate LLM synthesis output */ export declare function validateSynthesis(context: ValidationContext): ValidationResult; //# sourceMappingURL=synthesis-validator.d.ts.map