/** * Durable, fenced storage mapping for trusted conflict-resolution commands. * * The pure core decides whether an acknowledgement is resolved, stale, or * rejected. This module records that decision with the command receipt, * clears only the currently active candidate pointer, and queues any * resolution projection effect in one SQLite transaction. */ import type { SyncConflict } from "../../../contracts/domain/model/types.js"; import type { LookupResult } from "../../../contracts/state/types.js"; import { type FencingContext, type NewEffect } from "@hikoutei/ikisaki"; import type { SqlExecutor, SqlStorageAdapter } from "../../../contracts/storage/sql.js"; import type { CommandRow, PersistResolutionCommandInput, PersistResolutionCommandResult } from "./resolutionWriterContracts.js"; export { PERSIST_RESOLUTION_RESULT_KINDS, RESOLUTION_COMMAND_STATUSES, } from "./resolutionWriterContracts.js"; export type { PersistResolutionCommandInput, PersistResolutionCommandResult, } from "./resolutionWriterContracts.js"; /** * Persists one trusted resolution command through an already-active async SQL * transaction. A command receipt, its conflict transition, and any effects * remain atomic with an ORM-managed user-entity mutation. */ export declare function persistResolutionCommandWithSql(sql: SqlExecutor, fence: FencingContext, input: PersistResolutionCommandInput): Promise; /** Persists one resolution command in an adapter-owned transaction. */ export declare function persistResolutionCommandWithAdapter(storage: SqlStorageAdapter, fence: FencingContext, input: PersistResolutionCommandInput): Promise; /** Reads conflict ids that carry a durable pending resolution command for one logical entity sheet. */ export declare function readPendingConflictIdsWithSql(sql: SqlExecutor, logicalSheetId: string): Promise; /** Reads every durable pending command targeting one conflict. */ export declare function readPendingCommandsForConflictWithSql(sql: SqlExecutor, conflictId: string): Promise; /** * Marks one durable pending command stale idempotently. * * Legacy automatic commands and obsolete revision generations are never * applied; staling is a no-op when the command already left the pending set. */ export declare function markPendingResolutionCommandStaleWithSql(sql: SqlExecutor, fence: FencingContext, commandId: string): Promise; /** * Stales every pending automatic command superseded by a newer resolution * identity. * * Only the newest planned automatic command for a conflict may remain pending; * older automatic generations are obsolete the moment a newer canonical * revision is planned. Manual or unknown pending commands are never consumed: * the SQL restricts supersession to the retired legacy * `sync:auto-system-wins` and current implicit `sync:system-wins` identities. */ export declare function staleSupersededPendingCommandsWithSql(sql: SqlExecutor, fence: FencingContext, conflictId: string, keepCommandId: string): Promise; /** * Rebases an unresolved conflict to the current canonical field state. * * The caller must have already verified the new revision strictly exceeds the * conflict's current canonical revision; the guarded UPDATE never downgrades * a resolved row. */ export declare function rebaseActiveConflictWithSql(sql: SqlExecutor, fence: FencingContext, input: { readonly conflictId: string; readonly currentCanonicalValue: import("../../../contracts/encoding/types.js").NormalizedCell; readonly currentCanonicalRevision: number; readonly lastRebasedCommitId: string; readonly updatedAt: number; }): Promise; /** Reads and validates one conflict record through the active async SQL transaction. */ export declare function readConflictWithSql(sql: SqlExecutor, logicalSheetId: string, conflictId: string): Promise>; /** Registers unseen resolution effects through the active async SQL transaction. */ export declare function appendResolutionEffectsWithSql(sql: SqlExecutor, fence: FencingContext, effects: readonly NewEffect[]): Promise; //# sourceMappingURL=resolutionWriter.d.ts.map