dsh-memvault 0.9.11 → 0.9.12
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 +2 -2
- package/README.zh.md +2 -2
- package/docs/DEVLOG.md +38 -2
- package/lib/extract.js +33 -1
- package/package.json +1 -1
- package/scripts/smoke-extract.mjs +21 -0
package/README.md
CHANGED
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
</p>
|
|
13
13
|
|
|
14
14
|
<p align="center">
|
|
15
|
-
<img alt="version" src="https://img.shields.io/badge/version-0.9.
|
|
15
|
+
<img alt="version" src="https://img.shields.io/badge/version-0.9.12-4a6cf7">
|
|
16
16
|
<img alt="npm" src="https://img.shields.io/npm/v/dsh-memvault?color=cb3837">
|
|
17
17
|
<img alt="license" src="https://img.shields.io/badge/license-MIT-30a46c">
|
|
18
18
|
<img alt="platform" src="https://img.shields.io/badge/platform-DeepSeek%20Harness-f76b15">
|
|
@@ -78,7 +78,7 @@ The plugin does three things:
|
|
|
78
78
|
|
|
79
79
|
**Prerequisite:** a working MemVault checkout — its virtualenv and its `memvault.db` (the store is shared with the MemVault service and MCP clients; this plugin only ever `SELECT`s from it).
|
|
80
80
|
|
|
81
|
-
Install from npm (0.9.
|
|
81
|
+
Install from npm (0.9.12 and newer):
|
|
82
82
|
|
|
83
83
|
```powershell
|
|
84
84
|
dsh plugin --profile desktop add dsh-memvault
|
package/README.zh.md
CHANGED
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
</p>
|
|
13
13
|
|
|
14
14
|
<p align="center">
|
|
15
|
-
<img alt="version" src="https://img.shields.io/badge/version-0.9.
|
|
15
|
+
<img alt="version" src="https://img.shields.io/badge/version-0.9.12-4a6cf7">
|
|
16
16
|
<img alt="npm" src="https://img.shields.io/npm/v/dsh-memvault?color=cb3837">
|
|
17
17
|
<img alt="license" src="https://img.shields.io/badge/license-MIT-30a46c">
|
|
18
18
|
<img alt="platform" src="https://img.shields.io/badge/platform-DeepSeek%20Harness-f76b15">
|
|
@@ -78,7 +78,7 @@
|
|
|
78
78
|
|
|
79
79
|
**前置条件**:一份能跑的 MemVault checkout——它的 virtualenv 与 `memvault.db`(该库与 MemVault 服务、MCP 客户端共享;本插件只对它 `SELECT`)。
|
|
80
80
|
|
|
81
|
-
从 npm 安装(0.9.
|
|
81
|
+
从 npm 安装(0.9.12 起):
|
|
82
82
|
|
|
83
83
|
```powershell
|
|
84
84
|
dsh plugin --profile desktop add dsh-memvault
|
package/docs/DEVLOG.md
CHANGED
|
@@ -815,6 +815,42 @@ bundle、注入与面板路由都不依赖 rc.3 → rc.5 之间的差异。所
|
|
|
815
815
|
- `package.json` 0.9.10 → 0.9.11;两版 README 的版本徽章与安装行同步。
|
|
816
816
|
- README 兼容性表:实测宿主 `0.2.1-rc.3` → `0.2.1-rc.5`(中英各一处;严格判定器的示例同步)。
|
|
817
817
|
|
|
818
|
-
### 23.4
|
|
818
|
+
### 23.4 发版记录(2026-11-01)
|
|
819
819
|
|
|
820
|
-
-
|
|
820
|
+
- **`npm publish --registry https://registry.npmjs.org --access public`**,账号 `zheexinn`,
|
|
821
|
+
发布 `dsh-memvault@0.9.11`;`dist-tags.latest` 在约 50 秒后变为 `0.9.11`。
|
|
822
|
+
- **发布物自检**(§22.5 的流程):从 registry 拉下 tgz 解包后跑 `node scripts/smoke-package.mjs` → ALL PASS;
|
|
823
|
+
字节数 4,264,727,sha512 与本地 `npm pack`、registry 的 `dist.integrity` 三者一致。
|
|
824
|
+
- **传播延迟**:packument / `dist-tags` 先更新,tarball 地址在约 3 分钟内仍回 404,之后变 200——
|
|
825
|
+
与 §22.5 记录的 registry 传播特性同类,不是发布失败,不要因此重发或 `npm unpublish`。
|
|
826
|
+
|
|
827
|
+
## 24. 2026-11-01:抽取一直 `added=0`(v0.9.12)
|
|
828
|
+
|
|
829
|
+
### 24.1 现象
|
|
830
|
+
|
|
831
|
+
面板停在 10-26。状态文件里当天的 5 次抽取:2 次 `failed: httpx.ReadTimeout`,3 次 `ok added=0`;
|
|
832
|
+
库内 `max(created_at)` = `2026-10-26T15:11:36Z`。
|
|
833
|
+
|
|
834
|
+
### 24.2 根因(实测,不是推断)
|
|
835
|
+
|
|
836
|
+
1. **抽取只送 `user/message`,而 DSH 的 user 事件里混着机器文本**:runtime context(其中还嵌着
|
|
837
|
+
MemVault 自己注入的核心块)、checkpoint 摘要、skill catalog、`<system-reminder>`、background job
|
|
838
|
+
输出、`Time sampled` 时间戳。当天 5 个窗口里机器文本占 **32%–67%**;一个真实会话 97 条 user 消息,
|
|
839
|
+
最长的是 **20,133 字**的 skill catalog 与 **13,118 字**的 checkpoint。
|
|
840
|
+
2. **真实用户回合极短**:同一会话里多为「现状」「继续做 R26」「现况,服务器docker现在有哪些」(2–55 字)。
|
|
841
|
+
3. **提示词只收「用户自述的长期事实」**,所以这些窗口返回 `[]` 是**符合契约**的结果,不是抽取器坏了。
|
|
842
|
+
另有一层独立问题:`LLMExtractor` 的 HTTP 超时硬编码 60s,慢网关下会整窗失败(今天的 2 次)。
|
|
843
|
+
|
|
844
|
+
### 24.3 改了什么(v0.9.12)
|
|
845
|
+
|
|
846
|
+
- `renderTranscript` 在渲染 user 文本前丢弃机器前缀(runtime context / MemVault 核心块 / checkpoint /
|
|
847
|
+
system-reminder / skill catalog / background job / 时间戳 / hindsight refresh),预算与模型注意力回到
|
|
848
|
+
真人说的话上。
|
|
849
|
+
- `smoke-extract` 新增 2 条:机器文本被丢、真实回合存活。
|
|
850
|
+
|
|
851
|
+
### 24.4 没有改什么
|
|
852
|
+
|
|
853
|
+
- 没有打开 `includeAssistant`,也没有放宽抽取提示词——那会把项目过程写进记忆,属于产品取舍。
|
|
854
|
+
- 实测:把最近 8 条含助手结论的对话(4,262 字)喂给同一管线,仍返回 0 条。**所以「多送助手文本」本身
|
|
855
|
+
不解决这个问题**;要让项目结论入库,需要显式 `memory_add`(procedural)或改抽取范围与提示词。
|
|
856
|
+
- 本轮手动写入 3 条 procedural 记忆(MCP 修复、发布流程、本根因),面板因此重新出现 11-01 的记录。
|
package/lib/extract.js
CHANGED
|
@@ -33,6 +33,38 @@ function blockText(block) {
|
|
|
33
33
|
return undefined
|
|
34
34
|
}
|
|
35
35
|
|
|
36
|
+
/**
|
|
37
|
+
* Harness-injected, user-role text that the user did not write.
|
|
38
|
+
*
|
|
39
|
+
* The session log stores all of this as ordinary `user/message` events: the
|
|
40
|
+
* runtime-context block (which even carries the injected core memory), timing
|
|
41
|
+
* stamps, background-job reports, checkpoints, skill-catalog reminders and the
|
|
42
|
+
* Hindsight refresh. Measured on 2026-11-01: a 2 248-char window was 67 % this
|
|
43
|
+
* material, and one real transcript held a 20 k-char skill catalog next to a
|
|
44
|
+
* 7-char command ("继续做 R26") — the extractor then correctly returns [] for a
|
|
45
|
+
* window that contains nothing of the user. Dropping these keeps the budget and
|
|
46
|
+
* the model's attention on what the person actually said.
|
|
47
|
+
*/
|
|
48
|
+
const MACHINE_USER_PREFIXES = [
|
|
49
|
+
'Current runtime context',
|
|
50
|
+
'MemVault core memory (persistent facts',
|
|
51
|
+
'Time sampled while preparing',
|
|
52
|
+
'Browser time zone for this request',
|
|
53
|
+
'Elapsed since the preceding',
|
|
54
|
+
'Current DeepSeek Harness Web GUI URL',
|
|
55
|
+
'background job ',
|
|
56
|
+
'<system-reminder>',
|
|
57
|
+
'<hindsight_knowledge_refresh>',
|
|
58
|
+
'This is an automatically generated checkpoint',
|
|
59
|
+
]
|
|
60
|
+
|
|
61
|
+
/** Whether a user-role text was produced by the harness rather than the person. */
|
|
62
|
+
export function isMachineUserText(text) {
|
|
63
|
+
const trimmed = text.trimStart()
|
|
64
|
+
return MACHINE_USER_PREFIXES.some((prefix) => trimmed.startsWith(prefix))
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
|
|
36
68
|
/**
|
|
37
69
|
* Render an event span as a bounded transcript, newest content kept.
|
|
38
70
|
*
|
|
@@ -55,7 +87,7 @@ export function renderTranscript(events, maxChars = 6000, { includeAssistant = f
|
|
|
55
87
|
if (event.type === 'user/message') {
|
|
56
88
|
for (const block of event.data?.content ?? []) {
|
|
57
89
|
const text = blockText(block)
|
|
58
|
-
if (text) lines.push(`用户: ${text}`)
|
|
90
|
+
if (text && !isMachineUserText(text)) lines.push(`用户: ${text}`)
|
|
59
91
|
}
|
|
60
92
|
} else if (event.type === 'assistant/message') {
|
|
61
93
|
for (const block of event.data?.message?.content ?? []) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-memvault",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.12",
|
|
4
4
|
"description": "DeepSeek Harness plugin: inject MemVault core memory blocks into the system prompt, extract finished turns as one windowed pass, and show, edit, trace, review and replay all of it in a memory panel",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "lib/index.js",
|
|
@@ -67,6 +67,27 @@ check('skips non-text blocks', !rendered.includes('image'))
|
|
|
67
67
|
check('honours the char budget', renderTranscript(events, 30).length <= 30,
|
|
68
68
|
`len=${renderTranscript(events, 30).length} of 30`)
|
|
69
69
|
|
|
70
|
+
// Harness-injected user-role text (runtime context, checkpoints, skill catalogs,
|
|
71
|
+
// background-job reports) is not something the person wrote. Measured 2026-11-01:
|
|
72
|
+
// a 2 248-char window was 67 % this material, and one transcript was a 20 k-char
|
|
73
|
+
// skill catalog next to a 7-char command — extraction returned [] and the panel
|
|
74
|
+
// looked frozen at an old date.
|
|
75
|
+
const noisy = [
|
|
76
|
+
{ seq: 1, type: 'user/message', data: { content: [{ type: 'text', text: 'Current runtime context. This snapshot supersedes earlier ones.'.repeat(20) }] } },
|
|
77
|
+
{ seq: 2, type: 'user/message', data: { content: [{ type: 'text', text: '<system-reminder> The available skill catalog changed.'.repeat(10) }] } },
|
|
78
|
+
{ seq: 3, type: 'user/message', data: { content: [{ type: 'text', text: 'background job pwsh-abc finished: exit 1'.repeat(10) }] } },
|
|
79
|
+
{ seq: 4, type: 'user/message', data: { content: [{ type: 'text', text: 'This is an automatically generated checkpoint condensing an earlier span'.repeat(10) }] } },
|
|
80
|
+
{ seq: 5, type: 'user/message', data: { content: [{ type: 'text', text: '继续做 R26' }] } },
|
|
81
|
+
]
|
|
82
|
+
const cleaned = renderTranscript(noisy, 6000)
|
|
83
|
+
check('drops harness-generated user text',
|
|
84
|
+
!cleaned.includes('Current runtime context') && !cleaned.includes('system-reminder')
|
|
85
|
+
&& !cleaned.includes('background job') && !cleaned.includes('automatically generated checkpoint'),
|
|
86
|
+
cleaned.includes('Current runtime context') ? 'runtime context survived' : 'noise dropped')
|
|
87
|
+
check('keeps the real user turn when machine noise is dropped',
|
|
88
|
+
cleaned.trim() === '用户: 继续做 R26', JSON.stringify(cleaned))
|
|
89
|
+
|
|
90
|
+
|
|
70
91
|
// ── turnSpanByBoundary (replaces the seq-window slice) ───────────────────────
|
|
71
92
|
const turnEvents = [
|
|
72
93
|
{ seq: 0, type: 'turn/start' },
|