/** * Governance ledger — CLI port of the pure hashing core. * * MUST stay byte-identical to lib/governance/ledger-service.ts (repo root). * The shared golden vectors (src/__tests__/golden-vectors.test.ts) enforce * this: if the two implementations ever diverge, the build fails * (CONSTITUTION.md → Ledger Invariants). */ export declare const GENESIS_PREV_HASH = "GENESIS"; export type LedgerEventType = 'genesis' | 'propose' | 'approve' | 'reject' | 'commit' | 'supersede' | 'policy_change' | 'deletion'; export interface LedgerRow { project_id: string; seq: number; prev_hash: string; entry_hash: string; event_type: string; pillar: string | null; ref_table: string | null; ref_id: string | null; author_user: string | null; author_agent: string | null; ts: string; payload_jcs: string; content_hash: string; } /** * RFC 8785 canonical JSON. The canonicalize package silently DROPS * non-JSON values (functions, undefined, symbols) the way JSON.stringify * does — unacceptable for a ledger preimage, so we reject them explicitly. */ export declare function canonicalizePayload(payload: Record): string; export declare function sha256Hex(text: string): string; export declare function computeContentHash(payload: Record): string; export interface EntryPreimageFields { project_id: string; seq: number; prev_hash: string; event_type: string; pillar: string | null; ref_table: string | null; ref_id: string | null; author_user: string | null; author_agent: string | null; ts: string; content_hash: string; } export declare function computeEntryPreimage(fields: EntryPreimageFields): string; export declare function computeEntryHash(fields: EntryPreimageFields): string; export interface VerifyResult { valid: boolean; checked: number; firstBadSeq?: number; reason?: string; } /** * Verify a chain from an ordered array of raw rows — recomputes every * content_hash and entry_hash and checks prev_hash linkage. Used by the CLI * against rows fetched from the server OR read from local SQLite; trusts * nothing but the rows themselves. */ export declare function verifyChainRows(rows: LedgerRow[]): VerifyResult; //# sourceMappingURL=ledger.d.ts.map