/**
 * `execution_jobs` cold-store adapter (Orchestrator side).
 *
 *
 * Contract:
 *   - tenant column: `routing_key` (denormalized in migration 006)
 *   - partition column: `created_at`
 *   - warm TTL: 30 days (design §5 matrix row 8)
 *   - eligibility: terminal job status AND no live steps remain for this
 *     (run, job)
 *
 * Order: registered AFTER `ExecutionStepsAdapter`, BEFORE
 * `ExecutionRunsAdapter` (within one cycle: steps → jobs → runs). The
 * "no live steps" predicate makes the ordering self-correcting across
 * cycle interruptions.
 *
 * FK ordering on the orchestrator side: `execution_jobs.run_id` is a
 * FK to `execution_runs(run_id)`. Deleting a job is safe from the FK's
 * perspective (the FK only constrains job → run direction). The runs
 * adapter's eligibility predicate handles the dependent-rows check.
 */
import { type Kysely, type Selectable } from 'kysely';
import { type ChunkCommitMetadata, type ColdStoreTableConfig, type EligiblePartition, type TableAdapter } from '@kici-dev/shared';
import type { Database, ExecutionJobTable } from '../../db/types.js';
export type ExecutionJobRow = Selectable<ExecutionJobTable>;
export interface ExecutionJobsAdapterOptions {
    overrides?: Partial<ColdStoreTableConfig>;
}
export declare class ExecutionJobsAdapter implements TableAdapter<ExecutionJobRow> {
    private readonly kdb;
    private readonly instanceId;
    readonly db: "orchestrator";
    readonly table = "execution_jobs";
    readonly tenantColumn = "routing_key";
    readonly partitionColumn = "created_at";
    readonly config: ColdStoreTableConfig;
    constructor(kdb: Kysely<Database>, instanceId: string, opts?: ExecutionJobsAdapterOptions);
    listEligiblePartitions(args: {
        warmCutoff: Date;
    }): AsyncIterable<EligiblePartition>;
    countTenantWarmBytes(args: {
        tenantId: string;
        warmCutoff: Date;
    }): Promise<number>;
    withPartitionLock<T>(args: {
        tenantId: string;
        partitionDate: string;
    }, fn: () => Promise<T>): Promise<T | null>;
    selectEligible(args: {
        tenantId: string;
        partitionDate: string;
        limit: number;
    }): AsyncIterable<ExecutionJobRow>;
    encodeRow(row: ExecutionJobRow): string;
    decodeRow(line: string): ExecutionJobRow;
    rowId(row: ExecutionJobRow): string | number;
    rowTimestamp(row: ExecutionJobRow): Date | string;
    markArchivedAndDelete(args: {
        rowIds: ReadonlyArray<string | number>;
        chunkMeta: ChunkCommitMetadata;
    }): Promise<void>;
}
//# sourceMappingURL=execution-jobs.d.ts.map