/**
 * `access_log` cold-store adapter (Orchestrator side).
 *
 *
 * Contract:
 *   - tenant column: `org_id` (NULL → synthetic `__orchestrator__`)
 *   - partition column: `created_at`
 *   - warm TTL: 30 days (design §5 matrix row 11)
 *
 * Replaces the previous 90-day `expires_at`-based hard delete (removed
 * by migration 007). Rows older than 30 days now live in S3
 * indefinitely.
 *
 * Synthetic tenant: orchestrator-level access events (e.g. scheduler
 * tick failures, admin-triggered scheduled jobs) carry `org_id IS
 * NULL`; they collapse to the `__orchestrator__` synthetic prefix.
 *
 * Recursion: archiving access_log rows writes a new access_log row
 * recording the archive (one per chunk). The new row is itself
 * eligible for archive in a future cycle. Volume is bounded — one
 * audit row per ~50K-row chunk.
 */
import { type Kysely, type Selectable } from 'kysely';
import { type ChunkCommitMetadata, type ColdRetention, type ColdStoreTableConfig, type EligiblePartition, type TableAdapter } from '@kici-dev/shared';
import type { AccessLogTable, Database } from '../../db/types.js';
export type AccessLogColdStoreRow = Selectable<AccessLogTable>;
export interface AccessLogAdapterOptions {
    overrides?: Partial<ColdStoreTableConfig>;
}
export declare class AccessLogAdapter implements TableAdapter<AccessLogColdStoreRow> {
    private readonly kdb;
    private readonly instanceId;
    readonly db: "orchestrator";
    readonly table = "access_log";
    readonly tenantColumn = "org_id";
    readonly partitionColumn = "created_at";
    readonly config: ColdStoreTableConfig;
    constructor(kdb: Kysely<Database>, instanceId: string, opts?: AccessLogAdapterOptions);
    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<AccessLogColdStoreRow>;
    encodeRow(row: AccessLogColdStoreRow): string;
    decodeRow(line: string): AccessLogColdStoreRow;
    rowId(row: AccessLogColdStoreRow): string | number;
    rowTimestamp(row: AccessLogColdStoreRow): Date | string;
    /**
     * Phase 2 — per-row cold-retention TTL. Mirrors the warm-side override
     * layering: outcome=denied/error → 730d (forensic), platform_operator →
     * `'forever'` (compliance), otherwise per-action map. The framework
     * groups rows by `coldDaysToBucket(coldTtlDays(row))` at archive time.
     */
    coldTtlDays(row: AccessLogColdStoreRow): ColdRetention;
    markArchivedAndDelete(args: {
        rowIds: ReadonlyArray<string | number>;
        chunkMeta: ChunkCommitMetadata;
    }): Promise<void>;
    purgeChunkRecord(args: {
        tenantId: string;
        chunkId: string;
        gzipBytes: number;
        rowCount: number;
        bucket: string;
        maxColdDays: number;
        objectKey: string;
    }): Promise<void>;
}
//# sourceMappingURL=access-log.d.ts.map