/** * ValueGate — LLM-based knowledge value assessment (FR-N04). * * Evaluates whether a knowledge entry fills a gap in LLM's native capabilities. * High-value: jargon, badcases, domain-specific rules, easy-to-forget constraints, * complex intents, user shorthand. * Low-value: general common sense, things LLM already knows well. * * Also used at injection time (FR-E05 AC6) to filter out entries that don't * add value for the current query context. */ import type { ValueGateThresholds } from '../config/types.js'; export type ValueCategory = 'jargon' | 'badcase' | 'domain_rule' | 'constraint' | 'complex_intent' | 'user_shorthand' | 'common_knowledge' | 'llm_native'; export interface ValueAssessment { /** Whether this knowledge is high-value (fills LLM blind spot) */ isHighValue: boolean; /** Assessed category */ category: ValueCategory; /** Confidence of the assessment (0-1) */ confidence: number; /** Brief reasoning from LLM */ reasoning: string; /** Value dimensions evaluated */ dimensions: { /** Is this private/proprietary knowledge? */ privacy: number; /** Is this specific to a particular scenario? */ scenarioSpecificity: number; /** Does this address a known LLM weakness? */ llmBlindSpot: number; /** Will it still be useful one month later? */ timeliness: number; /** Does it transfer to different projects/scenarios? */ crossScenario: number; /** Does it retain guidance after removing concrete context? */ abstractness: number; }; /** When true, the assessment failed due to LLM unavailability and should be retried */ requiresRetry?: boolean; } export interface InjectionValueAssessment { /** Whether this entry should be injected for the given query */ shouldInject: boolean; /** Reasoning */ reasoning: string; } export interface QualityDimensions { atomicity: number; completeness: number; unambiguity: number; verifiability: number; timeliness: number; crossScenario: number; abstractness: number; uniqueness: number; consistency: number; } export interface QualityAssessment { dimensions: QualityDimensions; overallScore: number; passesGate: boolean; failedDimensions: string[]; } /** * Load valueGate thresholds from kivo.config.json in cwd. * Re-reads the file on every call to support runtime hot-update (FR-N04 AC5). * Falls back to DEFAULT_VALUE_GATE_THRESHOLDS when config is absent or malformed. */ export declare function loadValueGateThresholds(configDir?: string): Required; /** * Assess the value of a knowledge entry for ingest (FR-N04 AC1-AC4, AC6). * Returns whether the entry is high-value and its category. * Reads thresholds from kivo.config.json on every call (hot-reload, FR-N04 AC5). */ export declare function assessIngestValue(title: string, content: string, configDir?: string): Promise; /** * Assess whether a matched entry should be injected for a given query (FR-E05 AC6). * Filters out common knowledge that LLM already knows, even if semantic similarity is high. */ export declare function assessInjectionValue(query: string, entryTitle: string, entryContent: string): Promise; /** * Batch assess multiple entries (for audit-value CLI). * Returns assessments in the same order as input entries. * Passes configDir through for threshold hot-reload. */ export declare function batchAssessValue(entries: Array<{ id: string; title: string; content: string; }>, configDir?: string): Promise>; /** * Assess quality dimensions of a knowledge entry (FR-N05 Enhancement). * * Evaluates atomicity, completeness, unambiguity, verifiability, timeliness * alongside the existing value dimensions (privacy, scenarioSpecificity, llmBlindSpot) * in a single LLM call. * * Returns both a QualityAssessment and a ValueAssessment for backward compatibility. * When LLM is unavailable, degrades to metadata-only validation with all dimensions at 0.5. */ export declare function assessQualityDimensions(title: string, content: string, configDir?: string): Promise<{ quality: QualityAssessment; value: ValueAssessment; }>; //# sourceMappingURL=value-gate.d.ts.map