dsh-lite-memory 0.18.44 → 0.18.46

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 CHANGED
@@ -115,6 +115,11 @@ Off by default, per project only. When enabled it distills a few project rules f
115
115
  - Turning it off stops learning, reads and late writes; results stay viewable. While project memory is off, self-evolution is necessarily off and cannot be switched on by itself.
116
116
  - Switching columns, a new episode and one-off exceptions do not leak into each other; a repository subdirectory, symlink or worktree is the same project, separate clones are not.
117
117
 
118
+ ## 发布候选 / Release candidate
119
+
120
+ - 全链路审计结论与轻量化数字:[`docs/RC-0.18.46.md`](docs/RC-0.18.46.md)
121
+ - 基准复现:`npm run bench`、`npm run bench:evolution`,基线见 [`docs/BENCH.md`](docs/BENCH.md)
122
+
118
123
  ## 安装 / Install
119
124
 
120
125
  Plugin Manager 里搜 `dsh-lite-memory` 直接装;或 `npm pack` 后用 Plugin Manager 安装生成的 `.tgz`。
package/client.js CHANGED
@@ -1074,6 +1074,8 @@ window.__ModuleLoader__.load({
1074
1074
  return { id: room.id, name: room.name, items, total: items.length, pages: Math.max(1, Math.ceil(items.length / PALACE_PAGE_SIZE)) };
1075
1075
  });
1076
1076
  };
1077
+ /** 房间预览按内容铺:1 条就 1 个槽,不拿虚位占地方。 */
1078
+ const palaceSlotCountOf = (total) => Math.min(PALACE_PREVIEW, Math.max(1, Number.isFinite(total) ? Math.floor(total) : 0));
1077
1079
  const palaceRoomPageOf = (records, roomId, page) => {
1078
1080
  const room = palaceRoomsOf(records).find((row) => row.id === roomId);
1079
1081
  if (!room) return { items: EMPTY, total: 0, pages: 0, page: 1 };
@@ -2026,8 +2028,8 @@ window.__ModuleLoader__.load({
2026
2028
  const PalaceRoomCard = (props) => {
2027
2029
  const room = props.room;
2028
2030
  const empty = room.total === 0;
2029
- const preview = room.items.slice(0, PALACE_PREVIEW);
2030
- const slots = Array.from({ length: PALACE_PREVIEW }, (_, index) => preview[index] || null);
2031
+ const preview = room.items.slice(0, palaceSlotCountOf(room.total));
2032
+ const slots = Array.from({ length: palaceSlotCountOf(room.total) }, (_, index) => preview[index] || null);
2031
2033
  return h('div', {
2032
2034
  role: 'listitem',
2033
2035
  style: { ...PANEL_CARD, padding: 0, position: 'relative', overflow: 'hidden', display: 'flex', width: '100%', flexDirection: 'column' },
@@ -3100,7 +3102,7 @@ window.__ModuleLoader__.load({
3100
3102
 
3101
3103
  // 测试缝:Node 里验引用投影,浏览器里没有任何副作用。
3102
3104
  if (typeof globalThis.__LITE_MEMORY_TEST__ === 'function') {
3103
- globalThis.__LITE_MEMORY_TEST__({ metaOf, citationOf, citationsOfMeta, citationsOfTurn, dedupe, undoRefOf, graphOf, ruleGraphOf, processingStatusOf, currentBodyOf, historyDiffsOf, MemoryPanel, MemoryGraph, MemoryPalace, TurnMemory, RefSection, displayKeyOf, readDisplaySettings, writeDisplaySettings, graphViewOf, viewModeOf, filterRecords, projectionOf, failureStateOf, evidenceTextOf, evidenceMetaOf, palaceRoomsOf, palaceRoomPageOf, palacePageWindow, palaceToggleOf, palaceMotionOf, palaceRoomIdOf, refMetaOf, explainKeyOf, explainModeOf, setExplainMode, recallLineOf, agoLabel, checkupOf, refSectionRowsOf, refDetailTitleOf, versionLine, titleCountsOf, rowKeyOf, rowKeepFlags, Row, conflictVisibleRows, conflictFactsOf });
3105
+ globalThis.__LITE_MEMORY_TEST__({ metaOf, citationOf, citationsOfMeta, citationsOfTurn, dedupe, undoRefOf, graphOf, ruleGraphOf, processingStatusOf, currentBodyOf, historyDiffsOf, MemoryPanel, MemoryGraph, MemoryPalace, TurnMemory, RefSection, displayKeyOf, readDisplaySettings, writeDisplaySettings, graphViewOf, viewModeOf, filterRecords, projectionOf, failureStateOf, evidenceTextOf, evidenceMetaOf, palaceRoomsOf, palaceRoomPageOf, palaceSlotCountOf, palacePageWindow, palaceToggleOf, palaceMotionOf, palaceRoomIdOf, refMetaOf, explainKeyOf, explainModeOf, setExplainMode, recallLineOf, agoLabel, checkupOf, refSectionRowsOf, refDetailTitleOf, versionLine, titleCountsOf, rowKeyOf, rowKeepFlags, Row, conflictVisibleRows, conflictFactsOf });
3104
3106
  }
3105
3107
 
3106
3108
  return {
@@ -0,0 +1,36 @@
1
+ # 0.18.46 — 发布候选:全链路审计结论
2
+
3
+ 候选版本 `0.18.46`。本文只记「查了什么、凭什么说它成立、还留着什么」,细节在对应 RELEASE 与 `docs/BENCH.md`。
4
+
5
+ ## 七条链路的结论
6
+
7
+ | 链路 | 结论 | 证据 |
8
+ | --- | --- | --- |
9
+ | 召回边界 | 无关不注入、条件不匹配不召回、整卡装不下就整卡省、准备阶段不记账、归档不进常规检索 | `test/recall.test.mjs` A08/A09/A10/A11b/A18;A19 按规范化字节计预算 |
10
+ | 任务识别 | 短追问沿用上一句;明说换任务就断开旧线索;新话题可判定时旧动作线索不跟;认不出类型的换任务也不继承 | A02b/A25/A25b/A25c/A25d/A25e/A26/A29 |
11
+ | 学习收敛 | 每轮最多 2 处改动、试用到 30 天自动停、规则封顶 32 条、失败只留回执无副作用 | `test/learning.test.mjs` 59 项;`bench/evolution.mjs` 压到 32 条、`stateBytes 132 KB` |
12
+ | 待裁决审批 | 候选满就明说「先处理旧的」,不接受静默丢;确认后才写正式条目;已消费候选重放不写第二条 | `test/store.test.mjs` 候选门限与重放用例;`acceptCandidate` 同锁窗口内确认+消费+回执 |
13
+ | 全局写入 | 只有真人明确说「存到全局/所有项目」才跨项目写入;普通用词(如「全局变量」)不放行 | A31;全局层容量 200/1000 两档与项目层同一套裁决 |
14
+ | 使用统计 | 只有真正交付给模型的卡片才记 `lastUsed`/`hits`,检索与读正文是纯读;空召回不顺手记账 | A03/A12/A32;`test/store.test.mjs`「search and read leave hits and lastUsed alone」;10 分钟防抖避免每次检索抢锁 |
15
+ | 动作前触发 | npm 类原生命令在动作前拦一次并给凭据用法,同轮不重复;项目层优先于全局层;零命中时关键动作后补查一次且不重复注入 | A27/A27b/A28;A30 只读文件不花补查机会 |
16
+
17
+ ## 轻量化
18
+
19
+ | 指标 | 0.18.41 | 候选 0.18.46 |
20
+ | --- | --- | --- |
21
+ | 常驻描述+参数+schema | 13 375 B | 13 375 B(上限 13 600) |
22
+ | 每轮平均注入 | 368 B | 365 B |
23
+ | 热点层 `state.json` | 132 KB | 约 132 KB;回执上限 256→64,再省约 27 KB |
24
+ | 热快照 P50 / P95 | 67.1 / 84.6 ms | 70.3 / 85.7 ms(噪声内) |
25
+ | 每轮文件读 | 0.4 次 | 0.3 次 |
26
+ | npm tarball / 解包 / 文件数 | 377.6 KB / 1.4 MB / 97 | 252.3 KB / 861.7 KB / 74(含本文与候选说明) |
27
+
28
+ `npm run bench` 与 `npm run bench:evolution` 均 `ok:true`;`npm test` 21 个套件全绿。
29
+
30
+ ## 明确没做与已知边界
31
+
32
+ - 不引向量库、图数据库、后台整理进程:召回是文本打分,同义改写靠 `TRIGGERS.md` 的触发词与词面覆盖,不承诺任意改写都能召回;承诺的是「只递相关卡、只对递出去的记账、标题纠错只重试一次」。
33
+ - 候选满时 `store.js` 抛错、`state.js` 遇候选超限静默留最近的:两条路径保留不对称,理由写在这里,不假装一致。
34
+ - 回执裁剪走写入路径:长期不写的层会保留旧回执,下一次写入即压回上限。旧进程写下的 256 条不会自己消失,靠这次写入自愈。
35
+ - 面板「第一视角宫殿」四间房、每页 24 条、4 格预览,预览格数已按内容铺(1 条就 1 格);不做拖拽重排、不做跨房间合并。
36
+ - 发布候选即上述版本:CI 绿、`dist-tags.latest` 指向本版、profile 同步后 client 已 reload。
@@ -0,0 +1,16 @@
1
+ # 0.18.45 — 宫殿房间按内容铺槽位
2
+
3
+ ## 变化
4
+
5
+ - 房间预览槽位从固定 4 个改成 `min(4, max(1, 条数))`:1 条记录的房间只占 1 个槽,不再用 3 个虚位撑满一行。
6
+ - 空房间行为不变:仍然显示「还没有记录」,房间固定四间、位置不变。
7
+ - 新增纯函数 `palaceSlotCountOf`,槽位数量可单测,不依赖渲染。
8
+
9
+ ## 为什么
10
+
11
+ ROADMAP R1 明写「房间宽高由内容决定,去掉无意义空地」。此前 1–3 条的房间会画 1–3 个 28% 透明度的虚线空槽,占 46px 高,读起来像没加载完。
12
+
13
+ ## 验证
14
+
15
+ - `test/client.test.mjs`:新增槽位数断言(0/1/3/4/40 五个边界),22 项通过。
16
+ - `npm test`:21 个套件全绿;`node --check client.js` 通过;UI 文案 lint 与改动前同计数(3 错 21 警,均为既有误报)。
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-lite-memory",
3
- "version": "0.18.44",
3
+ "version": "0.18.46",
4
4
  "description": "On-demand memory for the DeepSeek Harness: nothing resident, at most three small cards on a real hit, bodies read on demand.",
5
5
  "type": "module",
6
6
  "main": "index.js",