import type { BatchPhase } from '../batch/batch-progress-types.js'; import type { AutoCompactMode } from './auto-compact-modes.js'; /** Which rule decided the compaction point. */ export type BatchCompactionKind = 'silent' | 'ratio' | 'phase-boundary' | 'red-line'; /** * The decision, in the shape the caller acts on. * * `action` uses the same vocabulary as `evaluateAutoCompactDecision`, so a * caller that already handles that action handles this one. */ export interface BatchCompactionPoint { readonly kind: BatchCompactionKind; readonly shouldCompact: boolean; readonly action: 'ok' | 'soft-warn' | 'auto-compact-now' | 'red-line'; readonly ratio: number; /** Whether the batch is crossing one of the two compaction boundaries. */ readonly atBoundary: boolean; } /** * The two phase transitions that are a compaction boundary. * * ①→② is the diagnosis giving way to the topology, ③→④ the fix giving * way to the verification. The other two transitions (②→③, ④→done) are * not boundaries: neither of them is followed by a stage that reads the * stage before it back. * * @param fromPhase - The phase the batch was in. * @param toPhase - The phase the batch is in now. */ export declare function isBatchPhaseBoundary(fromPhase: BatchPhase, toPhase: BatchPhase): boolean; /** * Decide the batch's compaction point. * * @param input.ratio - The context ratio, 0..1. * @param input.fromPhase - The phase the batch was in. * @param input.toPhase - The phase the batch is in now; the same value as * `fromPhase` when no transition happened. * @param input.mode - The auto-compact mode; the thresholds come from it. */ export declare function decideBatchCompactionPoint(input: { readonly ratio: number; readonly fromPhase: BatchPhase; readonly toPhase: BatchPhase; readonly mode?: AutoCompactMode; }): BatchCompactionPoint;