Skip to content

Commit 11b765b

Browse files
authored
Merge branch 'main' into feat/panel-memory-entity-ux
2 parents 018a075 + ba6cde9 commit 11b765b

8 files changed

Lines changed: 939 additions & 917 deletions

File tree

‎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-1836%20passed-3E63DD?style=flat-square" alt="tests"></a>
13+
<a href="https://github.com/slow-stack/mneme"><img src="https://img.shields.io/badge/tests-1869%20passed-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>
@@ -209,7 +209,7 @@ dsh-mneme-serve # 默认 ~/.dsh/memory + 127.0.0.1:8790
209209

210210
```bash
211211
cd dsh-mneme && npm install
212-
npm test # 1836 个测试
212+
npm test # 1869 个测试
213213
npm run stress # 三轴线压测
214214
npm run sync # src → lib 同步
215215
```
@@ -430,7 +430,7 @@ Community projects that wire mneme into more platforms — not part of this repo
430430

431431
```bash
432432
cd dsh-mneme && npm install
433-
npm test # 1836 tests
433+
npm test # 1869 tests
434434
npm run stress # three-axis stress test
435435
npm run sync # src → lib sync
436436
```

‎dsh-mneme/CHANGELOG.md‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
## [Unreleased]
44

5+
## [0.9.0] - 2026-10-17
6+
57
## 🆕 新增
68

79
- **M.O. 给图留一个出口:绕行、候选分层与「跳过 ≠ 绕开」(beta)**:一个只会被照着走的图会让 agent 失去自主性——它要么**沉默地服从**(照着走,做错了也不知道错在哪),要么**沉默地偏离**(觉得不适用就跳了,不记账,没人知道这次执行了几成)。一条规矩如果没留出口,走不通的人不会遵守它,会自己凿一个**而且不告诉你**。所以图上必须有一扇合法的逃生门:agent 判断「这条路这次可能不对」时,能按风险档决定记账先走还是停下问人。分界是一句话:**护栏,不是轨道**——允许偏离,但偏离要响。**分档(2026-10-16 拍板 B 档)**:自报 R0/R1 **且**不跨闸门 **且**兜底清单没命中 → `decidedBy: "model"`,**记账先走**;其余 → `"human"`,**停下等点头**。一句话:**自主性住在 R0/R1,刚性只住在它必须住的地方。** 三条各自独立、都要过:① 风险档是自报的,单靠它不够;② **兜底清单**(`IRREVERSIBLE_PATTERNS`)机械匹配、**不看自报**——自报说 R0 但命令里有 `git push` 照样拦,这是「模型在自己上下文里给自己打分不可靠」的直接应用,不是不信任而是**不给单点判断**(清单可审计可 diff 可追责,让模型再判一次只是把同一个错误问两遍);③ **闸门保护**——这条绕行如果走下去、图上某个 `gate` 会永远不被经过就拦住,**与风险档无关**(闸门本来就放在「错了很难撤」的地方,绕开它等于把安全阀绕掉,哪怕全是只读动作)。**两条路由读的是两处不同的东西**:`/pipeline` 读定稿(住仓库、可提交可 review),`/candidates` 读候选(住 `<memoryDir>/candidates/<项目键>/`、只在本地)。候选不进仓库是刻意的:它是草稿,一天可能长十条死九条,进仓库就是垃圾、也会被当成规程引用。**候选是定稿的唯一入口,定稿只放人亲手批过的东西**——这正是「一个会自己起草 SOP 的学徒」那句的字面意思。`<项目键>` 取「目录名 + 路径哈希前 8 位」:同一项目每次算到同一个键,但不把绝对路径写进文件名(那里面是本机用户名)。**升格两条都要满足**:走过两次(至少一次 `worked`——「复用第二次才算类型,第一次只是实例」)**且**写得出反事实;够格之后系统**提议**、不自己写进仓库(提交是 R1、推送是 R2,分开两档、人始终握着一道),`promoteCandidate()` 只返回内容不写盘,补出来的东西照样要过 `validatePipeline`——**升格不是降低标准,是补齐标准**。**怎么死**:只走过 1 次且 30 天没再被走到 → 归档(`dropped`,**文件留着**当负清单的邻居);`failed` 直接进负清单(走不通是知识);人否掉记理由。候选不需要人维护——它只增不减地长,死掉的是「没被再走到」的那些。**「跳过」与「绕开」是两个指标,这一版把它们分开了**:跳过 = 这次不用这一步(≥3 次 → 提议删掉**这一步**);绕开 = 这条路整个不对(≥3 次 → 提议重看**这条路径**)。混在一起数,两种提议就都发不出来。**绕行不给节点染色**——被绕开不等于这一步坏了(可能只是这次不需要),染色留给真正被推翻过的 `refuted`(唯一有硬判据的信号)。**四处只有实机才现形的坑**:① 兜底清单第一版把**工具名当成动作**,于是 `gh pr view`(只看一眼 PR)也被拦下,直接毁掉「自主性住在 R0/R1」——工具名 + **子命令**才是动作,条目因此拆成 `commands`/`requires`/`forbids` 三层;② `requires` 与 `forbids` 的语义不能混:**requires 表达「必须出现才算数」,forbids 表达「出现就排除」**,对「默认安全、显式才危险」的动作(`gh api` 不写方法时是 GET)只能用 requires,用 forbids 表达「默认安全」会让只读调用被误拦;③ 三种处置第一版写成 `if/else if`,**绕行把跳过吃掉了**——一次绕行很可能同时是「这一步这次没用」+「从这里岔出去了」,两件事驱动的提议不同,吞掉一个就少一条提议,改成各自独立累加;④ **变异验证本身会假绿**:`node --test --test-name-pattern` 在**零匹配时照样报 pass**,拿断言里的提示语当用例名跑,得到的是「变红 ✗」的假象(同类的还有「只查最终树的冲突标记」)。**边界(写在契约的 `boundaries` 里,免得以后有人以为忘了做)**:`autoPromote: false` / `autoApprove: false` / `injectIntoMemory: false`——不做自动升格、不做绕行自动批准、不把候选塞进注入路径,也不做「图自动重写」(图的变化一律经过提议 + 人批,回写是新版本)。**执行侧仍未开始**:所以这一版只有判定与落账的代码,**没有触发绕行的地方**,提议与批准的动作也还没有落点。回归锁 24 条进新增的 `test/candidates.test.js`(分档、兜底清单的 34 条子命令判定、requires/forbids 语义、项目键不含绝对路径、候选按形状归并、两次才够格、失败留痕、归档不删文件、升格必须过 `validatePipeline`),另 7 条进 `test/pipeline.test.js`(跳过与绕开分开计数、绕行不染色、两种提议互不吞并、`suggestions` 字段必须在、候选路由与三条边界);**关键规则逐条变异验红**(兜底失效、闸门失效、子命令不分、候选不归并、reason 不再是硬要求、升格跳过校验、归档改成删文件、绕行吃掉跳过——各自精确红对应那一条)。

‎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-1836%20passed-success)](https://github.com/slow-stack/mneme)
8+
[![tests](https://img.shields.io/badge/tests-1869%20passed-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)
@@ -618,7 +618,7 @@ src/
618618
├── api.js # HTTP 路由(Web 面板数据通道,含 /conflicts 冲突队列)
619619
└── index.js # 插件接线
620620
lib/ # src 的同步分发产物(npm run sync;发布前由 root prepack 的 check-sync.js 校验一致性;唯一手写例外 lib/client.js——Web 面板 bundle,sync 不覆盖)
621-
test/ # 1836 个 node:test 测试(审计与三轴线压测不变量;src↔lib 一致性由 scripts/check-sync.js 发布闸门校验)
621+
test/ # 1869 个 node:test 测试(审计与三轴线压测不变量;src↔lib 一致性由 scripts/check-sync.js 发布闸门校验)
622622
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 运行时清单
623623
```
624624
@@ -627,7 +627,7 @@ scripts/ # e2e-dsh.js 端到端演示 · stress-dsh.js 三轴线压
627627
```bash
628628
cd dsh-mneme
629629
npm install # 安装 peer 依赖(以 devDependencies 形式,用于本地测试)
630-
npm test # 运行 1836 个测试
630+
npm test # 运行 1869 个测试
631631
npm run stress # 三轴线压测:长会话检索 / 冲突仲裁 / 多 Agent 并发(离线 mock LLM)
632632
npm run sync # 把 src/ 同步到 lib/(发布时由 prepack 钩子自动执行)
633633
```

0 commit comments

Comments
 (0)