Skip to content

Commit 9d5cd72

Browse files
committed
test: 认清单形状而不是首行——补上 main 的 #515 锁与本批围栏的碰撞
#515 那条「模式扫描必须真发起 LLM 调用」的反向断言,靠 userText.startsWith("id=") 认出扫描提示。本批给 prompt 补围栏后 user 段以角色声明开头,首行判据当场失效: 合上 main 之后它是红的(实得 0 次调用,看起来像扫描没跑)。改成认清单形状 (行里带 | importance=),这条只在 sleep.js 的扫描提示里出现,冲突提示(type= 但没 importance=)不会串台。 顺带更正 dream-candidate-hybrid 的注释:它写的还是「mockCtx 靠首行区分阶段,所以 不能用」,而本批已经把 helper 的判据换成了形状——那个误判不存在了,这里保留 system prompt 判定的理由是它与 listText 形态解耦。
1 parent e3a9012 commit 9d5cd72

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

‎dsh-mneme/test/dream-candidate-hybrid.test.js‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ function seed(service, vectorIndex, title, vec) {
3939
}
4040

4141
/** Capture the candidate titles the LLM was handed. */
42-
// 注意:不能用 helpers 的 mockCtx —— 它靠 userText.startsWith("id=") 区分阶段,而
43-
// semantic 可用时候选列表以「# 聚类 N」开头(语义预分组),会被误判成 summary。
42+
// 注:helpers 的 mockCtx 过去靠 userText.startsWith("id=") 区分阶段,semantic 预分组把清单
43+
// 头换成「# 聚类 N」就误判成 summary;#501/#493 把它的判据换成了清单形状(includes("| type=")),
4444
// 这里改用 system prompt 判定,与 listText 的形态解耦。
4545
function stubCtx(consolidationReply) {
4646
const seen = { titles: [] };

‎dsh-mneme/test/scope-state.test.js‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -476,8 +476,8 @@ test("#515:被按下的行占满 LIMIT 200 窗口时,模式扫描不报「
476476
llm: {
477477
async *stream(options) {
478478
const text = options.messages.find((m) => m.role === "user")?.content?.[0]?.text ?? "";
479-
// 只收模式扫描的提示(listText 每行以 `id=` 开头),别的时间不掺进来。
480-
if (text.startsWith("id=")) seen.push(text);
479+
// 认清单**形状**(行里带 `| importance=`),不认首行——#501/#493 那批围栏让 user 段以角色声明开头了
480+
if (text.includes("| importance=")) seen.push(text);
481481
yield { type: "text-delta", index: 0, text: "[]" };
482482
yield { type: "finish", reason: { kind: "stop" } };
483483
}

0 commit comments

Comments
 (0)