/** * SemanticNoveltyEncoder — the learned-local-semantic ADVISORY layer for the * conjecture novelty check (D.060 / scope 2026-05-23_holoembed-semantic-encoder). * * The shipped novelty check (`assessConjectureNovelty`) uses HoloEmbed char-trigram * histograms — a LEXICAL exact-restatement guard that catches near-verbatim restatements * only (a paraphrase of a known result returns `novel`, a false negative — the W.520 trap). * This module adds a genuinely SEMANTIC layer using a local learned model * (`Xenova/all-MiniLM-L6-v2`) via the already-present `@huggingface/transformers` — no new * heavy dependency, runs offline/CPU (sovereign, F.063), NOT an external API. * * LAYERING (the determinism resolution): the deterministic trigram guard stays * RECEIPT-BINDING; this learned layer is ADVISORY only — it does NOT feed any receipt * hash. Same-text determinism is verified (byte-identical vectors across runs on one * machine), but cross-fleet floating-point reproducibility is unproven, so it must not * enter a receipt until that determinism gate passes. It returns a review signal * ("resembles known result X at 0.82"), never a receipt-binding verdict. * * Empirically (probe 2026-05-23, this model, cached): Euler's-formula claim vs a paraphrase * = cos 0.73; vs an unrelated sentence = cos 0.08 — clean separation the trigram check (at * 0.995) misses entirely. Async (model inference); the trigram path stays sync. */ import type { ConjecturePriorArtEntry } from './ConjectureEngine'; /** Pinned model — local ONNX via transformers.js. 384-dim, mean-pooled, L2-normalized. */ export declare const SEMANTIC_NOVELTY_MODEL: "Xenova/all-MiniLM-L6-v2"; /** * Default advisory threshold, CALIBRATED (scope P2, 2026-05-23) on the labeled eval set * below: same-result paraphrases scored 0.65–0.72, different/unrelated scored 0.02–0.32 * (cleanly separable, gap 0.34, midpoint ≈0.49). 0.5 sits centered in the gap — 0.18 * above every no-match and 0.15 below every match — so it is robust to harder paraphrases * and recall-favoring (right for an ADVISORY flag, where a missed rediscovery is worse * than a flagged-for-review false positive). Still advisory-only; re-run calibration if * the model changes. */ export declare const SEMANTIC_NOVELTY_THRESHOLD = 0.5; export type SemanticNoveltyStatus = 'near-duplicate' | 'novel'; export interface SemanticNoveltyMatch { priorArtId: string; source: string; title?: string; statement: string; similarity: number; } export interface SemanticNoveltyAssessment { /** ADVISORY — never receipt-binding (see module note). */ binding: 'advisory'; provider: 'transformers.js'; modelId: typeof SEMANTIC_NOVELTY_MODEL; status: SemanticNoveltyStatus; threshold: number; corpusSize: number; query: string; nearest: SemanticNoveltyMatch | null; } /** Embed text into a mean-pooled, L2-normalized vector via the local learned model. */ export declare function embedSemantic(text: string): Promise; export interface LabeledNoveltyPair { query: string; reference: string; /** true = query is the SAME result as reference (a paraphrase); false = different/unrelated. */ isMatch: boolean; } /** * Labeled eval set for threshold calibration (scope P2) — paraphrases of known results * across the engine's live domains (should match) vs different/unrelated claims (should not). * Durable artifact: reused by the determinism gate (P1) and corpus work (P3). */ export declare const LABELED_NOVELTY_EVAL_SET: ReadonlyArray; export interface ThresholdCalibration { threshold: number; separable: boolean; minMatchSim: number; maxNoMatchSim: number; gap: number; } /** * Pure calibration: given scored (similarity, isMatch) pairs, return the midpoint * threshold between the lowest match and the highest no-match, plus whether the classes * are separable and the margin. Deterministic; no model required. */ export declare function calibrateNoveltyThreshold(scored: ReadonlyArray<{ similarity: number; isMatch: boolean; }>): ThresholdCalibration; /** Cosine similarity of two equal-length vectors (inputs are L2-normalized → dot product). */ export declare function cosineSimilarity(a: ReadonlyArray, b: ReadonlyArray): number; /** * ADVISORY semantic novelty assessment: embeds the query + each corpus statement with the * local learned model and flags `near-duplicate` if the nearest match is >= threshold. * Unlike the trigram guard, this catches PARAPHRASES of known results. NOT receipt-binding. */ export declare function assessSemanticNovelty(query: string, corpus: ReadonlyArray, threshold?: number): Promise; //# sourceMappingURL=SemanticNoveltyEncoder.d.ts.map