export declare const RECONCILE_CURSOR_FORMAT = 1; export type ReconcilePhase = "local-discovery" | "remote-list" | "diff" | "apply"; export type ReconcileCursor = { routerVersion: number; epoch: string; areaId: string; phase: ReconcilePhase; localDirectoryStack?: readonly string[]; localAfterPath?: string; remotePrefix?: string; remoteContinuation?: string; journalAfterKey?: string; remoteHighWater?: string; }; export type ReconcileCursorState = { format: typeof RECONCILE_CURSOR_FORMAT; cursor?: ReconcileCursor; completedEpoch?: string; }; export type ReconcileCursorStoreOptions = { rootDir: string; journalSlug: string; layoutEpoch: number; areaId: string; initialCursor?: ReconcileCursor; }; export type ReconcilePathOutcome = { path: string; /** True only after the journal/ledger outcome for this path is durable. */ durable: boolean; }; /** Passed by a bounded apply caller after its journal/ledger writes commit. */ export type ReconcileApplyCheckpoint = { store: ReconcileCursorStore; cursor: ReconcileCursor; }; export type ReconcileSliceBudget = { /** Rollout default from the parallel-sync design. */ maxEntries?: number; /** Bound candidate buffering independently of entry count. */ maxBytes?: number; /** CPU wall-clock budget before returning to the scheduler mailbox. */ maxWallClockMs?: number; }; export type ReconcileSliceEntry = { path: string; bytes: number; }; export type ReconcileSliceResult = { entries: readonly T[]; bytes: number; yielded: boolean; cancelled: boolean; /** One look-ahead candidate retained for the next slice; never dropped. */ deferred?: T; }; /** * StateStore-backed cursor for exactly one area. Independent areas use * independent StateStore scopes, so checkpointing a slow area never holds a * mutation lock for another area. */ export declare class ReconcileCursorStore { private readonly store; readonly areaId: string; private constructor(); static open(options: ReconcileCursorStoreOptions): ReconcileCursorStore; read(): ReconcileCursorState; /** Persist a discovery/list/diff checkpoint; it intentionally owns no path lease. */ checkpointDiscovery(cursor: ReconcileCursor): void; /** * Persist an apply checkpoint only after every path in the slice has a * durable outcome. The ordering is enforced at the API boundary so callers * cannot accidentally save progress before journal/ledger commits. */ checkpointApply(cursor: ReconcileCursor, outcomes: readonly ReconcilePathOutcome[]): void; /** A completed area is never rediscovered when the same epoch restarts. */ complete(epoch: string): void; /** * A remote LIST continuation is valid only for the remote high-water that * produced it. A changed high-water restarts remote listing, rather than * accepting a continuation from an invalidated inventory. */ invalidateRemoteContinuation(epoch: string, remoteHighWater?: string): ReconcileCursor | undefined; } /** * Pull no more than one scheduler slice from an iterable inventory. The * iterable is consumed lazily; callers can feed a 562k-file generator without * turning it into an array. An over-budget first entry still runs so a single * large file cannot livelock the cursor. */ export declare function takeBoundedReconcileSlice(entries: Iterable, options?: ReconcileSliceBudget & { now?: () => number; isCancelled?: () => boolean; }): ReconcileSliceResult; /** Advance an apply cursor only after the caller's path outcomes are durable. */ export declare function checkpointReconcileApply(checkpoint: ReconcileApplyCheckpoint | undefined, paths: Iterable): void; //# sourceMappingURL=reconcile-cursor.d.ts.map