@@ -1110,6 +1110,17 @@ describe("short-term promotion", () => {
11101110 ) . toBe ( false ) ;
11111111 } ) ;
11121112
1113+ it ( "treats empty rem candidate placeholders as contaminated" , ( ) => {
1114+ expect (
1115+ __testing . isEmptyDreamingCandidatePlaceholder ( "- No strong candidate truths surfaced." ) ,
1116+ ) . toBe ( true ) ;
1117+ expect (
1118+ __testing . isContaminatedDreamingSnippet (
1119+ "- Candidate: Possible Lasting Truths: No strong candidate truths surfaced." ,
1120+ ) ,
1121+ ) . toBe ( true ) ;
1122+ } ) ;
1123+
11131124 it ( "treats transcript-style dreaming prompt echoes as contaminated" , ( ) => {
11141125 expect (
11151126 __testing . isContaminatedDreamingSnippet (
@@ -1118,6 +1129,48 @@ describe("short-term promotion", () => {
11181129 ) . toBe ( true ) ;
11191130 } ) ;
11201131
1132+ it ( "skips empty rem candidate placeholders during apply" , async ( ) => {
1133+ await withTempWorkspace ( async ( workspaceDir ) => {
1134+ const applied = await applyShortTermPromotions ( {
1135+ workspaceDir,
1136+ minScore : 0 ,
1137+ minRecallCount : 0 ,
1138+ minUniqueQueries : 0 ,
1139+ candidates : [
1140+ {
1141+ key : "memory:memory/2026-04-08.md:13:13" ,
1142+ path : "memory/2026-04-08.md" ,
1143+ startLine : 13 ,
1144+ endLine : 13 ,
1145+ source : "memory" ,
1146+ snippet : "- Candidate: Possible Lasting Truths: No strong candidate truths surfaced." ,
1147+ recallCount : 3 ,
1148+ avgScore : 0.95 ,
1149+ maxScore : 0.95 ,
1150+ uniqueQueries : 2 ,
1151+ firstRecalledAt : "2026-04-08T00:00:00.000Z" ,
1152+ lastRecalledAt : "2026-04-09T00:00:00.000Z" ,
1153+ ageDays : 0 ,
1154+ score : 0.95 ,
1155+ recallDays : [ "2026-04-08" , "2026-04-09" ] ,
1156+ conceptTags : [ "candidate" , "truths" ] ,
1157+ components : {
1158+ frequency : 1 ,
1159+ relevance : 1 ,
1160+ diversity : 1 ,
1161+ recency : 1 ,
1162+ consolidation : 1 ,
1163+ conceptual : 1 ,
1164+ } ,
1165+ } ,
1166+ ] ,
1167+ } ) ;
1168+
1169+ expect ( applied . applied ) . toBe ( 0 ) ;
1170+ await expectEnoent ( fs . readFile ( path . join ( workspaceDir , "MEMORY.md" ) , "utf-8" ) ) ;
1171+ } ) ;
1172+ } ) ;
1173+
11211174 it ( "skips direct candidates that exceed maxAgeDays during apply" , async ( ) => {
11221175 await withTempWorkspace ( async ( workspaceDir ) => {
11231176 const applied = await applyShortTermPromotions ( {
0 commit comments