From 56769a5419f6e2b37310301936afa94a46717fd8 Mon Sep 17 00:00:00 2001 From: Gustavo Madeira Santana Date: Tue, 14 Apr 2026 20:10:54 -0400 Subject: [PATCH] memory: match session corpus dreaming prompt shape --- extensions/memory-core/src/short-term-promotion.test.ts | 2 +- extensions/memory-core/src/short-term-promotion.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/extensions/memory-core/src/short-term-promotion.test.ts b/extensions/memory-core/src/short-term-promotion.test.ts index ce379000549..3e0821f0968 100644 --- a/extensions/memory-core/src/short-term-promotion.test.ts +++ b/extensions/memory-core/src/short-term-promotion.test.ts @@ -1104,7 +1104,7 @@ describe("short-term promotion", () => { it("treats transcript-style dreaming prompt echoes as contaminated", () => { expect( __testing.isContaminatedDreamingSnippet( - "[main/dreaming-narrative-light.jsonl#L1] Write a dream diary entry from these memory fragments:", + "[main/dreaming-narrative-light.jsonl#L1] User: Write a dream diary entry from these memory fragments:", ), ).toBe(true); }); diff --git a/extensions/memory-core/src/short-term-promotion.ts b/extensions/memory-core/src/short-term-promotion.ts index e159ef83ac7..b20f21bab3d 100644 --- a/extensions/memory-core/src/short-term-promotion.ts +++ b/extensions/memory-core/src/short-term-promotion.ts @@ -38,7 +38,7 @@ const PHASE_SIGNAL_LIGHT_BOOST_MAX = 0.06; const PHASE_SIGNAL_REM_BOOST_MAX = 0.09; const PHASE_SIGNAL_HALF_LIFE_DAYS = 14; const DREAMING_TRANSCRIPT_PROMPT_LINE_RE = - /\[[^\]]*dreaming-narrative[^\]]*]\s*Write a dream diary entry from these memory fragments:?/i; + /\[[^\]]*dreaming-narrative[^\]]*]\s*(?:User|Assistant):\s*Write a dream diary entry from these memory fragments:?/i; const DREAMING_DIFF_PREFIX_RE = /@@\s*-\d+(?:,\d+)?\s+[-*+]\s+/iy; const inProcessShortTermLocks = new Map>(); const ensuredShortTermDirs = new Map>();