/** * The decision ledger AT REST (DES-decision-capture §4.2.1, DC-S4a). * * One append-only JSONL file per project at `/decisions/.jsonl`: * the directory 0700, each file 0600 — the posture of the chat transcripts (`chat-transcripts.ts`). * The words live HERE and nowhere else crew writes (never the bus, logs or `/diagnostics`). * Registered in `tests/fixtures/state-home-subtrees.json` as `decisions` (crew half) — the core half, * the worker Read fence, shipped with wicked-core-ts 0.7.35 — so a worker cannot read the operator's * words through the file system. * * Reads fold `record` + `outcome` lines into a {@link DecisionView}; the in-memory index is built * once at first use and kept current by `append`. */ import type { DecisionOutcome, DecisionRecord, DecisionView } from './types.js'; /** The state-home entry (`/decisions/`) — the name the fixture registers. */ export declare const DECISIONS_DIRNAME = "decisions"; export declare function defaultDecisionsDir(): string; export interface DecisionFilter { project?: string; chat?: string; run?: string; state?: DecisionView['state']; since?: number; } export declare class DecisionLedger { private readonly dir; private loaded; private readonly byId; /** decision key → ids, in record order (recurrence + widen). */ private readonly byKey; /** estate proposal id → decision id (B12: answering either one resolves both). */ private readonly byProposal; constructor(dir?: string); private fileFor; private load; private index; private write; appendRecord(record: DecisionRecord): void; appendOutcome(outcome: DecisionOutcome): void; record(id: string): DecisionRecord | null; outcomes(id: string): DecisionOutcome[]; /** The decision a review-queue proposal was filed for, or `null` (an ordinary proposal). */ decisionForProposal(proposalId: string): string | null; /** Prior records with this key: how often, since when, and in which projects. */ recurrence(key: string): { count: number; first_at: number; projects: string[]; } | null; /** Remembered, not undone decisions with this key, newest outcome last. */ rememberedWithKey(key: string): Array<{ record: DecisionRecord; rule_id: string; }>; /** Records whose route asks for an action but carry no outcome yet (the restart re-drive). */ pending(): DecisionRecord[]; view(id: string): DecisionView | null; list(filter?: DecisionFilter): DecisionView[]; } //# sourceMappingURL=ledger.d.ts.map