import { type JournalLink, type JournalNodeStatus, type JournalNodeType } from './node-codec.js'; export interface CreateDecision { kind: 'create' | 'refine' | 'supersede'; targetNodeId?: string; title: string; type: JournalNodeType; topic: string; tags: string[]; links: JournalLink[]; status: JournalNodeStatus; description: string; context: string; consequences: string; } export interface MergeDecision { kind: 'merge'; targetNodeId: string; reason: string; } export type JournalRecordDecision = CreateDecision | MergeDecision; export interface ApplyRecordInput { learning: string; decision: JournalRecordDecision; } export interface ApplyRecordResult { recorded: Array<{ learning: string; type: string; topic: string; nodeId: string; nodePath: string; }>; failed: Array<{ learning: string; reason: string; }>; invariantsPassed: boolean; } export declare class JournalStore { private readonly journalRoot; static open(opts: { journalRoot: string; }): Promise; private constructor(); private get nodesDir(); private loadNodes; private regenerateCatalog; /** * Re-derive the committed `index.md` catalog from the authoritative node * files and atomically overwrite it. Node content is never mutated. This is * the opt-in `--regenerate-catalog` entry point for `mma journal reindex`; * building/refreshing the derived `index.db` is always safe, but touching the * committed `index.md` requires the explicit flag. */ rebuildCatalog(): Promise; private appendLogLines; /** * Remove any leftover staging files (`*.tmp`) from an aborted batch. Temp node * files live in `nodes/`; the temp `index.md` / `log.md` live in the journal * root — sweep both. Best-effort: a stray obstacle (e.g. a directory) never * masks the original error. */ private cleanupTempFiles; applyRecordBatch(records: ApplyRecordInput[]): Promise; private runRecordBatch; } //# sourceMappingURL=store.d.ts.map