export type JournalOp = "remember" | "forget" | "invalidate" | "promote" | "demote" | "touch"; export interface JournalEntry { op: JournalOp; id: number; ts: string; content?: string; category?: string; tags?: string[] | null; confidence?: number; git_sha?: string | null; git_branch?: string | null; related_files?: string[] | null; tier?: string; invalidated_at_sha?: string | null; replaced_by_id?: number | null; new_tier?: string; } /** * MemoryJournal writes append-only JSONL to /.sverklo/memories.jsonl. * * Writes are synchronous on purpose: the journal must be committed * before the corresponding SQLite write returns to the caller, so we * never have a window where SQLite succeeds and the journal is missing * the record. Agent workloads are low-frequency on the memory side * (dozens of writes per session, not thousands) so sync writes are * fine. If memory write volume grows we can batch. * * Errors are swallowed with a log. The journal is advisory for 0.2.x — * a broken journal must not break memory. */ export declare class MemoryJournal { private path; private ready; constructor(projectRoot: string); private ensureDir; private write; remember(params: { id: number; content: string; category: string; tags?: string[] | null; confidence: number; git_sha?: string | null; git_branch?: string | null; related_files?: string[] | null; tier: string; }): void; forget(id: number): void; invalidate(id: number, atSha: string | null, replacedById: number | null): void; promote(id: number, newTier: string): void; demote(id: number, newTier: string): void; /** * Return the path to the journal file so callers can show it in * error messages ("see .sverklo/memories.jsonl for the write log"). */ get filePath(): string; /** * True if the journal file exists on disk. Useful for the doctor * command to report journal presence. */ exists(): boolean; }