/** * Inbound User_Input polling report and cell-validation contracts. * * Extracted verbatim from the MikroORM adapter's observation modules (P8-C): * the internal sync service (supervisor options, shutdown, option * validation) and the existing-sheet adoption seeding both consume the * polling report shape and the exact cell-kind gate, so the report surface * and the pure cell validation live in the contracts leaf while the adapter * keeps the polling engine. The adapter modules re-export these declarations * so existing adapter-internal and test import paths stay valid. */ import type { SyncSnapshotCell } from "./syncSheets.js"; import type { TypedSheetsEntityFieldMapping } from "../sync-orm/mapping/contracts.js"; /** Closed set of inbound polling modes. */ export declare const MAPPED_USER_INPUT_POLL_MODES: { readonly FULL: "full"; readonly ADAPTIVE: "adaptive"; }; export type MappedUserInputPollingMode = (typeof MAPPED_USER_INPUT_POLL_MODES)[keyof typeof MAPPED_USER_INPUT_POLL_MODES]; /** Per-projection result of one polling pass. */ export interface MappedUserInputPollingSheetReport { readonly physicalSheetId: string; readonly logicalSheetId: string; readonly rowsScanned: number; readonly changedRows: number; readonly appliedRows: number; readonly conflictRows: number; readonly quarantinedRows: number; readonly duplicateRows: number; readonly staleRows: number; readonly fencedRows: number; readonly invalidRows: number; readonly unknownBusinessKeyRows: number; readonly duplicateBusinessKeyRows: number; } /** Aggregate result for one inbound polling pass. */ export interface MappedUserInputPollingReport { readonly elapsedMs: number; readonly mode: MappedUserInputPollingMode; readonly safetyFullScan: boolean; /** * How far past the configured full-scan deadline this safety scan started, in * milliseconds. Zero before the first completed scan, on adaptive passes, and * for direct calls without coordinator cadence state. Diagnostic only. */ readonly safetyScanLagMs: number; readonly fullMetadataTables: number; readonly fastPathRowsScanned: number; readonly fastPathChangedRows: number; readonly sheets: readonly MappedUserInputPollingSheetReport[]; readonly rowsScanned: number; readonly changedRows: number; readonly appliedRows: number; readonly conflictRows: number; readonly quarantinedRows: number; readonly duplicateRows: number; readonly staleRows: number; readonly fencedRows: number; readonly invalidRows: number; readonly unknownBusinessKeyRows: number; readonly duplicateBusinessKeyRows: number; } /** Stable quarantine reasons for one observed User_Input cell/row. */ export declare const MAPPED_USER_INPUT_INVALID_REASONS: { readonly UNKNOWN_BUSINESS_KEY: "unknown_business_key"; readonly DUPLICATE_BUSINESS_KEY: "duplicate_business_key"; readonly NON_LITERAL_CELL: "non_literal_cell"; readonly FORMULA_CELL: "formula_cell"; readonly MERGED_CELL: "merged_cell"; readonly ERROR_CELL: "error_cell"; readonly MISSING_CELL: "missing_cell"; readonly INVALID_CELL: "invalid_cell"; readonly MISSING_CANONICAL_STATE: "missing_canonical_state"; readonly MISSING_VISIBLE_STATE: "missing_visible_state"; readonly PRIMARY_KEY_MUTATION: "primary_key_mutation"; }; export type MappedUserInputInvalidReason = (typeof MAPPED_USER_INPUT_INVALID_REASONS)[keyof typeof MAPPED_USER_INPUT_INVALID_REASONS]; /** * Cell-kind gate for one observed User_Input cell against its declared field * contract. Pure: cell mapping + field contract in, quarantine reason out. * * The polling pipeline quarantines every observed cell whose kind violates * the mapping's declared field contract; adoption seeding applies the EXACT * same gate before any SQLite state is written, so both sides share this one * implementation (P8-C extraction). */ export declare function validateSnapshotCell(field: TypedSheetsEntityFieldMapping, cell: SyncSnapshotCell | undefined): MappedUserInputInvalidReason | undefined; //# sourceMappingURL=userInputPolling.d.ts.map