import type { AdapterObservation } from '../types.js'; import { type BatchStoreLifecycleBinding, type BatchStoreRestoreReport } from './protection.js'; import type { DecisionBatchReceipt } from './types.js'; export interface BatchResultSnapshot { schemaVersion: 'decision-batch-result/v1'; tenantId: string; projectId: string; batchId: string; receiptRevision: number; questionId: string; answerId: string; resultId: string; observation: AdapterObservation; createdAtEpochMs: number; } export interface BatchResultStore { writeMany(receipt: DecisionBatchReceipt, observations: ReadonlyMap): Promise; readMany(receipt: DecisionBatchReceipt): Promise>; } export declare class MemoryBatchResultStore implements BatchResultStore { private readonly records; writeMany(receipt: DecisionBatchReceipt, observations: ReadonlyMap): Promise; readMany(receipt: DecisionBatchReceipt): Promise>; } export interface FileBatchResultStoreOptions extends BatchStoreLifecycleBinding { /** HMAC-SHA256 key of at least 32 bytes sealing every snapshot envelope. */ integrityKey: Uint8Array; /** Logical name of the AES-256 key new snapshots are encrypted with. Never key material. */ encryptionKeyReference: string; /** Host key resolver. It must return exactly 32 bytes; the store zeroes its copy after each use. */ resolveEncryptionKey: (reference: string) => Promise; } /** * Snapshot values are encrypted with AES-256-GCM. The AAD binds tenant, project, batch, question, * answer and receipt revision, so a snapshot moved to any other scope fails authentication. */ export declare class FileBatchResultStore implements BatchResultStore { private readonly directory; private readonly options; private readonly key; private readonly rule; private readonly clock; constructor(directory: string, options: FileBatchResultStoreOptions); writeMany(receipt: DecisionBatchReceipt, observations: ReadonlyMap): Promise; /** Erased, expired and missing snapshots all return an empty map. A verification failure throws. */ readMany(receipt: DecisionBatchReceipt): Promise>; /** Cascade target of batch receipt erasure: a body-free tombstone, then every snapshot body is removed. */ eraseBatch(batchId: string, tenantId: string, projectId: string): Promise; /** Restore sealed snapshots from a backup copy, refusing erased batches, expired values and unverifiable files. */ restoreFrom(backupDirectory: string): Promise; /** * Explicit, authorized upgrade of plaintext snapshots written before encryption. Every legacy * file is validated before authorization; each is sealed and encrypted, then the plaintext is removed. */ migrateLegacy(authorize: (summary: { results: number; }) => Promise): Promise<{ migrated: number; }>; private batchPrefix; private sealedName; private tombstonePath; private ensurePrivateDirectory; private resolveKey; private publish; private envelope; private decrypt; } //# sourceMappingURL=result-store.d.ts.map