/** * Salience Judge (Phase 7b, plan item 7b). * * Scores the importance/salience (∈ [0,1]) of a memory's content + type, for * the `MemoryController.store` path when the caller omits `importance`. The * scored value IS the `salience` input to Phase-1 `decayScore` (the memories * table `importance` column already drives decay). * * Contract (cross-cutting §1 + spec R7B-01..04): * - Default-off via `config.memory.autoImportance.enabled`. * - Silent degradation: on `!isLlmEnabled()`, `{ok:false}`, or any throw, * returns the neutral default 0.5. Never throws to the caller (store()). * - Embedding-independence: scores from content only — the Phase-4/5/6 FTS-only * seed memories (embedding:[]) are scored identically. * - Truncates very-long content to the LLM context budget before scoring. * * Pure over inputs + the injected LLM surface, so tests inject fakes without * touching config or network (design.md §7). */ import { z } from "zod"; import type { MemoryType } from "@massa-th0th/shared"; import type { QueryLlmSurface } from "../search/query-understanding.js"; export declare const SalienceSchema: z.ZodObject<{ importance: z.ZodNumber; }, z.core.$strip>; export type Salience = z.infer; /** Neutral default returned on every degradation path. */ export declare const NEUTRAL_SALIENCE = 0.5; /** * Stateful handle bundling scoreSalience. Stateless; the `llm` surface is * injectable for tests. */ export declare class SalienceJudge { private readonly llm; constructor(llm?: QueryLlmSurface); /** * Score salience ∈ [0,1] for the given content + memory type. * * - When `!isLlmEnabled()` OR `autoImportance.enabled` is false OR `{ok:false}` * OR throw → returns `NEUTRAL_SALIENCE` (0.5). Logged at warn on failure. * - Empty/whitespace content → neutral (no signal to score). */ scoreSalience(content: string, type: MemoryType): Promise<{ salience: number; source: "llm" | "default"; }>; } export declare function getSalienceJudge(): SalienceJudge; /** Test seam: override the module-level judge. */ export declare function _setSalienceJudgeForTesting(judge: SalienceJudge | null): void; //# sourceMappingURL=salience-judge.d.ts.map