/**
 * CheckpointController — snapshot lifecycle, GC, and coverage anchoring.
 *
 * Extracted from checkpoint.methods.js. WarpRuntime delegates to this
 * controller via defineProperty loops on the prototype.
 *
 * @module domain/services/controllers/CheckpointController
 */
import { type LoadedCheckpoint } from '../state/checkpointLoad.ts';
import { type WarpState } from '../JoinReducer.ts';
import type Patch from '../../types/Patch.ts';
import type GCExecuteResult from '../GCExecuteResult.ts';
import type { ProvenanceIndex } from '../provenance/ProvenanceIndex.ts';
import type WarpStateCachePort from '../../../ports/WarpStateCachePort.ts';
import type CodecPort from '../../../ports/CodecPort.ts';
import type CommitMessageCodecPort from '../../../ports/CommitMessageCodecPort.ts';
import type CryptoPort from '../../../ports/CryptoPort.ts';
import type LoggerPort from '../../../ports/LoggerPort.ts';
import type CheckpointStorePort from '../../../ports/CheckpointStorePort.ts';
import type StateHashService from '../state/StateHashService.ts';
import type MaterializedViewService from '../MaterializedViewService.ts';
import type GCPolicy from '../GCPolicy.ts';
type CheckpointFrontier = Pick<LoadedCheckpoint, 'schema' | 'frontier'>;
type CheckpointHost = {
    _graphName: string;
    _persistence: {
        readRef(ref: string): Promise<string | null>;
        updateRef(ref: string, oid: string): Promise<void>;
        commitNode(options: {
            message: string;
            parents: string[];
        }): Promise<string>;
        getNodeInfo(sha: string): Promise<{
            message: string;
        }>;
    };
    _cachedState: WarpState | null;
    _stateDirty: boolean;
    _checkpointing: boolean;
    _viewService: MaterializedViewService | null;
    _checkpointStore: CheckpointStorePort | null;
    _stateHashService: StateHashService | null;
    _provenanceIndex: ProvenanceIndex | null;
    _materializedGraph?: object | null;
    _logicalIndex?: object | null;
    _propertyReader?: object | null;
    _cachedIndexTree: Record<string, Uint8Array> | null;
    _codec: CodecPort;
    _commitMessageCodec: CommitMessageCodecPort;
    _crypto: CryptoPort;
    _logger: LoggerPort | null;
    _gcPolicy: GCPolicy;
    _patchesSinceGC: number;
    _lastGCLamport: number;
    _maxObservedLamport: number;
    _lastFrontier: Map<string, string> | null;
    _cachedViewHash: string | null;
    _stateCache: WarpStateCachePort | null;
    _readPatchBlob(patchMeta: ReturnType<CommitMessageCodecPort['decodePatch']>): Promise<Uint8Array>;
    discoverWriters(): Promise<string[]>;
};
export default class CheckpointController {
    _host: CheckpointHost;
    constructor(host: CheckpointHost);
    createCheckpoint(): Promise<string>;
    _readCheckpointSha(): Promise<string | null>;
    private _requireCheckpointReadingState;
    private _coordinateForCheckpoint;
    private _buildSnapshotRecord;
    private _computeStateHash;
    private _assertCheckpointCreatePersistence;
    private _assertLoadPersistence;
    syncCoverage(): Promise<void>;
    _loadLatestCheckpoint(): Promise<LoadedCheckpoint | null>;
    _loadPatchesSince(checkpoint: CheckpointFrontier): Promise<Array<{
        patch: Patch;
        sha: string;
    }>>;
    _validateMigrationBoundary(): Promise<void>;
    _hasSchema1Patches(): Promise<boolean>;
    _maybeRunGC(state: WarpState): void;
    maybeRunGC(): {
        ran: boolean;
        result: GCExecuteResult | null;
        reasons: string[];
    };
    runGC(): GCExecuteResult;
    private _installCompactedState;
    getGCMetrics(): {
        nodeCount: number;
        edgeCount: number;
        tombstoneCount: number;
        tombstoneRatio: number;
        patchesSinceCompaction: number;
        lastCompactionLamport: number;
    } | null;
}
export {};
