import type { AgentEventRecord, RunLedger, RunRecord, ToolCallRecord, UsageRecord } from "../contracts.js"; export interface RunLedgerConformanceFixture { readonly ledger: RunLedger; readonly readRuns?: () => Promise | readonly RunRecord[]; readonly readEvents?: () => Promise | readonly AgentEventRecord[]; readonly readToolCalls?: () => Promise | readonly ToolCallRecord[]; readonly readUsage?: () => Promise | readonly UsageRecord[]; } export interface RunLedgerConformanceOptions { readonly sessionId?: string; readonly runId?: string; readonly tenantId?: string; readonly accountId?: string; readonly userId?: string; /** When true, requires read* callbacks and asserts tenant-scoped rows do not leak. */ readonly exerciseTenantIsolation?: boolean; /** When true, factory is invoked twice to assert durable writes survive reopen. */ readonly exerciseReopen?: boolean; } export type RunLedgerConformanceFactory = () => RunLedgerConformanceFixture | Promise; /** * Assert that a `RunLedger` implementation satisfies the write contract: * all record kinds round-trip via optional read callbacks, per-run event order * is preserved, and tenant-scoped rows store `tenant_id` when * `exerciseTenantIsolation` is enabled. */ export declare function assertRunLedgerConforms(fixture: RunLedgerConformanceFixture, options?: RunLedgerConformanceOptions): Promise; /** * Factory-based conformance entry point for durable adapters. Invokes * `assertRunLedgerConforms` against a fresh fixture and optionally reopens via * the same factory to assert writes survive process/database reopen. */ export declare function runRunLedgerConformance(factory: RunLedgerConformanceFactory, options?: RunLedgerConformanceOptions): Promise;