Skip to content

Garry's Opinionated OpenClaw/Hermes Agent Brain

TypeScript

test(write-attribution): calibrate the fixed test embedder for cosine supersession (master test meets lane 4's per-model thresholds)

garrytan8a94a4d4adab
diff --git a/test/write-attribution-facts-takes.test.ts b/test/write-attribution-facts-takes.test.ts
index 10a33ebeb3..46c137166f 100644
--- a/test/write-attribution-facts-takes.test.ts
+++ b/test/write-attribution-facts-takes.test.ts
@@ -85,6 +85,8 @@ describe('legacy facts helpers on an unmanaged brain', () => {
test('writeSingleFact DB-only supersession: the new fact is maintenance-created and the old fact keeps its creator', () => withFixedEmbeddings(async () => {
for (const engine of engines) {
const brain = await unmanagedBrain(engine);
+ // Calibrate the fixed test embedder: an uncalibrated model never supersedes by cosine (supersession-threshold.ts).
+ await engine.setConfig('facts.supersession_thresholds', JSON.stringify({ 'openai:text-embedding-3-small@1536': 0.95 }));
const old = await creatorFact(brain, 'Prefers morning meetings', { entity: 'people/alice-example' });
const written = await writeSingleFact(engine, brain.sourceId, { fact: 'Prefers afternoon meetings', provenance: 'test', entity: 'people/alice-example' });
@@ -98,6 +100,8 @@ describe('legacy facts helpers on an unmanaged brain', () => {
test('writeSingleFact fence path: the fenced fact, its supersession strike and the page body mirror name the maintenance principal', () => withFixedEmbeddings(async () => {
for (const engine of engines) {
const brain = await unmanagedBrain(engine);
+ // Calibrate the fixed test embedder: an uncalibrated model never supersedes by cosine (supersession-threshold.ts).
+ await engine.setConfig('facts.supersession_thresholds', JSON.stringify({ 'openai:text-embedding-3-small@1536': 0.95 }));
await sourceRoot(brain);
const slug = 'people/bob-example';
await importFromContent(engine, slug, '---\ntype: person\ntitle: Bob\n---\nA person.\n', { sourceId: brain.sourceId, sourcePath: `${slug}.md`, noEmbed: true });