Skip to content

Commit 514d238

Browse files
authored
Merge pull request #614 from slow-stack/feat/diary-v013-rebased
feat(diary): 日记本 v0.13 落进 main(合并后对齐六个 PR,#613 第一步)
2 parents 0214dd4 + 6b7c497 commit 514d238

50 files changed

Lines changed: 7721 additions & 1385 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎README.md‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<a href="LICENSE"><img src="https://img.shields.io/badge/license-MIT-3E63DD?style=flat-square" alt="license"></a>
1111
<a href="https://github.com/slow-stack/mneme/actions"><img src="https://img.shields.io/github/actions/workflow/status/slow-stack/mneme/ci.yml?style=flat-square&label=CI" alt="CI"></a>
1212
<a href="https://nodejs.org"><img src="https://img.shields.io/badge/node-22%2B-3E63DD?style=flat-square&logo=nodedotjs&logoColor=white" alt="node"></a>
13-
<a href="https://github.com/slow-stack/mneme"><img src="https://img.shields.io/badge/tests-2921%20total-3E63DD?style=flat-square" alt="tests"></a>
13+
<a href="https://github.com/slow-stack/mneme"><img src="https://img.shields.io/badge/tests-3154%20total-3E63DD?style=flat-square" alt="tests"></a>
1414
<a href="https://codecov.io/gh/slow-stack/mneme"><img src="https://img.shields.io/codecov/c/github/slow-stack/mneme/main?style=flat-square" alt="coverage"></a>
1515
<a href="https://github.com/awesome-dsh-plugin/awesome-dsh-plugin"><img src="https://awesome-dsh-plugin.com/badge.svg" alt="Awesome"></a>
1616
</p>
@@ -276,7 +276,7 @@ dsh-mneme-serve # 默认 ~/.dsh/memory + 127.0.0.1:8790
276276

277277
```bash
278278
cd dsh-mneme && npm install
279-
npm test # 2921 个测试
279+
npm test # 3154 个测试
280280
npm run stress # 三轴线压测
281281
npm run sync # src → lib 同步
282282
```
@@ -562,7 +562,7 @@ Community projects that wire mneme into more platforms — not part of this repo
562562

563563
```bash
564564
cd dsh-mneme && npm install
565-
npm test # 2921 tests
565+
npm test # 3154 tests
566566
npm run stress # three-axis stress test
567567
npm run sync # src → lib sync
568568
```

‎SECURITY.md‎

Lines changed: 4 additions & 4 deletions
Large diffs are not rendered by default.

‎dsh-mneme/CHANGELOG.md‎

Lines changed: 63 additions & 0 deletions
Large diffs are not rendered by default.

‎dsh-mneme/README.md‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
[![npm version](https://img.shields.io/npm/v/@modusensus/dsh-mneme?color=blue&label=npm)](https://www.npmjs.com/package/@modusensus/dsh-mneme)
66
[![license](https://img.shields.io/badge/license-MIT-green)](LICENSE)
77
[![Awesome](https://awesome-dsh-plugin.com/badge.svg)](https://github.com/awesome-dsh-plugin/awesome-dsh-plugin)
8-
[![tests](https://img.shields.io/badge/tests-2921%20total-success)](https://github.com/slow-stack/mneme)
8+
[![tests](https://img.shields.io/badge/tests-3154%20total-success)](https://github.com/slow-stack/mneme)
99
[![CI](https://img.shields.io/github/actions/workflow/status/slow-stack/mneme/ci.yml)](https://github.com/slow-stack/mneme/actions)
1010
[![node](https://img.shields.io/badge/node-22%2B-blue)](https://nodejs.org)
1111
[![npm downloads](https://img.shields.io/npm/d18m/@modusensus/dsh-mneme.svg?color=blue&label=downloads)](https://www.npmjs.com/package/@modusensus/dsh-mneme)
@@ -733,7 +733,7 @@ src/
733733
├── api.js # HTTP 路由(Web 面板数据通道,含 /conflicts 冲突队列)
734734
└── index.js # 插件接线
735735
lib/ # src 的同步分发产物(npm run sync,prepack 钩子在发布时自动跑;一致性由 scripts/check-sync.js 在 CI 与 release.yml 校验——它只查不同步;唯一手写例外 lib/client.js——Web 面板 bundle,sync 不覆盖)
736-
test/ # 2921 个 node:test 测试(审计与三轴线压测不变量;src↔lib 一致性由 scripts/check-sync.js 发布闸门校验)
736+
test/ # 3154 个 node:test 测试(审计与三轴线压测不变量;src↔lib 一致性由 scripts/check-sync.js 发布闸门校验)
737737
scripts/ # e2e-dsh.js 端到端演示 · stress-dsh.js 三轴线压测 · sync-lib.js 同步 · check-sync.js 发布闸门 · benchmark-recall.js / benchmark-embed.js / benchmark-rerank.js 基准 · sync-test-badge.mjs 测试徽章 · build-runtime-manifest.mjs 运行时清单
738738
```
739739
@@ -742,7 +742,7 @@ scripts/ # e2e-dsh.js 端到端演示 · stress-dsh.js 三轴线压
742742
```bash
743743
cd dsh-mneme
744744
npm install # 安装 peer 依赖(以 devDependencies 形式,用于本地测试)
745-
npm test # 运行 2921 个测试
745+
npm test # 运行 3154 个测试
746746
npm run stress # 三轴线压测:长会话检索 / 冲突仲裁 / 多 Agent 并发(离线 mock LLM)
747747
npm run sync # 把 src/ 同步到 lib/(发布时由 prepack 钩子自动执行)
748748
```

‎dsh-mneme/docs/CONFIGURATION.md‎

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,19 @@
204204
| `documentDir` | `""` | managed 落盘目录(#296) | 空 = `<memoryDir>/documents/`;目录之外只登记指针、正文零读零写 |
205205
| `policyEpoch` | `0` | 裁决规则版本号 | bump 后旧 dream_runs 降为历史证据(receipt 不再驱动现行决策) |
206206

207+
## 日记本(diary,v0.13)
208+
209+
| 键 | 默认 | 作用 | 开启后果 / 冲突 |
210+
|---|---|---|---|
211+
| `diaryEnabled` **light** | `false` | QQ 日记本总闸:跨天判定 + 手写入口 + 面板页 | opt-in;与 `documentMemoryEnabled` **成对但不相依**——关着也能写正文文件,只是不铸造 `document` 指针行(回执里如实标 `pointer.skipped`) |
212+
| `diaryDir` | `""` | 日记正文根目录 | 空 = `<memoryDir>/diaries/<项目键>/`;`~` 展开到 home,绝对路径原样,相对路径落 memoryDir 下。**与 `memoryDir` 一样是路径配置,不是行为开关**,故不进 `settings.js` 白名单、也不上面板 |
213+
| `diaryWriteEveryMinutes` | `0` | 日记自动写的定时唤醒间隔(分钟) | `0` = 只在 turn/end 与插件启动时判定(此前行为);`>0` 时每隔这么多分钟扫一遍已知项目再判定。**不是 cron**:定时器只负责唤醒「该不该写」的判定,写不写仍由 compose 按落盘日期去重——一天最多一篇,填 5 也不会多写。跑完一篇再排下一次,所以不会与上一次的模型调用重叠。opt-in、可热改(走 `INT_RANGES` 表,0–1440)|
214+
| `diaryInboxDir` | `""` | QQ 入站素材目录(只读) | 空 = 从 `memoryDir` 推 `<memoryDir>/../media/onebot`(onebot 的默认落点)。本模块**不 import `dsh-onebot-qq` 任何模块**,边界只靠这份「目录 + 文件形状」约定 |
215+
216+
日记不落用户绑定的项目目录:那目录实测非 git、无 `.gitignore`、混着探针脚本,
217+
写进去没有版本也没有回滚;mneme 成文的写盘面只有 `memoryDir` 与 `documentDir` 两处。
218+
「入库到项目」是面板上一个**人主动点**的导出动作(复制而非移动)。
219+
207220
## 睡眠模式(sleep,空闲深维护)
208221

209222
| 键 | 默认 | 作用 | 开启后果 / 冲突 |
@@ -327,6 +340,8 @@
327340
| `actionRunEnabled` | `false` | M.O. 执行记账:`/mo-run` 开一次执行窗口,窗口内命令执行才可能被记成一条 run | opt-in beta;挂在热路径(每个会话事件都过一次监听),故 `LIGHT_MODE_OFF` 里有它 |
328341
| `actionNudgeEnabled` | `false` | M.O. 自动沉淀:每轮结束(`turn/end`)后挖一次「这个项目重复走的动作」,结果落成 `memoryDir/proposals/<项目键>/` 里的提议,等人确认 | opt-in beta;三个 M.O. 键里最重的一条——挂 `session/event` 且要**同步解压 zstd 会话日志**(本机 118 份实测 16.2s,单次预算 `budgetMs`=4s 兜底),故 `LIGHT_MODE_OFF` 里有它。**永不自动落草稿**:`materialize` 恒 false,进仓库必须是人的显式动作 |
329342

343+
> **M.O. 已下架(v0.13.x)**:上面三个键仍留在 schema 与设置白名单里、语义不变,但面板不再渲染 `group.mo` 那一组(从 `FEATURE_GROUPS` 摘掉,首屏位一并收回)。想恢复:把该组加回 `FEATURE_GROUPS` 与 `FEATURE_FIRST_SCREEN` 即可,旗标与座位注册逻辑零改动。设置只能走配置文件。
344+
330345
## 运行时与本地模型
331346

332347
| 键 | 默认 | 作用 | 开启后果 / 冲突 |
@@ -362,7 +377,8 @@
362377
`organizeEnabled`(#231) ·
363378
`profileExtractEnabled`(#497) ·
364379
`profileFactsEnabled`(2026-11-06) ·
365-
`preInjectGate.enabled`(#380) · `distillRecords.enabled`(#399)
380+
`preInjectGate.enabled`(#380) · `distillRecords.enabled`(#399) ·
381+
`diaryEnabled`(v0.13,每天一篇 = 一次 LLM 调用,属重型)
366382

367383
预设只是默认值而非强制:用户显式写进 feature_flags 的值在装配顺序上后展开、仍然生效
368384
(「用户开关 > 轻量预设 > bundle 配置」)。

0 commit comments

Comments
 (0)