dsh-memory-bond 0.3.0-beta.0 → 1.0.0
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/CHANGELOG.md +6 -7
- package/README.md +125 -91
- package/README.zh-CN.md +122 -92
- package/SECURITY.md +29 -0
- package/dist/audit.js +155 -80
- package/dist/automatic.js +10 -2
- package/dist/client.js +2035 -0
- package/dist/command-scope.js +4 -4
- package/dist/commands.js +15 -9
- package/dist/consolidation-store.js +87 -20
- package/dist/consolidation.js +2 -6
- package/dist/domain.js +8 -4
- package/dist/encoder.js +46 -5
- package/dist/file-import-store.js +120 -0
- package/dist/file-import.js +265 -0
- package/dist/foreground-attempts.js +91 -0
- package/dist/guidance.js +133 -92
- package/dist/host.js +13 -0
- package/dist/index-policy.js +91 -48
- package/dist/index.js +102 -40
- package/dist/knowledge-hooks.js +70 -27
- package/dist/knowledge.js +2 -3
- package/dist/maintenance-store.js +38 -4
- package/dist/maintenance.js +29 -5
- package/dist/personal.js +37 -0
- package/dist/policy.js +45 -47
- package/dist/prompt-copy.js +93 -0
- package/dist/proposal-receipts.js +70 -0
- package/dist/proposal-review.js +656 -0
- package/dist/propose-contract.js +32 -36
- package/dist/question-answers.js +86 -29
- package/dist/retrieval.js +25 -8
- package/dist/scope-narrowing.js +49 -0
- package/dist/search-index.js +93 -13
- package/dist/semantic.js +69 -207
- package/dist/service.js +633 -204
- package/dist/sharing.js +7 -13
- package/dist/sources.js +28 -3
- package/dist/store.js +432 -96
- package/dist/tool-experience.js +87 -0
- package/dist/turn-review-store.js +83 -16
- package/dist/turn-review.js +155 -59
- package/dist/ui.js +128 -26
- package/dist/vector-index.js +69 -33
- package/docs/architecture.zh-CN.md +52 -0
- package/docs/benchmark.zh-CN.md +60 -0
- package/docs/benchmarks/repository-tasks.json +5355 -0
- package/docs/images/bond-memory-principle-en.svg +644 -0
- package/docs/images/bond-memory-principle-zh.svg +644 -0
- package/docs/images/bond-memory-principle.drawio +644 -0
- package/docs/images/memory-settings-en.png +0 -0
- package/docs/images/memory-settings-zh.png +0 -0
- package/docs/images/memory-turn-recalled-en.png +0 -0
- package/docs/images/memory-turn-recalled-zh.png +0 -0
- package/docs/images/memory-turn-saved-en.png +0 -0
- package/docs/images/memory-turn-saved-zh.png +0 -0
- package/docs/media/memory-bond-name-en.gif +0 -0
- package/docs/media/memory-bond-name-en.mp4 +0 -0
- package/docs/media/memory-bond-name-zh.gif +0 -0
- package/docs/media/memory-bond-name-zh.mp4 +0 -0
- package/locale/detail.en.md +5 -1
- package/locale/detail.zh.md +5 -1
- package/locale/en.json +338 -0
- package/locale/zh.json +338 -0
- package/native/embeddings/NOTICE.md +2 -2
- package/package.json +39 -19
- package/scripts/benchmark-bond.mjs +72 -0
- package/scripts/benchmark-conditions.mjs +144 -0
- package/scripts/benchmark-example.mjs +37 -0
- package/scripts/benchmark-scale.mjs +119 -0
- package/scripts/benchmark-scenarios.mjs +57 -0
- package/scripts/benchmark-tasks.mjs +244 -0
- package/src/audit.ts +144 -85
- package/src/automatic.ts +12 -2
- package/src/command-scope.ts +4 -4
- package/src/commands.ts +12 -8
- package/src/consolidation-store.ts +80 -18
- package/src/consolidation.ts +2 -6
- package/src/domain.ts +9 -4
- package/src/encoder.ts +46 -6
- package/src/file-import-store.ts +139 -0
- package/src/file-import.ts +256 -0
- package/src/foreground-attempts.ts +97 -0
- package/src/guidance.ts +138 -102
- package/src/host.ts +22 -2
- package/src/index-policy.ts +93 -46
- package/src/index.ts +87 -43
- package/src/knowledge-hooks.ts +71 -29
- package/src/knowledge.ts +2 -3
- package/src/maintenance-store.ts +37 -4
- package/src/maintenance.ts +25 -5
- package/src/personal.ts +36 -0
- package/src/policy.ts +55 -52
- package/src/prompt-copy.ts +99 -0
- package/src/proposal-receipts.ts +59 -0
- package/src/proposal-review.ts +614 -0
- package/src/propose-contract.ts +31 -35
- package/src/question-answers.ts +99 -29
- package/src/retrieval.ts +26 -9
- package/src/scope-narrowing.ts +58 -0
- package/src/search-index.ts +94 -14
- package/src/semantic.ts +67 -188
- package/src/service.ts +595 -210
- package/src/sharing.ts +7 -14
- package/src/sources.ts +26 -4
- package/src/store.ts +434 -97
- package/src/tool-experience.ts +93 -0
- package/src/turn-review-store.ts +86 -15
- package/src/turn-review.ts +142 -60
- package/src/ui.ts +122 -27
- package/src/vector-index.ts +57 -29
- package/client/index.js +0 -1186
- package/design/dsh-memory-plugin-design.md +0 -46
- package/design/dsh-memory-plugin-evaluation.md +0 -135
- package/design/evaluations/locomo-conv-26-2026-12-03.json +0 -252
- package/design/evaluations/locomo-conv-26-paired-2026-12-03.json +0 -549
- package/design/evaluations/locomo-conv-26-write-replay-2026-12-03.json +0 -289
- package/design/evaluations/project-memory-tasks-2026-12-03.json +0 -1059
- package/design/memory-lifecycle-consolidation.excalidraw +0 -1212
- package/design/memory-lifecycle-consolidation.mobile.excalidraw +0 -1083
- package/design/memory-lifecycle-consolidation.mobile.svg +0 -2
- package/design/memory-lifecycle-consolidation.mobile.zh-CN.excalidraw +0 -1083
- package/design/memory-lifecycle-consolidation.mobile.zh-CN.svg +0 -94
- package/design/memory-lifecycle-consolidation.svg +0 -2
- package/design/memory-lifecycle-consolidation.zh-CN.excalidraw +0 -1212
- package/design/memory-lifecycle-consolidation.zh-CN.svg +0 -94
- package/design/memory-lifecycle.excalidraw +0 -2105
- package/design/memory-lifecycle.mobile.excalidraw +0 -1896
- package/design/memory-lifecycle.mobile.svg +0 -95
- package/design/memory-lifecycle.mobile.zh-CN.excalidraw +0 -1896
- package/design/memory-lifecycle.mobile.zh-CN.svg +0 -97
- package/design/memory-lifecycle.svg +0 -95
- package/design/memory-lifecycle.zh-CN.excalidraw +0 -2105
- package/design/memory-lifecycle.zh-CN.svg +0 -97
- package/native/embeddings/LICENSE +0 -21
- package/native/embeddings/en/model.onnx +0 -4
- package/native/embeddings/en/vocab.txt +0 -30522
- package/native/embeddings/runtime/LICENSE +0 -21
- package/native/embeddings/runtime/ThirdPartyNotices.txt +0 -6156
- package/native/embeddings/runtime/ort-wasm-simd-threaded.mjs +0 -70
- package/native/embeddings/runtime/ort-wasm-simd-threaded.wasm +0 -0
- package/native/embeddings/runtime/ort.wasm.min.mjs +0 -7
- package/native/embeddings/worker.mjs +0 -97
- package/native/embeddings/zh/model.onnx +0 -0
- package/native/embeddings/zh/vocab.txt +0 -21128
package/README.zh-CN.md
CHANGED
|
@@ -1,150 +1,180 @@
|
|
|
1
|
-
|
|
1
|
+
<p align="center">
|
|
2
|
+
<img src="./client/memory-icon.svg" width="88" height="88" alt="DSH Memory Bond 标志">
|
|
3
|
+
</p>
|
|
4
|
+
<h1 align="center">DSH Memory Bond</h1>
|
|
5
|
+
<p align="center"><strong>DeepSeek Harness 的本地记忆插件。</strong></p>
|
|
6
|
+
<p align="center"><a href="./README.md">English</a> · <a href="#快速安装">快速安装</a> · <a href="#一分钟体验">一分钟体验</a> · <a href="#功能">功能</a> · <a href="#常见问题">常见问题</a> · <a href="#仓库任务基准">仓库任务基准</a></p>
|
|
2
7
|
|
|
3
|
-
|
|
8
|
+
在一个项目里告诉助手「以后叫我小林。」切到另一个项目,问「你应该怎么称呼我?」它会答「小林」。点开回答下方的回执,就能看到这次用到了哪条记忆。
|
|
4
9
|
|
|
5
|
-
|
|
10
|
+
[](./docs/media/memory-bond-name-zh.mp4)
|
|
6
11
|
|
|
7
|
-
[
|
|
12
|
+
[观看完整演示](./docs/media/memory-bond-name-zh.mp4)。画面录自 DSH Web,使用 Memory Bond 1.0.0。示例助手由本地脚本驱动,记忆保存和回执生成由插件在录制时完成。
|
|
8
13
|
|
|
9
|
-
|
|
14
|
+
你可以查看助手记住了什么、依据哪句原话,也可以随时更正或撤回。还可以让它在项目会话空闲时找出疑似重复的记忆。这个选项默认关闭,保留哪条由你决定。
|
|
10
15
|
|
|
11
|
-
|
|
16
|
+
<a id="安装"></a>
|
|
17
|
+
|
|
18
|
+
## 快速安装
|
|
19
|
+
|
|
20
|
+
从公共 npm 源安装 `dsh-memory-bond` 即可使用本地存储和关键词检索。Memory Bond 1.0.0 适用于 DSH `>=0.2.2-rc.3 <0.3.0-0`。[npm 包](https://www.npmjs.com/package/dsh-memory-bond) · [版本记录](./CHANGELOG.md)
|
|
21
|
+
|
|
22
|
+
**DSH 桌面版**
|
|
23
|
+
|
|
24
|
+
1. 在侧栏打开「插件 → 添加插件」。
|
|
25
|
+
2. 选择公共 npm 源,在「包名或地址」输入 `dsh-memory-bond`。
|
|
26
|
+
3. 点击「安装」,完成后点击「立即启用」。如果界面提示重启,按提示操作。
|
|
27
|
+
|
|
28
|
+
**命令行**
|
|
29
|
+
|
|
30
|
+
桌面版先启动一次以初始化配置,再完全退出。运行下面的命令,然后重新打开 DSH。使用 DSH Web 时,将 `desktop` 换成 `web`,安装后重启 Web 服务。
|
|
12
31
|
|
|
13
32
|
```sh
|
|
14
|
-
dsh plugin --profile desktop add dsh-memory-bond
|
|
33
|
+
dsh plugin --profile desktop add dsh-memory-bond --registry=https://registry.npmjs.org
|
|
15
34
|
```
|
|
16
35
|
|
|
17
|
-
|
|
36
|
+
## 一分钟体验
|
|
18
37
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
| macOS 独立 DSH CLI(实测 Node.js 24.15.0,宿主要求 ≥24.9.0) | `0.2.2-rc.3`、`0.2.2-rc.4` |
|
|
38
|
+
1. 在第一个项目里告诉助手「以后叫我小林。」展开回答下方的「本轮记忆回执」,可以看到刚保存的称呼。
|
|
39
|
+
2. 在同一份 DSH 配置中切到另一个项目,在那里新开对话,问「你应该怎么称呼我?」看看它能否答出「小林」。
|
|
40
|
+
3. 点开这次回答的回执,再展开称呼这条记忆。「正文已送达」表示模型在回答时确实收到了这条偏好。
|
|
23
41
|
|
|
24
|
-
|
|
42
|
+
如果第一步没有看到已保存的条目,可在会话里运行 `/project-memory status`,确认 `memoryEnabled` 为 `true`。如果助手尝试保存但没有成功,回执里也会列出原因。
|
|
25
43
|
|
|
26
|
-
|
|
44
|
+
<details>
|
|
45
|
+
<summary>看看项目如何记住更新说明的格式</summary>
|
|
27
46
|
|
|
28
|
-
|
|
29
|
-
2. 在**同一个仓库新开会话**,只说 **“帮我写发布说明。这次修好了登录后反复跳回首页的问题,还升级了 HTTP 客户端。”** 看看哪项排在前面。
|
|
30
|
-
3. 打开 **设置 → 记忆**,选中这个项目。你可以核对这条约定的版本、查看来源、调整它是主动生效还是按需查阅,也可以撤回。
|
|
47
|
+
以下截图来自 DSH Web,示例助手由本地脚本驱动。第一个会话的回执记录了刚保存的项目约定。
|
|
31
48
|
|
|
32
|
-
|
|
49
|
+
<img src="./docs/images/memory-turn-saved-zh.png" width="751" alt="第一个会话的回执,显示更新说明约定已保存到项目。">
|
|
33
50
|
|
|
34
|
-
|
|
35
|
-
| --- | --- | --- |
|
|
36
|
-
| “以后这个项目的集成验证用 make river-suite。” | 首次请求收到第 1 版 | `make river-suite` |
|
|
37
|
-
| “更正一下,以后这个项目的集成验证用 make lake-suite。” | 同一条约定的第 2 版 | `make lake-suite` |
|
|
38
|
-
| 改为按需查阅 | 执行前通过检索收到第 3 版 | `make lake-suite` |
|
|
39
|
-
| 撤回,并在本次任务中指定备用命令 `make check` | 查不到已撤回版本 | `make check` |
|
|
51
|
+
新会话里的「正文已送达」表示,模型在起草这段更新说明时收到了约定的全文。
|
|
40
52
|
|
|
41
|
-
|
|
53
|
+
<img src="./docs/images/memory-turn-recalled-zh.png" width="751" alt="新会话的回执,显示更新说明约定的正文已送达本次模型请求。">
|
|
42
54
|
|
|
43
|
-
|
|
44
|
-
<source media="(max-width: 600px)" srcset="https://cdn.jsdelivr.net/npm/dsh-memory-bond@0.3.0-beta.0/design/memory-lifecycle.mobile.zh-CN.svg">
|
|
45
|
-
<img src="https://cdn.jsdelivr.net/npm/dsh-memory-bond@0.3.0-beta.0/design/memory-lifecycle.zh-CN.svg" alt="每个 profile 的本地 SQLite 同时保存全局和项目记忆。第一层将适用约定放进提示词,例如更正后的第 2 版 just integration。第二层按需检索或读取现行结论、条件和例外。第三层在用户追问时查询短引文及核验状态。可选的后台整理在项目会话持续空闲时约每小时检查一次。">
|
|
46
|
-
</picture>
|
|
55
|
+
</details>
|
|
47
56
|
|
|
48
|
-
|
|
57
|
+
## 功能
|
|
49
58
|
|
|
50
|
-
|
|
59
|
+
- **换个会话,继续沿用。** 全局偏好可以保存你的惯用称呼,同一份 DSH 配置下的各项目都能使用。更新说明格式这样的项目约定,只在对应项目生效。[记忆的作用域](./docs/architecture.zh-CN.md)
|
|
60
|
+
- **约定变了,随时更正。** 在对话或设置里修改条目,修订沿用原 ID 并生成新版本。如果刚保存的全局约定只该在本项目使用,可以在原会话的下一轮澄清范围。过时的约定可以撤回。[版本记录](./src/store.ts) · [范围更正](./src/scope-narrowing.ts)
|
|
61
|
+
- **查清一条记忆的来历。** 可以核对留存的原话,原会话可访问时还能跳回去。展开回答的回执,可查看哪次模型请求收到了哪个版本,并区分短线索、正文送达、显式引用和匹配的 Bash 执行。[请求审计](./src/audit.ts)
|
|
62
|
+
- **检查重复记忆。** 在「设置 → 记忆」开启「跨会话整理」,让助手比较同一项目不同会话中的相似条目。你可以保留两条,也可以撤回其中一条。[重复检查](./src/consolidation.ts)
|
|
63
|
+
- **在当前工作树核验项目规则。** Bond 会核对路径、分支、Make 或 Just 目标以及仓库指令。例如,某个分支删掉构建目标后,依赖该目标的约定会在这个工作树中标为待复核。[适用性核验](./src/policy.ts)
|
|
64
|
+
- **在项目记忆和仓库文件之间导入、导出。** 在可写的项目会话输入 `/project-memory import all`,扫描 `AGENTS.md`、`CLAUDE.md` 和 Claude Code 项目记忆。在「设置 → 记忆」的「待确认」中查看导入建议,选择「记住」或「忽略」。已有项目约定也可以通过会话命令导出到工作树,随项目改动一起提 PR。
|
|
51
65
|
|
|
52
|
-
|
|
66
|
+
<details>
|
|
67
|
+
<summary>如何选择导入来源、预览和应用导出</summary>
|
|
53
68
|
|
|
54
|
-
|
|
69
|
+
- **选择来源。** 只读仓库根目录的 `AGENTS.md`,输入 `/project-memory import agents`。读取 `CLAUDE.md` 和 `.claude/CLAUDE.md`,用 `/project-memory import claude`。只读 Claude Code 的项目记忆,用 `/project-memory import claude-memory`。
|
|
70
|
+
- **预览导出。** 输入 `/project-memory status`,找到要导出的项目条目的 `id` 和 `rev`,组合成 `ID@版本`。输入 `/project-memory export agents <ID@版本>`,查看对 `AGENTS.md` 的改动。对于已有成功执行记录的操作手册,输入 `/project-memory export skill <ID@版本> release-check`,即可预览 `.dsh/skills/release-check/SKILL.md`。请把尖括号占位符换成实际值。
|
|
71
|
+
- **写入文件。** 核对返回的 `diff` 后,在同一会话中复制并运行 `apply` 字段里的完整命令。预览有效期为 30 分钟。[文件导入](./src/file-import.ts) · [导出实现](./src/sharing.ts)
|
|
55
72
|
|
|
56
|
-
|
|
57
|
-
| --- | --- |
|
|
58
|
-
| 1 · 主动提示 | DSH 组装模型请求时,写入适用的主动约定,含动作、条件、例外和版本。置顶项优先,短索引默认最多 **16 行、2,048 个 UTF-8 字节**。 |
|
|
59
|
-
| 2 · 按需详情 | 助手需要更多信息时,可按 ID 读取现行结论,或按主体与主题、关键词、相近表述检索。关键词由 SQLite FTS5 检索。查中英文混用的约定时,助手可在一次调用中给出两种语言的等义问法,各自使用对应的本地 BGE 模型匹配。按需资料和标记为敏感的条目只在查阅时出现。 |
|
|
60
|
-
| 3 · 来源核验 | 你追问出处时,助手可单独查询短引文及其核验状态。项目引文可与原会话中的一个事件核对。结果区分已核验原话、留存引文、用户确认的表述和仅有回执。你可以单独清除引文,保留结论。 |
|
|
73
|
+
</details>
|
|
61
74
|
|
|
62
|
-
|
|
75
|
+
<img src="./docs/images/memory-settings-zh.png" width="564" alt="「设置 → 记忆」列出两条全局偏好和一条项目约定。展开更新说明约定,可以看到原话和原对话入口。">
|
|
63
76
|
|
|
64
|
-
##
|
|
77
|
+
## 工作原理
|
|
65
78
|
|
|
66
|
-
|
|
79
|
+
Bond 将记忆、版本和来源一起存在当前 DSH 配置的本地 SQLite 库里。新会话可以从提示中直接收到适用的长期约定(L1),需要细节时检索或读取正文(L2),有人问起依据时再核对留存的原话(L3)。助手按当下的问题选择读取深度。
|
|
67
80
|
|
|
68
|
-
|
|
69
|
-
<source media="(max-width: 600px)" srcset="https://cdn.jsdelivr.net/npm/dsh-memory-bond@0.3.0-beta.0/design/memory-lifecycle-consolidation.mobile.zh-CN.svg">
|
|
70
|
-
<img src="https://cdn.jsdelivr.net/npm/dsh-memory-bond@0.3.0-beta.0/design/memory-lifecycle-consolidation.zh-CN.svg" alt="开启后,项目主会话完成一轮、进入空闲时首查,持续空闲时约每小时复查,新一轮开始时暂停。SQLite 先分批检查已有记忆,之后将新增或修订与旧条目匹配。没有候选时模型调用为零。符合条件时模型只比较两条摘要,判为疑似重复后由用户决定保留哪些记录。">
|
|
71
|
-
</picture>
|
|
81
|
+

|
|
72
82
|
|
|
73
|
-
[
|
|
83
|
+
[查看大图](./docs/images/bond-memory-principle-zh.svg) · [可编辑的 draw.io 源图](./docs/images/bond-memory-principle.drawio) · [架构与配置](./docs/architecture.zh-CN.md)
|
|
74
84
|
|
|
75
|
-
|
|
85
|
+
<details>
|
|
86
|
+
<summary>同一条命令,两个 Git 工作树 · 查看两次回答的实测记录并在本机复现</summary>
|
|
87
|
+
|
|
88
|
+
项目原先用 `make verify` 跑集成检查,更正后的第 2 版改用 `make integration`,两个工作树共享这条约定。只在 `release` 工作树的 Makefile 中删掉 `integration` 目标,然后在两边各开一个新会话。在 DSH `0.2.2-rc.5` 上用本地脚本驱动助手,两个会话都收到同一句请求 `Run the integration checks for this change.`
|
|
89
|
+
|
|
90
|
+
| 查看哪里 | `main` · 目标仍在 | `release` · 目标已删除 |
|
|
76
91
|
| --- | --- | --- |
|
|
77
|
-
|
|
|
78
|
-
|
|
|
79
|
-
|
|
|
80
|
-
|
|
92
|
+
| `/project-memory status` | 第 2 版仍适用 | 同一版本被列入 `needs_review` |
|
|
93
|
+
| 回答下方的「本轮记忆回执」 | 两次模型请求都收到了第 2 版正文。第 1 次还记录了匹配的执行。 | 助手检索了一次,这一版没有送达记录。 |
|
|
94
|
+
| Bash 工具与落盘结果 | `make integration` 成功执行一次,退出码为 0 | 没有发起 Bash 调用 |
|
|
95
|
+
|
|
96
|
+
在安装了 DSH、Git 和 Make 的机器上,从源码目录运行以下命令。脚本使用临时仓库和独立的 DSH profile,并打印两版原话、核验状态和逐请求回执。
|
|
81
97
|
|
|
82
|
-
|
|
98
|
+
```sh
|
|
99
|
+
npm run build
|
|
100
|
+
npm run verify:dsh -- --worktrees
|
|
101
|
+
```
|
|
83
102
|
|
|
84
|
-
|
|
103
|
+
</details>
|
|
85
104
|
|
|
86
|
-
|
|
105
|
+
## 常见问题
|
|
87
106
|
|
|
88
|
-
|
|
89
|
-
| --- | --- |
|
|
90
|
-
| `project_memory_propose` | 根据用户原话提出新记忆或更正,并指定属于当前项目还是整个 profile。 |
|
|
91
|
-
| `project_memory_search` | 在可见范围内按 ID、主体与主题、关键词或语义相似度查找现行条目。 |
|
|
92
|
-
| `project_memory_read` | 读取现行结论、适用条件、例外和版本。 |
|
|
93
|
-
| `project_memory_source` | 用户追问出处时,查阅留存表述及其核验状态。 |
|
|
94
|
-
| `project_memory_ticket` | 任务命中预设触发条件时,凭 DSH 给出的短期票据读取对应的项目事实、参考资料或操作手册。 |
|
|
107
|
+
**需要额外的 API Key 或数据库服务吗?** 插件沿用 DSH 已配置的会话模型,并在本机当前配置目录中创建 SQLite 库。
|
|
95
108
|
|
|
96
|
-
|
|
109
|
+
**哪些内容会发给模型提供方?** 检索和可选的向量计算在本机完成。聊天时,模型能看到进入本次请求的记忆。复核写入时,提供方还可能收到用户原话、拟保存的内容、相关候选记忆和适用的仓库指令。默认的轮末复核也可能发送符合条件的用户原话和相关非敏感记忆,即使你没有明确要求保存。将 `turnReviewBudget` 设为 `0` 可关闭轮末复核。跨会话重复检查会发送两条候选的摘要和适用条件。本地数据库及受管备份均未加密。[数据流与隐私](./SECURITY.md)
|
|
97
110
|
|
|
98
|
-
|
|
111
|
+
**哪些会话能用同一条记忆?** 全局记忆在同一份 DSH 配置的项目之间共享。项目记忆跟随 Git 仓库,同一仓库的多个工作树共享记忆,分别克隆的仓库各自保存。非 Git 目录可以用 `nonGitRoots` 指定项目根目录。[项目识别](./src/domain.ts)
|
|
99
112
|
|
|
100
|
-
|
|
113
|
+
**可以查看、修改、撤回或关闭记忆吗?** 在「设置 → 记忆」里可以查看来源、编辑或撤回条目。关闭「启用记忆」后,助手会停止保存和使用记忆,你仍可管理已有记录。在会话中输入 `/project-memory help` 可查看命令。
|
|
101
114
|
|
|
102
|
-
|
|
115
|
+
**可选模型有什么用?** 主包按关键词查找。加装本地模型后,换一种说法也可以按含义找到相关条目。两种语言可以任选一种,也可以同时安装。[添加语言模型](#可选语言模型)
|
|
103
116
|
|
|
104
|
-
|
|
117
|
+
| 安装内容 | 可用能力 |
|
|
118
|
+
| --- | --- |
|
|
119
|
+
| 主包 | 本地存储、关键词检索 |
|
|
120
|
+
| 主包 + 中文模型 | 增加中文语义检索 |
|
|
121
|
+
| 主包 + 英文模型 | 增加英文语义检索 |
|
|
105
122
|
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
turnReviewBudget: 0
|
|
110
|
-
```
|
|
123
|
+
**「每小时最多一次」指什么?** 开启「跨会话整理」后,可写的项目会话完成一轮并空闲时,Bond 会查找相似记忆。每个项目每小时最多把一对候选交给会话模型比较。日常聊天和记忆写入复核有各自的模型调用。[后台检查](./src/consolidation.ts)
|
|
124
|
+
|
|
125
|
+
<a id="实测结果"></a>
|
|
111
126
|
|
|
112
|
-
|
|
127
|
+
## 仓库任务基准
|
|
113
128
|
|
|
114
|
-
|
|
129
|
+
这项测试由脚本驱动助手,在 DSH `0.2.2-rc.5` 上对 34 个仓库任务各换 5 种问法。每题新开会话。脚本选定 Make 目标时,DSH 的 Bash 工具会实际运行它,基准根据写入的标记判分。每组 170 题,其中 15 题应该跳过执行。
|
|
115
130
|
|
|
116
|
-
|
|
131
|
+
| 检索配置 | 正确完成(含正确跳过) | 跑错命令 | 漏执行 |
|
|
132
|
+
| --- | ---: | ---: | ---: |
|
|
133
|
+
| 主包 · 关键词检索 | 120/170(70.6%) | 28 | 22 |
|
|
134
|
+
| 主包 + 中英文模型 · 混合检索 | 137/170(80.6%) | 32 | 1 |
|
|
117
135
|
|
|
118
|
-
|
|
136
|
+
这组任务中,加入双模型后多完成了 17 题,提升 **10 个百分点**。漏执行从 22 次降到 1 次,选错命令从 28 次增到 32 次。这些结果衡量固定选择策略下的检索与执行。真实模型遵从约定的比例仍需单独评测。[逐题结果](./docs/benchmarks/repository-tasks.json) · [方法与复现](./docs/benchmark.zh-CN.md)
|
|
119
137
|
|
|
120
|
-
|
|
121
|
-
| --- | ---: | ---: | ---: | ---: |
|
|
122
|
-
| 关闭插件,只给问题 | 0.0 | 92 | 577,993 | ¥0.22 |
|
|
123
|
-
| 开启插件,可查 118 条已保存记忆 | **27.1** | 54 | 1,031,787 | ¥0.61 |
|
|
124
|
-
| 关闭插件,每题附上 19 场对话全文 | 41.6 | 20 | 452,779 | ¥0.12 |
|
|
138
|
+
## 高级安装与开发
|
|
125
139
|
|
|
126
|
-
|
|
140
|
+
### 从源码安装
|
|
127
141
|
|
|
128
|
-
|
|
142
|
+
需要 **Node.js 22.18 或以上版本**。在源码仓库根目录用 Bash 或 Zsh 运行以下命令,完成后重启 DSH。桌面版请先启动一次,再完全退出后安装。[DeepSeek Harness 项目](https://github.com/deepseek-ai/deepseek-harness)
|
|
129
143
|
|
|
130
144
|
```sh
|
|
131
|
-
npm
|
|
145
|
+
npm ci
|
|
146
|
+
npm pack
|
|
147
|
+
dsh plugin --profile desktop add --offline "$PWD/dsh-memory-bond-1.0.0.tgz"
|
|
132
148
|
```
|
|
133
149
|
|
|
134
|
-
###
|
|
150
|
+
### 可选语言模型
|
|
135
151
|
|
|
136
|
-
|
|
152
|
+
装好主包后可以直接加模型。如果手上没有源码,可下载并解压对应版本的源码包,其中包含中英文模型和共用的 ONNX 运行时。[下载 1.0.0 源码(.zip)](https://github.com/PersistentJZH/dsh-memory-bond/archive/f3bb0f3eea696b300066640631209046057e675e.zip)
|
|
137
153
|
|
|
138
|
-
|
|
154
|
+
用 Node.js 22.18 或以上版本,在解压后的目录或源码仓库根目录运行 `npm ci`。退出 DSH,按需要运行对应语言的命令,选用安装主包时的同一个 profile。
|
|
139
155
|
|
|
140
156
|
```sh
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
npm run verify:tasks -- --live # 使用已配置的 DeepSeek 凭据运行真实模型
|
|
157
|
+
dsh plugin --profile desktop add --offline "link:$PWD/native/embeddings/zh"
|
|
158
|
+
dsh plugin --profile desktop add --offline "link:$PWD/native/embeddings/en"
|
|
144
159
|
```
|
|
145
160
|
|
|
146
|
-
|
|
161
|
+
使用期间请保留源码目录和已安装的依赖。重新启动 DSH,在会话中运行 `/project-memory status`。`embeddingLanguages` 会列出已识别的语言,只装主包时该列表为空。已有记忆会在后台补建索引。
|
|
162
|
+
|
|
163
|
+
<details>
|
|
164
|
+
<summary>安装时遇到问题</summary>
|
|
165
|
+
|
|
166
|
+
- macOS 终端找不到 `dsh` 时,在同一终端运行 `export PATH="/Applications/DeepSeek Harness.app/Contents/Resources/runtime/cli/bin:$PATH"`,再重试。
|
|
167
|
+
- 新建记忆库使用 SQLite schema 版本 4。如果启动时报 `unsupported_schema`,请保留原 profile 及其数据,在新的 DSH profile 中安装。
|
|
168
|
+
|
|
169
|
+
</details>
|
|
170
|
+
|
|
171
|
+
在源码目录运行 `npm test` 可执行测试套件,`npm run verify:models` 可验证纯关键词、单模型和双模型配置。
|
|
172
|
+
|
|
173
|
+
<details>
|
|
174
|
+
<summary>同属 DSH 生态的记忆插件</summary>
|
|
175
|
+
|
|
176
|
+
dsh-loci 提供原话证据与已核验条目的短索引,RestRegular/dsh-memory 提供本地混合检索并区分选中与投递,dsh-auto-memory 提供注入日志与查阅统计。需要排查一个分支里某次回答的行为时,Bond 可以把当前工作树的条件核验与那次请求收到的具体版本对应起来。[dsh-loci](https://github.com/Awenforever/dsh-loci) · [RestRegular/dsh-memory](https://github.com/RestRegular/dsh-memory#诊断与审计) · [dsh-auto-memory](https://github.com/AskTheWay/dsh-auto-memory)
|
|
147
177
|
|
|
148
|
-
|
|
178
|
+
</details>
|
|
149
179
|
|
|
150
|
-
|
|
180
|
+
[MIT 许可证](./LICENSE) · [模型与运行时许可](./native/embeddings/NOTICE.md)
|
package/SECURITY.md
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# Security and privacy
|
|
2
|
+
|
|
3
|
+
## Local storage
|
|
4
|
+
|
|
5
|
+
Each DSH profile stores its memory database at `memory-bond/memory.sqlite` and managed backups at `memory-bond/backups/projects.sqlite`. They contain conclusions, applicable conditions, revision history, source references and retained excerpts. Both files are unencrypted. A person or process with access to the profile files can read them. DSH manages the original conversation history separately. Clearing a retained excerpt in Bond affects the plugin’s copies, including its managed backups.
|
|
6
|
+
|
|
7
|
+
## Model requests
|
|
8
|
+
|
|
9
|
+
Keyword search and optional embedding inference run locally. The configured DSH model provider receives the content of its requests. This can include applicable standing agreements, search or read results, and quotes requested through the source tool. A sensitive entry stays out of the standing index and task pointers. An explicit lookup can still bring its value into a request.
|
|
10
|
+
|
|
11
|
+
During a chat write, the session’s provider compares the proposal with the complete eligible user message (or typed form answer and its question) and a small set of current candidates. For a standing request, the provider can also receive the questions and selected option labels from eligible form submissions linked to that message. Bond validates the native call, the submitted result, the offered label and their source bindings. The retained source distinguishes the user’s original words from the submitted option. Clearing the source removes both pieces of evidence. An explicit reference or an exact subject and topic can identify a protected entry. The comparison receives its identity and version and withholds its old value. For an ordinary project proposal with applicable repository instructions, the provider can also receive the relevant instruction documents to compare their meaning. The plugin checks the decision against the file contents and fingerprints before using it.
|
|
12
|
+
|
|
13
|
+
End-of-turn review sends eligible user excerpts, any attached submitted formats for standing instructions, and relevant non-sensitive candidates’ current conclusions, conditions and exceptions to the session’s provider. Setting `turnReviewBudget: 0` disables this background call. Optional cross-session review sends two candidate summaries, including their conditions and exceptions, when enabled. It excludes sensitive entries and source quotes.
|
|
14
|
+
|
|
15
|
+
## Source and scope checks
|
|
16
|
+
|
|
17
|
+
Automatic saves of user statements require an excerpt the plugin can locate uniquely. For a single short user input, the plugin can supply the quote directly. Bond filters or redacts common credential formats. Treat exported project files, database backups and saved DSH conversations as potentially sensitive. Project entries belong to a Git repository or to a directory explicitly configured in `nonGitRoots`. Global entries are shared across the profile’s projects.
|
|
18
|
+
|
|
19
|
+
A clarification in the following turn of the same project session can narrow an eligible global agreement to the current project. The review sends the previous agreement’s ID, topic, action, conditions and exceptions together with the new user input to the session’s provider. The plugin checks the source and repository conditions, then commits the project write and withdrawal of the global agreement together.
|
|
20
|
+
|
|
21
|
+
A Bash-backed lesson requires an observed native result in the current writable project session. Its review card retains the command, relative working directory, exit code and event references. Command arguments can contain project details. The evidence excludes standard output and standard error. The source tool can return the command to an authorized model request. Clearing the source removes that retained evidence from the plugin and its managed backups.
|
|
22
|
+
|
|
23
|
+
The import command reads project instruction files and Markdown files in the current project’s Claude Code memory directory. Review cards retain source paths, hashes, line numbers and proposed wording. Approving a card stores the wording the reviewer accepted. A later lookup can send this wording to the configured provider. Batch undo cancels pending cards and withdraws unchanged imports. The original files stay on disk.
|
|
24
|
+
|
|
25
|
+
The settings page aggregates body deliveries and full lookups by revision and session. These receipts record what reached the model. They cannot establish whether the assistant followed an agreement or whether a task succeeded.
|
|
26
|
+
|
|
27
|
+
## Reporting a vulnerability
|
|
28
|
+
|
|
29
|
+
Use the repository’s private vulnerability reporting form if it is enabled. If you need a private contact, open an issue requesting one. Include the plugin and DSH versions. Share a minimal example using synthetic data and keep credentials, transcripts and profile databases private.
|