dsh-layers-hippocampus 1.9.1 → 1.9.3

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
@@ -4,6 +4,65 @@ All notable changes to `dsh-layers-hippocampus` are documented here.
4
4
  The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
5
5
  and the project adheres to [Semantic Versioning](https://semver.org/).
6
6
 
7
+ ## [1.9.3] — 2026-11-30
8
+
9
+ **「空间」改名为「存储」(store),并把最后一块业务路由搬走:海马体不再创建/删除物理目录。**
10
+ 至此命名模型才真正干净:**store 是物理目录,layer 是业务语义**(会话/项目/全局)。
11
+ 1.9.0 把 layer 交给了 orchestrator,1.9.3 把 store 的生命周期也交出去。
12
+
13
+ - **Changed — 工具改名 `space_transfer` → `store_transfer`**。这是**唯一注册**的名字,
14
+ 不再保留旧工具名:一个模型会看到所有已注册工具,同一个操作挂两个名字只会让它挑错。
15
+ 操作本身没变(隐私扫描、新 event id、move 走两阶段 pending_delete 全部照旧)。
16
+ - **Changed — 参数改名 `target_store_id` / `source_store_id`**,`*_space_id` 作为**弃用别名继续接受**
17
+ (真实调用活在提示词与脚本里,改名字不能把它们的argument弄断)。
18
+ `required` 因此只保留 `event_ids`:id 在 `execute()` 里校验,两者都缺时报
19
+ `MEM_E_INVALID_INPUT` 并点名 `target_store_id`,**绝不静默落到默认 store**。
20
+ - **Removed — 创建/删除存储目录的路由**。`POST /api/hippocampus/{stores,spaces}` 一律
21
+ `405 MEM_E_FEATURE_DISABLED`,响应里写明 `substitutedBy: dsh-layers-orchestrator`
22
+ 与替代路径 `GET /api/hippocampus/stores`。删除按钮与「新建空间」输入框从面板**整个移除**
23
+ (连同 `create`/`remove` 两个处理函数——留着死代码只会诱使将来有人重新暴露一条必 405 的路)。
24
+ 目录本就在首次写入时自动创建,手动"新建"只是提前建;而删除需要 orchestrator 接管。
25
+ - **Added — `GET /api/hippocampus/stores`(只读)**。旧路径 `/spaces` 是**同一个 handler**
26
+ 的弃用别名,payload 同时给 `stores` 与 `spaces`(一致),并带
27
+ `deprecated: { spaces, post }` 说明。
28
+ - **Added — 能力握手**:`capabilities.stores` / `storesDelete` / `storesReason`,
29
+ `spaces` / `spacesDelete` 继续镜像。`spacesDelete` 现在**如实为 false**——
30
+ 它以前意思是"旧宿主没有删除路由",现在意思是"这个包根本没有删除路由"。
31
+ - **Tests — 7 个新用例(`test/v193.stores.test.js`)+ 受影响的断言按新契约更新**:
32
+ 工具列表里只有新名、两条路径都能 GET 且 payload 一致、
33
+ POST 两条路径都 405 且**没有落盘**、capabilities 三个键如实、
34
+ 新拼写可用/旧拼写仍可用、两个 id 都缺时拒绝而非默认。
35
+
36
+ ## [1.9.2] — 2026-11-30
37
+
38
+ **修 1.9.1 上线后暴露的真问题:宿主模型能调到了,但 20 次里只成功 1 次。**
39
+ 19 次全都报 `dream LLM answer is not a JSON object`——根因不是提示词,是**算错了输出预算**。
40
+
41
+ - **Fixed — 输出预算(`dream.llm.maxTokens`,默认 1200)**。旧代码把预算从摘要长度推导
42
+ (`maxSummaryChars*2+64` = 默认 **464** tokens),而推理型模型要先消耗预算推理、再输出 JSON,
43
+ 464 常在写出 `{` 之前就耗尽,于是答案里根本不含花括号 → 每次都被判「不是 JSON 对象」。
44
+ 现在预算是显式配置项:实际请求值 = `max(128, 配置值, 摘要长度*2+64)`,
45
+ 配置低于摘要下限时自动抬到下限(不会静默按小值发出)。范围 128–16000,fail-fast。
46
+ - **Fixed — 截断与格式错误分开报(`llm-truncated`)**。宿主接缝现在把 finish reason 一起返回
47
+ (`{ text, finish, reasoningChars }`,同时兼容只回字符串的老接缝)。当 `finish === 'max-tokens'`
48
+ 且答案里没有 `{` 时抛 `phase:'truncated'`,`fallbackReason` 记为 **`llm-truncated`** 并附
49
+ `hint: raise dream.llm.maxTokens`;而模型明明停笔却没给 JSON 的情况仍是 `llm-error`
50
+ (`phase:'format'`,带 `chars` 与 `hasBrace`)。两种失败的修法不同,不该长得一样。
51
+ - **Fixed — 答案完整就照用**。`finish:'max-tokens'` 但答案已含 JSON 时正常采纳——
52
+ 模型写完答案后停在上限,没有理由丢弃。
53
+ - **Added — 诊断字段(不含正文)**。`dreamStatus().lastFallback.diagnostic` 携带
54
+ `phase` / `transport` / `chars` / `hasBrace` / `maxTokens` / `timeoutMs`。
55
+ **绝不记录模型返回的文本**——那是从记忆内容推导出来的,不能进面板或日志。
56
+ - **Added — 推理长度只计数不保留**。接缝统计 `reasoning-delta` 的字符数用于诊断
57
+ (推理吃光预算正是截断的解释),但推理内容本身不入库、不入状态。
58
+ - **Changed — 一处旧隐藏行为被纠正**:`block-end` 文本块以前只在「没有任何 delta」时采纳,
59
+ 现在用 `sawDelta` 显式标记,避免适配器既发 delta 又发 block-end 时重复拼接。
60
+ - **Tests — 8 个新用例(`test/v192.dream.budget.test.js`)**:预算默认值/范围 fail-fast、
61
+ 引擎确实按配置值请求(不再是 464)、配置低于摘要下限时被抬升、
62
+ 截断→`llm-truncated` 且诊断齐全、`max-tokens` 但有 JSON 仍采纳、
63
+ 停笔但没 JSON→`llm-error` 且 `hasBrace:false`、
64
+ **隐私**(`dreamStatus()` 里搜不到模型返回的正文片段)、老式字符串接缝仍可用。
65
+
7
66
  ## [1.9.1] — 2026-11-29
8
67
 
9
68
  **Dream 真正接上 LLM:默认走宿主自己的模型,不再需要 endpoint 与 API key。**