/** * Forgen Meta-Learning — Shared Types * * HyperAgents-inspired self-tuning layer above the compound system. * All types consumed by the meta-learning runner and its sub-modules. */ export interface SessionQualityScore { sessionId: string; /** corrections per prompt in this session */ correctionRate: number; /** final EWMA drift score (0-100) */ driftScore: number; /** total reverts detected */ revertCount: number; /** reflected / injected ratio (0-1, NaN → 0 if no injections) */ solutionEffectiveness: number; /** composite score 0-100 (higher = better) */ overallScore: number; /** which solutions were injected this session */ injectedSolutions: string[]; computedAt: string; } export interface MatcherWeights { tfidf: number; bm25: number; bigram: number; updatedAt: string; /** how many solutions informed this tuning */ sampleSize: number; /** monotonic version for rollback detection */ version: number; /** original defaults for fallback */ defaults: { tfidf: number; bm25: number; bigram: number; }; } export interface PromotionThresholds { reflected: number; sessions: number; reExtracted: number; } export interface AdaptiveLifecycleThresholds { experiment: PromotionThresholds; candidate: PromotionThresholds; verified: PromotionThresholds & { negative: number; }; /** solutions per week */ learningVelocity: number; updatedAt: string; sampleSize: number; defaults: { experiment: PromotionThresholds; candidate: PromotionThresholds; verified: PromotionThresholds & { negative: number; }; }; } export interface ExtractionBias { typeWeights: Record; updatedAt: string; sampleSize: number; } export interface ProjectUsageEntry { projects: string[]; updatedAt: string; } export interface ProjectUsageMap { solutions: Record; } export interface MetaLearningFeatures { sessionQualityScorer: boolean; matcherWeightTuning: boolean; scopeAutoPromotion: boolean; adaptiveThresholds: boolean; extractionTuning: boolean; } export interface ColdStartConfig { minSessionsForQuality: number; minSolutionsForMatcher: number; minSolutionsForThresholds: number; minSolutionsForExtraction: number; minProjectsForScope: number; } export interface GuardrailConfig { weightFloor: number; weightCeiling: number; maxWeightDelta: number; thresholdFloor: number; thresholdCeiling: number; maxThresholdDelta: number; degradationThreshold: number; } export interface MetaLearningConfig { enabled: boolean; features: MetaLearningFeatures; coldStart: ColdStartConfig; guardrails: GuardrailConfig; } export interface MetaLearningResult { skipped?: boolean; reason?: string; qualityScore?: SessionQualityScore | null; matcherWeights?: MatcherWeights | null; scopePromotions?: string[]; thresholds?: AdaptiveLifecycleThresholds | null; extractionBias?: ExtractionBias | null; } export declare const DEFAULT_CONFIG: MetaLearningConfig; export declare const DEFAULT_MATCHER_WEIGHTS: MatcherWeights['defaults']; export declare const DEFAULT_PROMOTION_THRESHOLDS: AdaptiveLifecycleThresholds['defaults'];