/** * MCP tool handlers: code-anchored agent memory. * (change: add-code-anchored-memory-staleness) * * remember — persist a durable, code-anchored note for any agent to recall later * recall — return memories relevant to a task, each with a deterministic * freshness verdict; an orphaned memory is NEVER served as * authoritative context (the bullet-proof guarantee). * * Notes live in .openlore/memory/notes.json, entirely separate from the decision * store and commit gate. Architectural decisions are recalled too (read-only) so * one call surfaces all anchored memory touching a task. Freshness is static * analysis only — no LLM. With no `task`, recall doubles as a memory-staleness * scan over everything persisted. */ import { type AnchorOutcome, type ReselectionReason } from '../../decisions/anchor.js'; import type { GovernanceFinding } from './enforcement-policy.js'; import { type StructuralAnchor, type AnchorVerdict } from '../../../types/index.js'; export interface AnchorHint { symbol?: string; file?: string; /** Exact text inside the symbol the memory is about (add-memory-anchor-verdicts). */ span?: string; } export declare function handleRemember(directory: string, content: string, anchorHints?: AnchorHint[], tags?: string[], type?: string, supersedes?: string, trigger?: unknown, pinned?: unknown, claims?: unknown): Promise; export declare function handleRecall(directory: string, task?: string, limit?: number, tokenBudget?: number, asOf?: string, changedSince?: string, typeFilter?: string, federation?: boolean, federationRepos?: string[]): Promise; type SummarizedVerdict = ReturnType; /** * The `memory-anchor-lost` finding for one memory, or undefined when none of its * anchors needs reselection (add-memory-anchor-verdicts). One finding per memory, * with the memory id as subject, so a policy or frozen baseline tracks it by memory. */ export declare function memoryAnchorLostFinding(id: string, anchors: readonly SummarizedVerdict[]): GovernanceFinding | undefined; declare function summarizeVerdict(v: AnchorVerdict, assessed?: boolean): { symbol?: string; file: string; level: 'symbol' | 'file'; freshness: 'fresh' | 'drifted' | 'orphaned'; relocatedTo?: string; staleRegion?: boolean; staleRegionComposition?: import('../../../types/index.js').StaleRegionComposition; carriedAcross?: StructuralAnchor['carriedAcross']; possiblyMovedTo?: string[]; spanCandidates?: AnchorVerdict['spanCandidates']; outcome?: AnchorOutcome; reselectReason?: ReselectionReason; }; /** * The `memory-anchor-lost` source for `openlore enforce` (add-memory-anchor-verdicts): * one finding per recorded, non-retired note that has a lost or ambiguous anchor, * computed with the same freshness engine recall uses. `checked` counts the * anchored notes evaluated; `staleFiles` names symbol-anchored files whose content * differs from what the analysis indexed; `unverifiedFiles` names those the index * has no content key for (an imported bundle), which are disclosed, not counted as * changed; `unassessedReason` is set when anchored * notes exist but there is no analysis to check them against. */ export declare function detectMemoryAnchorLoss(rootPath: string): Promise<{ findings: GovernanceFinding[]; checked: number; staleFiles: string[]; unverifiedFiles?: string[]; unassessedReason?: string; }>; export {}; //# sourceMappingURL=memory.d.ts.map