@a9i5k4/dsh-auto-memory 3.1.5 → 3.1.7

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.
Files changed (93) hide show
  1. package/docs/CONTINUITY-FLOW.md +6 -6
  2. package/docs/HANDBOOK.md +54 -53
  3. package/docs/M-CM-PLAN.md +1 -1
  4. package/docs/M-CM-STATE.md +1 -1
  5. package/docs/M-CM7-HANDOFF-LAYERED-RETRIEVAL.md +1 -1
  6. package/docs/M3B-CONTRACT.md +7 -7
  7. package/docs/M7-AUTONOMOUS-STATE.md +1 -1
  8. package/docs/M7-TASKSET-DISPATCH.md +1 -1
  9. package/docs/PROMPT-PACK-LAYERED-RECALL.md +3 -3
  10. package/docs/PROMPT-SET-STRICT.md +3 -3
  11. package/docs/RELEASE-GO-NOGO.md +1 -1
  12. package/docs/STATUS-BOARD.md +1 -1
  13. package/docs/USER-GUIDE.en.md +21 -21
  14. package/docs/USER-GUIDE.zh-CN.md +21 -21
  15. package/docs/WHITEPAPER.md +1 -1
  16. package/docs/prompts/FIX-AGENT-P12-FULL-REGRESSION.md +1 -1
  17. package/docs/prompts/LIVE-VERIFY-ZCODE.md +2 -2
  18. package/docs/prompts/P2-semantic-recall.md +2 -2
  19. package/docs/prompts/P7-write-fix.md +1 -1
  20. package/docs/prompts/RELEASE-AGENT.md +4 -4
  21. package/docs/prompts/ZCODE-DROPIN.md +1 -1
  22. package/lib/acceptance.js +6 -6
  23. package/lib/activation-host.js +15 -14
  24. package/lib/activation-inbox-state.js +4 -4
  25. package/lib/activation-inbox.js +44 -44
  26. package/lib/board-mode.js +3 -3
  27. package/lib/client.js +225 -41
  28. package/lib/config-io.js +12 -12
  29. package/lib/context-bridge.js +22 -22
  30. package/lib/context-host.js +24 -23
  31. package/lib/datadir.js +95 -0
  32. package/lib/degrade.js +21 -21
  33. package/lib/dsh-home.js +8 -8
  34. package/lib/engine-identity.js +12 -12
  35. package/lib/engine-switch.js +3 -3
  36. package/lib/episodic-store.js +13 -13
  37. package/lib/evidence-agg.js +4 -4
  38. package/lib/evidence-store.js +12 -12
  39. package/lib/fact-store.js +47 -47
  40. package/lib/handoff-anchor.js +4 -4
  41. package/lib/hub-io.js +356 -3
  42. package/lib/index-sync.js +5 -5
  43. package/lib/index.js +426 -242
  44. package/lib/intent-clean-safe.js +3 -3
  45. package/lib/intent-clean.js +1 -1
  46. package/lib/l0-extract.js +15 -15
  47. package/lib/l0-index-sync.js +8 -8
  48. package/lib/l0-index.js +11 -11
  49. package/lib/ledger-criteria.js +8 -8
  50. package/lib/m4-corpus.js +1 -1
  51. package/lib/m7-index-sync-host.js +2 -2
  52. package/lib/m7-wire.js +24 -24
  53. package/lib/memory-anchor.js +1 -1
  54. package/lib/memory-envelope.js +15 -15
  55. package/lib/memory-hub.js +95 -50
  56. package/lib/memory-importance.js +7 -7
  57. package/lib/memory-mutation.js +5 -5
  58. package/lib/note-status-apply.js +2 -2
  59. package/lib/note-status.js +7 -7
  60. package/lib/policies/activation_policy_v2.json +2 -2
  61. package/lib/policies/recall_intent_lr_v1.json +1 -1
  62. package/lib/procedure-observation.js +2 -2
  63. package/lib/procedure-store.js +117 -28
  64. package/lib/python-setup.js +6 -5
  65. package/lib/python-sidecar-client.js +26 -26
  66. package/lib/recall-fusion.js +12 -12
  67. package/lib/recall-stats.js +36 -1
  68. package/lib/rerank-host.js +11 -11
  69. package/lib/rules-edit.js +9 -9
  70. package/lib/rules-layer.js +26 -26
  71. package/lib/semantic-decide.js +7 -7
  72. package/lib/semantic-js.js +13 -13
  73. package/lib/shadow-host.js +7 -6
  74. package/lib/shadow-retrieval.js +40 -40
  75. package/lib/skill-export-host.js +7 -7
  76. package/lib/skill-export.js +6 -6
  77. package/lib/state-commit.js +10 -10
  78. package/lib/storage-manage.js +6 -6
  79. package/lib/tier-layer-inject.js +28 -28
  80. package/lib/tier0-catalog.js +4 -4
  81. package/lib/wb-contract.js +45 -45
  82. package/lib/wb-sidecar.js +11 -11
  83. package/package.json +3 -4
  84. package/python/m7_activation_features_v2.py +7 -7
  85. package/python/m7_embedding_v1.py +12 -12
  86. package/python/policies/activation_policy_v2.json +2 -2
  87. package/python/policies/decision-record-activation-v2-delta-exp-override-20260824.json +1 -1
  88. package/python/policies/decision-record-reasoning-kind-admission-20260826.json +2 -2
  89. package/python/policies/decision-record-stale-gate-per-candidate-20260825.json +2 -2
  90. package/python/policies/recall_intent_lr_v1.json +1 -1
  91. package/python/verify_policy_artifact.py +3 -3
  92. package/python/worker_semantic_v1.py +18 -18
  93. package/python/worker_v1.py +18 -18
@@ -17,7 +17,7 @@
17
17
  | **S4** | 建新会话 | 材料就绪 | `sessionController.create` | 新 sessionId + 工作区绑定 |
18
18
  | **S5** | 状态沿用 | 会话创建后 | `selectModel` | provider / model / reasoningEffort |
19
19
  | **S6** | 首轮注入 | 新会话首条 | `carryText` 作为 prompt | 新窗口上下文 |
20
- | **S7** | 按需取回 | 推进中 | `memory_recall_pre` / `read` | 细节补充 |
20
+ | **S7** | 按需取回 | 推进中 | `memory_recall` / `read` | 细节补充 |
21
21
 
22
22
  ---
23
23
 
@@ -73,8 +73,8 @@
73
73
  **执行方式**:`client` 通过 `remote.session.prompt` 把指令发回**旧会话**(`:2047`)。
74
74
 
75
75
  **旧 AI 被要求做的事**(`:2050-2054`,本轮内只做这两件):
76
- 1. `memory_note_pre(kind=plan, …)` 重写 PLAN.md(项目白板最新全貌)
77
- 2. `memory_note_pre(kind=handoff, …)` 写一篇四段式账本
76
+ 1. `memory_note(kind=plan, …)` 重写 PLAN.md(项目白板最新全貌)
77
+ 2. `memory_note(kind=handoff, …)` 写一篇四段式账本
78
78
  - 四段:`## 任务状态` / `## 目标` / `## 已试方案与失败原因` / `## 进度与下一步`
79
79
  - 每段 ≤5 行;下一步必须是**可直接执行的第一步**,带文件路径或命令
80
80
  3. 完成后只回复「已刷新」
@@ -144,15 +144,15 @@
144
144
  | | 文案 |
145
145
  |---|---|
146
146
  | 改前 | **接续前先用 read 工具读取该转写文件**,以完全理解旧会话的讨论、结论与未竟事项 |
147
- | 改后 | 完整转写已归档,**不必在接续前通读**:仅在第0-2层不足以推进时再 read;优先用 `memory_recall_pre(scope='sessions', query='关键词')` 定位片段,避免整篇读入 |
147
+ | 改后 | 完整转写已归档,**不必在接续前通读**:仅在第0-2层不足以推进时再 read;优先用 `memory_recall(scope='sessions', query='关键词')` 定位片段,避免整篇读入 |
148
148
 
149
149
  **改动意图**:分层此前被"全读"指令架空——模型被要求通读就不会选择性取用。改后分层才真正生效。
150
150
 
151
151
  ### S7 · 按需取回
152
152
 
153
- - `memory_recall_pre(scope='sessions' | 'handoff' | 'all', query=…)`:轻量直返,带 provenance 与预算截断
153
+ - `memory_recall(scope='sessions' | 'handoff' | 'all', query=…)`:轻量直返,带 provenance 与预算截断
154
154
  - `read`:完整转写(仅在前述不足时)
155
- - `memory_recall_pre` 亦可跨 WorkBuddy / CodeBuddy / Claude Code / Codex / ZCode / Kimi Code / TRAE 检索
155
+ - `memory_recall` 亦可跨 WorkBuddy / CodeBuddy / Claude Code / Codex / ZCode / Kimi Code / TRAE 检索
156
156
 
157
157
  ---
158
158
 
package/docs/HANDBOOK.md CHANGED
@@ -13,11 +13,11 @@
13
13
  | **DSH** | **DeepSeek Harness**,宿主应用。以 CLI `dsh` 启动,提供浏览器 UI(`dsh web`)与插件装载能力。Windows 默认装在 `%APPDATA%\npm\node_modules\@deepseek-ai\dsh`(**不要写死某个用户名**) |
14
14
  | **Cordis** | DSH 使用的插件框架(`@deepseek-ai/cordis ^4.0.1`)。本插件是 Cordis 插件,通过 `cordis.patch.yml` 注入宿主 |
15
15
  | **本插件** | `dsh-auto-memory`,包名同名,工程根目录 `D:\dsh-auto-memory` |
16
- | **pre 线 / `-pre.js`** | 源码约定:新增模块一律命名为 `lib/xxx-pre.js`(纯函数、零 IO、IO 注入)。发布时由 `tools/release.mjs` 的**转换表**剥去 `-pre` 生成同名 `lib/xxx.js`。**改源码改 `-pre.js`;`lib/xxx.js` 是产物,禁止手改** |
17
- | **命名口径(发布名 vs pre 名)** | 同一份身份在两条线上拼写不同,**本手册正文一律给「发布名」——即用户实际装到的那个**;pre 开发树各加 `-pre`。成对关系:端点前缀 `/api/dsh-auto-memory/` ↔ `/api/dsh-auto-memory-pre/`;诊断日志 `dsh-auto-memory-diagnose.log` ↔ `dsh-auto-memory-pre-diagnose.log`;配置 `dsh-auto-memory.json` ↔ `dsh-auto-memory-pre.json`;目录 `memory/hub/` ↔ `memory/hub-pre/`、`memory/evidence/` ↔ `memory/evidence-pre/`、`memory/index/` ↔ `memory/index-pre/`、`memory/semantic/` ↔ `memory/semantic-pre/`。**★例外:`memory/degrade-pre/` 转换表里没有对应规则 ⇒ 发布物里仍叫 `degrade-pre`,不要改成 `degrade`**。依据:`tools/release.mjs` 转换表 + 已发布产物 `D:\dsh_debug\_publish_dsh-auto-memory\lib\index.js` |
16
+ | **源码约定** | 新增模块一律命名为 `lib/xxx.js`(纯函数、零 IO、IO 注入)。去 pre 后**没有 `-pre` 后缀与孪生体**,发布构建为纯复制。 |
17
+ | **命名口径** | 去 pre 后**只有一套名字**:源码名即发布名,不再有 `-pre` 变体。此前「pre 树带 `-pre`、发布时由 `tools/release.mjs` 转换表剥掉」的双名机制已整体退役(该表已删除,构建退化为纯复制)。 |
18
18
  | **宿主侧 / 后端** | `lib/index.js`,运行在 Node 进程里,负责存储、检索、端点、工具、调度 |
19
19
  | **浏览器侧 / 前端** | `lib/client.js`,注入到 DSH 浏览器 UI,负责面板与设置页 |
20
- | **工具(tool)** | 供模型调用的函数(类似 MCP 工具)。本插件注册 **18 个**;pre 树名字以 `_pre` 结尾,发布名去掉 `_pre`(如 `memory_recall`) |
20
+ | **工具(tool)** | 供模型调用的函数(类似 MCP 工具)。本插件注册 **19 个**;pre 树名字以 `_pre` 结尾,发布名去掉 `_pre`(如 `memory_recall`) |
21
21
  | **水位(water level)** | 当前会话上下文占用比例(0–1)。用于决定何时触发接续 |
22
22
  | **接续 / handoff** | 上下文将满时,把进度交接给一个新会话继续工作的机制 |
23
23
  | **主动联想** | 不等用户询问,由系统主动判断"该想起什么"并注入上下文——本插件的核心差异化能力 |
@@ -27,7 +27,7 @@
27
27
  | **BM25** | 经典词法相关性算法 |
28
28
  | **M8 / 记忆中枢** | 三层记忆存储(fact 事实/episodic 经历/procedure 技能)与编排器 memory-hub 的合称 |
29
29
  | **evidence(证据)** | 记忆被使用情况的记录,六类:`seen`(曝光)/`read`(读到原文)/`cite`(回复引用)/`reuse`(跨会话复用)/`success`(任务成功)/`correction`(用户纠正) |
30
- | **endpoint / 端点** | 后端 HTTP 接口,路径前缀统一为 `/api/dsh-auto-memory/`(pre 树为 `/api/dsh-auto-memory-pre/`),共 54 条 |
30
+ | **endpoint / 端点** | 后端 HTTP 接口,路径前缀统一为 `/api/dsh-auto-memory/`(pre 树为 `/api/dsh-auto-memory/`),共 54 条 |
31
31
 
32
32
  ---
33
33
 
@@ -36,7 +36,7 @@
36
36
  本插件给 DSH 加一套**长期记忆系统**:记忆以 Markdown 文件存放在用户目录下,插件负责写入、检索、在合适时机主动提醒模型,并在上下文将满时把进度交给新会话。
37
37
 
38
38
  - 工程根:`D:\dsh-auto-memory`
39
- - 源码:`lib/index.js`(宿主侧,约 11,600 行)、`lib/client.js`(浏览器侧)、`lib/*-pre.js`(各纯核心模块,62 个文件)
39
+ - 源码:`lib/index.js`(宿主侧,约 11,600 行)、`lib/client.js`(浏览器侧)、`lib/*.js`(各纯核心模块)
40
40
  - 发布产物:`lib/`(含剥名后的 `.js`)、`python/`、`docs/`、`cordis.patch.yml`
41
41
  - 运行时依赖:**零**。`dependencies` 为空;peer 为 cordis;optional 为 transformers
42
42
 
@@ -75,11 +75,11 @@ dsh web --no-open --port 0
75
75
  │ · 语义引擎环境检测面板 │
76
76
  │ 仅负责「展示 + 收集用户操作」,通过 DSH 远程 API 调用后端 │
77
77
  └───────────────┬───────────────────────────────────────────┘
78
- │ HTTP /api/dsh-auto-memory/*(pre 树为 /api/dsh-auto-memory-pre/*)
78
+ │ HTTP /api/dsh-auto-memory/*(pre 树为 /api/dsh-auto-memory/*)
79
79
  ┌───────────────▼───────────────────────────────────────────┐
80
- │ 宿主侧(后端)lib/index.js + lib/*-pre.js │
80
+ │ 宿主侧(后端)lib/index.js + lib/*.js │
81
81
  │ · 端点路由(54 个) │
82
- │ · 工具(18 个,供模型调用) │
82
+ │ · 工具(19 个,供模型调用) │
83
83
  │ · 存储:记忆文件、M8 三层 JSON、evidence 事件 JSONL │
84
84
  │ · 检索:C1 词法 / C2 语义 / C3 Python 语义 │
85
85
  │ · 决策:主动联想门控、接续调度、水位监测 │
@@ -95,14 +95,14 @@ dsh web --no-open --port 0
95
95
  ```
96
96
 
97
97
  > ⚠️ **诊断日志的位置**:`~/.dsh/dsh-auto-memory-diagnose.log` —— 它与 `memory/` **同级**,不在 `memory/` 里面
98
- > (代码依据:`lib/index.js` 里是 `path.join(dshHome(), 'dsh-auto-memory-pre-diagnose.log')`,没有 `'memory'` 这一段)。
98
+ > (代码依据:`lib/index.js` 里是 `path.join(dshHome(), 'dsh-auto-memory-diagnose.log')`,没有 `'memory'` 这一段)。
99
99
  > 打包日志时先确认文件存在再交:`ls -l ~/.dsh/*diagnose*.log`
100
100
 
101
101
  ```
102
102
 
103
103
  **数据流向(一次典型记忆检索)**:
104
104
 
105
- 1. 模型调用工具 `memory_recall`(pre 树 `memory_recall_pre`;或前端点选)→ 宿主侧 `recall()`
105
+ 1. 模型调用工具 `memory_recall`(pre 树 `memory_recall`;或前端点选)→ 宿主侧 `recall()`
106
106
  2. `recall()` 构建 L0 语料(从日志/反思/笔记抽取摘要)
107
107
  3. 词法臂(C1)打 L0、语义臂(C2)打 L0;若查询含时间表达,追加时间臂
108
108
  4. 三臂经 `rankFusionRRFPre`(rank-space,k=60)融合排序
@@ -132,7 +132,7 @@ dsh web --no-open --port 0
132
132
 
133
133
  - **位置**:记忆窗格内的「记忆中枢」页签
134
134
  - **内容**:技能(procedure)/事实(fact)/经历(episodic)三栏
135
- - **预期**:有内容时显示条目;无内容显示正确空态;数据来自 `memory\hub\*.json`(pre 树为 `memory\hub-pre\*.json`)
135
+ - **预期**:有内容时显示条目;无内容显示正确空态;数据来自 `memory\hub\*.json`
136
136
 
137
137
  ### 4.3 设置分组(`data-dam-settings-group`)
138
138
 
@@ -154,7 +154,7 @@ dsh web --no-open --port 0
154
154
  | `procedurePromotionEnabled` | false | 开启 → 技能晋升可用 |
155
155
  | `unattendedMode` / `awayMinutes` | false / 60 | 无人值守相关(**设置页 UI 尚未核实,属待办**) |
156
156
 
157
- > ⚠️ 修改设置后需要**重载/重启 dsh web**才生效的场景,以实际观察为准;若改完无变化,先查 `/api/dsh-auto-memory/config`(pre 树 `/api/dsh-auto-memory-pre/config`)是否已回写。
157
+ > ⚠️ 修改设置后需要**重载/重启 dsh web**才生效的场景,以实际观察为准;若改完无变化,先查 `/api/dsh-auto-memory/config`(pre 树 `/api/dsh-auto-memory/config`)是否已回写。
158
158
 
159
159
  ### 4.4 语义引擎环境检测面板(`data-dam-detect-panel`)
160
160
 
@@ -200,21 +200,21 @@ dsh web --no-open --port 0
200
200
  ### 5.2 日志
201
201
 
202
202
  - **诊断日志**:`~/.dsh/dsh-auto-memory-diagnose.log`(Windows:`%USERPROFILE%\.dsh\dsh-auto-memory-diagnose.log`)
203
- - **★它不在 `memory/` 下面**:代码是 `path.join(dshHome(), 'dsh-auto-memory-pre-diagnose.log')`(pre 树),无 `'memory'` 段
203
+ - **★它不在 `memory/` 下面**:代码是 `path.join(dshHome(), 'dsh-auto-memory-diagnose.log')`(pre 树),无 `'memory'` 段
204
204
  - 关键线索:插件加载异常、`diag(...)` 输出的降级与状态(如 `hub success evidence: +N`、`p9a correction attribution: ...`)
205
- - **证据事件**:`~/.dsh/memory/evidence/events/YYYY-MM-DD.jsonl`(pre 树为 `~/.dsh/memory/evidence-pre/events/`)
205
+ - **证据事件**:`~/.dsh/memory/evidence/events/YYYY-MM-DD.jsonl`(pre 树为 `~/.dsh/memory/evidence/events/`)
206
206
  - 单行结构(实测):顶层 `kind` / `memoryId` / `recordedAt` / `anchorId` …,**时间戳在 `event.ts`**(顶层无 `ts`/`createdAt`)
207
- - **M8 数据**:`~/.dsh/memory/hub/{episodes,facts,procedures}.json`(原子写;pre 树为 `memory/hub-pre/`)
208
- - **降级台账**:`~/.dsh/memory/degrade-pre/latest.json` —— ★**这条没有发布名,两条线都叫 `degrade-pre`**,见下方自核
207
+ - **M8 数据**:`~/.dsh/memory/hub/{episodes,facts,procedures}.json`(原子写;pre 树为 `memory/hub/`)
208
+ - **降级台账**:`~/.dsh/memory/degrade/latest.json` —— ★去 pre 后**唯一的真名**,不再有 `-pre` 变体
209
209
 
210
- > **一条命令自核上面 4 条路径的「发布名」**(读源码 + 发布转换表,所以两条线都对得上):
210
+ > **一条命令自核上面 4 条路径**(直接读源码真值 —— 去 pre 后源码名即真名):
211
211
  >
212
212
  > ```bash
213
- > node -e "const f=require('fs');const s=f.readFileSync('lib/index.js','utf8'),r=f.readFileSync('tools/release.mjs','utf8');const P=[...r.matchAll(/\['([^']+)',\s*'([^']+)'\]/g)].map(m=>[m[1],m[2]]);const c=x=>P.reduce((a,[b,d])=>a.split(b).join(d),x);const d=s.match(/'dsh-auto-memory[^']*diagnose\.log'/)[0].slice(1,-1);console.log('诊断日志(发布名):',c(d));for(const k of ['hub-pre','evidence-pre','index-pre','semantic-pre','degrade-pre'])console.log(' ',k,'->',c(k))"
213
+ > node -e "const s=require('fs').readFileSync('lib/index.js','utf8');console.log('诊断日志:',s.match(/'dsh-auto-memory[^']*diagnose\.log'/)[0].slice(1,-1));console.log('memory 子目录:',[...new Set([...s.matchAll(/memoryDir\('([a-z-]+)'\)/g)].map(m=>m[1]))].join(', '))"
214
214
  > ```
215
215
  >
216
- > 输出应为:`诊断日志(发布名): dsh-auto-memory-diagnose.log`,以及 `hub-pre -> hub`、`evidence-pre -> evidence`、
217
- > `index-pre -> index`、`semantic-pre -> semantic-pre`、**`degrade-pre -> degrade-pre`**(最后一行就是「不能整体替换」的证据)。
216
+ > 输出应为:`诊断日志: dsh-auto-memory-diagnose.log`,以及 `memory 子目录: workspaces, index, evidence, degrade, semantic, hub`
217
+ > —— 全部为裸名,**不带 `-pre` 后缀**。
218
218
 
219
219
  ### 5.3 「前端操作 → 后端确认」判定方法(通用三步)
220
220
 
@@ -234,31 +234,32 @@ dsh web --no-open --port 0
234
234
 
235
235
  ---
236
236
 
237
- ## 6. 工具(模型可调用,18 个)
237
+ ## 6. 工具(模型可调用,19 个)
238
238
 
239
- > 下表给的是**发布名**;pre 树各加 `_pre` 后缀(`memory_recall` ↔ `memory_recall_pre`)。
239
+ > 下表给的是**发布名**;pre 树各加 `_pre` 后缀(`memory_recall` ↔ `memory_recall`)。
240
240
  > 自核(数一遍源码里的注册调用):`node -e "const s=require('fs').readFileSync('lib/index.js','utf8');const n=[...s.matchAll(/defineTool\('([a-z_]+)'/g)].map(m=>m[1]);console.log(n.length,'个:',n.sort().join(' '))"`
241
241
 
242
242
  | 工具(发布名) | pre 树名 | 作用 |
243
243
  |---|---|---|
244
- | `memory_recall` | `memory_recall_pre` | 记忆检索(默认返回 L0,`expand` 展开原文) |
245
- | `memory_read` | `memory_read_pre` | 按锚点读取记忆原文 |
246
- | `memory_note` | `memory_note_pre` | 写入记忆(含 `kind` 区分日志/笔记/白板 `plan`/账本 `handoff` 等) |
247
- | `memory_log` | `memory_log_pre` | 记录日志条目 |
248
- | `memory_reflect` | `memory_reflect_pre` | 生成反思 |
249
- | `memory_consolidate` | `memory_consolidate_pre` | 记忆巩固 |
250
- | `memory_maintain` | `memory_maintain_pre` | 存储维护(30 天蒸馏) |
251
- | `memory_status` | `memory_status_pre` | 状态查询 |
252
- | `memory_user` | `memory_user_pre` | 用户级记忆读写 |
253
- | `memory_external` | `memory_external_pre` | 外部记忆源管理(list / import) |
254
- | `memory_procedure` | `memory_procedure_pre` | 流程(技能)直写:write 进审批列表 / activate 写入+晋升+激活 |
255
- | `memory_rules` | `memory_rules_pre` | 用户级硬约束的条目级增删改:list / add / update / remove(删改须带 `expect` 内容锚定) |
256
- | `memory_expand` | `memory_expand_pre` | 白板结构化展开(需 `boardMode=graph`) |
257
- | `memory_trace` | `memory_trace_pre` | 白板结构化回溯(需 `boardMode=graph`) |
258
- | `calendar_add` | `calendar_add_pre` | 添加日历事项 |
259
- | `calendar_list` | `calendar_list_pre` | 列出日历条目 |
260
- | `calendar_done` | `calendar_done_pre` | 标记日历条目完成 |
261
- | `calendar_remove` | `calendar_remove_pre` | 删除日历条目 |
244
+ | `memory_recall` | `memory_recall` | 记忆检索(默认返回 L0,`expand` 展开原文) |
245
+ | `memory_read` | `memory_read` | 按锚点读取记忆原文 |
246
+ | `memory_note` | `memory_note` | 写入记忆(含 `kind` 区分日志/笔记/白板 `plan`/账本 `handoff` 等) |
247
+ | `memory_log` | `memory_log` | 记录日志条目 |
248
+ | `memory_reflect` | `memory_reflect` | 生成反思 |
249
+ | `memory_consolidate` | `memory_consolidate` | 记忆巩固 |
250
+ | `memory_maintain` | `memory_maintain` | 存储维护(30 天蒸馏) |
251
+ | `memory_status` | `memory_status` | 状态查询 |
252
+ | `memory_user` | `memory_user` | 用户级记忆读写 |
253
+ | `memory_external` | `memory_external` | 外部记忆源管理(list / import) |
254
+ | `memory_procedure` | `memory_procedure` | 流程(技能)直写:write 进审批列表 / activate 写入+晋升+激活 |
255
+ | `memory_procedure_list` | `memory_procedure_list` | 技能库**只读浏览**:列出两库条目(含属于哪个库)、阶段、证据量与未晋升原因码;写之前先查重 |
256
+ | `memory_rules` | `memory_rules` | 用户级硬约束的条目级增删改:list / add / update / remove(删改须带 `expect` 内容锚定) |
257
+ | `memory_expand` | `memory_expand` | 白板结构化展开(需 `boardMode=graph`) |
258
+ | `memory_trace` | `memory_trace` | 白板结构化回溯(需 `boardMode=graph`) |
259
+ | `calendar_add` | `calendar_add` | 添加日历事项 |
260
+ | `calendar_list` | `calendar_list` | 列出日历条目 |
261
+ | `calendar_done` | `calendar_done` | 标记日历条目完成 |
262
+ | `calendar_remove` | `calendar_remove` | 删除日历条目 |
262
263
 
263
264
  ---
264
265
 
@@ -266,7 +267,7 @@ dsh web --no-open --port 0
266
267
 
267
268
  > **通用前置**:`dsh web --no-open` 已启动;插件已装载;已确认端口并手动打开 UI。
268
269
  > **通用通过标准**:每一步都要有**证据**(截图 / 日志原文 / 数据快照)。禁止"看起来正常"这类无证据结论。
269
- > ★**端点写法**:本节一律写发布名 `GET /api/dsh-auto-memory/xxx`;**在 pre 开发树里跑要换成 `/api/dsh-auto-memory-pre/xxx`**(别把手册里的写法当成 pre 树的写法)。工具名同理(`memory_recall` ↔ `memory_recall_pre`)。
270
+ > ★**端点写法**:本节一律写发布名 `GET /api/dsh-auto-memory/xxx`;**在 pre 开发树里跑要换成 `/api/dsh-auto-memory/xxx`**(别把手册里的写法当成 pre 树的写法)。工具名同理(`memory_recall` ↔ `memory_recall`)。
270
271
 
271
272
  ### A. 启动与装载
272
273
 
@@ -338,15 +339,15 @@ dsh web --no-open --port 0
338
339
 
339
340
  ```bash
340
341
  cd /d/D/dsh-auto-memory || cd D:/dsh-auto-memory
341
- node tests/smoke/smoke-test-m4-pre.mjs # m4
342
- node tests/smoke/smoke-test-p8-rrf-wiring-pre.mjs # 14
343
- node tests/smoke/smoke-test-p4-l0-response-pre.mjs # 34
344
- node tests/smoke/smoke-test-evidence-agg-pre.mjs # 14
345
- node tests/smoke/smoke-test-memory-importance-pre.mjs # 18
346
- node tests/smoke/smoke-test-p9a-correction-attribution-pre.mjs # 26
347
- node tests/smoke/smoke-test-p9d-recent-evidence-ts-pre.mjs # 13
348
- node tests/smoke/smoke-test-handoff-pre.mjs # 51
349
- node tests/smoke/smoke-test-continue-chain-pre.mjs # 58
342
+ node tests/smoke/smoke-test-m4.mjs # m4
343
+ node tests/smoke/smoke-test-p8-rrf-wiring.mjs # 14
344
+ node tests/smoke/smoke-test-p4-l0-response.mjs # 34
345
+ node tests/smoke/smoke-test-evidence-agg.mjs # 14
346
+ node tests/smoke/smoke-test-memory-importance.mjs # 18
347
+ node tests/smoke/smoke-test-p9a-correction-attribution.mjs # 26
348
+ node tests/smoke/smoke-test-p9d-recent-evidence-ts.mjs # 13
349
+ node tests/smoke/smoke-test-handoff.mjs # 51
350
+ node tests/smoke/smoke-test-continue-chain.mjs # 58
350
351
  ```
351
352
 
352
353
  **任一数字下降 → 停止,回报**。
@@ -368,7 +369,7 @@ node tests/smoke/smoke-test-continue-chain-pre.mjs # 58
368
369
 
369
370
  ## 9. 边界与禁止事项
370
371
 
371
- - 改源码只改 `lib/*-pre.js`;**禁止手改 `lib/*.js` 同名产物**(由流水线重建)
372
+ - 源码即产物:去 pre 后**直接改 `lib/*.js`**(不再有 `-pre` 孪生与流水线重建)
372
373
  - **禁止引入运行时依赖**(项目承诺零依赖)
373
374
  - 禁止删除既有测试断言;禁止整文件重写
374
375
  - 涉及用户隐私:日志与诊断输出**不得包含用户原文**
@@ -384,11 +385,11 @@ node tests/smoke/smoke-test-continue-chain-pre.mjs # 58
384
385
  | 工程根 | `D:\dsh-auto-memory` |
385
386
  | 宿主侧入口 | `lib/index.js` |
386
387
  | 浏览器侧入口 | `lib/client.js` |
387
- | 端点前缀 | `/api/dsh-auto-memory/`(54 条;pre 树 `/api/dsh-auto-memory-pre/`) |
388
+ | 端点前缀 | `/api/dsh-auto-memory/`(54 条;pre 树 `/api/dsh-auto-memory/`) |
388
389
  | 工具 | 10 个,`memory_*_pre` |
389
390
  | 记忆根 | `C:\Users\JH Z\.dsh\memory` |
390
391
  | 证据事件 | `...\memory\evidence\events\YYYY-MM-DD.jsonl`(时间戳在 `event.ts`) |
391
392
  | 诊断日志 | `...\dsh-auto-memory-diagnose.log`(**与 `memory\` 同级**,不在其下) |
392
393
  | M8 数据 | `...\memory\hub\{episodes,facts,procedures}.json` |
393
- | 降级台账 | `...\memory\degrade-pre\latest.json`(★两条线同名,无发布名) |
394
+ | 降级台账 | `...\memory\degrade\latest.json`(★两条线同名,无发布名) |
394
395
  | 水位/接续阈值 | 0.75 / 0.75(**须低于官方压缩 0.80**) |
package/docs/M-CM-PLAN.md CHANGED
@@ -68,7 +68,7 @@ OS 式记忆分层:core memory(上下文内的 self-edited memory blocks,"
68
68
 
69
69
  ## 4. M-CM3 会话检索增强(2026-09-06 审计修正:host 已有关键词级检索,本项=升级非新建)
70
70
 
71
- > **审计修正**:原文"会话帧未索引"有误。host 自带 `sessionQuery.searchSessions`(`lib/index.js:4531` `ctx.get('sessionQuery')`,:2226 调用,limit≤10),`memory_recall_pre` 已覆盖"历史 DSH 会话全文检索(如部署启用)"——**关键词级**,GUIDANCE 自己声明了局限:"外部会话检索为关键词级(非语义)"。
71
+ > **审计修正**:原文"会话帧未索引"有误。host 自带 `sessionQuery.searchSessions`(`lib/index.js:4531` `ctx.get('sessionQuery')`,:2226 调用,limit≤10),`memory_recall` 已覆盖"历史 DSH 会话全文检索(如部署启用)"——**关键词级**,GUIDANCE 自己声明了局限:"外部会话检索为关键词级(非语义)"。
72
72
 
73
73
  - **真正的增量**:①**语义通道**——C2/BGE-M3 向量升档(词法兜底不变),补齐"非语义"短板;②**排序与 provenance**——命中带时间戳/会话 id/帧位置引用(现状仅文本段),统一 M5 cite 规范;③**handoff corpus 并入**(M-CM1 新地面);④limit≤10 的预算策略与 evidence 引用按需深查。
74
74
  - 索引器(若 host sessionQuery 能力不足再建):增量扫描→digest 去重→词法倒排+可选向量;凭证段过滤**先于**入索引;脏 token 拒入;元数据落 memoryRoot 独立目录可整体删除。
@@ -12,7 +12,7 @@
12
12
  - [x] 规划与审计(M-CM-PLAN.md §0-§10,含回归审计对账表)
13
13
  - [x] 实施步骤 1:读代码锚点(memory_note handler、GUIDANCE/静态纪律层、renderMemoryDynamic、resolvePaths、_doRefresh 装载器、DEFAULT_PROMPT_LAYERS)
14
14
  - [x] 实施步骤 2:handoff 存储函数(writePlanSnapshot 归档/writeHandoffLedger 同秒 -b 后缀/readLatestHandoff 按 mtime)
15
- - [x] 实施步骤 3:memory_note_pre 增 kind: handoff|plan(同 sanitizeForWrite 门禁;plan 走 replace 归档;不走项目笔记预算)
15
+ - [x] 实施步骤 3:memory_note 增 kind: handoff|plan(同 sanitizeForWrite 门禁;plan 走 replace 归档;不走项目笔记预算)
16
16
  - [x] 实施步骤 4:renderMemoryStatic 增"交接与白板"纪律行(GUIDANCE 层不用动,静态层即固化纪律载体)
17
17
  - [x] 实施步骤 5:注入片段(动态快照首位:snapshotPlanTitle→snapshotHandoffTitle→日志段;stripSensitiveSections+truncateHead 硬预算;handoffEnabled=false 隐藏)
18
18
  - [x] 实施步骤 5.5:smoke-test-handoff-pre.mjs 22/22(G0 源码守卫/G1 时间戳/G2 白板归档/G3 账本最新篇/G4 注入行为);主套件+4 套 UI 回归全绿
@@ -191,7 +191,7 @@
191
191
  | | 文案 |
192
192
  |---|---|
193
193
  | 现 | `- **接续前先用 read 工具读取该转写文件**,以完全理解旧会话的讨论、结论与未竟事项;任务推进中也可随时回读。` |
194
- | 改 | `- 完整转写已归档:{path}。**仅在锚点索引与第0–2层不足以推进时才 read**;优先用 memory_recall_pre(scope='sessions', query='关键词') 定位片段,避免整篇读取。` |
194
+ | 改 | `- 完整转写已归档:{path}。**仅在锚点索引与第0–2层不足以推进时才 read**;优先用 memory_recall(scope='sessions', query='关键词') 定位片段,避免整篇读取。` |
195
195
 
196
196
  **理由**:当前实现强制全量 read,分层在此处退化为一刀切。
197
197
 
@@ -58,8 +58,8 @@ Anchor marker 必须独占一行,固定放在逻辑记录内容之前。解析
58
58
 
59
59
  推荐粒度:一次明确写入事务 = 一个 memoryId。
60
60
 
61
- - memory_log_pre:一次调用的单条日志为一个记录。
62
- - memory_note_pre / memory_user_pre append:一次调用为一个记录。
61
+ - memory_log:一次调用的单条日志为一个记录。
62
+ - memory_note / memory_user append:一次调用为一个记录。
63
63
  - 自动沉淀:一次 LOG / NOTE / USER 分组分别为一个记录,不把每个 bullet 单独编号。
64
64
  - 一份 reflection 文件:一个记录。
65
65
  - 一次外部链接导入 block:一个记录。
@@ -205,7 +205,7 @@ rebuildMemorySidecar(file)
205
205
 
206
206
  ## 9. Replace 语义
207
207
 
208
- memory_note_pre / memory_user_pre replace 是最高风险路径。
208
+ memory_note / memory_user replace 是最高风险路径。
209
209
 
210
210
  - 输入中保留的合法 anchor 保持原 ID。
211
211
  - 未带 anchor 的新 block 分配新 ID。
@@ -218,10 +218,10 @@ memory_note_pre / memory_user_pre replace 是最高风险路径。
218
218
 
219
219
  必须逐项迁移和测试:
220
220
 
221
- - memory_log_pre
222
- - memory_note_pre append / replace
223
- - memory_user_pre append / replace
224
- - memory_reflect_pre
221
+ - memory_log
222
+ - memory_note append / replace
223
+ - memory_user append / replace
224
+ - memory_reflect
225
225
  - 自动沉淀 LOG / NOTE / USER
226
226
  - compact/maintain 新摘要与 archive
227
227
  - 外部记忆 import / remove
@@ -32,7 +32,7 @@ index_sync 语义;不接生产 activation(默认关闭零副作用);到 M7-8 停
32
32
  | dshLifecycleControl | true(能力)/false(授权) | dsh 命令存在;本轮用户明令禁止停止/重启 3080 → 视为 false |
33
33
  | subagents | true | ZCode Agent 工具可用(仅只读研究/复核,主 Agent 唯一 writer) |
34
34
 
35
- 不假设存在 memory_recall_pre/memory_external_pre/goal/calendar 等 DeepSeek
35
+ 不假设存在 memory_recall/memory_external/goal/calendar 等 DeepSeek
36
36
  Harness 工具;未暴露即不模拟。无 dshLifecycleControl 授权不构成离线 M7 阻断:
37
37
  M7-2~M7-7 照常推进,M7-8 人工门停止。
38
38
 
@@ -21,7 +21,7 @@
21
21
  - 可以检查 dsh 命令是否存在,但不得停止、启动或重启宿主
22
22
 
23
23
  重要:
24
- - 不得假设存在 memory_recall_pre、memory_external_pre、goal、calendar 等 DeepSeek Harness 工具。
24
+ - 不得假设存在 memory_recall、memory_external、goal、calendar 等 DeepSeek Harness 工具。
25
25
  - 若这些工具没有真实暴露,不得模拟、描述为已调用或绕过限制。
26
26
  - 没有 dshLifecycleControl 不构成离线 M7 阻断;继续完成 M7-2 至 M7-7,并在 M7-8 人工门停止。
27
27
  - 即便存在 dshLifecycleControl,未经用户本轮明确授权,也严禁停止或重启 3080。
@@ -239,12 +239,12 @@ query(q):
239
239
 
240
240
  #### 【P2】语义臂接入 memory_recall
241
241
 
242
- **背景**:`memory_recall_pre`(`lib/index.js:6302`)当前是**纯词法关键词匹配**,工具描述自己写着"关键词匹配"。语义引擎(C2 e5-small q8 / C3 bge-m3)只用在主动联想注入,recall 这条完全没接。本任务把语义臂接进来,**输入用 L0 而非全文**(全文超 e5 512 token 上限会被截断,实测最长条目 11046 字符)。
242
+ **背景**:`memory_recall`(`lib/index.js:6302`)当前是**纯词法关键词匹配**,工具描述自己写着"关键词匹配"。语义引擎(C2 e5-small q8 / C3 bge-m3)只用在主动联想注入,recall 这条完全没接。本任务把语义臂接进来,**输入用 L0 而非全文**(全文超 e5 512 token 上限会被截断,实测最长条目 11046 字符)。
243
243
 
244
244
  **前置约定**:依赖 P1 完成(有 L0 向量索引)。不改动激活决策层(那是原创核心,与本任务无关)。
245
245
 
246
246
  **要改的文件/模块**:
247
- - `lib/index.js` 中 `memory_recall_pre` 的处理逻辑(约 `:6302` 附近)
247
+ - `lib/index.js` 中 `memory_recall` 的处理逻辑(约 `:6302` 附近)
248
248
  - 语义调用复用 `lib/semantic-js-pre.js`,不新写引擎
249
249
 
250
250
  **验收标准**:
@@ -431,7 +431,7 @@ for s in orderByWeightDesc(sections):
431
431
  **前置约定**:无依赖,随时可做。
432
432
 
433
433
  **要改的文件/模块**:
434
- - 账本写入逻辑(`memory_note_pre` 的 `kind=handoff` 分支)
434
+ - 账本写入逻辑(`memory_note` 的 `kind=handoff` 分支)
435
435
  - 白板归档逻辑(复用现有 PLAN archive 机制)
436
436
 
437
437
  **验收标准**:
@@ -117,7 +117,7 @@ git diff --stat
117
117
 
118
118
  **目标**:`memory_recall` 当前为纯词法(工具描述自述"关键词匹配")。接入语义臂,**输入用 L0 而非全文**(全文会超 e5 512 token 上限被截断)。
119
119
 
120
- **涉及功能模块**:`lib/index.js` 的 `recall()` 实现与 `memory_recall_pre` 工具定义;`lib/semantic-js-pre.js`(C2);`lib/shadow-retrieval-pre.js`(词法臂)。
120
+ **涉及功能模块**:`lib/index.js` 的 `recall()` 实现与 `memory_recall` 工具定义;`lib/semantic-js-pre.js`(C2);`lib/shadow-retrieval-pre.js`(词法臂)。
121
121
 
122
122
  **验收标准**:
123
123
  1. 主题性查询("发布踩坑")能召回词法不重合但语义相关的记忆
@@ -128,7 +128,7 @@ git diff --stat
128
128
 
129
129
  **需先检索的仓库路径与符号关键词**:
130
130
  - 路径:`lib/index.js`、`lib/semantic-js-pre.js`、`lib/shadow-retrieval-pre.js`、`lib/context-host-pre.js`
131
- - 关键词:`async recall(`、`defineTool('memory_recall_pre'`、`engine.recall(`、`lexicalSearch`、`buildQueryPlan`、`D6_FUSION_WEIGHTS_PRE_V1`、`fuseD6Pre`、`SHADOW_GATE_POLICY_PRE_V1`
131
+ - 关键词:`async recall(`、`defineTool('memory_recall'`、`engine.recall(`、`lexicalSearch`、`buildQueryPlan`、`D6_FUSION_WEIGHTS_PRE_V1`、`fuseD6Pre`、`SHADOW_GATE_POLICY_PRE_V1`
132
132
  - 必须先确认:① `recall()` 真实行号与完整函数体 ② 当前召回走的是 `lexicalSearch` 还是别的函数 ③ C2 引擎实例在 `index.js` 中如何持有(字段名)④ 是否已有 `scope='sessions'` 走 host 的分支
133
133
 
134
134
  **改动边界**:
@@ -253,7 +253,7 @@ git diff --stat
253
253
 
254
254
  **目标**:两个独立小缺陷 ① 账本标题重复(最近 6 个中 3 个含两个 `# 交接账本` 标题行、时间戳不一致,解析会取到错的)② `PLAN.md` 退化成日志(并列堆积 2.2.5/2.2.6 状态与历史踩坑,无老化)。
255
255
 
256
- **涉及功能模块**:`memory_note_pre` 的 `kind=handoff` 分支;白板归档(复用既有 PLAN archive 机制)。
256
+ **涉及功能模块**:`memory_note` 的 `kind=handoff` 分支;白板归档(复用既有 PLAN archive 机制)。
257
257
 
258
258
  **验收标准**:
259
259
  1. 追加写入前检测已存在标题则跳过(或解析取最后一个标题,二选一并断言)
@@ -44,7 +44,7 @@ M lib/python-setup-pre.js (+16/-4) issue #27 bge-m3 仓库名(HF 401)+ #28 t
44
44
  - [ ] **B1** 重启 dsh web,设置页「记忆中枢」可见、三栏有内容或正确空态
45
45
  - [ ] **B2** `GET /api/dsh-auto-memory-pre/memory-hub` 返回 200 + overview
46
46
  - [ ] **B3** ⭐ **P8 语义臂实证**(排序行为变更,最关键):
47
- 用 `memory_recall_pre` 查一个**与记忆词法不重合但语义相关**的查询(如记忆里写"npm 发布报 ENEEDAUTH",查"发布凭证问题"),
47
+ 用 `memory_recall` 查一个**与记忆词法不重合但语义相关**的查询(如记忆里写"npm 发布报 ENEEDAUTH",查"发布凭证问题"),
48
48
  确认能召回 ⇒ 证明 RRF 融合生效、语义臂不是摆设。
49
49
  若召回失败且 `legacy` 开关切回后正常 → 立即回报,**暂缓发版**。
50
50
  - [ ] **B4** correction 端到端:对 AI 说一句命中纠正词典的话(如"不对,你记错了"),检查当日 events 是否新增 `"kind":"correction"`
@@ -136,7 +136,7 @@
136
136
  **建议:发版。** 只需两步:
137
137
 
138
138
  1. 处理工作区两个未提交文件(`lib/index.js` +11/-5、`lib/python-setup-pre.js` +16/-4,均为真实 bug 修复,建议带上先 commit)
139
- 2. 跑 live 冒烟,**时间紧就只做 B3**:用 `memory_recall_pre` 查一个**词法不重合但语义相关**的查询,能召回即证明 P8 融合生效
139
+ 2. 跑 live 冒烟,**时间紧就只做 B3**:用 `memory_recall` 查一个**词法不重合但语义相关**的查询,能召回即证明 P8 融合生效
140
140
 
141
141
  **No-Go 条件**:B3 失败但切回 `legacy` 正常 → P8 排序回归,暂缓。
142
142
 
@@ -50,7 +50,7 @@
50
50
  - The version number in the panel title and in Settings → "Check for updates" both show the **installed** version.
51
51
  - A **floating pin** (line-drawn quick-access icon) also lives in the sidebar for one-click access to memory actions from anywhere.
52
52
  - Since DSH 0.1.2-rc.1 the Web UI sits behind a token gate (new token every restart; the `?token=…` URL in the startup log is your address). This plugin's HTTP endpoints are loopback-only and unaffected by the gate.
53
- - All data stays on your machine: `~/.dsh/memory/` (memory files), `~/.dsh/dsh-auto-memory.json` (config). **Note**: inside this repo's pre dev tree the same file carries a `-pre` suffix; the build you install from npm uses the suffix-less name. Same applies to every path below.
53
+ - All data stays on your machine: `~/.dsh/memory/` (memory files), `~/.dsh/dsh-auto-memory.json` (config). **Note**: after the de-pre migration the source name *is* the published name — the repo and the npm build use identical paths, so every path below applies to both.
54
54
 
55
55
  ## 2. First launch
56
56
 
@@ -98,7 +98,7 @@ The control room of proactive recall. On, the plugin watches context, runs seman
98
98
  | Recall cooldown (`jsDecideCooldownRounds`) | 1 | No re-decision for N rounds after an injection, to save tokens; **0 = no cooldown** (legal) |
99
99
  | Margin threshold (`jsDecideDeltaExp`) | 0.01 | Gap between top-1 and top-2 candidates must exceed this to inject (e5's cosine distribution is tight: 0.01; bge-m3 calibrates to 0.03). Smaller = more eager, larger = more conservative; 0 = no filter |
100
100
  | Candidate scheme (`jsDecideCandidateScheme`) | `balanced` | balanced = 3 refs × 40 chars; dense = 6 × 20 (more candidates, wider association); custom = your own count (1–8) and length |
101
- | Injected excerpt length (`jsDecideExcerptChars`) | 40 | Reference-line content cap. 40 = keyword-level (cheap; the model fetches full text via `memory_read_pre`); range 20–480 |
101
+ | Injected excerpt length (`jsDecideExcerptChars`) | 40 | Reference-line content cap. 40 = keyword-level (cheap; the model fetches full text via `memory_read`); range 20–480 |
102
102
  | Retrieval mode (`semanticEngineMode`) | `auto` | **auto** = built-in semantics when ready, lexical fallback; **lexical** only; **js** = built-in e5-small (~130MB); **python** = advanced BGE-M3 int8 (~563MB). See §5. The **⟳ detect** button next to it health-checks the environment and pops the install guide when assets are missing |
103
103
  | CoT observer (`reasoningObserverEnabled`) | on | Include the model's chain of thought in live observation `(restart)` — closed-source models' summarizing CoT counts too; an important signal for "remembering while doing" |
104
104
  | Branch-session observation (`contextBridgeObserveChildSessions`) | on | Sessions that continue across days are marked as branches and observed too |
@@ -178,7 +178,7 @@ The static injection face: the `<memory_system>` block composed into every turn.
178
178
  | Setting | Default | How to tune |
179
179
  |---|---|---|
180
180
  | Handoff whiteboard (`handoffEnabled`) | off | **PLAN.md snapshot + four-part handoff ledger**: written by the model at milestones, injected first in the dynamic snapshot, live in the Whiteboard tab — context that survives windows. Recommended on |
181
- | Plan budget (`handoffPlanChars`) | 1200 | Hard truncation for injecting PLAN.md; full text via `memory_read_pre` or the Whiteboard tab |
181
+ | Plan budget (`handoffPlanChars`) | 1200 | Hard truncation for injecting PLAN.md; full text via `memory_read` or the Whiteboard tab |
182
182
  | Ledger budget (`handoffLedgerChars`) | 800 | Injection budget for the latest ledger; internally truncated by section weight (failure reasons .35 > next step .30 > goals .20 > state .15, trimmed from the lightest section first) |
183
183
  | Water-level window override (`waterLevelWindowTokens`) | 0 = auto | 0 = auto: official routed capacity first, then settings.yaml for the active model. **Keep 0 unless you have an exotic model** |
184
184
  | Advisory threshold (`waterLevelThreshold`) | 0.75 | Past the threshold: inject the handoff advisory and backfill the ledger. **0.75, not 0.8**: the host's own compaction fires at 80%; sitting right under 80% means the host compresses before the handoff finishes — the 5% margin (~50K tokens on a 1M window) is the room to complete it |
@@ -201,7 +201,7 @@ The static injection face: the `<memory_system>` block composed into every turn.
201
201
 
202
202
  ## 5. Retrieval deep dive
203
203
 
204
- One `memory_recall_pre` call (or the panel's Search tab) runs a **multi-arm fused** pipeline:
204
+ One `memory_recall` call (or the panel's Search tab) runs a **multi-arm fused** pipeline:
205
205
 
206
206
  ### 5.1 The four arms
207
207
 
@@ -217,7 +217,7 @@ One `memory_recall_pre` call (or the panel's Search tab) runs a **multi-arm fuse
217
217
  - Arm rankings merge via **RRF (rank-space reciprocal-rank fusion, k=60)** — ranks only, never raw scores, so any arm's absence never perturbs the rest.
218
218
  - Query terms first pass through **QueryPlan assembly** (8-segment / 4096-char window budget, ≤32 terms); terms are kept **in weight-descending order** (user/trigger 1.0 > recent-user 0.8 > tool-result 0.6 > reasoning 0.5 > tool-call 0.4 > assistant 0.2), so budget cuts bite the low-weight words and the high-weight question words are never dropped.
219
219
  - The default response is an **L0 summary list**: ~93 characters each (6.78:1 compression), with `id`, score, and match reason (`lexical×N` / `semantic×x.xx`) — one retrieval costs about a tenth of the tokens.
220
- - Need the full text of one? Pass its id as `expand="mem_xxx"` (or use `memory_read_pre`) — an anchor-based **byte-range** lookup returns exactly that entry, never a mix-up.
220
+ - Need the full text of one? Pass its id as `expand="mem_xxx"` (or use `memory_read`) — an anchor-based **byte-range** lookup returns exactly that entry, never a mix-up.
221
221
  - Scope: `all` (default: handoff corpus + cross-workspace + external + session history) / `handoff` (whiteboard corpus only — check here when resuming long tasks) / `sessions` (session history only).
222
222
  - Query for something that doesn't exist: an empty or weak-hit response, no error, no blocking (fail-soft).
223
223
 
@@ -250,7 +250,7 @@ Every decision lands in the **Recall review** tab for A/P/S/H/E grading. Every i
250
250
 
251
251
  ## 7. Evidence chain & memory importance
252
252
 
253
- Every memory keeps an auditable usage dossier — six event types, filed daily under `~/.dsh/memory/evidence/events/YYYY-MM-DD.jsonl` (this repo's pre dev tree uses `evidence-pre/`):
253
+ Every memory keeps an auditable usage dossier — six event types, filed daily under `~/.dsh/memory/evidence/events/YYYY-MM-DD.jsonl` :
254
254
 
255
255
  | Event | Meaning |
256
256
  |---|---|
@@ -334,17 +334,17 @@ Available to the AI in conversation (14 in total; you don't need to memorize the
334
334
 
335
335
  | Tool | Purpose |
336
336
  |---|---|
337
- | `memory_recall_pre` | Retrieve memory: local memory (all workspaces' logs / notes / reflections / whiteboard) + cross-workspace + external + session history. Returns an L0 summary list by default; `expand` for full text; `scope=handoff/sessions` shortcuts |
338
- | `memory_read_pre` | Read a specific memory / day's log / reflection / notes on demand |
339
- | `memory_note_pre` | Write project notes / handoff ledger / rewrite the PLAN whiteboard (`kind=plan/handoff`) |
340
- | `memory_log_pre` | Append today's log (append-only) |
341
- | `memory_user_pre` | Cross-project long-term rules |
342
- | `memory_reflect_pre` | Save a daily reflection |
343
- | `memory_consolidate_pre` | Dream-style consolidation: read recent logs, distill long-term points |
344
- | `memory_maintain_pre` | 30-day distill: distill old logs into notes, archive originals — not a character lost |
345
- | `memory_status_pre` | Memory system status overview |
346
- | `memory_external_pre` | External memory source management (scan / connect / remove other AI tools' memories) |
347
- | `calendar_add_pre` / `calendar_list_pre` / `calendar_done_pre` / `calendar_remove_pre` | Calendar — the AI extracts deadlines from conversation proactively; unfinished items keep reminding |
337
+ | `memory_recall` | Retrieve memory: local memory (all workspaces' logs / notes / reflections / whiteboard) + cross-workspace + external + session history. Returns an L0 summary list by default; `expand` for full text; `scope=handoff/sessions` shortcuts |
338
+ | `memory_read` | Read a specific memory / day's log / reflection / notes on demand |
339
+ | `memory_note` | Write project notes / handoff ledger / rewrite the PLAN whiteboard (`kind=plan/handoff`) |
340
+ | `memory_log` | Append today's log (append-only) |
341
+ | `memory_user` | Cross-project long-term rules |
342
+ | `memory_reflect` | Save a daily reflection |
343
+ | `memory_consolidate` | Dream-style consolidation: read recent logs, distill long-term points |
344
+ | `memory_maintain` | 30-day distill: distill old logs into notes, archive originals — not a character lost |
345
+ | `memory_status` | Memory system status overview |
346
+ | `memory_external` | External memory source management (scan / connect / remove other AI tools' memories) |
347
+ | `calendar_add` / `calendar_list` / `calendar_done` / `calendar_remove` | Calendar — the AI extracts deadlines from conversation proactively; unfinished items keep reminding |
348
348
 
349
349
  All three write tools (log/note/user) pass the **write gate**: GBK mojibake, stutter degeneration, consecutive duplicate lines, external-AI persona JSON signatures, base64 residue — all rejected with a human-readable reason; appends ≤8,000 chars, rewrites ≤200,000; appends are deduped against the last ~60 lines. **Credential/secret sections never enter prompts.**
350
350
 
@@ -374,13 +374,13 @@ All three write tools (log/note/user) pass the **write gate**: GBK mojibake, stu
374
374
 
375
375
  | Content | Path |
376
376
  |---|---|
377
- | Plugin config | `~/.dsh/dsh-auto-memory.json` (this repo's pre dev tree uses `dsh-auto-memory-pre.json`) |
377
+ | Plugin config | `~/.dsh/dsh-auto-memory.json` (this repo's pre dev tree uses `dsh-auto-memory.json`) |
378
378
  | User-level memory | `~/.dsh/memory/MEMORY.md` |
379
379
  | Workspace memory | `~/.dsh/memory/workspaces/<workspace>/` (MEMORY.md, daily logs, handoff/, reflections/, summaries/) |
380
380
  | Whiteboard & ledgers | `~/.dsh/memory/workspaces/<workspace>/handoff/` (PLAN.md + handoff-*.md) |
381
- | Memory Hub layers | `~/.dsh/memory/hub/` (episodes / facts / procedures .json, atomic writes; this repo's pre dev tree uses `hub-pre/`) |
382
- | Evidence events | `~/.dsh/memory/evidence/events/YYYY-MM-DD.jsonl` (six types, per day; pre dev tree uses `evidence-pre/`) |
383
- | Semantic-engine data | `~/.dsh/memory/semantic/` (embedding-config.json, decision shadow logs, vector cache; pre dev tree uses `semantic-pre/`) |
381
+ | Memory Hub layers | `~/.dsh/memory/hub/` (episodes / facts / procedures .json, atomic writes) |
382
+ | Evidence events | `~/.dsh/memory/evidence/events/YYYY-MM-DD.jsonl` (six types, per day) |
383
+ | Semantic-engine data | `~/.dsh/memory/semantic/` (embedding-config.json, decision shadow logs, vector cache) |
384
384
  | Models / venv | `~/.dsh/models/js-semantic/` (C2 model) · `~/.dsh/python-engine/` (C3 venv + model; plugin upgrades never touch these) |
385
385
  | Subagent trace backups | `~/.dsh/subagent-gc-backup/` (move back into `~/.dsh/sessions/` to roll back) |
386
386
  | Diagnostics log | `~/.dsh/dsh-auto-memory-diagnose.log` (next to `memory/`, **not** inside it) |