/** * Lessons: the curated, one-line-per-rule index of what went wrong and what * to do instead (T13949, owner decision D11181). * * A lesson is an observation of type `lesson`: the title holds the one-line * rule and the narrative holds why (the incident). Process lessons default to * the global (main) brain so every project and device reads them. The index * lists current lessons newest first; an invalidated (superseded) lesson is * hidden. * * Code placed in `packages/core/` per Package-Boundary Check — verified against AGENTS.md. * * @module memory/lessons * @task T13949 */ /** Longest one-line rule a lesson title may hold. */ export declare const LESSON_RULE_MAX = 200; /** Which store a lessons read covers. */ export type LessonScope = 'project' | 'global' | 'all'; /** One row of the lessons index. */ export interface LessonEntry { /** Observation id. */ id: string; /** The one-line rule (the observation title). */ rule: string; /** Why: the incident behind the rule (the observation narrative). */ why: string; /** Creation time, SQLite `datetime` shape. */ createdAt: string; /** Store the lesson lives in. */ scope: 'project' | 'global'; } /** * Validate the one-line rule of a lesson before it is stored. * * @param title - The proposed rule; required for a lesson. * @returns An error message, or `null` when the rule is acceptable. * @example * ```ts * lessonRuleError('Run biome on the exact changed files before push'); // null * ``` */ export declare function lessonRuleError(title: string | undefined): string | null; /** * List current lessons, newest first, from the project brain, the global * (main) brain, or both. * * With scope `all` each store is read on its own: a store that fails is * reported to `onStoreError` and the other store's lessons are still listed. * When every store fails the call throws one error naming each store's cause, * and `onStoreError` is not called. * * @param projectRoot - Project whose brain is read for `project` / `all`. * @param options - `scope` (default `all`), `limit` (default 50) and * `onStoreError`, told which store failed under scope `all`. * @returns Lessons merged across the requested stores, newest first. * @example * ```ts * const lessons = await listLessons(root, { scope: 'all', limit: 20 }); * ``` */ export declare function listLessons(projectRoot: string, options?: { scope?: LessonScope; limit?: number; onStoreError?: (scope: 'project' | 'global', error: Error) => void; }): Promise; //# sourceMappingURL=lessons.d.ts.map