/** * Agentic QE v3 - Diff Risk Classifier for RuVector Integration * * Uses RuVector's ML capabilities to classify risk in code changes. * Falls back to rule-based classification when RuVector is unavailable. */ import type { DiffRiskClassifier, RiskClassification, DiffContext, FileChange, RuVectorConfig } from './interfaces'; import type { Severity } from '../../shared/types'; /** * Pattern definitions for risk classification */ export interface RiskPatterns { /** High-risk code patterns (security, auth, etc.) */ highRisk: RegExp[]; /** Sensitive file patterns */ sensitiveFiles: RegExp[]; /** Critical path patterns */ criticalPaths: RegExp[]; /** Architectural boundary patterns */ boundaryPatterns: RegExp[]; } /** * Diff risk classifier that integrates with RuVector * Provides ML-enhanced risk classification for code changes */ export declare class RuVectorDiffRiskClassifier implements DiffRiskClassifier { private readonly config; private readonly fallback; private readonly patterns; private readonly cache; constructor(config: RuVectorConfig, patterns?: Partial); /** * Classify risk of a diff/changeset */ classifyDiff(context: DiffContext): Promise; /** * Get files sorted by risk */ rankFilesByRisk(files: FileChange[]): Promise>; /** * Check if change requires security review */ requiresSecurityReview(context: DiffContext): Promise; /** * Get recommended reviewers based on risk */ getRecommendedReviewers(context: DiffContext): Promise; /** * Predict potential defects in change */ predictDefects(context: DiffContext): Promise>; /** * Perform risk classification */ private performClassification; /** * Calculate change size risk factor */ private calculateChangeSizeFactor; /** * Calculate security-sensitive code factor */ private calculateSecurityFactor; /** * Calculate critical path factor */ private calculateCriticalPathFactor; /** * Calculate API boundary factor */ private calculateBoundaryFactor; /** * Calculate file diversity factor */ private calculateDiversityFactor; /** * Calculate deletion factor */ private calculateDeletionFactor; /** * Calculate risk score for a single file */ private calculateFileRisk; /** * Identify high-risk files */ private identifyHighRiskFiles; /** * Convert score to risk level */ private scoreToLevel; /** * Generate test recommendations */ private generateTestRecommendations; /** * Predict defect type based on file and risk score */ private predictDefectType; /** * Estimate defect location in file */ private estimateDefectLocation; /** * Identify domains touched by changes */ private identifyDomains; /** * Compute cache key for context */ private computeCacheKey; } /** * Create diff risk classifier with optional RuVector integration */ export declare function createDiffRiskClassifier(config: RuVectorConfig, patterns?: Partial): DiffRiskClassifier; //# sourceMappingURL=diff-risk-classifier.d.ts.map