@yolk_vat-y/dsh-project-memory 0.5.15 → 0.6.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 CHANGED
@@ -1,3 +1,209 @@
1
+ ## 0.6.0 (2026-10-13)
2
+
3
+ `npm test` **616 → 650 项 / 34 → 36 个文件**;`npm run typecheck` 通过。注入场景集 8 → **13** 个,另加 3 个 hint-only 场景。
4
+
5
+ ### 新增:可选语义层(只重排经验 / 洞察两层)
6
+
7
+ 可选依赖 `leanvec` 随安装默认可用并自动启用(约 79 MB、约 +130 MB RSS);未安装或 `vectorDir: 'off'` 时逐字段退回纯词法。只改这两层排序,返回条数与文档/符号层不变;`vectorAlpha` 默认 `0.5`。
8
+
9
+ 实测(36 条**刻意改写成不含原词**的查询 / 115 条池):
10
+
11
+ | 策略 | hit@1 | hit@3 | hit@5 | hit@10 |
12
+ |---|---|---|---|---|
13
+ | BM25 单路 | 39% | 50% | 58% | **69%** |
14
+ | 纯向量替换 | 22% | 36% | 42% | 53% |
15
+ | 融合 α=0.5 | **42%** | **53%** | **64%** | **72%** |
16
+
17
+ **纯向量替换明显更差**,加权融合每个 k 都更好(中位名次 2 → 1);同批数据还测出"用余弦当绝对阈值"不可行(换文本变体就剪掉 100% 的条目)。所以向量只做排序、不做门槛。
18
+
19
+ - 索引持久化在 `vectors.json`(实测 151 KB),两级失效(模型指纹 / 逐条文本哈希):冷启 183 ms、热启 91 ms。指纹变了或文件损坏都当"没有"重建,不抛。
20
+
21
+ ### 新增:检索路径的最小相关性闸门
22
+
23
+ `query_memory` 与经验/洞察层要求**命中的不同查询词数 ≥ min(2, 查询词数)**(单词查询不受影响)。修的是 `zzz-no-such-topic-xyz` 靠 `-` 切出的片段 `no` 命中一条无关经验(3.13 分)的真事故。
24
+
25
+ ⚠ **只在没有向量层时生效**:A/B 实测对纯 BM25 无影响(hit@10 69% → 69%),却砍掉向量的 3 条救援(72% → 64%)。语义层出厂默认即启用,因此默认装法下这条闸门不生效。
26
+
27
+ 另有一条与向量层无关、两种模式一致的规则:经验/洞察两层的查询词里,**拉丁片段短于 3 个字符的直接丢弃**(tokenizer 从 `no-op` / `--no-edit` 切出来的 `no`、`op` 没有独立语义,却因为稀缺拿到不低的 BM25)。doc/symbol 层不适用——`js` / `id` 这类短标识符本来就该命中。
28
+
29
+ ### 性能:冷加载不再为 storeCache 记账扫全库
30
+
31
+ 0.5.13 把 storeCache 的驻留估算从"读盘文本量换算"改成对内存对象图精确计数——账准了,代价却记在每次 `load()` 上:**逐串 `Buffer.byteLength` 扫一遍全库**。当时记的是"冷加载 +8~11%",这次在同一棵树(12,634 文件 / 80,231 条目)上用同一个**空进程**口径交替实测是 **+18%**(0.5.11 255 ms → 0.6.0 301 ms)。
32
+
33
+ 现在精确计量只在**真有可能逐出**时才做:条数超上限,或保守上界(内存文本字符数 × 4 + 骨架常数)就已超字节预算。文本字符数按文件**替换式**累计(读盘分片 / 写条目 / 非分片 JSON 三条路径),重写同一个文件不会算两遍;在真实语料上标定的上界 / 精确值比是 1.16~1.74 倍。预算宽裕时(单项目常态)一次遍历都不做。
34
+
35
+ | 空进程冷加载(80,231 条目) | 0.5.11 | 0.6.0 修前 | 本次 |
36
+ |---|---|---|---|
37
+ | 实测(交替三轮) | 255 / 258 / 255 ms | 301 / 300 / 301 ms | **251 / 246 / 256 ms** |
38
+
39
+ - 同一个进程里再 load 第二个大 root 时仍会结算一次——那正是预算可能被撞上的情形。`bench --json` 现在把两个口径分开:`coldLoadMs` 只记空进程冷启动,`secondStoreLoadMs` 记同进程第二个 store;合成基准的冷加载也改成独立进程量(同进程连 load 5 份副本会攒下 5 个 store,既绕不开结算也不是"冷启动")。
40
+ - `test/store-cache.test.mjs` 34 → **43** 项:新增"预算宽裕时不精确计量(无版本戳)""上界 ≥ 精确值且不超 8 倍""写进来的条目计入上界""同一文件重写是替换而非累加"。
41
+ - README 双语的性能表按新口径重测(冷加载:Vue 8 ms、文档工作区 10 ms、3k 切片 70 ms、整棵树 278 ms)。
42
+
43
+ ### 测试与修复
44
+
45
+ - 新增 **5 个自然语言对照**与 **3 个 hint-only 场景**(提示通道召回 0/3、精度 1.00,只报告不设门);其中 1 条对照在基线上就注入一条无关经验,属**已知缺陷并钉住上界**。
46
+ - 新增 `test/recall-vector-fusion.test.mjs`(13 项)与 `test/vector-index.test.mjs`(10 项),都不需要 leanvec。
47
+ - `test/run-test.mjs` 读开发机真实的全局 insight store,导致 `no-hit query shows store overview` 随本机经验条数变红(乱码查询被 `no` 片段命中)。现在 globalFile 指向临时文件,测试**密闭**。
48
+
49
+ ## 0.5.16 (2026-10-11)
50
+
51
+ `npm test` **592 → 616 项 / 30 → 34 个文件**;`npm run typecheck` 通过。
52
+
53
+ ### 性能:`chunkText` 不再对整份正文物化(只对有 section 结构的文档有效)
54
+
55
+ 原实现先把整份正文 `split(/\r?\n/)`,再把所有 section 的正文同时留在内存里。现在逐行扫描,
56
+ 一个 section 处理完就放掉,攒够 `maxChunks` 就停。
57
+
58
+ 省内存靠的是**提前停**:chunk 按文档顺序产出,够 40 个之后剩下的输入永远不会被保留,所以
59
+ **只在文档有 section 结构(`#` 标题,或 PDF 每页的 `## Page N`)时**才省。
60
+
61
+ 107 MB 语料实测(独立子进程 + `--expose-gc`,量 `chunkText` 自己额外占用的增量 RSS):
62
+
63
+ | 语料 | 旧 | 新 |
64
+ |---|---|---|
65
+ | 12000 个 `#` 小节 | 45.8 MB | **0.6 MB** |
66
+ | 整篇无标题 | 116.1 MB | 111.3 MB(没有实质改善) |
67
+
68
+ 无标题的长文本(单页大 PDF、纯 txt)仍会把整份内容攒在 section 缓冲里;要覆盖那种情形得把
69
+ 切分做到 section 内部,本次没做。
70
+
71
+ 这次改动不改输出,所以判据是与旧实现逐字节一致:`test/chunker.test.mjs` 把旧实现当参考实现内联,
72
+ 边界输入(14 种 × 6 组参数)与随机语料(1200 例,定种子)全部一致;另核过仓库 151 个真实文件 /
73
+ 604 例,零不一致。`eval:injection` 逐项不变。
74
+
75
+ - `parsePdf` 那侧的第二份全文未动(`buildMarkdown` 仍把所有页拼成一份字符串)。
76
+
77
+ ### 修复:legacy `trigger.scope` 不再被当作过滤条件
78
+
79
+ `readiness.js` 的注释写的是"`scope` → 默认忽略",但 `src/index.js` 的 schema 默认值是 `filter`,
80
+ 两处不一致。结果是唯一带 `scope` 的条目(`ins_510aa6f6`「npm 包发布流程」)永远无法命中:它的
81
+ `scope=['release','npm','dsh-project-memory']` 与项目画像 tag 无交集,guard 直接判死。
82
+
83
+ - 默认改为 `ignore`(`src/index.js` 的 schema 与 `cfgEngine` 两处同时改)。显式配
84
+ `legacyScope: 'filter'` 可保留旧语义。
85
+ - 验收:`cfgEngine({}).legacyScope === 'ignore'`,另加一条定向断言——场景 A 必须注入 `p_npmpub`
86
+ (只掉这一条是 14/15 = 0.93,仍在 0.9 地板之上,地板抓不住)。
87
+ - 两条断言旧行为的测试按新契约改写:`test/auto-inject.test.mjs`、`test/readiness-eval.test.mjs`。
88
+ - `npm run eval:injection`:命中 14 → 15、857 → 907 字符,假阳性与漏召仍为 0。
89
+
90
+ ### 变更:合成评测集从「逐位棘轮」改成「冒烟 + 地板」
91
+
92
+ 原来要求 `precision/recall ≥ 1.00`,钉的是当前实现的行为;合成场景由写 trigger 的同一个作者构造,
93
+ 测不出漏召,而真实改进(比如上面那条 scope 修复)会被当成回归拦下。现在只保留两条硬门:
94
+ 对照组零注入(`--store` 模式失守即退出码 1)与 P/R 地板 0.9。历史基线留在注释里
95
+ (v1 P0.48/R0.72;v2 P/R 1.00/1.00)。
96
+
97
+ ### 修复:客户端半边不再「静默消失」——顶层 inject 去门控,缺服务改为降级挂载
98
+
99
+ 用户侧的现象是:面板没了、`/` 菜单里的「工作流」组也没了,**浏览器控制台一行报错都没有**。
100
+ 病因在 cordis 的**顶层 `inject` 是装配期门控**:声明的一项在当前客户端装配里不可用,
101
+ `apply()` 根本不会被调用 —— 插件既不挂载也不报错。插件的五个必需服务(`slots` / `sessions` /
102
+ `remote` / `remote.commands` / `locale`)里只要有一个对不上(宿主换装配、服务改名、加载顺序),
103
+ 就是这种形态;0.1.7 会话快照变更、0.2.0 装配差异都踩过。
104
+
105
+ - **顶层 `inject` 置空**(`src/client/client.ts`),必需服务的检查挪到运行时:新增
106
+ `src/client/services.ts` 的 `service()` / `missingServices()` —— 先 `ctx.get(name)`(cordis 里
107
+ **不需要 inject**),老宿主回退属性访问,两条路都**永不抛出**。`slots` 改走嵌套
108
+ `ctx.inject(['slots'], …)`:现成的直接用,没有就等它,等不到也不影响插件挂载。
109
+ - **缺什么就说清楚**:`apply()` 仍照常跑完,面板顶部显示
110
+ `插件降级:缺少客户端服务 <names>`(`panel.degraded`,中英双语),宽限期(3s,装配是异步的,
111
+ apply 时服务没到位不算缺)之后仍缺则打**一条** `console.warn` 点名缺失项 —— 这行日志正是
112
+ 「静默」的反面。服务齐全时行为与之前完全一致,不新增任何输出(不误报)。
113
+ - **数据通道缺失不再抛**:cordis 里 `ctx.<service>` 在"没有 inject 又没有实现"时**抛错**而不是
114
+ 返回 undefined,所以 `TaskPanel` / `MemoryView` / `slash` 里所有 `ctx.remote` / `ctx.sessions` /
115
+ `ctx.locale` 取值一律改走 `service()`;面板的「还没有会话」在 `sessions` 服务本身缺失时不再显示
116
+ (那会误导成"没有会话",真正原因由降级行给出)。
117
+ - **刻意不做「服务迟到唤醒」**:去掉顶层 inject 后 `apply()` 会更早跑,自然想挂一个"服务到齐就
118
+ 叫醒面板"的通知。但那条路的判据与 cordis 的注入门控**不完全等价** —— 门控看"实现存在且 provider
119
+ 活跃",而 `ctx.get()` 返回的是实现的 **value**;服务"已 provide、值还是 undefined"时两边结论相反
120
+ (门控满足 → 立刻回调 → 重渲染 → 探测仍说缺失 → 再注册 → 又立刻回调),就是**永不停止的重渲染
121
+ 循环**(表现:单个标签页永久未响应、风扇满载,新开标签页却正常)。客户端半边因此立一条规矩:
122
+ **不引入任何会自己触发渲染的机制**;缺服务的提示只在渲染时现算(面板本来就会随 store / 会话变化
123
+ 重渲染,降级行会自然消失)。
124
+ - **测试**:新增 `test/client-degraded.test.mjs`(5 → 7 项)——顶层 inject 必须为空、贫服务宿主上
125
+ `apply()` 跑完且不抛、宽限期前不报/宽限后恰好一条且点名每个缺失项、服务齐全时不误报、
126
+ **面板真的渲染出降级原因**(不只是打日志),外加一条静态守卫禁止 `src/client` 里再出现
127
+ `ctx.<必需服务>` 直取。`test/client-slash.test.mjs` 的 inject 断言同步改成"顶层为空 + 嵌套注入"。
128
+ - **范围**:这是插件侧兜底。宿主层(客户端插件加载/装配)若不改,其他插件仍会是同样的静默形态;
129
+ `client/client.js` 已按新源码重建入库。
130
+
131
+ ### 修复:客户端把 `remote.commands` 读错了门 —— 面板常驻「缺少客户端服务 remote.commands」
132
+
133
+ 上一节去掉顶层 `inject` 之后,服务改由 `service()` 现读;但 `service()` 把路径按 `.` 拆开、顺着父服务
134
+ 取属性(`ctx.get('remote')` 再取 `.commands`),而**属性路径同样是 inject 门控的**。cordis 里子命名空间
135
+ 是**独立注册的扁平服务**(名字就叫 `remote.commands`,由 gateway 的 `RemoteNamespaceService` 在嵌套
136
+ fiber 里 `provide`):读它不需要 inject 的**唯一**路径是 `ctx.get('remote.commands')`;顺着父服务取属性
137
+ 会走 ctx 代理,抛 `cannot get property "remote.commands" without inject`,被软探测吞掉 → 判成"缺失"。
138
+ 于是**宿主明明提供了它,面板却常年挂着降级行**,数据通道(`/tasks`、`/insight` 的 `execute`)也一并不可用。
139
+ 宿主自己读子命名空间用的正是整名写法(`ctx.get('remote.probe')` / `ctx.get('remote.credentials')`)。
140
+
141
+ - `service()` 改成**整名优先**(`ctx.get('remote.commands')`),读不到再回退属性路径(老宿主 / 把子
142
+ 命名空间挂在服务对象上的形状);`TaskPanel` / `MemoryView` 的取值点从 `service(ctx, 'remote')?.commands`
143
+ 改成 `service(ctx, 'remote.commands')`。
144
+ - **宿主替身的形状修正**:`test/client-degraded.test.mjs` 原来的假宿主是 `ctx.remote = { commands }`
145
+ (没有 `ctx.get`、也没有 inject 门控)—— 它验证的是自己的假设,所以线上坏、测试全绿。现在按真实装配
146
+ 建模:扁平服务表 + `ctx.get(name)` + 属性读按 inject 门控抛错,`remote` 服务对象上**没有** `commands`。
147
+ - **回归闸门(+2 项)**:真实宿主形状下必须不误报、面板不渲染降级行,且数据通道**真的 `execute` 一次**
148
+ (只断言"没显示降级"会漏掉"通道仍然不通");老宿主形状(属性回退)也必须通 —— 两条路都锁住。
149
+ 静态守卫加一条:禁止 `service(ctx, 'remote')?.…` 这类顺父服务取子命名空间。
150
+ - 顺带:slash 的嵌套 `ctx.inject` 从 `['inputTriggers', 'sessions', 'remote.commands']` 收成
151
+ `['inputTriggers', 'sessions']` —— 那三行菜单只开面板页、**不发宿主命令**,多写一个依赖就是多一种
152
+ "菜单组永不出现"的静默形态。
153
+ - **验证**:`npm test` **610 项 / 33 个文件**、`npm run typecheck` 通过;`client/client.js` 已重建入库。
154
+
155
+ ### 修复:引用路径的写入期约束 + 删掉 `blindSpots` 死字段
156
+
157
+ 两件都是同一种形状的债:**schema / 文档承诺了,实现里没人管**。
158
+
159
+ - **`insight.files` 只收项目内相对路径**(此前零校验):`save_lesson` 的参数描述一直写着「项目相对
160
+ 路径」,但项目外的绝对路径会原样落盘 —— 实测本仓库 144 处引用里 **3 处项目外、6 处真悬空**,
161
+ 事后只能靠审计发现"查不到"。现在写入期收敛:反斜杠归一、`./` 前缀去掉、重复合并、
162
+ **项目内绝对路径 → 项目相对路径**,其余(项目外绝对 / `..` 逃出根 / 没有根时无法判定的绝对路径)
163
+ **丢弃并把数量写进返回文本**(不静默少几行)。两条写入路径共用同一个纯函数
164
+ `normalizeCitationFiles`(`src/util/fs.js`):工具 `save_lesson` 与面板编辑(`/tasks insight edit`)。
165
+ **刻意不做**生成物识别(`lib/`、`dist/` 既可能是产物也可能是源码,误拒的代价大于收益)。
166
+ - **删掉 `blindSpots`**:写侧(`src/doc-pipeline.js`)恒写 `''`,读侧(`src/tools/query-memory.js`)
167
+ 的分支因此永不触发 —— 133 个分片里非空 **0**。声明了却没有任何写入方的字段就是谎,删字段与那段
168
+ 死分支(`test/doc-index.test.mjs` 的断言从 `blindSpots === ''` 改成"字段不存在")。
169
+ - **测试**:新增 `test/citation-paths.test.mjs`(6 项)——纯函数三层(相对保真 / 项目内绝对转相对 /
170
+ 项目外与逃出根丢弃并回报 / 无根时不猜)、**真工具 `save_lesson` 落盘已归一且返回文本点名丢弃数**、
171
+ 外加静态守卫禁止 `blindSpots` 回到 `src/`。602 → **608 项 / 33 个文件**。
172
+
173
+ ### 变更:轮询只在没人用的时候发生(会话期间静默,回合结束立刻补扫一次)
174
+
175
+ 轮询是插件里唯一"用户没在等、却仍在花机器"的地方:旧实现只按"有没有改动"退避(30s 起、无变化
176
+ 翻倍、封顶 2 分钟),**有人在跑回合时照样按节拍扫**,扫描时机正好撞上用户打字 / 模型跑工具的那一刻。
177
+ 现在把"有没有人在用"也变成调度信号(信号取自宿主已有的 `session/event`,零新增配置键):
178
+
179
+ - 会话进行中(`turn/start` / `step/start` → `turn/end`):节拍压到 `max(watchInterval×10, 5 分钟)`
180
+ 作兜底 —— 活跃 ≠ 停摆,外部编辑器改文件、或回合始终不结束(崩溃 / 长任务)时索引仍会自愈。
181
+ - 最后一个会话结束:取消待跑的轮询,**立刻合并扫一次**这一轮攒下的改动,然后回到常规节拍
182
+ (有改动回 base,没改动继续退避)。多会话用 Set 记:任一在跑即活跃;`session/disposed` 兜底摘标记。
183
+ - 失败方向是"更慢"而不是"坏":事件名将来变了 → 永远不活跃 = 与旧版一致;`turn/end` 丢了 → 停在
184
+ 5 分钟兜底,不会卡死。**代价**(明确记账):长回合里索引最多陈旧 5 分钟(多会话同项目时才明显)。
185
+ - 成本口径(免得下次再吵):一轮 poll 在本仓库是 `walkDir` **7ms**(178 文件,含 stat 的实测
186
+ 58–87ms),空闲 60 秒实测整进程 **0.32 秒 CPU ≈ 0.5% 单核**、store **零写入** —— 这一版买到的是
187
+ "交互期一行 I/O 都不做 + 成本可解释",不是性能修复。
188
+ - **测试**:新增 `test/watch-idle.test.mjs`(5 项,不打真实定时器)——间隔口径、活跃期不扫描、
189
+ 多会话任一在跑即活跃、回合结束的节拍恢复(有改动回 base / 无改动继续退避)、`watch: false` 与
190
+ `stop()` 之后活跃信号不抛错也不复活定时器。
191
+
192
+ ### 修复:`budget` 掉落的两维数字在审计面被抹掉
193
+
194
+ `57b464c` 给 `dropped` 加了 `remaining` / `need`(理由写在代码里:"还剩 38 字符、这条最少要 120"
195
+ 与"根本没预算"在日志里长得一样,配额逼近上限时那条**永久静默的细缝**因此不可诊断)。
196
+ 但 `auditRecordFrom` 把它们投影掉了,落盘的只有 `{id, channel, reason}` —— **源码里有、日志里永远没有**。
197
+ 本仓库实测 **186 次** budget 掉落(hint 153 / trigger 33)全部无纲;而
198
+ `test/injection-budget.test.mjs` 断言的是 `buildInjection` 的**内存产物**:
199
+ 两处各自有测试,接缝没人测。
200
+
201
+ - 审计投影原样保留这两维。只对带数字的条目落键 —— coverage 等没有量纲的掉落占绝大多数,
202
+ 不该为此多出两个 `null`。
203
+ - **回归**:`buildInjection` → `auditRecordFrom` → `appendInjectionAudit` → 读回最后一行,
204
+ 断言 `remaining: 30` / `need: 120` 真的落到盘上(回退修复即失败)。
205
+ - **验证**:`npm test` **610 → 611 项 / 33 个文件**、`npm run typecheck` 通过。
206
+
1
207
  ## 0.5.15 (2026-10-06)
2
208
 
3
209
  `npm test` **563 → 592 项 / 30 个文件**;`npm run eval:injection` 逐项不变
package/README.md CHANGED
@@ -7,7 +7,7 @@
7
7
  [![ci](https://github.com/00080000/dsh-project-memory/actions/workflows/ci.yml/badge.svg)](https://github.com/00080000/dsh-project-memory/actions/workflows/ci.yml) [![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE) [![npm](https://img.shields.io/npm/v/@yolk_vat-y/dsh-project-memory)](https://www.npmjs.com/package/@yolk_vat-y/dsh-project-memory) [![npm downloads](https://img.shields.io/npm/dm/%40yolk_vat-y%2Fdsh-project-memory?style=flat-square&color=orange)](https://www.npmjs.com/package/@yolk_vat-y/dsh-project-memory) [![Listed on dsh-plugin.org](https://dsh-plugin.org/badges/listed.svg)](https://dsh-plugin.org/plugins/00080000/dsh-project-memory) [![Awesome](https://awesome-dsh-plugin.com/badge.svg)](https://awesome-dsh-plugin.com)
8
8
 
9
9
 
10
- A persistent **project development memory** for [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness) (dsh) agents. Built specifically for project development, natively integrated with dsh's task system: task lists and files read during a session are automatically persisted as cross-session task records, with tasks ↔ files linked — workflows can be switched and resumed, no need to re-scope the whole project, solving context loss. Documents (PDF/Markdown/txt) and code symbols are stored separately per workspace; documents are automatically cross-linked to the code symbols they mention. Experience notes (problem → solution) are automatically deduplicated, preventing repeated mistakes. All data is stored per project on disk, survives session compaction and handover; recalls include `path:line` citations for source verification. Only one dependency, no vector DB, no native builds.
10
+ A persistent **project development memory** for [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness) (dsh) agents. Built specifically for project development, natively integrated with dsh's task system: task lists and files read during a session are automatically persisted as cross-session task records, with tasks ↔ files linked — workflows can be switched and resumed, no need to re-scope the whole project, solving context loss. Documents (PDF/Markdown/txt) and code symbols are stored separately per workspace; documents are automatically cross-linked to the code symbols they mention. Experience notes (problem → solution) are automatically deduplicated, preventing repeated mistakes. All data is stored per project on disk, survives session compaction and handover; recalls include `path:line` citations for source verification. No native builds, no vector database. A 79 MB local embedding table (`leanvec`) installs and runs by default; without it, recall falls back to pure lexical.
11
11
 
12
12
  > The plugin keeps a compact project **memory** on disk, with every entry pointing to a concrete file and line — the agent can reorient quickly instead of re-reading the whole project.
13
13
 
@@ -21,7 +21,7 @@ A persistent **project development memory** for [DeepSeek Harness](https://githu
21
21
  - **Code symbol memory** — a dependency-free scanner extracts functions, classes, methods, interfaces and type aliases with full signatures across 8 languages. Where `typescript` is installed, an optional second layer adds inferred return types, generics and interface shapes; it runs in the background and never blocks indexing.
22
22
  - **Automatic, read-time memorization** — a file is memorized the moment the model reads it, so memory is a byproduct of normal work rather than an upfront scan, and files nobody reads are never indexed. A background poll re-memorizes changed files only.
23
23
  - **Doc ↔ code cross-linking** — a document that mentions a symbol is surfaced when that symbol is queried. Links are resolved against the current symbol table, so they cannot go stale.
24
- - **BM25 recall** — ranked search over documents, symbols, experience notes and insights, with optional LLM query expansion. Tuned for CJK: phrase boost, a synonym table, and CJK-aware boundaries for doc↔symbol linking.
24
+ - **Hybrid recall** — ranked search over documents, symbols, experience notes and insights, with optional LLM query expansion. The experience/insight layers are re-ordered by cosine when `leanvec` is present — installed by default, absent ⇒ pure lexical. Tuned for CJK: phrase boost, a synonym table, and CJK-aware boundaries for doc↔symbol linking.
25
25
  - **Experience notes** — problems → solutions, deduplicated by overlap rather than repeated, bounded by project size, and returned only when a search matches.
26
26
  - **Tiered insight memory (lessons / decisions / procedures)** — one entity across task, project and global scope. Near-duplicates merge or reinforce, and promotion moves an entry between scopes instead of copying it. Use is recorded, so decay and capacity rank by activity rather than age alone. The panel exposes a per-scope view for reviewing and editing entries.
27
27
  - **Triggered injection** — an insight may carry an authored trigger: only `when` triggers, `guard` narrows it, and `prevents` records what breaks without the entry. Corpus text can never trigger an injection; the statistical channel is gated separately and silent by default.
@@ -72,7 +72,7 @@ The design follows four principles:
72
72
 
73
73
  - **Volatility** — context is ephemeral; it is lost when a session is compacted.
74
74
  - **Persistence** — the **memory** is stored on disk and survives compaction and new sessions.
75
- - **Compactness** — one bounded declaration line per symbol, and a ≤300-char summary plus a bounded term set per document chunk. Derived data is never stored: doc→symbol links are computed at read time. Index size depends on symbol density and chunk length, so treat these as measurements of specific corpora (2026-09-25), not guarantees: a code-only Vue app (289 files) lands at **325 bytes/entry ≈ 21% of source**, a symbol-dense TypeScript monorepo (12,408 files / 106 MB of code + 14 MB of docs) at **22% of source for the code layer (553 bytes/entry overall)** and **130% for the document layer**, and a 274-document workspace (PDFs and Markdown) at **1,506 bytes/entry**.
75
+ - **Compactness** — one bounded declaration line per symbol, and a ≤300-char summary plus a bounded term set per document chunk. Derived data is never stored: doc→symbol links are computed at read time. Index size depends on symbol density and chunk length, so treat these as measurements of specific corpora (2026-10-13), not guarantees: a code-only Vue app (289 files) lands at **325 bytes/entry ≈ 21% of source**, a symbol-dense TypeScript monorepo (12,634 files / 107 MB of code + 14 MB of docs) at **22% of source for the code layer (549 bytes/entry overall)** and **127% for the document layer**, and a document-heavy workspace (Markdown + PDFs) at **1,401 bytes/entry**.
76
76
  - **Verifiability** — **recalls** carry a `path:line` citation where applicable, so the agent can confirm details against the source.
77
77
 
78
78
  Building the **memory** does not require an upfront scan: files are memorized as the model reads them, so the **memory** grows to cover exactly what has been worked with. Re-reading an unchanged file is a no-op, so the **memory** stays fresh with minimal ongoing overhead.
@@ -90,12 +90,11 @@ The store is per-project and follows the codebase: changed files are re-extracte
90
90
  tasks.json TaskBridge task entities (cross-session)
91
91
  binding.json current session ↔ task binding
92
92
  insights.json project-scope insights (lessons / decisions / procedures)
93
+ vectors.json optional semantic index (only when the vector layer runs)
93
94
  injection-audit.jsonl one line per real injection (what / why / dropped / budget)
94
95
  admission-shadow.jsonl one line per step, all scored candidates + features (offline replay)
95
96
  ```
96
97
 
97
- Stores created before v0.2.0 migrate automatically and idempotently on first load. Within one dsh process, all tool calls share a single in-memory store per project, so hot-path indexing writes only the shard that changed.
98
-
99
98
  - **Incremental** — a content hash per file; only changed files are re-extracted.
100
99
  - **Cross-linking** — a returned document chunk resolves the symbols it mentions against the **current** symbol table and appends them as `references`, so a doc indexed before its symbols still links correctly.
101
100
  - **Query expansion** — when enabled, `query_memory` asks the LLM to rewrite the query into several variants (synonyms, EN/CN, identifier guesses) and merges the scores; when off, queries never touch the LLM. Indexing itself is model-free.
@@ -126,9 +125,9 @@ The workflow panel is collapsible, adapts to dsh and theme plugin styles, and of
126
125
  | `maxOutputChars` | 8000 | cap for `query_memory` result text (chars) |
127
126
  | `lazyIndexing` | true | index files the moment the model reads them |
128
127
  | `autoIndexOnFirstUse` | false | full scan of the current working directory on plugin load (opt-in) |
129
- | `watch` / `watchInterval` | true / 30 | background refresh; base poll interval in seconds (idle polls back off up to 2 minutes and reset on any change) |
130
- | `maxScanFiles` / `maxScanDepth` | 20000 / 12 | per-scan caps on files and directory depth; a truncated pass is reported and never removes what it did not reach. Set `0` to disable |
131
- | `allowUnsafeRoots` | false | allow **explicit** tool calls to target a directory on the excluded list. Automatic paths (lazy indexing, session audit, TaskBridge, `autoIndexOnFirstUse`) stay inert there regardless |
128
+ | `watch` / `watchInterval` | true / 30 | background refresh; base poll interval in seconds (polls stay quiet while a turn is running — a 5-minute fallback keeps external edits fresh — and one merged scan runs at turn end; idle polls back off up to 2 minutes and reset on any change) |
129
+ | `maxScanFiles` / `maxScanDepth` | 20000 / 12 | per-scan caps on files and directory depth; a truncated pass is reported and never removes what it did not reach. Cannot be disabled: `0` or any invalid value falls back to the default |
130
+ | `allowUnsafeRoots` | false | allow **explicit** tool calls to target a directory on the excluded list. Lazy indexing, session audit and TaskBridge always stay inert there; `autoIndexOnFirstUse` does not — this flag releases it too |
132
131
  | `llmQueryExpansion` / `expansionCount` | false / 6 | expand queries via the LLM before search (off by default to save tokens); max variants |
133
132
  | `tsPath` / `enableTypeScript` | (auto) / true | optional absolute path to a specific `typescript` install; set `enableTypeScript: false` to disable the type-aware layer entirely |
134
133
  | `tasklist.enabled` / `tasklist.syncHostOnAdopt` | true / true | TaskBridge auto-sync (task entities from the session todo list and file reads); push a bound task's steps to the host task list so dsh mirrors it |
@@ -139,14 +138,12 @@ The workflow panel is collapsible, adapts to dsh and theme plugin styles, and of
139
138
  | `autoContext.maxItemsPerSession` / `autoContext.maxItemCharsPerSession` | 60 / 24000 | **runaway fuse, not a throttle** — a hard per-session ceiling by count and characters; once reached, the item channel stays silent for the rest of the session |
140
139
  | `autoContext.hintMinCoverage` | 0.45 | **absolute** floor for the statistical channel: the IDF-weighted share of the query's information mass the entry covers. A ratio-only threshold cannot tell signal from "best of a bad lot" |
141
140
  | `autoContext.hintMinMatched` / `autoContext.hintMinSupport` | 2 / 0.15 | a hint must share at least this many terms with the query, and at least this share of the query's terms must exist in the corpus at all — otherwise the channel stays silent this round |
142
- | `autoContext.legacyScope` | `filter` | how to treat a legacy `trigger.scope`: `filter` keeps the old semantics, `ignore` drops it. `npm run selfcheck:triggers` reports entries whose scope cannot intersect the project tag space |
141
+ | `autoContext.vectorDir` | unset | **optional** semantic layer over the experience/insight layers, on by default via the `leanvec` optionalDependency (79 MB, ≈+130 MB RSS). `off` forces pure lexical; a path or `DSH_LEANVEC_DIR` overrides it. Re-orders only, returned counts unchanged; while it is active these two layers are not filtered by lexical match count |
142
+ | `autoContext.vectorAlpha` | 0.5 | weight of `(1-α)·lexical + α·cosine` in those layers; `0` disables the layer, `1` (pure vector) measured worse |
143
+ | `autoContext.legacyScope` | `ignore` | how a legacy `trigger.scope` is treated: `ignore` (default) does not use it as a filter; `filter` keeps the old behaviour. `npm run selfcheck:triggers` lists entries that still carry a scope |
143
144
  | `autoContext.auditLog` | true | append one JSONL line per **actual** injection to `injection-audit.jsonl` (what / why / dropped / budget); rotates to `.1` past `auditMaxBytes` (`262144`). Silent on I/O errors |
144
145
  | `autoContext.shadowLog` / `autoContext.shadowMaxBytes` | true / 524288 | append one JSONL line **per step** (including steps that injected nothing) to `admission-shadow.jsonl`: scored candidates with their features and the gate that rejected each one — what makes a threshold change answerable offline. Disk only, never in the prompt; rotates keeping one `.1` generation |
145
146
 
146
- ### Injection admission (why it stays quiet)
147
-
148
- Automatic injection used to be a *retrieval* problem ("which entry is most related to this text?"), which is total — a ranking always returns something, so noise was structural. It is now an **admission** problem ("is this step about to cross a boundary I have been burned by?"), with silence as the default. Only `when` triggers, from a low-dimensional typed signal: normalized operations, the files this step is about to **write**, and intent words from the human message *after* stripping quoted/path references — tool arguments, file contents and filenames can never trigger anything. `guard` only narrows (extension/name globs such as `*.pptx` or `README*` are ignored outright: they can only lie). The statistical channel needs the relative score, an absolute coverage floor and at least two shared terms, and item injections are limited to one every `gateCooldownSteps` and capped per session — the resident task card is exempt, and the budget is a ceiling, not a target. Injections are appended at the tail of the history, so the cached prefix is never rewritten: they cost cache-read tokens, not cache misses. Every real injection is logged with its reason and dropped candidates, and a shadow log adds one line per step — including the steps that correctly injected nothing. `npm run eval:injection` scores 8 labelled scenarios on a **synthetic** pool (currently precision 1.00 / recall 1.00 with a clean control group); that pool is the CI baseline, not evidence about your data — point the harness at your own store (`--store`) and the control group becomes a **hard gate**.
149
-
150
147
  ### Toggling features
151
148
 
152
149
  The two most relevant switches are `lazyIndexing` (index a file the moment the model reads it; default on) and `autoIndexOnFirstUse` (full scan of the current working directory on plugin load; default off). Lazily indexed project roots are automatically registered with the watcher, so changed files stay fresh without an explicit `watch_repo`.
@@ -159,7 +156,7 @@ When the root comes from the working directory, the model gets one notice per se
159
156
 
160
157
  **Scan limits.** One pass covers at most `maxScanFiles` files (20000) and `maxScanDepth` directory levels (12). A truncated pass is reported in the `index_repo` result and logged once per root by the watcher, and it does not remove entries it did not reach. A directory that cannot be read (e.g. `EACCES`) counts as a truncated pass too and is named in the result: a read failure is not a deletion.
161
158
 
162
- **Per-file memory budget.** `maxFileSizeMb` is a memory gate, not a disk-space preference. Indexing a file first materializes it — the whole buffer plus decoded text for code, or every PDF page's text plus the joined markdown for documents — and the peak scales with the file's size. Measured on this machine with `npm run bench:peak` (peak RSS fitted against disk size over a 1–50 MB ladder, one fresh process per point): **≈10×** for typical source code (1 declaration per ~1.2 KB), **≈21×** for symbol-dense code (1 per 240 B), **≈19×** for a text-heavy PDF, plus a one-off ≈150 MB floor the first time a PDF is parsed. The 10 MB default therefore keeps a single file at roughly **+300 MB RSS**; raising the cap raises that ceiling proportionally. The old default of 50 MB let one ordinary-sized file drive the host process to ~1.2 GB.
159
+ **Per-file memory budget.** `maxFileSizeMb` is a memory gate, not a disk-space preference. Indexing a file first materializes it — the whole buffer plus decoded text for code, or every PDF page's text plus the joined markdown for documents — and the peak scales with the file's size. Measured on this machine with `npm run bench:peak` (peak RSS fitted against disk size over a 1–50 MB ladder, one fresh process per point): **≈10×** for typical source code (1 declaration per ~1.4 KB), **≈22×** for symbol-dense code (1 per 220 B) and **≈20×** for a text-heavy PDF, on top of a ~52 MB process baseline plus a one-off ≈175 MB the first time a PDF is parsed. The 10 MB default therefore keeps a single file at roughly **+300 MB RSS** for code and **+370 MB** for a PDF; raising the cap raises that ceiling proportionally. The old default of 50 MB let one ordinary-sized file drive the host process to ~1.2 GB.
163
160
 
164
161
  The store lives in the tree it indexes and **ignores itself**: a `*` rule inside the store keeps it out of `git status` and `git add -A`, and means `git clean -fd` leaves it alone. To commit project memory deliberately, `git add -f .dsh-project-memory` — tracked files are not affected by ignore rules.
165
162
 
@@ -172,14 +169,15 @@ Settings live in the plugin's config object. To change them, add an override ent
172
169
  autoIndexOnFirstUse: false # off: no upfront full scan (default)
173
170
  llmQueryExpansion: false # off: do not spend tokens on LLM query expansion (default)
174
171
  watch: true # on: background refresh for watched roots (default)
175
- watchInterval: 30 # base poll interval; idle polls back off to at most 2 min
172
+ watchInterval: 30 # base poll interval; quiet during a turn, one merged scan at turn end, idle backoff to 2 min
176
173
  maxScanFiles: 20000 # per-scan file cap (truncation is reported, never deletes)
177
174
  maxScanDepth: 12 # per-scan directory-depth cap
178
175
  enableTypeScript: true # on: type-aware enhancement when TS is installed (default)
179
176
  # allowUnsafeRoots: false # keep false unless you really want to index a home/system dir explicitly
180
- # budgetLog: once # debugging: log budget drops to stderr (default off = silent)
181
- # reinjectItemsAfter: 20 # debugging: allow the same insight again after N steps (default 0 = once per session)
182
177
  # tsPath: /custom/path/to/typescript # optional: force specific TS install
178
+ # autoContext: # note: the next two keys live under autoContext, not at the top level
179
+ # budgetLog: once # debugging: log budget drops to stderr (default off = silent)
180
+ # reinjectItemsAfter: 20 # debugging: allow the same insight again after N steps (default 0 = once per session)
183
181
  ```
184
182
 
185
183
  Only list the keys you want to change; the rest fall back to the plugin defaults. Verify the result with `dsh --profile web --dump-config`.
@@ -194,35 +192,35 @@ where `config.yml` contains the same override block.
194
192
 
195
193
  ## Performance
196
194
 
197
- ### Measured on real projects (2026-09-25)
195
+ ### Measured on real projects (2026-10-13)
198
196
 
199
197
  Four corpora, one machine (Node 24.19, 20 vCPU, Linux file system), each run twice with the **second, warm-cache run** quoted. "Cold index" is a full index pass (walk + hash + extract + commit); "query" runs the shipped scorer over 100 sampled queries; "re-index 1 file" is the watch/lazy hot path.
200
198
 
201
199
  | Corpus | Files / entries | Cold index | Cold load | Query p50 / p95 | Re-index 1 file | Store content / on disk | Heap after load |
202
200
  |--------|-----------------|-----------|-----------|-----------------|-----------------|------------------------|-----------------|
203
- | Vue 3 + Vite app (code only) | 289 / 2,142 | 283 ms | 5.2 ms | 0.86 / 1.8 ms | 0.4 ms | 0.66 MB / 1.52 MB | 6.1 MB |
204
- | Docs + PDFs workspace (274 docs) | 286 / 2,120 | 6.5 s | 12.4 ms | 4.6 / 13.9 ms | 0.4 ms | 3.05 MB / 3.63 MB | 9.0 MB |
205
- | TypeScript monorepo, 3,000-file slice | 3,000 / 17,733 | 2.1 s | 59 ms | 10.2 / 21.4 ms | 1.8 ms | 11.0 MB / 19.0 MB | 22.6 MB |
206
- | TypeScript monorepo, whole tree | 12,408 / 79,168 | 8.6 s | 239 ms | 45.8 / 89.3 ms | 7.4 ms | 41.7 MB / 74.7 MB | 73.9 MB |
201
+ | Vue 3 + Vite app (code only) | 289 / 2,142 | 246 ms | 8 ms | 0.76 / 1.4 ms | 0.3 ms | 0.66 MB / 1.52 MB | 6.3 MB |
202
+ | Docs workspace (Markdown + PDFs) | 249 / 977 | 705 ms | 10 ms | 1.8 / 5.5 ms | 0.4 ms | 1.31 MB / 1.84 MB | 6.8 MB |
203
+ | TypeScript monorepo, 3,000-file slice | 3,000 / 17,576 | 1.9 s | 70 ms | 9.2 / 18.9 ms | 1.9 ms | 10.9 MB / 18.9 MB | 22.7 MB |
204
+ | TypeScript monorepo, whole tree | 12,634 / 80,231 | 7.8 s | 278 ms | 40.6 / 74.8 ms | 7.2 ms | 42.0 MB / 75.7 MB | 75.2 MB |
207
205
 
208
- **How it scales.** Re-indexing a changed file costs O(file), not O(corpus) — 0.4–7.4 ms across every corpus above. Cold load (≈19 µs/file), query (≈0.6 µs/entry) and resident heap (≈1.4 KB/entry) grow linearly with the index, which keeps small and mid-size projects in the single-digit-millisecond range.
206
+ **How it scales.** Re-indexing a changed file costs O(file), not O(corpus) — 0.3–7.2 ms across every corpus above. Cold load (≈22 µs/file), query (≈0.5 µs/entry on the largest corpus) and resident heap (≈1.5 KB/entry once queried) grow linearly with the index, which keeps small and mid-size projects in the single-digit-millisecond range.
209
207
 
210
- > Two notes on method: `read+hash` depends on the OS page cache (2.5 s cold vs 0.3 s warm on the 12.4k-file tree), so the warm run is quoted; and these numbers drift by up to ~20% across days on the same machine, so compare runs measured in one session.
208
+ > `read+hash` depends on the OS page cache — 2.3 s cold vs 0.27 s warm on the 12,634-file tree — so the table quotes the warm figure.
211
209
 
212
210
  ### Synthetic Benchmark (Node 24.19, 20 vCPU, Linux file system)
213
211
 
214
212
  | Scenario | Scale | Measured |
215
213
  |----------|-------|----------|
216
- | Full cold index | 5,000 files / 20k entries | 373 ms avg (p50 374) |
217
- | Cold load | 5,000 files | 56 ms |
218
- | Hot lazy re-index (single file) | 5k files | p50 2.8 ms / max 3.5 ms |
219
- | query_memory (cached) | 5k files / 20k entries | p50 3.3 ms / p95 6.9 ms |
220
- | query_memory (cached) | 1k files / 4k entries | p50 0.7 ms / p95 1.5 ms |
221
- | Full cold index | 10,000 files / 40k entries | 696 ms avg (p50 668) |
222
- | Cold load | 10,000 files | 123 ms |
223
- | Hot lazy re-index (single file) | 10k files | p50 5.9 ms / max 13.5 ms |
214
+ | Full cold index | 5,000 files / 20k entries | 284 ms avg (p50 286) |
215
+ | Cold load | 5,000 files | 58 ms |
216
+ | Hot lazy re-index (single file) | 5k files | p50 2.5 ms / max 6.7 ms |
217
+ | query_memory (cached) | 5k files / 20k entries | p50 2.9 ms / p95 6.0 ms |
218
+ | query_memory (cached) | 1k files / 4k entries | p50 0.5 ms / p95 1.1 ms |
219
+ | Full cold index | 10,000 files / 40k entries | 558 ms avg (p50 540) |
220
+ | Cold load | 10,000 files | 117 ms |
221
+ | Hot lazy re-index (single file) | 10k files | p50 5.5 ms / max 8.4 ms |
224
222
 
225
- > Generated code (~4–5 symbols/file), measured 2026-09-25. Reproduce with `npm run bench:synthetic -- 5000` (`scripts/bench-synthetic.mjs`). Pure indexing overhead, no LLM calls. The first query after a write rebuilds the IDF cache (**142 ms at 40k entries**, 67 ms at 20k, 14 ms at 4k); later queries hit it.
223
+ > Generated code (~4–5 symbols/file), measured 2026-10-13. Reproduce with `npm run bench:synthetic -- 5000` (`scripts/bench-synthetic.mjs`). Pure indexing overhead, no LLM calls. The first query after a write rebuilds the IDF cache (**141 ms at 40k entries**, 68 ms at 20k, 17 ms at 4k); later queries hit it.
226
224
 
227
225
  ### Reproduce it on your own project
228
226
 
@@ -237,11 +235,11 @@ node scripts/bench.mjs /path/to/your/project [--json] [--samples 100] [--no-pdf]
237
235
  It reports the cold index split into read+hash / extract / commit, cold load, IDF rebuild, cold and hot query latency (p50/p95/max over 100 sampled queries through the shipped scorer), single-file hot re-index, store size, resident heap and bytes per entry. Example — the Vue app row above:
238
236
 
239
237
  ```
240
- cold index 283 ms (read+hash 11 ms · extract 256 ms · commit 14 ms) ← 2nd, warm-cache run
241
- store 0.66 MB content · 1.52 MB on disk · 325 bytes/entry · cold load 5.2 ms
242
- memory heap 6.1 MB after load → 6.7 MB after the first query (RSS 62 MB)
243
- hot query p50 0.86 ms · p95 1.8 ms (2,142 entries)
244
- re-index 1 file p50 0.4 ms
238
+ cold index 246 ms (read+hash 8 ms · extract 222 ms · commit 14 ms) ← 2nd, warm-cache run
239
+ store 0.66 MB content · 1.52 MB on disk · 325 bytes/entry · cold load 8 ms
240
+ memory heap 6.3 MB after load → 6.9 MB after the first query (RSS 62 MB)
241
+ hot query p50 0.76 ms · p95 1.4 ms (2,142 entries)
242
+ re-index 1 file p50 0.3 ms
245
243
  ```
246
244
 
247
245
  Pass `--queries your-queries.json` to run the labeled-set method (hit@5 / hit@10 / MRR) against your own project.
@@ -251,7 +249,7 @@ Pass `--queries your-queries.json` to run the labeled-set method (hit@5 / hit@10
251
249
  - **Synchronous lock-free transactions over async locks** — DSH runs single-process by architecture, so locking for a rare multi-process case would only slow the hot path (every `remember` / `forget` / `index_doc`).
252
250
  - **Watch: compute outside, commit inside** — no lock is held during parsing, and polling with mtime + content hash is used instead of `fs.watch`: it behaves identically on network drives, Docker volumes and WSL, without duplicate-trigger or missed-event failure modes.
253
251
  - **Corrupt shards are quarantined, not repaired** — a shard that fails to parse is renamed and only that file is re-indexed, so there is no WAL or embedded database adding native dependencies, lock contention and failure modes of their own.
254
- - **No vector embeddings, no semantic search at query time** — lexical retrieval already answers the queries this plugin targets. On a real Vue project with 29 labelled queries, file-level hit@5 is **96.6%**, and whole-chunk terms lift document term coverage from **27.3% to 100%** with MRR unchanged (**0.958** vs **0.955**). The method ships with the code (`scripts/bench.mjs --queries your-queries.json`).
252
+ - **Vectors re-rank, they do not rank** — on a paraphrased-query set, pure vector replacement is worse than BM25 (hit@10 **53% vs 69%**) while weighted fusion helps at small k (hit@3 **53% vs 50%**), so the optional layer only re-orders the experience/insight layers and never gates. Lexical retrieval still answers the queries this plugin targets: on a real Vue project with 29 labelled queries (2026-09), file-level hit@5 is **96.6%**, and whole-chunk terms raise document term coverage from **27.3% to 100%** with MRR unchanged (**0.958** vs **0.955**).
255
253
  - **Indexing is deterministic and model-free** — a model at index time would make two indexings of one document differ, and a wrong translation at query time means zero recall; rules plus symbol links cover the common cases and work offline.
256
254
  - **Model-facing memory: the agent writes, no human in the loop** — the consumer is the agent, usually headless, so memory that only promotes when someone clicks a card would never promote at all. `draft` is a provenance marker plus an evidence threshold, not an approval queue.
257
255
  - **Full entries returned directly** — entries are already compact, so returning them whole is more verifiable and one round-trip cheaper.
@@ -265,8 +263,8 @@ These commands are for **maintaining the plugin code** — regular users do not
265
263
 
266
264
  ```bash
267
265
  npm install
268
- npm test # 592 tests
269
- npm run eval:injection # scenario P/R on the synthetic pool: 14/14 hits, 0 false positives, control group clean
266
+ npm test # 650 tests
267
+ npm run eval:injection # synthetic pool P/R: precision 0.94 / recall 1.00, + a 3-scenario hint-only group
270
268
  npm run eval:injection -- --store .dsh-project-memory/insights.json # replay on YOUR store; control group is a hard gate
271
269
  npm run selfcheck:triggers # which entries can still push, which declarations are dead (reads your local store)
272
270
  npm run bench -- /path/to/project # index/query performance on any project — no dsh needed