/** * ImmutableLedger - Tamper-Evident Session Logging for EU AI Act Compliance * * Extends VSIL with persistent Merkle tree-based audit trail. * Each event is hashed and added to a Merkle tree per session. * Supports inclusion proofs for audit verification. * * EU AI Act Art. 12 (Traceability) & Art. 19 (Transparency obligations) */ import { SessionLedger, type HashedEntity, type SessionRiskSummary, type ThreatAnnotation } from '../security/session-ledger.js'; export interface LedgerEvent { request_id: string; session_id: string; timestamp: string; url?: string; original_hash: string; sanitization_steps: string[]; threats_detected: { pattern_id: string; severity: string; snippet_hash: string; }[]; pii_redacted_count: number; pii_types: string[]; cleaned_hash: string; visus_proof: string; human_review_flag: boolean; human_reviewer_id?: string; model_output_hash?: string; tool_name?: string; entities?: HashedEntity[]; risk_summary?: SessionRiskSummary; new_threats?: ThreatAnnotation[]; } export interface InclusionProof { leaf: string; siblings: string[]; path: number[]; root: string; } export declare class ImmutableLedger extends SessionLedger { private trees; private ledger_path; private enabled; private merkle_algo; private retention_months; constructor(); private sha256; private getOrCreateTree; addEvent(sessionId: string, event: Omit & { url?: string; tool_name?: string; }): Promise<{ merkle_root: string; proof: InclusionProof; }>; getProof(requestId: string): Promise; verifyProof(proof: InclusionProof, eventData: LedgerEvent): Promise; purgeOldLedgers(): Promise; startRetentionSweep(intervalMs?: number): void; } export default ImmutableLedger; /** * Export Ledger Events for Compliance/Audit * @param sessionId - Session to export * @param outputPath - File path for JSONL export * @returns Promise with exported file path and stats */ export declare function exportLedger(sessionId: string, outputPath?: string): Promise<{ file: string; eventCount: number; merkleRoots: string[]; }>; //# sourceMappingURL=ImmutableLedger.d.ts.map