/** * @fileoverview Change-journal reader — hash-chain verification * (SMI-5456 Wave 1 Step 3 / SMI-5470). * @module @skillsmith/core/journal/reader * * Never throws. The journal exists to be evidence (PRD §7 / §10 exclusion * 1); a reader that raises on the first bad byte can't produce that * evidence when it matters most (after a tamper or a crash mid-write). A * missing file is a valid, empty chain. A corrupt or tampered line is * reported via `breakAt` — the caller (e.g. `undo_apply`, or a future audit * surface) decides what to do with a break, but the reader never decides * for them by throwing. */ import type { JournalRecord } from './types.js'; export interface ChainVerificationResult { /** `true` iff every line parsed, chained, and hash-verified cleanly. */ valid: boolean; /** Records verified so far — the full chain when `valid` is `true`, or * every record BEFORE the break when `valid` is `false`. */ records: JournalRecord[]; /** 0-based line index of the first unparseable / malformed / tampered * record. Present iff `valid` is `false`. */ breakAt?: number; } /** * Verify the journal's hash chain line-by-line: each record's `prev_hash` * must equal the previous record's `record_hash` (or `JOURNAL_GENESIS_HASH` * for the first line), and each record's own `record_hash` must match a * fresh recomputation from its other fields (SMI-5456 §7 tamper signal). * * @param filePath - Override for tests; defaults to the resolved journal path. */ export declare function verifyJournalChain(filePath?: string): Promise; /** Convenience wrapper: the verified records, or as many as verified before * a break. Callers that need the break position should use * `verifyJournalChain` directly. */ export declare function readJournalRecords(filePath?: string): Promise; //# sourceMappingURL=reader.d.ts.map