import { type ChainHead } from "../audit/HashChain.js"; export type ChainFindingCode = "CHAIN_LINE_INVALID" | "CHAIN_HASH_MISMATCH" | "CHAIN_SEQ_GAP" | "CHAIN_PREV_MISMATCH"; export interface ChainFinding { readonly code: ChainFindingCode; /** One-based position in the input. */ readonly line: number; readonly stream: string | null; /** The hosted tenant whose chain it is, when the line names one. */ readonly tenant?: string; readonly seq: number | null; readonly expected?: string | number; readonly found?: string | number; } export interface StreamSummary { readonly lines: number; readonly head: ChainHead; /** Lines that began a chain from genesis: one per process start without a checkpoint. */ readonly starts: number; } export interface ChainVerification { readonly ok: boolean; readonly lines: number; /** Lines that belong to no chain, such as the process's own start-up lines. */ readonly ignored: number; /** By stream, or by `tenant/stream` for a hosted tenant's chain. */ readonly streams: Readonly>; readonly findings: readonly ChainFinding[]; } /** * Walks the lines of one or more chained streams and reports every break: * a line that is not one, a hash that does not match its fields, a sequence * that skips or rewinds, a `prev_hash` that is not the previous line's hash. * A line that names a `tenant` belongs to that tenant's chain of its stream, * so one hosted process's output, holding many tenants' chains, verifies whole. * A line with no `stream` field belongs to no chain and is counted as * ignored. A fresh start from genesis is a restart, not a break, and is * counted, so a reader can compare it with the process's restarts. Anyone * holding the lines can run this; it needs no key and no service. */ export declare function verifyAuditChain(lines: Iterable): ChainVerification; //# sourceMappingURL=VerifyAuditChain.d.ts.map