/** * Transcript Verifier * * Verifies transcript integrity, signature validity, and consistency. * Supports both local verification and Sigstore validation. * * @module transcripts/verifier */ import type { TranscriptBundle } from "./signing.js"; import type { TranscriptEntry } from "./logger.js"; /** * Verification result for a single check */ export interface VerificationCheck { name: string; passed: boolean; message: string; details?: Record; } /** * Complete verification result */ export interface TranscriptVerificationResult { /** Overall verification status */ valid: boolean; /** Bundle being verified */ bundlePath?: string; /** Session ID from transcript */ sessionId: string; /** Individual verification checks */ checks: VerificationCheck[]; /** Summary of passed/failed checks */ summary: { total: number; passed: number; failed: number; warnings: number; }; /** Timestamp of verification */ verifiedAt: string; /** Error if verification failed catastrophically */ error?: string; } /** * Chain verification result */ export interface ChainVerificationResult { valid: boolean; entryCount: number; brokenAt?: number; expectedHash?: string; actualHash?: string; message: string; } /** * Signature verification result */ export interface SignatureVerificationResult { valid: boolean; signed: boolean; signedAt?: string; certificate?: string; rekorLogId?: string; message: string; } /** * Verification options */ export interface VerificationOptions { /** Verify Sigstore signature (requires network) */ verifySignature?: boolean; /** Check timestamp ordering */ checkTimestamps?: boolean; /** Verify model ID consistency */ checkModelConsistency?: boolean; /** Verify provenance statement */ checkProvenance?: boolean; /** Expected session ID (optional) */ expectedSessionId?: string; /** Maximum allowed time gap between entries (ms) */ maxTimeGap?: number; } /** * Verify Merkle chain integrity of transcript entries */ export declare function verifyMerkleChain(entries: TranscriptEntry[], rootHash: string, tipHash: string): ChainVerificationResult; /** * Verify timestamp ordering */ export declare function verifyTimestampOrdering(entries: TranscriptEntry[], maxGap?: number): VerificationCheck; /** * Verify model ID consistency */ export declare function verifyModelConsistency(entries: TranscriptEntry[]): VerificationCheck; /** * Verify Sigstore signature */ export declare function verifySignature(bundle: TranscriptBundle): Promise; /** * Verify provenance statement consistency */ export declare function verifyProvenance(bundle: TranscriptBundle): VerificationCheck; /** * Verify a transcript bundle */ export declare function verifyTranscriptBundle(bundle: TranscriptBundle, entries?: TranscriptEntry[], options?: VerificationOptions): Promise; /** * Load and verify a transcript bundle from file */ export declare function verifyTranscriptFile(bundlePath: string, entriesPath?: string, options?: VerificationOptions): Promise; /** * Verify multiple transcript bundles */ export declare function verifyTranscriptBatch(bundles: Array<{ bundle: TranscriptBundle; entries?: TranscriptEntry[]; }>, options?: VerificationOptions): Promise<{ results: TranscriptVerificationResult[]; summary: { total: number; valid: number; invalid: number; }; }>; /** * Generate verification report */ export declare function generateVerificationReport(result: TranscriptVerificationResult): string; /** * Quick integrity check (chain only) */ export declare function quickIntegrityCheck(entries: TranscriptEntry[], rootHash: string, tipHash: string): boolean; //# sourceMappingURL=verifier.d.ts.map