import { type AtomicWriteOptions } from '../../state/atomic-write.js'; export interface LedgerRecords { live: TRec[]; archived: TRec[]; } /** * A subject's simple status-flip transitions (assumptions' validate/reject/ * reopen, decisions' supersede/rescind/reactivate) share this exact shape * today as two hand-duplicated maps per subject. Declaring it here lets a * spec describe it once; this module has no executor for it (deliberately — * bespoke transition logic with extra invariants or field mutations beyond a * status flip, e.g. recommendation promotion or decision's supersession-cycle * check, stays a subject-specific function on top of these primitives rather * than being forced into one generic shape it doesn't fit). */ export interface TransitionRule { from: readonly TStatus[]; to: TStatus; } /** Descriptor a subject (recommendations, evidence, assumptions, decisions, * milestones, ...) plugs in to get read/write/id-minting for free. */ export interface SubjectLedgerSpec { parse(data: unknown): TLedger; empty(): TLedger; idPrefix: string; idOf(record: TRec): string; records(ledger: TLedger): LedgerRecords; withRecords(ledger: TLedger, records: LedgerRecords): TLedger; crossCheckIds?(payload: TPayload): string[]; transitions?: Record>; } export declare function readLedger(spec: SubjectLedgerSpec, path: string): Promise; export declare function writeLedger(spec: SubjectLedgerSpec, path: string, ledger: TLedger, opts?: AtomicWriteOptions): Promise; export declare function mintId(spec: SubjectLedgerSpec, ledger: TLedger, now: Date, payload?: TPayload): string; //# sourceMappingURL=ledger.d.ts.map