import type { IndexDatabase } from '../db/database-facade.js'; import type { SyncResult } from './incremental-indexer.js'; /** * Enrichment strategy for the sync pipeline. * * - 'full': Clear + rebuild all layers (existing --force behavior) * - 'incremental': Process only dirty subsets at each layer * - 'none': No enrichment needed (no changes or no dirty entries) */ export type EnrichmentStrategy = 'full' | 'incremental' | 'none'; /** * Thresholds for deciding when to fall back from incremental to full rebuild. * All ratios are 0..1. */ export interface StrategyThresholds { /** Fall back to full rebuild if > this fraction of definitions changed (default 0.40) */ defsChangedRatio: number; /** Fall back to full rebuild if > this fraction of modules affected (default 0.60) */ modulesAffectedRatio: number; /** Fall back to full rebuild for interactions if > this fraction affected (default 0.70) */ interactionsAffectedRatio: number; } export declare const DEFAULT_THRESHOLDS: StrategyThresholds; export interface StrategyDecision { strategy: EnrichmentStrategy; reason: string; metrics: { totalDefinitions: number; changedDefinitions: number; changeRatio: number; totalModules: number; affectedModules: number; moduleRatio: number; totalInteractions: number; affectedInteractions: number; interactionRatio: number; }; } /** * Decide whether to use incremental or full enrichment based on change scope. * * Rules: * 1. No changes → 'none' * 2. No modules exist → 'full' (first enrichment must be full) * 3. Change ratio > threshold → 'full' (incremental overhead exceeds savings) * 4. Otherwise → 'incremental' */ export declare function selectStrategy(db: IndexDatabase, syncResult: SyncResult, thresholds?: StrategyThresholds): StrategyDecision; //# sourceMappingURL=sync-strategy.d.ts.map