Skip to content

Commit 0ac1c19

Browse files
committed
fix(memory-core): reject checked checkbox placeholders
1 parent fd0a6b7 commit 0ac1c19

2 files changed

Lines changed: 40 additions & 11 deletions

File tree

extensions/memory-core/src/short-term-promotion.test.ts

Lines changed: 39 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1510,47 +1510,76 @@ describe("short-term promotion", () => {
15101510
snippet: "[ ]",
15111511
source: "memory",
15121512
},
1513-
],
1514-
});
1515-
await recordGroundedShortTermCandidates({
1516-
workspaceDir,
1517-
query: "empty daily sections",
1518-
items: [
15191513
{
15201514
path: "memory/2026-04-03.md",
15211515
startLine: 11,
15221516
endLine: 11,
15231517
score: 0.96,
1524-
snippet: "*",
1518+
snippet: "[x]",
1519+
source: "memory",
15251520
},
1521+
],
1522+
});
1523+
await recordGroundedShortTermCandidates({
1524+
workspaceDir,
1525+
query: "empty daily sections",
1526+
items: [
15261527
{
15271528
path: "memory/2026-04-03.md",
15281529
startLine: 12,
15291530
endLine: 12,
15301531
score: 0.96,
1531-
snippet: "---",
1532+
snippet: "*",
15321533
},
15331534
{
15341535
path: "memory/2026-04-03.md",
15351536
startLine: 13,
15361537
endLine: 13,
15371538
score: 0.96,
1538-
snippet: "|---|",
1539+
snippet: "---",
15391540
},
15401541
{
15411542
path: "memory/2026-04-03.md",
15421543
startLine: 14,
15431544
endLine: 14,
15441545
score: 0.96,
1545-
snippet: "[]",
1546+
snippet: "|---|",
15461547
},
15471548
{
15481549
path: "memory/2026-04-03.md",
15491550
startLine: 15,
15501551
endLine: 15,
15511552
score: 0.96,
1553+
snippet: "[]",
1554+
},
1555+
{
1556+
path: "memory/2026-04-03.md",
1557+
startLine: 16,
1558+
endLine: 16,
1559+
score: 0.96,
1560+
snippet: "[X]",
1561+
},
1562+
{
1563+
path: "memory/2026-04-03.md",
1564+
startLine: 17,
1565+
endLine: 17,
1566+
score: 0.96,
15521567
snippet: "- [ ]",
15531568
},
1569+
{
1570+
path: "memory/2026-04-03.md",
1571+
startLine: 18,
1572+
endLine: 18,
1573+
score: 0.96,
1574+
snippet: "- [x]",
1575+
},
1576+
{
1577+
path: "memory/2026-04-03.md",
1578+
startLine: 19,
1579+
endLine: 19,
1580+
score: 0.96,
1581+
snippet: "- [X]",
1582+
},
15541583
],
15551584
});
15561585

extensions/memory-core/src/short-term-promotion.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,7 @@ function isMarkdownPlaceholderLine(line: string): boolean {
363363
/^~{3,}$/.test(compact) ||
364364
/^\|+$/.test(compact) ||
365365
/^\|?:?-{3,}:?(?:\|:?-{3,}:?)*\|?$/.test(compact) ||
366-
/^[-*+]?\[\]$/.test(compact)
366+
/^[-*+]?\[[xX]?\]$/.test(compact)
367367
);
368368
}
369369

0 commit comments

Comments
 (0)