/** * Incremental checking for faster CI runs. * * Compares current tool schemas against a baseline to determine which tools * need retesting. Tools with unchanged schemas can use cached results. */ import type { MCPTool } from '../transport/types.js'; import type { BehavioralBaseline, ToolFingerprint } from './types.js'; /** * Result of incremental analysis. */ export interface IncrementalCheckResult { /** Tools that need testing (new or changed schema) */ toolsToTest: string[]; /** Tools that can use cached results */ toolsToSkip: string[]; /** Tool fingerprints from baseline for skipped tools */ cachedFingerprints: ToolFingerprint[]; /** Summary of what changed */ changeSummary: IncrementalChangeSummary; } /** * Summary of changes detected during incremental analysis. */ export interface IncrementalChangeSummary { /** Number of new tools (not in baseline) */ newTools: number; /** Number of tools with changed schemas */ changedTools: number; /** Number of tools with unchanged schemas */ unchangedTools: number; /** Number of removed tools (in baseline but not current) */ removedTools: number; /** Names of new tools */ newToolNames: string[]; /** Names of changed tools */ changedToolNames: string[]; /** Names of removed tools */ removedToolNames: string[]; } /** * Options for incremental checking. */ export interface IncrementalCheckOptions { /** Force retest even if schema unchanged */ forceRetest?: boolean; /** Specific tools to always retest */ alwaysRetest?: string[]; /** Maximum age of cached results in hours (default: 168 = 1 week) */ maxCacheAgeHours?: number; } /** * Determine which tools need testing based on schema changes. * * Algorithm: * 1. Load previous baseline * 2. Compare current tool schemas to baseline inputSchemaHash * 3. Return list of tools that need testing (new or changed) * 4. Return cached fingerprints for unchanged tools * * @param currentTools - Current tools from discovery * @param baseline - Previous baseline to compare against * @param options - Incremental check options * @returns Analysis result with tools to test and cached data */ export declare function analyzeForIncremental(currentTools: MCPTool[], baseline: BehavioralBaseline | null, options?: IncrementalCheckOptions): IncrementalCheckResult; /** * Merge new test results with cached fingerprints to create a complete baseline. * * @param newFingerprints - Fingerprints from newly tested tools * @param cachedFingerprints - Fingerprints from skipped tools (cached) * @returns Combined fingerprints in deterministic order */ export declare function mergeFingerprints(newFingerprints: ToolFingerprint[], cachedFingerprints: ToolFingerprint[]): ToolFingerprint[]; /** * Format incremental check summary for display. * * @param summary - The incremental change summary * @returns Human-readable summary */ export declare function formatIncrementalSummary(summary: IncrementalChangeSummary): string; /** * Check if incremental mode can provide meaningful speedup. * * @param result - Incremental check result * @returns true if skipping tools provides >20% speedup */ export declare function isIncrementalWorthwhile(result: IncrementalCheckResult): boolean; /** * Update tool fingerprints with incremental metadata. * * @param fingerprint - Tool fingerprint to update * @param schemaHash - Current schema hash * @returns Updated fingerprint with lastTestedAt and inputSchemaHashAtTest */ export declare function addIncrementalMetadata(fingerprint: ToolFingerprint, schemaHash: string): ToolFingerprint; //# sourceMappingURL=incremental-checker.d.ts.map