Skip to content

Commit 6d7489e

Browse files
committed
fix(guide): 第 5 条写出 memory_forget 的完整副作用面,memory_save 尾句改短(#249)
文案复审口径:第 5 条原写 "memory_forget only stops it being injected",比工具描述窄 ——tools.js 里 memory_forget 是「挡注入 + 从检索与列表里消失」,memory_archive 另含 dream 巩固排除——只写「挡注入」会诱导模型低估 forget 的代价。memory_save 尾句与总则 第 4 条句式几乎同形,易被读成同一句的复写;改成贴工具动词的短句。 新增回归锁住 forget 的副作用面不被写窄。
1 parent 360f7c8 commit 6d7489e

3 files changed

Lines changed: 14 additions & 6 deletions

File tree

‎dsh-mneme/lib/guide.js‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,9 @@ const SECTION_LINES = [
2424
"3. Write back sparingly: use memory_save for durable, cross-session value — a preference, a decision with its rationale, " +
2525
"an engineering constraint, a pitfall with its root cause. Trivial single-turn work is not worth a memory.",
2626
"4. When unsure, do nothing. Not acting is a valid outcome: a useless memory is paid for by every future session.",
27-
"5. Prefer the reversible tools. memory_archive hides an entry and memory_forget only stops it being injected — both are " +
28-
"recoverable. memory_delete is permanent, so reach for it only when an entry is wrong or unwanted, not merely stale."
27+
"5. Prefer the reversible tools. memory_archive hides an entry from search, injection and consolidation, and memory_forget " +
28+
"suppresses it from injection and search results — both are recoverable. memory_delete is permanent, so reach for it only " +
29+
"when an entry is wrong or unwanted, not merely stale."
2930
];
3031

3132
/** 系统提示段(order 150)的总则文本。常量:同会话内稳定是硬约束。 */
@@ -39,5 +40,5 @@ export const TOOL_GUIDE = {
3940
"Skip it for facts you can read directly from the repository.",
4041
memory_save:
4142
" Save only durable, cross-session value (a preference, a decision with its rationale, an engineering constraint, " +
42-
"a pitfall with its root cause). Trivial single-turn work does not belong here, and when unsure it is correct to save nothing."
43+
"a pitfall with its root cause). Trivial single-turn work does not belong here, and when unsure, do not save."
4344
};

‎dsh-mneme/src/guide.js‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,9 @@ const SECTION_LINES = [
2424
"3. Write back sparingly: use memory_save for durable, cross-session value — a preference, a decision with its rationale, " +
2525
"an engineering constraint, a pitfall with its root cause. Trivial single-turn work is not worth a memory.",
2626
"4. When unsure, do nothing. Not acting is a valid outcome: a useless memory is paid for by every future session.",
27-
"5. Prefer the reversible tools. memory_archive hides an entry and memory_forget only stops it being injected — both are " +
28-
"recoverable. memory_delete is permanent, so reach for it only when an entry is wrong or unwanted, not merely stale."
27+
"5. Prefer the reversible tools. memory_archive hides an entry from search, injection and consolidation, and memory_forget " +
28+
"suppresses it from injection and search results — both are recoverable. memory_delete is permanent, so reach for it only " +
29+
"when an entry is wrong or unwanted, not merely stale."
2930
];
3031

3132
/** 系统提示段(order 150)的总则文本。常量:同会话内稳定是硬约束。 */
@@ -39,5 +40,5 @@ export const TOOL_GUIDE = {
3940
"Skip it for facts you can read directly from the repository.",
4041
memory_save:
4142
" Save only durable, cross-session value (a preference, a decision with its rationale, an engineering constraint, " +
42-
"a pitfall with its root cause). Trivial single-turn work does not belong here, and when unsure it is correct to save nothing."
43+
"a pitfall with its root cause). Trivial single-turn work does not belong here, and when unsure, do not save."
4344
};

‎dsh-mneme/test/inject-pools.test.js‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,12 @@ test("#249: capability guide is off by default, registered once when on", () =>
134134
// 不可逆工具(memory_delete)的克制指引必须在场:这是全 guide 里唯一有数据
135135
// 损失后果的一句,被误删掉的回归要能立刻转红。
136136
assert.ok(MEMORY_GUIDE_SECTION.includes("memory_delete"), "guide keeps the irreversible-tool warning");
137+
// memory_forget 的副作用面同样不能被写窄:工具描述是「挡注入 + 从检索与列表里
138+
// 消失」,只写「只挡注入」会让模型低估它(#249 文案定稿时专门改过这一句)。
139+
assert.ok(
140+
MEMORY_GUIDE_SECTION.includes("memory_forget suppresses it from injection and search results"),
141+
"reversible-tools rule states memory_forget's full reach"
142+
);
137143
// 优先序那条不得让模型拿 memory_search 去核对当前指令/仓库:它只搜记忆库,
138144
// 搜不到「现在」——把它写成验证手段会换来一轮无效查询 + 继续采信陈旧记忆。
139145
assert.ok(

0 commit comments

Comments
 (0)