/** * Datasync session (loop D.4): a bounded walk of a peer's flatsql-sync * cursor chain (`read_chunk` over the server's rowid-snapshot cursor — the * sdn_record_index rowid space, GROUND TRUTH: wire-stable for deployed * peers) that materializes every chunk into THE engine record store with * true provider/source/batch provenance. */ import type { FlatSQLEngineRecordStore, EngineSyncChunkIngestOptions } from './engine-record-store'; import type { FlatSqlSyncChunk, FlatSqlSyncQuery } from './flatsql-sync'; /** The transport surface a sync session drives (SDNNode satisfies it). */ export interface FlatSqlSyncChunkTransport { readFlatSqlSyncChunk(query: FlatSqlSyncQuery): Promise; } export interface FlatSqlSchemaSyncOptions extends EngineSyncChunkIngestOptions { /** Chunk budget for this session (bounded by design; default 32). */ maxChunks?: number; } /** Result of a bounded datasync session (loop D.4 `syncFlatSqlSchema`). */ export interface FlatSqlSchemaSyncSummary { schema: string; standardId: string; /** Chunks fetched from the peer this session. */ chunks: number; /** Record frames delivered by the peer (before dedupe). */ totalRecords: number; /** New engine rows materialized (idempotent replay ingests 0). */ ingestedRecords: number; /** New envelope index rows. */ indexedEnvelopes: number; /** Engine source partitions touched (true provider/source provenance). */ sources: string[]; snapshotId: string; head: string; highWaterMark: string; /** Resume cursor (rowid-snapshot space) — empty when the walk completed. */ nextCursor: string; complete: boolean; } /** * Walk `read_chunk` pages from `transport` and materialize each into * `store` (per-provider engine source partitions + envelope index rows + * ingested-keys dedupe — see FlatSQLEngineRecordStore.ingestSyncChunk). * Stops when the peer reports no next cursor, a chunk comes back empty, or * `maxChunks` is reached; the summary's `nextCursor` resumes the walk. */ export declare function syncFlatSqlSchemaIntoStore(transport: FlatSqlSyncChunkTransport, store: FlatSQLEngineRecordStore, query: FlatSqlSyncQuery, options?: FlatSqlSchemaSyncOptions): Promise; //# sourceMappingURL=datasync-session.d.ts.map