/** * HostRecall — the Brain speaks through the host's own tools, not just Lemma's. * * formatRecallNote made reading a file the Brain has notes on surface them, but only through * read_workspace_file. Agents mostly read, edit and run tests with their host's native tools * (Claude Code's Read / Edit / Bash), so in practice the Brain stayed silent unless the model * remembered to call search_memory — the exact moment an agent that doesn't know a memory exists * has no reason to. This module answers a host PostToolUse hook payload with the same kind of * note, at the same three moments: * * - Reading a file the Brain has memories about → their ids (formatRecallNote's rule). * - Editing a file a documented FAILED attempt depends on → a warning. Plain "this will go * stale" notes stay off for native edits: they are the common case and not worth context. * - A verdict command (test/build/lint) failing with an error the Brain already has a recorded * fix for → that fix's id. This is the moment a memory is worth the most. * * Cost rules, because every note is context the host pays for on every later turn: * - Computing a note spends no model tokens: it is local BM25 / evidence lookups. * - Notes carry ids and one line, never memory bodies. get_memory / verify_memory fetch the * ones that matter. * - Silence is the default. No match, a weak match, or a match already noted this session * produces nothing at all. * - Notes are deduped per host session on disk (`.lemma/session/host-recall.json`), since each * hook invocation is a fresh process. * * Pointers are not reuse: nothing here moves hits or savings counters. A memory is credited * only when a search actually returns it to a caller. */ import { TheBrainV2 } from './TheBrainV2'; /** * BM25 similarity is normalized against the corpus, so the top result of any query scores * high — and every fix memory shares the "fix:" token. It only nominates candidates; this * term overlap between the two error headlines is what decides "the same failure". Below it, * a "fix for this error" is a guess about a different failure, so nothing is said. */ export declare const FIX_MATCH_MIN_OVERLAP = 0.5; /** Jaccard overlap of two error headlines' terms (numbers and punctuation ignored). */ export declare function headlineOverlap(a: string, b: string): number; /** * The note (empty string for none) to hand back to the host for one PostToolUse payload. * Never throws: a recall hint must never be the reason a tool call reports an error. */ export declare function recallForHookPayload(payload: unknown, cwd?: string, brain?: TheBrainV2): string; //# sourceMappingURL=HostRecall.d.ts.map