Skip to content

Commit cbf3489

Browse files
release: v0.7.23 记忆沉淀反复失败根治(consolidation 合法空数组 no-op)+ 空体第二段(dreamMaxTokens 32768)+ skipInvalid splice 修复 (#92)
Co-authored-by: Anans-Ivresse <[email protected]>
1 parent b565cde commit cbf3489

15 files changed

Lines changed: 404 additions & 35 deletions

‎CHANGELOG.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Changelog
22

3-
> **完整版本历史见 [dsh-mneme/CHANGELOG.md](dsh-mneme/CHANGELOG.md)**(正式版本正源,0.3.8 → 0.7.22)。以下为仓库早期开发记录(0.1.0–0.2.x,2026-08-13~14,已归档)。
3+
> **完整版本历史见 [dsh-mneme/CHANGELOG.md](dsh-mneme/CHANGELOG.md)**(正式版本正源,0.3.8 → 0.7.23)。以下为仓库早期开发记录(0.1.0–0.2.x,2026-08-13~14,已归档)。
44
55
All notable changes to dsh-mneme are documented here.
66

‎README.md‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<a href="LICENSE"><img src="https://img.shields.io/badge/license-MIT-3E63DD?style=flat-square" alt="license"></a>
1111
<a href="https://github.com/modusensus/dsh-mneme/actions"><img src="https://img.shields.io/github/actions/workflow/status/modusensus/dsh-mneme/ci.yml?style=flat-square&label=CI" alt="CI"></a>
1212
<a href="https://nodejs.org"><img src="https://img.shields.io/badge/node-24%2B-3E63DD?style=flat-square&logo=nodedotjs&logoColor=white" alt="node"></a>
13-
<a href="https://github.com/modusensus/dsh-mneme"><img src="https://img.shields.io/badge/tests-662%20passed-3E63DD?style=flat-square" alt="tests"></a>
13+
<a href="https://github.com/modusensus/dsh-mneme"><img src="https://img.shields.io/badge/tests-712%20passed-3E63DD?style=flat-square" alt="tests"></a>
1414
<a href="https://codecov.io/gh/modusensus/dsh-mneme"><img src="https://img.shields.io/codecov/c/github/modusensus/dsh-mneme/main?style=flat-square" alt="coverage"></a>
1515
<a href="https://github.com/awesome-dsh-plugin/awesome-dsh-plugin"><img src="https://awesome-dsh-plugin.com/badge.svg" alt="Awesome"></a>
1616
</p>
@@ -105,6 +105,7 @@ dsh web
105105
| **v0.7.0** | 自进化记忆:heat 幂律衰减 + sleep 双保护 + 实体热投影 | ✅ |
106106
| **v0.7.21** | 修复 autoDream/sleep 的 effort 回退在流式路径失效(catch 式回退死代码→流级捕获失败原因 + 去 effort 重试 + audit 记真实原因) | ✅ |
107107
| **v0.7.22** | 恢复 skipInvalid 宽容校验(issue #89:弱模型整单拒绝→单条跳过 + 合法子集应用 + run 记 degraded)+ autoDream 最小触发间隔 | ✅ |
108+
| **v0.7.23** | 记忆沉淀「反复失败」根治(consolidation 合法空数组 [] → no-op)+ 空体修复第二段(dreamMaxTokens 默认 8192→32768)+ skipInvalid splice 残留 bug | ✅ |
108109
| **v0.8.0** | 图谱增强:兴趣漂移可视化 + scope 隔离(issue #17)+ 跨 workspace 共享 | 🚧 计划中(9 月末) |
109110

110111
> 完整逐小版本路线图见 [dsh-mneme/README.md](dsh-mneme/README.md#-进化路线图)(中)/ [dsh-mneme/README.en.md](dsh-mneme/README.en.md#-evolution-roadmap)(英)。
@@ -114,7 +115,7 @@ dsh web
114115
```bash
115116
cd dsh-mneme
116117
npm install
117-
npm test # 662 个测试
118+
npm test # 712 个测试
118119
npm run stress # 三轴线压测
119120
npm run sync # src → lib 同步
120121
```
@@ -219,7 +220,7 @@ Works out of the box. Enable these as needed:
219220
```bash
220221
cd dsh-mneme
221222
npm install
222-
npm test # 662 tests
223+
npm test # 712 tests
223224
npm run stress # three-axis stress test
224225
npm run sync # src → lib sync
225226
```

‎dsh-mneme/CHANGELOG.md‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,20 @@
11
# Changelog
22

3+
## [0.7.23] - 2026-09-09
4+
5+
## 🐛 修复
6+
7+
- **记忆沉淀「反复失败」根治:consolidation 合法空数组 `[]` 不再误判失败**:CONSOLIDATION_PROMPT 明确允许「无问题的条目无需输出」,模型在记忆库无冗余时输出合法 JSON `[]`(**不是**空体/截断)——`validateDecisions` 却硬判 `decision list must be a non-empty array` → runDream 整单 failed、审计表反复记失败,**记忆越健康越容易「失败」**。与 sleep 空模式(skipped no-op)语义不一致,且**与模型无关**(任何遵守 prompt 的模型都会踩中,ChatGPT/Claude 同样)。修复:对空数组显式短路 `{ok:true, applied:0}` no-op(不可简单放行——隐式 keep 的覆盖率检查 0%<50% 会拦截)。Linux 本地真实 LLM(火山 coding OpenAI 端点)实测验证:无冗余场景 `ok:true applied:0 summary:true`,审计记 ok。
8+
- **空体修复第二段:`dreamMaxTokens` 默认 8192→32768**:思考型模型(v4 系)默认推理全开,8192 预算被 reasoning 烧光正文为空 → 默认预算翻四倍给推理留余量;上限 131072 不变,非思考模型实际用量远低无成本影响;设置面板可调。
9+
- **skipInvalid 恢复代码 splice 残留 bug(v0.6.9 原版就带,issue #89 回归路径)**:`decisions.splice` 守卫用长度相等代理「内容一致」——当「被跳非法决策数 == 隐式补齐 keep 数」时长度回等但内容已变,被跳决策残留进 apply/audit(重复 claim 的 merge 会被照样应用)→ 改无条件 splice。由本次新增的 skipInvalid 全量测试揪出。
10+
11+
## 🏗️ 工程
12+
13+
- **skipInvalid 恢复路径全量测试补全**(12 条:逐原因跳过 + 全局闸门交互 + runDream e2e)。
14+
- **合法空数组 e2e**:consolidation 返回 `[]` → run ok / applied 0 / summary 照跑 / audit+receipt 记 ok。
15+
- **webServer 可选化**:inject 声明去掉必填 webServer(headless/无 UI 宿主兼容),API 注册改运行时守卫。
16+
- **712 测试全绿**。
17+
318
## [0.7.22] - 2026-09-09
419

520
## 🐛 修复

‎dsh-mneme/README.en.md‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ English | [简体中文](README.md)
77
[![npm version](https://img.shields.io/npm/v/@modusensus/dsh-mneme?color=blue&label=npm)](https://www.npmjs.com/package/@modusensus/dsh-mneme)
88
[![license](https://img.shields.io/badge/license-MIT-green)](LICENSE)
99
[![Awesome](https://awesome-dsh-plugin.com/badge.svg)](https://github.com/awesome-dsh-plugin/awesome-dsh-plugin)
10-
[![tests](https://img.shields.io/badge/tests-685%20passed-success)](https://github.com/modusensus/dsh-mneme)
10+
[![tests](https://img.shields.io/badge/tests-712%20passed-success)](https://github.com/modusensus/dsh-mneme)
1111

1212
> A cross-session memory plugin for DeepSeek Harness: it lets the Agent remember you, remember your projects, and organize memories automatically. **Mneme** (Μνήμη) — named after Mnemosyne, the Greek goddess of memory who presides over memory and dreams, just as autoDream consolidates memories in the background.
1313
@@ -166,6 +166,7 @@ Every **background LLM call** (autoDream consolidation + summary, autoSummarize
166166
167167
| Version | Highlights |
168168
|------|------|
169+
| **v0.7.23** | Root-caused "memory consolidation keeps failing": a legal empty decision array `[]` from consolidation is no longer treated as a failure (CONSOLIDATION_PROMPT explicitly allows "no output when nothing needs changing", so a model with a healthy, non-redundant memory legitimately returns `[]` — yet `validateDecisions` hard-rejected it as `decision list must be a non-empty array`, failing the whole run and flooding the audit with failures; **model-agnostic** — ChatGPT/Claude hit the same trap; fix: empty array short-circuits to `ok:true` no-op instead of tripping the implicit-keep coverage check). Plus: empty-body fix part 2 (`dreamMaxTokens` default 8192→32768 so thinking models don't burn the whole budget on reasoning) + skipInvalid splice residue bug (length equality ≠ content equality, skipped decisions leaked into apply/audit); 712 tests green |
169170
| **v0.7.22** | Restored the v0.6.9 skipInvalid tolerant-validation path (issue #89 regression, lost in the v0.7.11 rewrite): `dreamSkipInvalid` (default true) skips individual invalid decisions, applies the valid subset, and marks the run degraded; `allowCrossTypeMerge` (default false) explicitly relaxes cross-type merging — weak models (e.g. qwen3.8-flash) with jittery schema compliance no longer fail the whole batch and burn LLM calls. Strict mode and the sleep path behave unchanged; global caps/coverage floors still reject the whole run (running over cap = broken model, not minor schema drift). New `dreamMinIntervalMinutes` (0–10080, default 0 = unlimited) minimum autoDream trigger interval — failed/degraded runs also consume the interval (throttling exists to stop back-to-back failing calls); feature_flags whitelist now 34 keys; 696 tests green |
170171
| **v0.7.21** | Fixed autoDream/sleep effort fallback being dead code on the stream path (the catch-based retry from v0.7.16 never fired): dsh-llm rc.1 turns adapter-stage failures (incl. `UNSUPPORTED_REASONING_EFFORT`) into a terminal error finish chunk instead of a throw; `streamText` now captures the finish-chunk failure cause (`describeStreamFailure` normalizes `{code,message}`) + `withEffortFallback` gains a `getStreamError` accessor (retries without effort when rejected) + `runAuditedLlm` supports `spec.streamError` (audit `error_message` carries the real cause; `run.error` stays a stable `"llm failed"`); 688 tests green |
171172
| **v0.7.20** | Heat model restored (issue #87): v0.7.0 self-evolving memory back (`src/heat.js` power-law decay `H=1/(1+λΔt)^α` + per-type half-lives), sleep demotion dual protection (cold time-window + heat<0.05 + importance<5), touchRecalled gating back on `heatEnabled`, entity heat projection (ego node heat → size/opacity), recall_runs recording on by default; **default OFF** (matches v0.7.12 behavior out of the box) + feature_flags whitelist rollback switch + lightMode linkage + sleep demotion audit counts exposed (workbench can show "N demoted") + phase-two frontend (/list heat projection, HeatBadge three-tier badge, self-gated status heat-distribution card, order=heat page-local sort, all self-gated); better-sidebar fix (issue #88: soft integration moved to an inner dynamic sub-plugin, no more startup failure without bs); 685 tests green |
@@ -440,7 +441,7 @@ src/
440441
lib/
441442
├── client.js # Web 面板(手写 ModuleLoader bundle)
442443
└── *.js # src 的同步分发产物
443-
test/ # 662 node:test tests (audit + three-axis stress invariants)
444+
test/ # 712 node:test tests (audit + three-axis stress invariants)
444445
scripts/ # e2e-dsh.js 端到端演示 · stress-dsh.js 三轴线压测 · sync-lib.js 同步
445446
```
446447
@@ -449,7 +450,7 @@ scripts/ # e2e-dsh.js 端到端演示 · stress-dsh.js 三轴线压
449450
```bash
450451
cd dsh-mneme
451452
npm install # 安装 peer 依赖(以 devDependencies 形式,用于本地测试)
452-
npm test # 运行 662 个测试
453+
npm test # 运行 712 个测试
453454
npm run stress # 三轴线压测:长会话检索 / 冲突仲裁 / 多 Agent 并发(离线 mock LLM)
454455
npm run sync # 把 src/ 同步到 lib/(发布时由 prepack 钩子自动执行)
455456
```

‎dsh-mneme/README.md‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
[![npm version](https://img.shields.io/npm/v/@modusensus/dsh-mneme?color=blue&label=npm)](https://www.npmjs.com/package/@modusensus/dsh-mneme)
66
[![license](https://img.shields.io/badge/license-MIT-green)](LICENSE)
77
[![Awesome](https://awesome-dsh-plugin.com/badge.svg)](https://github.com/awesome-dsh-plugin/awesome-dsh-plugin)
8-
[![tests](https://img.shields.io/badge/tests-685%20passed-success)](https://github.com/modusensus/dsh-mneme)
8+
[![tests](https://img.shields.io/badge/tests-712%20passed-success)](https://github.com/modusensus/dsh-mneme)
99
[![CI](https://img.shields.io/github/actions/workflow/status/modusensus/dsh-mneme/ci.yml)](https://github.com/modusensus/dsh-mneme/actions)
1010
[![node](https://img.shields.io/badge/node-24%2B-blue)](https://nodejs.org)
1111
[![npm downloads](https://img.shields.io/npm/dm/@modusensus/dsh-mneme?color=blue&label=downloads)](https://www.npmjs.com/package/@modusensus/dsh-mneme)
@@ -207,6 +207,7 @@ v0.3.0 起新增**记忆基因**层:从记忆里抽取**命名实体**、**带
207207
208208
| 版本 | 亮点 |
209209
|------|------|
210+
| **v0.7.23** | 记忆沉淀「反复失败」根治:consolidation 合法空数组 `[]` 不再误判 failed(CONSOLIDATION_PROMPT 允许「无问题无需输出」,模型无冗余时合法返回 `[]`——此前 `validateDecisions` 硬判 non-empty → 整单 failed、审计反复失败,且与模型无关,ChatGPT/Claude 同样踩中;修复:空数组显式短路 `ok:true` no-op)+ 空体修复第二段(`dreamMaxTokens` 默认 8192→32768,思考模型推理烧光预算的根治余量,设置面板可调)+ skipInvalid splice 残留 bug(长度相等≠内容一致,被跳决策残留);712 测试全绿 |
210211
| **v0.7.22** | 恢复 v0.6.9 的 skipInvalid 宽容校验路径(issue #89 回归,v0.7.11 重写丢失):`dreamSkipInvalid`(默认 true)单条非法决策跳过 + 合法子集应用 + run 记 degraded,`allowCrossTypeMerge`(默认 false)显式放宽跨类型合并——弱模型(如 qwen3.8-flash)决策合规抖动不再整单拒绝白烧 LLM 调用;严格模式/sleep 路径行为不变,全局上限/覆盖率下限仍整单拒绝(刷爆上限=模型坏了,非轻微 schema 漂移);新增 `dreamMinIntervalMinutes`(0-10080,默认 0=不限)autoDream 最小触发间隔,失败/degraded run 也占用间隔(节流防失败调用连发);feature_flags 白名单 34 键;696 测试全绿 |
211212
| **v0.7.21** | 修复 autoDream/sleep 的 effort 回退在流式路径失效(v0.7.16 的 catch 式回退是死代码):dsh-llm rc.1 把 adapter 阶段异常(含 `UNSUPPORTED_REASONING_EFFORT`)转成终态 error finish chunk 不再抛出;`streamText` 现捕获 finish-chunk 失败原因(新增 `describeStreamFailure` 归一化 `{code,message}`)+ `withEffortFallback` 增加 `getStreamError` 访问器(effort 被拒时去掉重试一次)+ `runAuditedLlm` 支持 `spec.streamError`(audit 行 `error_message` 携带真实原因,`run.error` 稳定 `"llm failed"` 不变);688 测试全绿 |
212213
| **v0.7.20** | heat 热度模型回归(issue #87):找回 v0.7.0 自进化记忆(`src/heat.js` 幂律衰减 `H=1/(1+λΔt)^α` + per-type 差异化半衰期)、sleep 降级热联合双保护(时间窗冷 + heat<0.05 + importance<5)、touchRecalled 门控改回 `heatEnabled`、实体热投影(ego 节点 heat → 前端大小/明暗)、recall_runs 默认记录;**默认关**(默认=与 v0.7.12 行为一致)+ feature_flags 白名单回滚开关 + lightMode 联动 + sleep 降级审计计数暴露(工作动态可展示"降级 N 条")+ 阶段二前端(/list heat 投影、HeatBadge 三档徽章、状态页热度分布卡、order=heat 页内排序,全部自门控);better-sidebar 修复(issue #88:软集成改内层动态子插件,无 bs 环境不再启动失败);685 测试全绿 |
@@ -292,6 +293,7 @@ v0.3.0 起新增**记忆基因**层:从记忆里抽取**命名实体**、**带
292293
| **v0.7.18** | ✅ 完成 | 生态第一步 + 查询收敛 | better-sidebar 软集成(inject 声明 + optional peer `dsh-better-sidebar` + registerTab 复用四视图,未装安全跳过;窄容器 `@container` 适配)+ `/list?deposited=only` 沉淀视图(receipt_chain ∪ source=dream)+ 记忆库沉淀/已归档筛选 chip + 状态页仪表盘化(统计 + 查看全部跳转预置筛选)+ 抽屉归档记忆「恢复」;667 测试全绿 |
293294
| **v0.7.20** | ✅ 完成 | heat 回归 + 阶段二前端 + better-sidebar 修复 | heat 热度模型完整找回(issue #87,v0.7.10 移植:幂律衰减 + TYPE_DECAY + sleep 热联合双保护 + 实体热投影)+ 验收清单落地(heatEnabled 默认关 / feature_flags 31 键 / lightMode 联动 / sleep 降级审计暴露 / updated_at⊥last_accessed_at 契约)+ 阶段二前端(/list heat 投影、HeatBadge 三档、order=heat 页内排序)+ better-sidebar 修复(issue #88:内层动态子插件);685 测试全绿 |
294295
| **v0.7.21** | ✅ 完成 | effort 回退流式修复 | autoDream/sleep 的 catch 式 effort 回退在流式路径是死代码(dsh-llm rc.1 把 adapter 异常转成终态 error finish chunk 不再抛出)→ `streamText` 捕获 finish-chunk 失败原因(`describeStreamFailure` 归一化)+ `withEffortFallback` 增加 `getStreamError` 访问器(effort 被拒去重试)+ `runAuditedLlm` 支持 `spec.streamError`(audit 记真实原因);688 测试全绿 |
296+
| **v0.7.23** | ✅ 完成 | 记忆沉淀「反复失败」根治 + 空体第二段 + skipInvalid splice 修复 | consolidation 合法空数组 `[]` no-op(CONSOLIDATION_PROMPT 允许无问题无需输出;此前 validateDecisions 硬判 non-empty → 整单 failed,模型无关、ChatGPT/Claude 同样踩中;修复:空数组显式短路 ok,不再触发隐式 keep 覆盖率误判);`dreamMaxTokens` 默认 8192→32768(思考模型推理烧光预算根治余量);skipInvalid splice 残留 bug(长度相等≠内容一致,被跳决策残留进 apply);712 测试全绿 |
295297
| **v0.7.22** | ✅ 完成 | skipInvalid 宽容校验回归(issue #89)+ autoDream 节流 | 恢复 v0.6.9 的 skipInvalid 双轨结构(v0.7.11 重写丢失):`dreamSkipInvalid` 单条非法决策跳过 + 合法子集应用 + run 记 degraded,`allowCrossTypeMerge` 显式放宽跨类型合并;弱模型(qwen3.8-flash)决策合规抖动不再整单拒绝;新增 `dreamMinIntervalMinutes`(0-10080,默认 0=不限)最小触发间隔,失败/degraded run 也占用间隔;严格模式/sleep 路径行为不变;feature_flags 白名单 34 键;696 测试全绿 |
296298
| **v0.8.0** | 🚧 计划中(9 月末) | 图谱增强 | 兴趣漂移可视化 + scope 隔离(issue #17)+ 跨 workspace 记忆共享 |
297299

@@ -527,7 +529,7 @@ src/
527529
├── api.js # HTTP 路由(Web 面板数据通道)
528530
└── index.js # 插件接线
529531
lib/ # src 的同步分发产物(npm run sync;发布前由 root prepack 的 check-sync.js 校验一致性;唯一手写例外 lib/client.js——Web 面板 bundle,sync 不覆盖)
530-
test/ # 662 个 node:test 测试(审计与三轴线压测不变量;src↔lib 一致性由 scripts/check-sync.js 发布闸门校验)
532+
test/ # 712 个 node:test 测试(审计与三轴线压测不变量;src↔lib 一致性由 scripts/check-sync.js 发布闸门校验)
531533
scripts/ # e2e-dsh.js 端到端演示 · stress-dsh.js 三轴线压测 · sync-lib.js 同步 · check-sync.js 发布闸门 · benchmark-recall.js 召回基准
532534
```
533535
@@ -536,7 +538,7 @@ scripts/ # e2e-dsh.js 端到端演示 · stress-dsh.js 三轴线压
536538
```bash
537539
cd dsh-mneme
538540
npm install # 安装 peer 依赖(以 devDependencies 形式,用于本地测试)
539-
npm test # 运行 662 个测试
541+
npm test # 运行 712 个测试
540542
npm run stress # 三轴线压测:长会话检索 / 冲突仲裁 / 多 Agent 并发(离线 mock LLM)
541543
npm run sync # 把 src/ 同步到 lib/(发布时由 prepack 钩子自动执行)
542544
```

‎dsh-mneme/bin/cli.mjs‎

100644100755
File mode changed.

0 commit comments

Comments
 (0)