@heixui/dsh-session-suite 0.3.4 → 0.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -345,6 +345,45 @@ anything, and it never deletes real content.
345
345
  as symptom → root cause → fix. Read it before changing the snapshot, compaction,
346
346
  memory, or export paths.
347
347
 
348
+ `docs/memory-architecture.md` maps the memory engine against the standard
349
+ two-layer agent-memory design, with measured numbers rather than claims — including
350
+ the parts that are deliberately not built and why.
351
+
352
+ ## What changed in 0.4.1
353
+
354
+ A sidebar entry, plus three fixes for things that looked functional but were not.
355
+
356
+ | Area | Before | Now |
357
+ |---|---|---|
358
+ | Where to find it | Settings → Snapshots / Long-term memory, three steps away | A **sidebar entry** opens everything in place; the three duplicate Settings sections are removed |
359
+ | Memory count | Panel said 17, Settings said 51 — one question, two answers | The panel walks **every registered workspace**; each figure states what it counts |
360
+ | Archive restore | Clicked, nothing happened, the mark on disk never changed | Fixed an argument-shape mismatch between the two Host services; restore now takes effect |
361
+ | Long lists | The panel clipped its content; the wheel did nothing | The panel scrolls |
362
+
363
+ **Why the counts disagreed (the real 0.4.0 defect):** long-term memory has a *global*
364
+ store plus one store per workspace. `longterm.list` without a `cwd` returns only the
365
+ global store (17 rows); with a `cwd` it returns global plus that workspace. The panel
366
+ has no workspace of its own, so it showed the 17. It now enumerates every registered
367
+ workspace instead.
368
+
369
+ ## What changed in 0.4.0
370
+
371
+ The memory engine was reorganised; the session features are unchanged.
372
+
373
+ | Area | Before | Now |
374
+ |---|---|---|
375
+ | Duplicate memories | One topic occupied 7 of 46 entries | Maintenance is idempotent (verified across 6 passes); existing duplicates merged into cold storage |
376
+ | Resident layer | 2 flat entries mixed into the "relevant" block | Up to 5 topic cards, in their own labelled section |
377
+ | Episodic memory | Absent | `kind: 'episode'` with time, context, and outcome; decays twice as fast |
378
+ | Dense reranking | Implemented but off, weight unverified | **Optional, off by default**, weight calibrated by measurement (MRR 0.535 → 0.760 on 8 paraphrased queries, recall unchanged) |
379
+ | Privacy | Scope only | `public` / `internal` / `secret`; credentials auto-detected; `secret` never injected or exported |
380
+ | Implicit queue | Keyword gate dropped 7 of 10 valid candidates | Gate removed; an empty queue now states why it is empty |
381
+
382
+ **Embedding is optional and adds no download by default.** Lexical retrieval alone is
383
+ the default behaviour; installing a model adds cross-lingual and paraphrase recall.
384
+ See `docs/memory-architecture.md` for the measured effect and
385
+ `tools/download-embedding.mjs` for the deliberate, explicit install path.
386
+
348
387
  ## Limits
349
388
 
350
389
  * Rewinding does not rewrite the durable log; it forks at the target message and archives the old session. That
package/README.zh.md CHANGED
@@ -157,13 +157,49 @@ tools/ 自测脚本与预清理脚本(不随插件打包)
157
157
  docs/ 需求与 API 笔记
158
158
  ```
159
159
 
160
+ ## 0.4.0 改了什么
161
+
162
+ 本次重构的是记忆引擎,会话相关功能未变。
163
+
164
+ | 方面 | 改前 | 改后 |
165
+ |---|---|---|
166
+ | 重复记忆 | 46 条里同一主题占 7 条 | 维护幂等(连续 6 轮验证);存量重复已合并进冷库 |
167
+ | 常驻层 | 2 条扁平记忆,混在「相关」区块里 | 最多 5 张主题卡片,独立分区标注 |
168
+ | 情景记忆 | 没有 | `kind: 'episode'`,带发生时间、情境、结果;衰减加倍 |
169
+ | dense 重排 | 实现了但默认关,权重未验证 | **可选,默认关**;权重经实测校准(8 条改写查询 MRR 0.535→0.760,recall 不变) |
170
+ | 隐私分级 | 只有 scope | `public`/`internal`/`secret`;凭据自动识别;secret 永不注入、永不导出 |
171
+ | 隐式队列 | 关键词闸门误杀 7/10 合法候选 | 闸门已移除;空队列会说明原因 |
172
+
173
+ **embedding 是可选增强,默认不下载任何东西。** 不装模型就是纯词法检索,功能完整;装了才有跨语言与改写召回。
174
+ 实测效果与安装方式见 `docs/memory-architecture.md` 和 `tools/download-embedding.mjs`。
175
+
176
+ ## 0.4.1 改了什么
177
+
178
+ 新增侧边栏入口,并修掉三个「看起来能用、实际没生效」的问题。
179
+
180
+ | 方面 | 改前 | 改后 |
181
+ |---|---|---|
182
+ | 入口位置 | 只能在 设置 → 会话快照 / 长期记忆 里找,三步才能到 | **左侧栏「会话套件」图标**,点开即用;设置页那三个重复入口已移除 |
183
+ | 记忆总数 | 面板显示 17,设置页显示 51 —— 同一句话两个数 | 面板遍历**所有已登记工作区**,与设置页一致;每个数字都写明统计口径 |
184
+ | 归档恢复 | 点了没反应,磁盘上的标记纹丝不动 | 修了参数签名(两个 Host 服务的入参形状不同),恢复真正生效 |
185
+ | 长列表滚动 | 面板内容被裁掉,滚轮无效 | 面板可滚动 |
186
+
187
+ **为什么数字会不一样(0.4.0 的真实缺陷)**:长期记忆分「全局库」和「各工作区的库」。
188
+ `longterm.list` 不带 `cwd` 时只返回全局库(17 条),带上 `cwd` 才是全局 + 该工作区。
189
+ 面板没有工作区概念,于是只显示了全局那 17 条。现在面板不带 `cwd` 时会遍历所有已登记工作区。
190
+
160
191
  ## 测试
161
192
 
162
- 两个自测脚本都在临时目录里跑,不会碰真实的 DSH 数据。
193
+ 全部自测脚本都在临时目录里跑,不会碰真实的 DSH 数据。
163
194
 
164
195
  ```bash
165
- node tools/selftest.mjs # 快照 / 忽略规则 / 恢复 / 淘汰 / 记忆
166
- node tools/selftest-rollback.mjs # 回滚 / 撤销 / 删除消息 / 分享 / 永久删除
196
+ node tools/selftest.mjs # 快照 / 忽略规则 / 恢复 / 淘汰 / 记忆
197
+ node tools/selftest-memory-dedupe.mjs # 维护幂等,重复不再生成
198
+ node tools/selftest-resident-cards.mjs # 常驻卡片分组与预算
199
+ node tools/selftest-episode-memory.mjs # 情景记忆类型与衰减
200
+ node tools/selftest-memory-privacy.mjs # 隐私分级与导出过滤
201
+ node tools/selftest-implicit-queue.mjs # 隐式候选不再被误杀
202
+ node tools/probe-dense-rerank.mjs # dense 重排的实测对比(需要模型)
167
203
  ```
168
204
 
169
205
  ## 已知边界