@yolk_vat-y/dsh-project-memory 0.6.9 → 0.6.11
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 +65 -0
- package/README.md +5 -5
- package/README.zh-CN.md +5 -5
- package/client/client.js +8 -3
- package/client/client.js.map +1 -1
- package/package.json +9 -9
- package/skills/project-memory/SKILL.md +5 -1
- package/skills/project-memory/scripts/pm-digest.mjs +67 -5
- package/src/auto-inject.js +14 -5
- package/src/client/MemoryView.tsx +8 -4
- package/src/commands/insight-actions.js +49 -7
- package/src/commands/tasks.js +1 -1
- package/src/enhancer.js +4 -2
- package/src/insight-store.js +55 -19
- package/src/lazy.js +19 -3
- package/src/ops.js +87 -4
- package/src/recall.js +2 -1
- package/src/setup/taskbridge.js +43 -9
- package/src/store.js +72 -12
- package/src/tools/forget.js +5 -5
- package/src/tools/index-doc.js +2 -2
- package/src/tools/index-repo.js +2 -2
- package/src/tools/lesson-tools.js +28 -25
- package/src/tools/query-memory.js +6 -5
- package/src/tools/remember.js +5 -5
- package/src/tools/stats.js +1 -1
- package/src/tools/task-tools.js +12 -8
- package/src/tools/watch-repo.js +10 -6
- package/src/util/fs.js +64 -8
- package/src/util/patch.js +28 -0
- package/src/util/search.js +28 -14
- package/src/util/task-view.js +3 -1
- package/src/util/text.js +2 -0
- package/src/watch.js +25 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,68 @@
|
|
|
1
|
+
## 0.6.11 (2026-11-06)
|
|
2
|
+
**兼容**:`format.json` 仅在成功从旧版 store 迁移时多一个可选的 `migratedFrom: 'legacy'` 标记(旧版本读到会忽略);无新增配置键,无破坏性 store 变更。
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
### 修复(2026-11-05 审计)
|
|
6
|
+
|
|
7
|
+
- **旧版 store 迁移不再删库**:`entries.json` 有数据、`index.json` 缺失/无 `files` 时,`load()` 保护性跳过后 `save()` 不再补写 `format.json`;成功迁移的标记带 `migratedFrom: 'legacy'`,没有标记的旧 `format.json` 也不会触发清理。
|
|
8
|
+
- **锁回收失败不再同步忙等**:stale 分支补 deadline 与 10ms 等待;只读目录 / Windows 持续占用下 `acquireDirLock()` 按 `timeoutMs` 返回 `null`,不再挂死 `save()` / 退出 flush。
|
|
9
|
+
- **懒索引的 L2 增强不再被覆盖**:`onFileObserved()` 移到 `commitFileUpdates()` 之后(与 `index_repo` / watch 同序);单文件读取后 `enhanced: true` 与类型符号都能落盘。
|
|
10
|
+
- **`global.json` 缺失/不可读不再清空整库**:读不到磁盘文档时保留内存副本重写,不再把“空 doc”当成对端删光。
|
|
11
|
+
- **experience 迁移保留并发写入**:锁内重读的 `insights.json` 作为合并基线,不再用等锁前的快照整份覆盖。
|
|
12
|
+
- **`reinjectItemsAfter` 恢复生效**:条目级冷却到期时绕过块级指纹去重,历史被外部裁剪后能按配置重发。
|
|
13
|
+
- **动作识别覆盖包装器与 npm 前置 flag**:`sudo -E rm`、`nice -n 10 npm publish`、`time -p`、`stdbuf -oL`、`npm --registry/--access/--otp … publish`、`(rm …)` / `{ …; }` / `if …; then …` 都归一成正确 op。
|
|
14
|
+
- **流式检索按词边界计 TF**:`cat` 不再命中 `concatenate`,与 token 化 IDF 同源。
|
|
15
|
+
- **面板删除同步清 `vectors.json`**(与 `forget` 一致);`watch_repo` 回报的 interval 与真实定时器一致(0/负数 clamp 成 1s)。
|
|
16
|
+
- **git 与非 git 扫描口径统一**:深度边界与 `DEFAULT_IGNORE` 只作用于目录段,`git init` 前后语料一致。
|
|
17
|
+
- **增强队列按 store 身份去重**:多项目同名文件不再互相顶掉。
|
|
18
|
+
- **畸形 `task.steps` / `fileMeta` 归一**:不会让绑定会话的整条注入与任务列表一起抛错。
|
|
19
|
+
- **面板记忆列表在 `root` / 绑定任务变化后重取**;编辑 procedure 不再把合成摘要写进 `body`。
|
|
20
|
+
- **空提交不再创建空 store**;`save_lesson` 改 `kind` 时清掉旧 kind 专属字段;`truncate()` 的缺省上限与 `timeAgo()` 的非法时间不再输出 `undefined` / `NaN天前`。
|
|
21
|
+
|
|
22
|
+
**测试**:新增 `test/audit-2026-11-05.test.mjs`(19 项:迁移保护/并发合并/畸形任务/global 缺失/锁超时/lazy 顺序/队列身份/reinject/ops/词边界/向量清理/watch/scan/kind/空提交/truncate)。`npm test` **977 项 / 58 个文件**全绿、`npm run typecheck` 通过;`npm run build:client` 后 `client/` 与源码一致。
|
|
23
|
+
|
|
24
|
+
**工具描述统一为英文,并写清「改而不是新建」**:12 个工具的描述与参数说明此前中英混排(3 中 / 9 英),现在全部英文。两处措辞补上更新优先:`save_lesson` 直说「看到的记忆记错、过时或不够用时,带 id 再写一次就地覆盖,别另建一条」;`query_memory` 补一句「查询后顺手用 id 更新过时、记错的条目」。
|
|
25
|
+
|
|
26
|
+
schema 预算守卫从「字符 ≤ 5600」改成「token 估算 ≤ 1800」(中文字符约 1 token/字,其余约 4 字符/token)。同一份内容实测:中文 4854 字符 / ~1772 token,英文 6734 字符 / ~1684 token——字符少不代表 token 少,按 token 判才选得对(这次英文略低,故取英文)。
|
|
27
|
+
|
|
28
|
+
### 适配 dsh 0.2.2-rc.1
|
|
29
|
+
|
|
30
|
+
**开发依赖对齐新宿主**:`dsh-tools` / `dsh-llm` / 四个 client 包从 `0.2.1-rc.2` 升到 `0.2.2-rc.1`,`@deepseek-ai/cordis` 从 `^4.0.4`(实际装 4.0.5)升到 `^4.1.0` —— 0.2.2 的 client 包 peer 已是 `~4.1.0`,旧依赖下的全绿只证明了 0.2.1 兼容。`package-lock.json` 同步重新生成。
|
|
31
|
+
|
|
32
|
+
**逐项核对 0.2.2 的接口变更**:`agent/pre-step`(dispatcher 仍注入 `agent`)、`session/event` / `session/disposed`、v4 消息 source 准入(仍拒 `kind: 'plugin'`、接受生产者自有 kind)、`ctx.tools.register`、`ctx.inject(['commands'])`、`workingDirectory.get(session)`、`sessions.list` 快照(`byId` + `retainedBy.mainView` + `blank`)、`shell.overlay` / `conversation.chat.commandview` 槽位、`remote.commands` 扁平服务、`ctx.configForms.get`、`inputTriggers.registerSource` —— 均未变;投影帧改 `changes[]`、已释放单元保留检查点、`session.list` 摘要去掉 contextPressure/contextBreakdown、LLM `purpose` 改为类型级声明、Loader 条目树改 `commit(change)` —— 插件都没读这些面。
|
|
33
|
+
|
|
34
|
+
**补齐 `apply_patch` 的文件追踪**:这个 0.2.2 的可选工具只收整段补丁文本(`input`),路径写在 `*** Add/Update/Delete File:` 与 `*** Move to:` 行里。TaskBridge 与动作平面此前只认 `file_path`/`path`,开启该工具后跨文件补丁会漏记任务热点、审计也指不到具体文件;现在都从正文提取路径(相对会话当前工作目录再归一到项目根,项目外丢弃)。
|
|
35
|
+
|
|
36
|
+
**实测**:`npm test` 全绿、`npm run typecheck` 通过、`npm run build:client` 产物与源码一致;0.2.2-rc.1 的 web profile 里工具注册、skill 注册与 pre-step 注入均正常。
|
|
37
|
+
|
|
38
|
+
## 0.6.10 (2026-11-04)
|
|
39
|
+
|
|
40
|
+
**兼容**:无新增配置键,无 store 格式变更。一处判据变化:`memoryDir` 只接受项目根内的相对路径,越界值(`.`、`..`、含 `..` 段、绝对路径)回落到默认目录并告警一次(此前会静默把 store 放到根上或根外)。
|
|
41
|
+
|
|
42
|
+
### 性能
|
|
43
|
+
|
|
44
|
+
- **CJK 分词从「逐字符判断」改成「整段匹配」**:`tokenizeRaw` 此前对整篇文本逐码点调用 `CJK_RANGE.test()` 并累积字符串,纯英文文档也要跑满整篇。现在用一条从 `CJK_RANGE` 派生的正则一次取出所有连续段,再按原有规则结算(段长 1 产单字、≥2 产全部相邻二元组)。**输出逐字节一致**,所以 `TOKENIZER_VERSION` 不动、旧 store 不需要回填;等价性由 `test/tokenizer-equivalence.test.mjs` 差分守住(冻结旧实现当标尺 + 固定输出契约 + 18 个边界串 + 5 个真实文件 + 2000 组固定种子随机拼接 + `stem` 两态)。
|
|
45
|
+
- **同会话 A/B**(Node 24.19 / WSL2 / 20 vCPU,同一小时内交替跑、每个版本两遍,引用页缓存已热的那遍):TypeScript 整树(14,528 文件 / 95,316 条目)首次查询的 IDF 重建 **1.44–1.53 s → 0.94–0.96 s**(约 −35%),抽取 9.42–9.51 s → 8.79–8.95 s(−6%),冷索引 10.66 s → 10.00 s(−6%);文档为主的语料(249 文件 / 889 条目)抽取 242–252 ms → 216–219 ms(−13%)、IDF 58–59 ms → 43–44 ms(−26%)。查询 p50 无可测变化(在噪声内)。
|
|
46
|
+
- **已知代价**:极端构造输入(CJK 单字与拉丁字母逐字交替,如 `中a文a` 重复)实测 **0.97×**——段长恒为 1 时,正则产出的段数组比逐字累积多一层分配;真实代码与文档里不出现这个密度。README 的性能表是 2026-10-13 的历史测量口径,本轮未重测。
|
|
47
|
+
|
|
48
|
+
### 修复
|
|
49
|
+
|
|
50
|
+
- **`save_lesson` 带 `id` 更新时静默改 `kind`**:`kind` 的 `'lesson'` 默认值此前也作用于就地更新,改一条 decision/procedure 的 `fix`/`reason` 会把它降级成 lesson;现在只在新建时补默认值,更新只覆盖调用方显式传入的字段。
|
|
51
|
+
- **watch / lazy 对超过 `maxFileSizeMb` 的文件只跳过、不摘旧条目**:文件涨过阈值后旧 entries 会永久可检索(watch 还把 `mtime:size` 写进快照,永远不再重试)。两处现在与 `index_repo` 一样走 `drop`;watch 轮询发现根已被删除时也不再经 `save()` 把根重新创建出来。
|
|
52
|
+
- **`archive_task` 归档后不解绑**:绑定会话下一步仍会注入归档任务卡与任务级 insights,任务级记忆也继续被召回;现在工具与 `/tasks archive` 一样清掉所有绑定,注入/召回侧同时挡 `task.archived`。
|
|
53
|
+
- **`autoContext.maxTokens: 0` 仍注入 root notice**:`buildInjection` 已零预算,但 `injectForStep` 在预算外补了“记忆根是推定的”提示;现在 0 预算时连状态声明也不发,真正零注入。
|
|
54
|
+
- **`watch_repo({watch:false})` 对已不存在的 root 重新创建目录**:stop 路径不再 load/commit 缺失根;避免 `save()` 的 `mkdirSync` 把用户刚停掉的路径复活。
|
|
55
|
+
- **宿主的 `str_replace_editor` 不被识别**:`ops` 现在按 `path` + `command` 把 create/str_replace/insert 归一成 `file-write`,`view` 不算写;TaskBridge 也把它的写/读分别记入任务热点文件。
|
|
56
|
+
- **面板 promote/demote 丢使用痕迹**:手工提升/降级此前直接走 `normalizeInsight`,丢掉 `triggerDerived`/`prev`/`lastHitAt`,也不执行 `maxProject`/`maxGlobalProcedures`;现在与自动提升共用 `carryUsageFields` 并收口容量。
|
|
57
|
+
- **空任务列表的 `/tasks` payload 缺 `root`**:跨标签页同步按项目根过滤,空列表时 root 为 null 会让本页失去项目作用域;现在空/非空两条路径都带 root。
|
|
58
|
+
- **`memoryDir` 为空 / `.` / `..` / 绝对路径时 store 落错位置**:空串与 `.` 让 `path.join(root, …)` 等于项目根本身,`save()` 的自我忽略会在那里写内容为 `*` 的 `.gitignore`(整个仓库从 git 视角消失),`format.json` / `shards/` 也会污染源码树;`..` 则把 store 写到根外。现在 `safeMemoryDirName()` 是读写两侧唯一的归一入口:空/空白、`.`、`..`、含 `..` 段、绝对路径(POSIX `/x`、Windows `C:\x`)一律回落到默认目录并告警一次;根内的嵌套目录(`a/b`)仍允许。
|
|
59
|
+
- **POSIX 上把 Windows 盘符路径当项目内相对路径**:`normalizeCitationFiles()` 现在丢弃 `C:\...` 这类在本平台不是绝对路径的盘符路径,避免生成 `C:/...` 的假引用。
|
|
60
|
+
- **`GlobalStore` 缓存键大小写未归一**:Windows/macOS 上同一 `global.json` 的两种写法会建两个实例;现在与项目 store 一样走 `storeKey()`。
|
|
61
|
+
- `save_lesson` 的 `scope` 描述改为与实现一致:绑定任务时默认 `task`,否则 `project`。
|
|
62
|
+
- **体检脚本读不到自定义 `memoryDir`**:`skills/project-memory/scripts/pm-digest.mjs` 把 store 目录写死成 `<root>/.dsh-project-memory`,配了自定义 `memoryDir` 的项目只会得到「no memory store」。现在依次按 `--memory-dir <name>` / `DSH_PROJECT_MEMORY_DIR` / 默认名解析;都没命中时在项目根下一层按 `format.json` 标记找唯一候选并标注 `auto-detected`,多个候选不猜、报错点名怎么传参。
|
|
63
|
+
|
|
64
|
+
**测试**:新增 `test/audit-2026-11-02.test.mjs`(13 项:save_lesson kind 保留、watch/lazy 超限摘旧条目、archive_task 解绑与注入/召回守卫、maxTokens 0 零注入、watch stop/poll 不重建缺失根、str_replace_editor 的 ops/TaskBridge、手工 promote 保留字段与容量、空任务 payload root、空 memoryDir 归一、POSIX 盘符路径丢弃)与 `test/tokenizer-equivalence.test.mjs`(5 项:固定输出契约、18 个边界串、5 个真实语料文件、2000 组固定种子随机拼接、`stem` 两态——全部与冻结的旧实现逐字节比对)与 `test/memorydir-guard.test.mjs`(4 项:空/`.`/`..`/含 `..` 段/绝对路径回落默认目录且不移动 store、嵌套相对目录仍允许、默认告警对同一坏值只发一次、`memoryDir: '.'` 不把 `*` 写进项目根);`test/skill.test.mjs` 补 1 项(自定义 `memoryDir` 的三种解析路径 + 多候选不猜)。`npm test` **956 项 / 57 个文件**全绿、`npm run typecheck` 通过。
|
|
65
|
+
|
|
1
66
|
## 0.6.9 (2026-11-02)
|
|
2
67
|
|
|
3
68
|
**兼容**:无新增配置键,无 store 格式变更(启动时会顺手把 `watch.json` 里大小写重复的根条目合并成一条;文件格式不变)。三个既有键——`watchInterval` / `autoIndexOnFirstUse` / `llmQueryExpansion`——在 `Config` 里标成 `.volatile()`:这是宿主设置表单的准入条件(只有 volatile 字段能被 settings 接口写入),也让它们在运行中原地更新而不重启插件。profile / 命令行的写法完全不变。插件内部读取统一走 `cfgValue()`:volatile 字段在运行时是 ref(`.get()`),直接把 ref 当布尔会读错。升级后**需要重启一次 dsh**——volatile 元数据只在装配期解析。两处**行为变化**:① 扫描与懒索引都跳过隐藏路径(任一段以 `.` 开头,如 `.env` / `.github/**`),显式 `index_doc` 仍可索引(已存在的隐藏路径条目会在下一次完整扫描被清理);② `autoContext.maxTokens: 0` 现在真的零注入(此前被 `|| 400` 顶回默认值)。
|
package/README.md
CHANGED
|
@@ -61,7 +61,7 @@ In a git work tree the corpus is whatever `git ls-files --cached --others --excl
|
|
|
61
61
|
| `query_memory query` | Ranked search over documents, symbols, experience and insights, optionally query-expanded by the LLM. `type` selects a layer (`all` / `doc` / `symbol` / `experience` / `insight` / `task`). Returns hits with relative scores, sources or insight ids, and doc→symbol references. |
|
|
62
62
|
| `list_tasks` | List task records for the project (archived marked). Call first in a new session before continuing work. |
|
|
63
63
|
| `select_task` | Bind the session to a task so its todo list and file reads sync into it. Exact `taskId`, or exact `title` (multiple matches return candidates; no match creates a new task). Pass `title` with `taskId` to rename. Auto-unarchives. |
|
|
64
|
-
| `archive_task` | Archive a task (hide from default views, exclude from capacity, stop syncing). `select_task` restores it. |
|
|
64
|
+
| `archive_task` | Archive a task (hide from default views, exclude from capacity, stop syncing, unbind the sessions that had it selected; archived tasks are also skipped by injection and recall). `select_task` restores it. |
|
|
65
65
|
| `show_task_panel` | Show the task panel in the UI. Call when the user asks to see the task list or when you want to display the panel. |
|
|
66
66
|
| `/tasks` (typed by the user, not the model) | The only user command: shows the task stack and drives the workflow card. Every other action is a **sub-verb** invoked by card buttons: `switch` / `archive` / `unbind` / `rename` / `todos …` / `step` / `step-move` / `step-text` for tasks, `insight list [scope] [offset] [limit]` / `confirm` / `promote` / `demote` / `archive` / `restore` / `delete` / `save` / `edit` for memory. |
|
|
67
67
|
| `remember problem solution` | Save an experience note. It is a `kind: 'experience'` insight — same store, same dedup and same delete path as lessons / decisions / procedures. Similar problems merge or overwrite instead of duplicating. |
|
|
@@ -123,9 +123,9 @@ The workflow panel is collapsible, adapts to dsh and theme plugin styles, and of
|
|
|
123
123
|
|
|
124
124
|
| Key | Default | Meaning |
|
|
125
125
|
|---|---|---|
|
|
126
|
-
| `memoryDir` | `.dsh-project-memory` | store directory inside each indexed root |
|
|
126
|
+
| `memoryDir` | `.dsh-project-memory` | store directory inside each indexed root. Must stay a relative path inside the root: `.`, `..`, any `..` segment or an absolute path falls back to the default with one warning (otherwise the store lands outside the root, or on the root itself and self-ignores the whole repository) |
|
|
127
127
|
| `chunkChars` / `maxChunksPerFile` | 3000 / 40 | max chars per document chunk, max chunks per document |
|
|
128
|
-
| `maxFileSizeMb` | 10 | skip documents (incl. PDF) and code files larger than this (MB); see the per-file memory budget below |
|
|
128
|
+
| `maxFileSizeMb` | 10 | skip documents (incl. PDF) and code files larger than this (MB); entries of an already-indexed file that later grows past the cap are dropped on the next scan / watch pass; see the per-file memory budget below |
|
|
129
129
|
| `maxPdfPages` | 1000 | PDF page cap |
|
|
130
130
|
| `maxOutputChars` | 8000 | cap for `query_memory` result text (chars) |
|
|
131
131
|
| `lazyIndexing` | true | index files the moment the model reads them |
|
|
@@ -243,7 +243,7 @@ Four corpora, one Linux machine (Node 24.19), each run twice with the **second,
|
|
|
243
243
|
| Cold load | 10,000 files | 117 ms |
|
|
244
244
|
| Hot lazy re-index (single file) | 10k files | p50 5.5 ms / max 8.4 ms |
|
|
245
245
|
|
|
246
|
-
> 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.
|
|
246
|
+
> 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. Those IDF figures are the pre-0.6.10 baseline — the 0.6.10 tokenizer rewrite makes that rebuild roughly a third faster on the same corpus (same-session A/B, numbers in the CHANGELOG).
|
|
247
247
|
|
|
248
248
|
### Reproduce it on your own project
|
|
249
249
|
|
|
@@ -285,7 +285,7 @@ These commands are for **maintaining the plugin code** — regular users do not
|
|
|
285
285
|
|
|
286
286
|
```bash
|
|
287
287
|
npm install
|
|
288
|
-
npm test #
|
|
288
|
+
npm test # 977 tests
|
|
289
289
|
npm run eval:injection # synthetic pool P/R: precision 0.93 / recall 1.00, + a 3-scenario hint-only group
|
|
290
290
|
npm run eval:injection -- --store .dsh-project-memory/insights.json # replay on YOUR store; control group is a hard gate
|
|
291
291
|
npm run selfcheck:triggers # which entries can still push, which declarations are dead (reads your local store)
|
package/README.zh-CN.md
CHANGED
|
@@ -59,7 +59,7 @@ dsh plugin --profile web add @yolk_vat-y/dsh-project-memory -w
|
|
|
59
59
|
| `query_memory query` | 对文档、符号、经验与 insight 执行排序检索,可选 LLM 查询扩展。`type` 选择层(`all` / `doc` / `symbol` / `experience` / `insight` / `task`)。返回带相对分数、引用或 insight id、以及文档→符号链接的结果。 |
|
|
60
60
|
| `list_tasks` | 列出本项目任务记录(含归档,带标记)。新会话/续接前先调用。 |
|
|
61
61
|
| `select_task` | 将会话绑定到某任务(此后 todo 清单与读文件同步进该任务)。按 `taskId` 精确绑定,或按 `title` 完全匹配(多个同名返回候选;无则新建)。带 title 可改名;自动解归档。 |
|
|
62
|
-
| `archive_task` |
|
|
62
|
+
| `archive_task` | 归档任务(隐藏默认视图、不占容量、停止同步、清掉选中它的会话绑定;归档任务也不再参与注入与召回)。`select_task` 可恢复。 |
|
|
63
63
|
| `show_task_panel` | 在 UI 中打开任务面板。用户要求查看任务列表或你想展示面板时调用。 |
|
|
64
64
|
| `/tasks`(用户输入,不经模型) | 唯一的用户命令:展示任务栈并驱动工作流卡片。其余动作是它的**子动词**,由卡片按钮调用:`switch` / `archive` / `unbind` / `rename` / `todos …` / `step` / `step-move` / `step-text` 为任务动作,`insight list [scope] [offset] [limit]` / `confirm` / `promote` / `demote` / `archive` / `restore` / `delete` / `save` / `edit` 为记忆动作。 |
|
|
65
65
|
| `remember problem solution` | 保存经验笔记。它就是 `kind: 'experience'` 的 insight——与教训 / 决策 / 流程同库、同去重、同删除入口。相似问题合并或覆盖而非重复。 |
|
|
@@ -121,9 +121,9 @@ TaskPanel (Container)
|
|
|
121
121
|
|
|
122
122
|
| 键 | 默认值 | 含义 |
|
|
123
123
|
|---|---|---|
|
|
124
|
-
| `memoryDir` | `.dsh-project-memory` |
|
|
124
|
+
| `memoryDir` | `.dsh-project-memory` | 每个被索引根目录内的存储目录。必须是根内的相对路径:`.`、`..`、含 `..` 段或绝对路径都会回落到默认目录并告警一次(否则 store 会落到根外,或落到根上并把整个仓库自我忽略掉) |
|
|
125
125
|
| `chunkChars` / `maxChunksPerFile` | 3000 / 40 | 每个文档块最大字符数、每文档最大块数 |
|
|
126
|
-
| `maxFileSizeMb` | 10 | 大于该值(MB)的文档(含 PDF
|
|
126
|
+
| `maxFileSizeMb` | 10 | 大于该值(MB)的文档(含 PDF)/代码文件跳过;已经索引过的文件后来涨过阈值,旧条目会在下一轮扫描 / watch 时摘掉;峰值系数见下文「单文件内存预算」 |
|
|
127
127
|
| `maxPdfPages` | 1000 | PDF 页数上限 |
|
|
128
128
|
| `maxOutputChars` | 8000 | `query_memory` 返回文本上限(字符) |
|
|
129
129
|
| `lazyIndexing` | true | 模型读取文件的瞬间即索引 |
|
|
@@ -241,7 +241,7 @@ dsh web --patch ./config.yml
|
|
|
241
241
|
| 冷加载 | 10,000 文件 | 117 ms |
|
|
242
242
|
| 热路径懒记忆 | 单文件重记忆+落盘 | p50 5.5 ms / 最大 8.4 ms (10k) |
|
|
243
243
|
|
|
244
|
-
> 合成基准:生成代码(~4–5 符号/文件),实测于 2026-10-13。复现命令 `npm run bench:synthetic -- 5000`(脚本 `scripts/bench-synthetic.mjs`)。测量纯索引开销,不含 LLM 调用。写入后的首次查询会重建 IDF 缓存(**40k 条目 141 ms**,20k 条目 68 ms,4k 条目 17 ms
|
|
244
|
+
> 合成基准:生成代码(~4–5 符号/文件),实测于 2026-10-13。复现命令 `npm run bench:synthetic -- 5000`(脚本 `scripts/bench-synthetic.mjs`)。测量纯索引开销,不含 LLM 调用。写入后的首次查询会重建 IDF 缓存(**40k 条目 141 ms**,20k 条目 68 ms,4k 条目 17 ms),后续查询命中缓存。这组 IDF 数字是 0.6.10 之前的基线——0.6.10 的分词重写在同一语料上把这次重建缩短约三分之一(同会话 A/B,数字见 CHANGELOG)。
|
|
245
245
|
|
|
246
246
|
### 自己复现这些数字
|
|
247
247
|
|
|
@@ -283,7 +283,7 @@ node scripts/bench.mjs /你的/项目路径 [--json] [--samples 100] [--no-pdf]
|
|
|
283
283
|
|
|
284
284
|
```bash
|
|
285
285
|
npm install
|
|
286
|
-
npm test #
|
|
286
|
+
npm test # 977 项测试
|
|
287
287
|
npm run eval:injection # 合成池 P/R:精确率 0.93 / 召回率 1.00,另有 3 个 hint-only 场景
|
|
288
288
|
npm run eval:injection -- --store .dsh-project-memory/insights.json # 用你自己的 store 重放;对照组是硬闸门
|
|
289
289
|
npm run selfcheck:triggers # 哪些条目还推得动、哪些声明是死的(读你本地的 store)
|
package/client/client.js
CHANGED
|
@@ -1883,7 +1883,12 @@ window.__ModuleLoader__.load({
|
|
|
1883
1883
|
return;
|
|
1884
1884
|
}
|
|
1885
1885
|
loadRef.current(0, 30, false);
|
|
1886
|
-
}, [
|
|
1886
|
+
}, [
|
|
1887
|
+
scope,
|
|
1888
|
+
sessionId,
|
|
1889
|
+
root,
|
|
1890
|
+
boundTaskId
|
|
1891
|
+
]);
|
|
1887
1892
|
(0, react.useEffect)(() => {
|
|
1888
1893
|
if (nextOffset === null || typeof IntersectionObserver === "undefined") return;
|
|
1889
1894
|
const sentinel = sentinelRef.current;
|
|
@@ -1918,7 +1923,7 @@ window.__ModuleLoader__.load({
|
|
|
1918
1923
|
}
|
|
1919
1924
|
};
|
|
1920
1925
|
const rowToForm = (row) => {
|
|
1921
|
-
const main = row.kind === "lesson" ? row.fix : row.kind === "experience" ? row.solution : row.kind === "decision" ? row.reason : row.body;
|
|
1926
|
+
const main = row.kind === "lesson" ? row.fix : row.kind === "experience" ? row.solution : row.kind === "decision" ? row.reason : row.kind === "procedure" ? "" : row.body;
|
|
1922
1927
|
const body = main && main !== row.title ? main : "";
|
|
1923
1928
|
return {
|
|
1924
1929
|
title: row.title || "",
|
|
@@ -1977,7 +1982,7 @@ window.__ModuleLoader__.load({
|
|
|
1977
1982
|
if (form.kind === "lesson") fields.pattern = title;
|
|
1978
1983
|
if (form.kind === "decision") fields.choice = title;
|
|
1979
1984
|
if (form.kind === "experience") fields.problem = title;
|
|
1980
|
-
if (form.body.trim()) {
|
|
1985
|
+
if (form.kind !== "procedure" && form.body.trim()) {
|
|
1981
1986
|
if (form.kind === "lesson") fields.fix = form.body.trim();
|
|
1982
1987
|
else if (form.kind === "decision") fields.reason = form.body.trim();
|
|
1983
1988
|
else if (form.kind === "experience") fields.solution = form.body.trim();
|