/** * Promotion and update helpers for candidate-time visible conflict evidence. * * A conflict stores the full-row visible revision/hash observed when its user * candidate was detected. That evidence is the compare-and-set baseline the * resolver uses when it writes the canonical value back to User_Input, so a * later human edit produces a guard mismatch instead of a silent overwrite. * * Legacy conflicts created before the v6 migration have both columns absent * (NULL). They carry no usable CAS baseline and must stay unresolved until a * human resolves them on the Sync_Conflicts tab. */ import type { CandidateVisibleEvidence } from "../../../contracts/domain/model/types.js"; import type { Presence } from "../../../contracts/state/types.js"; /** Returns the unavailable evidence variant used by legacy and unread rows. */ export declare function unavailableCandidateVisibleEvidence(): CandidateVisibleEvidence; /** * Promotes raw stored evidence columns into the validated evidence union. * * Both columns absent means legacy/unavailable evidence. Both present must be a * valid non-negative revision and a non-empty string hash. A one-sided column, * an invalid or negative/non-integer revision, or an empty or non-string hash * is a storage-consistency failure: the row cannot be trusted as resolution * CAS input. The raw values are treated as unknown because SQLite is * dynamically typed and must never be assumed to hold the declared shape. */ export declare function promoteCandidateVisibleEvidence(rawRevision: unknown, rawHash: unknown, conflictId: string): CandidateVisibleEvidence; /** * Selects the newer full-row visible evidence when the same active candidate * is re-observed while another accepted field advances the row. * * Returns the new evidence when it is strictly newer than the stored evidence, * the stored evidence when they are identical, and throws on a revision * regression or a same-revision/different-hash inconsistency. Unavailable * (legacy) stored evidence stays unavailable: only fresh v6 conflicts persist * AVAILABLE evidence at creation, and only those may advance monotonically. * A later polling observation must never upgrade a legacy conflict into an * auto-resolvable baseline. */ export declare function advanceCandidateVisibleEvidence(current: CandidateVisibleEvidence, observedRevision: number, observedHash: string, conflictId: string): CandidateVisibleEvidence; /** Unwraps available evidence or returns null when it is unavailable. */ export declare function availableCandidateVisibleEvidence(evidence: CandidateVisibleEvidence): { readonly visibleRevision: number; readonly visibleHash: string; } | null; /** Converts a presence-wrapped evidence pair into the validated evidence union. */ export declare function presenceCandidateVisibleEvidence(revision: Presence, hash: Presence, conflictId: string): CandidateVisibleEvidence; //# sourceMappingURL=candidateEvidence.d.ts.map