/** * Decision log: architecture decisions persisted in the project as one * Markdown file per decision (ADR-lite) under .elyra/memory/decisions/. * * Why one file per decision: append-only single files collide the moment two * developers record decisions in the same week. Separate files never conflict * in git and match the ADR convention people already know. * * Decisions are never deleted - a newer decision supersedes an older one, so * the history of "why did we switch back?" stays intact. */ export type DecisionStatus = "active" | "superseded"; export interface Decision { /** Stable id, also the file stem: YYYY-MM-DD-slug. */ id: string; title: string; /** ISO date (YYYY-MM-DD). */ date: string; status: DecisionStatus; /** Id of the decision this one replaces. */ supersedes?: string; /** Id of the decision that replaced this one (set when superseded). */ supersededBy?: string; /** Session id the decision was recorded in, when known. */ session?: string; /** Why a decision was needed. */ context: string; /** What was chosen. */ decision: string; /** Alternatives considered and why they were rejected. */ alternatives?: string; /** Consequences and constraints on future work. */ consequences?: string; } export interface DecisionInput { title: string; context: string; decision: string; alternatives?: string; consequences?: string; supersedes?: string; session?: string; /** Override the date (tests). Defaults to today. */ date?: string; } export interface WriteDecisionResult { decision: Decision; path: string; /** The decision that was marked superseded, if any. */ superseded?: Decision; } /** Pluggable filesystem operations (overridable for tests). */ export interface DecisionStoreOperations { readDir: (dir: string) => string[]; readFile: (path: string) => string; writeFile: (path: string, content: string) => void; mkdir: (dir: string) => void; exists: (path: string) => boolean; } export declare function getDecisionsDir(cwd: string): string; export declare function getDecisionPath(cwd: string, id: string): string; /** Turn a title into a filesystem- and URL-safe slug. */ export declare function slugify(title: string): string; /** Render a decision as Markdown with YAML frontmatter. */ export declare function formatDecisionMarkdown(decision: Decision): string; /** * Parse a decision file. Returns undefined for files that are not decisions * (missing frontmatter or required fields) so stray files are ignored. */ export declare function parseDecisionMarkdown(content: string): Decision | undefined; /** Load all decisions for a project, sorted by date then id. */ export declare function listDecisions(cwd: string, ops?: DecisionStoreOperations): Decision[]; /** * Find an existing decision with (near-)identical title. Used to keep * automatic extraction from re-recording the same decision after every * compaction. */ export declare function findSimilarDecision(decisions: readonly Decision[], title: string): Decision | undefined; /** * Write a new decision. If `supersedes` is given and that decision exists, * it is rewritten with status superseded and a back-reference. */ export declare function writeDecision(cwd: string, input: DecisionInput, ops?: DecisionStoreOperations): WriteDecisionResult; /** * Compact digest of active decisions for the system prompt: title plus a * one-line decision, newest last, capped so a long-lived log cannot crowd out * the context it is meant to protect. Full text stays on disk for `read`. */ export declare function buildDecisionsDigest(decisions: readonly Decision[], cwd: string): string | undefined; //# sourceMappingURL=decisions.d.ts.map