import type { DumpsRepo } from "./repo.js";
type JobCondition = {
    type?: string;
    status?: string;
    reason?: string;
};
type JobStatus = {
    active?: number;
    succeeded?: number;
    failed?: number;
    conditions?: JobCondition[];
};
export type ReconcileJobInput = {
    repo: DumpsRepo;
    dumpId: string;
    jobName: string;
    jobStatus: JobStatus;
    podPhase: string | null;
    now: Date;
    headSize: (s3Key: string) => Promise<number | null>;
    readPodLogs: (jobName: string) => Promise<string>;
};
/**
 * Translates a Job's observed state into row transitions on the
 * `database_dumps` table.
 *
 * - Idempotent: if the row is already in a terminal state (READY or
 *   FAILED), returns without touching it.
 * - Failure preferred over success: if both a Failed condition and a
 *   succeeded count are present (shouldn't happen, but be safe), we
 *   record the failure.
 * - Job condition `Complete=True` (or `succeeded > 0`) → READY. We
 *   then HEAD the s3 object to record `sizeBytes`; a missing object
 *   stores `0` rather than failing the row, so the user at least sees
 *   the dump is "done" — they can retry if download fails.
 * - Job condition `Failed=True` (or `failed > 0`) → FAILED. The error
 *   message is the last non-empty line of pod logs, or the Failed
 *   condition's reason as a fallback.
 */
export declare function reconcileJob(input: ReconcileJobInput): Promise<void>;
export {};
//# sourceMappingURL=watcher.d.ts.map