/** * Consolidation: what a turn learned, written down where a later turn can * find it. * * The working state is episodic memory — what happened in THIS turn: the * decisions taken, the discoveries made, the failures met and how. It * dies with the turn, and the semantic store behind `search_memory` only * ever received what a model chose to `save_memory` mid-task, which is * rarely the thing a later turn needed. Consolidation is the bridge: at * the end of a turn, the entries that can outlive it become one memory * entry, tagged so a later turn can search for what was learned rather * than what was done. What is deliberately NOT carried: the tool * results, the plan, the requirements — those describe the task, not a * lesson. Pure: the caller writes the entry, this only says what it is. */ import type { SessionId, TurnId } from '../types/ids/index.js'; import type { CreateMemoryParams, MemoryStore } from '../types/memory/index.js'; import type { WorkingState } from './types.js'; export declare const CONSOLIDATION_TAG = "learning"; export interface ConsolidationMeta { /** The session the learning turn belongs to; tagged `session:`. */ readonly sessionId: SessionId; /** The turn that learned it; tagged `turn:`. */ readonly turnId: TurnId; /** Milliseconds since the epoch, for the entry's metadata. */ readonly at: number; } /** * Whether `store` already holds a consolidation of exactly this knowledge. * * {@link consolidationEntry} is pure and cannot ask; the caller asks this * before writing, the way the promoter does, so a turn that learned what an * earlier turn already recorded — archived included — writes nothing. */ export declare function isConsolidated(store: MemoryStore, entry: CreateMemoryParams): Promise; /** * The memory entry a turn's state consolidates to, or `null` when the turn * learned nothing worth a later turn's attention — no decisions, no * discoveries, no failures. A turn that only read and edited leaves no * entry rather than an empty one. */ export declare function consolidationEntry(state: WorkingState, meta: ConsolidationMeta): CreateMemoryParams | null; //# sourceMappingURL=consolidation.d.ts.map