evolcore 0.0.34 → 0.0.35

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.
Files changed (69) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/bin/install-codex-managed-hooks.mjs +26 -3
  3. package/dist/agents/claude-runner.js +11 -1
  4. package/dist/agents/codex/diagnostics.js +42 -11
  5. package/dist/agents/codex-runner.js +27 -3
  6. package/dist/agents/ecagent-runner.js +17 -7
  7. package/dist/aun/aid/agentmd.js +13 -2
  8. package/dist/aun/aid/client.js +1 -1
  9. package/dist/aun/msg/managed-operation.js +16 -0
  10. package/dist/aun/msg/p2p.js +18 -2
  11. package/dist/channels/aun.js +113 -7
  12. package/dist/cli/aun-commands.js +37 -13
  13. package/dist/cli/daemon-commands.js +10 -4
  14. package/dist/cli/fs-command.js +1 -1
  15. package/dist/cli/getmeta-command.js +211 -0
  16. package/dist/cli/index.js +6 -0
  17. package/dist/cli/managed-command-guard.js +3 -0
  18. package/dist/cli/memory-command.js +46 -15
  19. package/dist/cli/thread-command.js +12 -4
  20. package/dist/config/resolved-config-op.js +25 -8
  21. package/dist/core/auth/operation-authorizer.js +21 -2
  22. package/dist/core/channel-runtime.js +1 -1
  23. package/dist/core/command/command-handler.js +7 -1
  24. package/dist/core/command/menu-handler.js +2 -0
  25. package/dist/core/command/topic-slash.js +4 -7
  26. package/dist/core/event-catalog.js +14 -0
  27. package/dist/core/ipc-registration.js +11 -1
  28. package/dist/core/memory/batch-meta.js +1 -0
  29. package/dist/core/memory/consolidation-context.js +97 -14
  30. package/dist/core/memory/consolidation-trigger.js +15 -7
  31. package/dist/core/memory/consolidation.js +55 -0
  32. package/dist/core/memory/memory-writer.js +20 -4
  33. package/dist/core/message/aun-ipc-sender.js +19 -1
  34. package/dist/core/message/message-bridge.js +3 -3
  35. package/dist/core/message/message-log.js +1 -0
  36. package/dist/core/message/peer-mode.js +17 -0
  37. package/dist/core/message/response-engine.js +15 -4
  38. package/dist/core/permission/ec-command-parser.js +76 -40
  39. package/dist/core/permission/tool-policy.js +32 -2
  40. package/dist/core/relation/peer-identity.js +87 -12
  41. package/dist/core/session/session-manager.js +56 -1
  42. package/dist/core/session/session-title.js +26 -1
  43. package/dist/core/system-session/memory.js +87 -20
  44. package/dist/core/thread/command-parser.js +6 -1
  45. package/dist/core/thread/ipc-operation.js +33 -16
  46. package/dist/core/thread/thread-operation.js +62 -24
  47. package/dist/core/thread/thread-service.js +246 -32
  48. package/dist/utils/cross-platform.js +6 -3
  49. package/kits/docs/evolcore/fs-architecture.md +5 -5
  50. package/kits/docs/evolcore/fs.md +1 -1
  51. package/kits/docs/evolcore/group-collaboration.md +1 -1
  52. package/kits/docs/evolcore/group.md +5 -3
  53. package/kits/docs/evolcore/memory-consolidation.md +1 -2
  54. package/kits/docs/evolcore/memory-tags.md +1 -1
  55. package/kits/docs/evolcore/memory.md +2 -2
  56. package/kits/docs/evolcore/stats.md +1 -1
  57. package/kits/docs/evolcore/thread-chain.md +25 -9
  58. package/kits/eck_manifest.auxiliary.json +9 -0
  59. package/kits/eck_manifest.json +20 -0
  60. package/kits/eck_manifest.memory.json +20 -0
  61. package/kits/rules/01-overview.md +3 -3
  62. package/kits/rules/07-memory-and-thread.md +1 -1
  63. package/kits/skills/ec-group/SKILL.md +6 -3
  64. package/kits/skills/thread-ops/SKILL.md +18 -18
  65. package/kits/templates/memory-consolidation/notes.md +1 -1
  66. package/kits/templates/memory-consolidation/workflow.md +36 -1
  67. package/kits/templates/system-fragments/bash-description.md +9 -0
  68. package/kits/templates/system-fragments/memory.md +2 -2
  69. package/package.json +1 -1
@@ -85,8 +85,8 @@ ec msg history --thread <threadId>
85
85
  ### 新建话题
86
86
 
87
87
  ```bash
88
- ec thread create <peer> --name "项目A需求讨论"
89
- ec thread create <peer> --name "项目A" --label 项目A --status in_progress
88
+ ec thread create <peer> --name '项目A需求讨论'
89
+ ec thread create <peer> --name '项目A' --label 项目A --status in_progress
90
90
  ```
91
91
 
92
92
  创建成功后返回 `threadId`,格式为 `thread-<ms>-<seq4>-<rand4>`(如 `thread-1791028341906-0000-136a`)。创建时会自动向对端发一条系统消息通知。
@@ -94,12 +94,28 @@ ec thread create <peer> --name "项目A" --label 项目A --status in_progress
94
94
  ### 修改话题
95
95
 
96
96
  ```bash
97
- ec thread rename <peer>/<threadId> "新名称"
97
+ ec thread rename <peer>/<threadId> '新名称'
98
+ ec thread rename <peer> '新名称' # 裸 peer 指主会话;等价于 <peer>/main
98
99
  ec thread label <peer>/<threadId> 重要
99
100
  ec thread label <peer>/<threadId> --clear # 清除标签
100
101
  ec thread status <peer>/<threadId> completed # pending|in_progress|completed|archived
101
102
  ```
102
103
 
104
+ 主会话可以改名(落在会话存档的 `name` 字段),但**不能**打标签或改状态——label/status 只对子话题生效。
105
+ `ec thread list` / `show` 里主会话的名称带 `[主会话] ` 前缀,该前缀只在展示层加,不是真实名字。
106
+
107
+ `summary set ... --name` 对主会话同样生效,改名走与 `ec thread rename` 相同的路径。
108
+
109
+ #### 名称长度
110
+
111
+ 正文上限 **80 字符**(按 Unicode 码点计,含空格与标点);加末尾 `...` 后落盘上限 **83 字符**。
112
+ 自动生成与手动改名(`create` / `rename` / `summary set --name`)共用 `session-title.ts` 里的同一组常量。
113
+
114
+ - 长于 80 字符的文本由 `sanitizeSessionTitle` 截为前 80 字符 + `...`;
115
+ - 写入时按 **83 字符**校验(落盘上限),超过即报 `NAME_TOO_LONG`,报错里带上当前长度和上限;
116
+ - 为什么不按 80 拒绝:系统自动生成的话题名最长就是 83 字符,按 80 拒绝会让这些名字「改不回去」;
117
+ - 历史遗留的超长名称原样保留、可正常读取。
118
+
103
119
  `/name` 和 `/rename` 也会同步更新话题索引。
104
120
 
105
121
  ### 删除话题
@@ -147,7 +163,7 @@ ec msg send '<消息内容>' --thread <threadId> --check-every 30m
147
163
 
148
164
  ```bash
149
165
  # A 向 B 的话题 T2 发送任务,并设置周期复查
150
- ec msg send "请处理项目A的数据清洗" --thread thread-T2-xxxx --check-every 2h
166
+ ec msg send '请处理项目A的数据清洗' --thread thread-T2-xxxx --check-every 2h
151
167
  ```
152
168
 
153
169
  **B 接收时感知来源上下文:**
@@ -174,12 +190,12 @@ daemon 不自动总结,需要 agent 主动写入。
174
190
  ec thread summary show <peer>/<threadId>
175
191
 
176
192
  # 写入摘要 —— --name 必填:同时把话题改成这个标题
177
- ec thread summary set <peer>/<threadId> "项目A需求已确认,正在开发登录模块" --name "项目A登录模块"
193
+ ec thread summary set <peer>/<threadId> '项目A需求已确认,正在开发登录模块' --name '项目A登录模块'
178
194
  # 不想改话题名就显式传 -
179
195
  ec thread summary set <peer>/<threadId> '<摘要内容>' --name -
180
196
 
181
197
  # 支持 CAS(乐观锁),防止并发覆盖
182
- ec thread summary set <peer>/<threadId> "新内容" --name - --if-rev 3
198
+ ec thread summary set <peer>/<threadId> '新内容' --name - --if-rev 3
183
199
 
184
200
  # 查看历史版本
185
201
  ec thread summary log <peer>/<threadId>
@@ -206,7 +222,7 @@ ec thread history <peer>/<threadId> --after <coveredThroughTs> --limit 50
206
222
  ec thread history <peer>/<threadId> --before <本页最早一条的ts> --limit 50
207
223
 
208
224
  # 4. 读完增量后写摘要,游标自动推进到当前最新一条
209
- ec thread summary set <peer>/<threadId> "新摘要" --name -
225
+ ec thread summary set <peer>/<threadId> '新摘要' --name -
210
226
  ```
211
227
 
212
228
  **约束**:`summary set` 把游标设为**写入时刻话题的最新一条**,所以跨话题总结必须**先把增量读完再写**——
@@ -263,5 +279,5 @@ ec thread check-index # 同 rebuild-index --check
263
279
  | `TOPIC_CONFLICT` | 同名话题已存在 | 改名或用现有话题 |
264
280
  | `TOPIC_BUSY` | 话题正在处理中 | 等待处理完成后再删除 |
265
281
  | `SUMMARY_CAS_CONFLICT` | 摘要版本冲突 | 重新 `show` 获取最新 rev,再重试 |
266
- | `INVALID_NAME` | 话题名称不合法 | 名称不能为空,不超过 80 字符 |
267
- | `NAME_TOO_LONG` | 话题名称超过 80 字符 | 缩短名称 |
282
+ | `INVALID_NAME` | 话题名称不合法 | 名称不能为空 |
283
+ | `NAME_TOO_LONG` | 话题名称超过 83 字符(正文 80 + 省略号) | 按报错里的当前长度缩写后重试 |
@@ -38,6 +38,15 @@
38
38
  "needsInjection": true,
39
39
  "when": { "var": "baseAgent", "neq": null },
40
40
  "description": "Base Agent 特定配置"
41
+ },
42
+ {
43
+ "id": "bash-description",
44
+ "type": "file",
45
+ "file": "$KITS_FRAGMENTS/bash-description.md",
46
+ "order": 75,
47
+ "needsInjection": true,
48
+ "when": { "var": "baseAgent", "in": ["claude", "ecagent"] },
49
+ "description": "Bash 调用 description 格式:目标描述 + 风险等级标记"
41
50
  }
42
51
  ]
43
52
  }
@@ -444,6 +444,26 @@
444
444
  },
445
445
  "description": "Base Agent 特定配置"
446
446
  },
447
+ {
448
+ "id": "bash-description",
449
+ "type": "file",
450
+ "file": "$KITS_FRAGMENTS/bash-description.md",
451
+ "order": 75,
452
+ "needsInjection": true,
453
+ "when": {
454
+ "and": [
455
+ {
456
+ "var": "baseAgent",
457
+ "in": ["claude", "ecagent"]
458
+ },
459
+ {
460
+ "var": "lifecycle",
461
+ "in": ["active", "bootstrapping"]
462
+ }
463
+ ]
464
+ },
465
+ "description": "Bash 调用 description 格式:目标描述 + 风险等级标记"
466
+ },
447
467
  {
448
468
  "id": "managed-runtime-notice",
449
469
  "type": "file",
@@ -240,6 +240,26 @@
240
240
  "eq": "active"
241
241
  },
242
242
  "description": "会话层:当前会话实例状态"
243
+ },
244
+ {
245
+ "id": "bash-description",
246
+ "type": "file",
247
+ "file": "$KITS_FRAGMENTS/bash-description.md",
248
+ "order": 65,
249
+ "needsInjection": true,
250
+ "when": {
251
+ "and": [
252
+ {
253
+ "var": "baseAgent",
254
+ "in": ["claude", "ecagent"]
255
+ },
256
+ {
257
+ "var": "lifecycle",
258
+ "eq": "active"
259
+ }
260
+ ]
261
+ },
262
+ "description": "Bash 调用 description 格式:目标描述 + 风险等级标记"
243
263
  }
244
264
  ]
245
265
  }
@@ -151,13 +151,13 @@ manifest schema、when 条件、合并覆盖、模板渲染、运行时变量目
151
151
  ## 命令行的引号写法
152
152
 
153
153
  `ec` 命令里的自由文本参数(消息正文、`--desc`、`--prompt`、`--name`、`--question`、
154
- `--reason` 等)**一律用单引号包住**(`'…'`)。
154
+ `--reason` 等)默认**用单引号包住**(`'…'`)。
155
155
 
156
156
  用双引号的话,正文里的反引号(`` ` ``)和 `$` 会被 shell 当作命令替换或变量展开,
157
157
  命令会被拒绝——`ec` 只接受能确认为字面量的命令。
158
158
 
159
- 正文里不要出现半角撇号本身(会提前闭合引号);需要时用 `ʼ`(U+02BC)或 `'`(U+FF07)代替。
160
- 单引号内无法转义单引号,改写措辞也是一种办法。
159
+ **正文本身含单引号时**,改用 bash ANSI-C quoting:`$'…'`。
160
+ 内部支持转义:`\'` `\n` `\t` `\\`。例:`ec msg send $'it\'s fine'`。
161
161
 
162
162
  ## 术语
163
163
 
@@ -82,7 +82,7 @@ ec thread summary show <peer>/<threadId> --self <selfAid>
82
82
  ```bash
83
83
  # 1. 选中目标话题(没有就新建)
84
84
  ec thread list <对方AID> --self <selfAid>
85
- ec thread create <对方AID> --name "问题跟踪" --self <selfAid> # 返回 threadId
85
+ ec thread create <对方AID> --name '问题跟踪' --self <selfAid> # 返回 threadId
86
86
 
87
87
  # 2. 带上话题发送;托管会话中 from/to 由话题推断,--check-every 必填
88
88
  ec msg send '<text>' --thread <threadId> --check-every 5m
@@ -45,7 +45,7 @@ ec group send <selfAid> <groupId> '<text>' [选项]
45
45
  | 选项 | 说明 |
46
46
  |---|---|
47
47
  | `--encrypt` / `--no-encrypt` | 必选一个,跟随收到消息的加密状态;不得省略后依赖默认 |
48
- | `--mention '<aid1>,<aid2>'` | @ 成员。写法固定为单引号包住、逗号分隔多个 aid,可重复传入 |
48
+ | `--mention '<aid1>,<aid2>'` | @ 成员。单引号包住、逗号分隔多个 aid,可重复传入 |
49
49
  | `--mention-all` | @ 所有人 |
50
50
  | `--file <path> [--as image\|video\|voice\|file]` | 发文件 |
51
51
  | `--payload '<json>'` | 附加结构化数据 |
@@ -53,7 +53,7 @@ ec group send <selfAid> <groupId> '<text>' [选项]
53
53
  其它硬约束(同见 `[reply]` 段):
54
54
 
55
55
  - 一次 shell 调用只跑一条完整的 `ec` 命令,不拼接管道、重定向或子 shell。
56
- - 正文一律用半角单引号包住;正文里的双引号、反引号和 `$` 前加反斜杠;半角撇号用 `ʼ`(U+02BC)或 `'`(U+FF07)代替。
56
+ - 正文用单引号包住;正文含单引号时改用 `$'…'` 语法(支持 `\'` `\n` `\t` `\\`)。
57
57
  - **正文必须以引号包住**。正文以 `/` 开头时尤其要注意——Git Bash 会把裸的 `/effort` 当成路径做 MSYS 转换,
58
58
  实际发出去的是 `C:/Program Files/Git/effort`。这不是命令没生效,是正文被 shell 改了。
59
59
  - 一轮任务可能发 0 到多条消息。发成功就继续做剩下的,不要重复发同一条。
@@ -132,6 +132,9 @@ ec group history <selfAid> <groupId> --limit 50 --format json
132
132
 
133
133
  **群结构和角色**:
134
134
 
135
+ 所有 `ec group` 子命令的参数顺序固定为「先发送方 AID,后群 AID」:群 ID 永远在第 2 个位置
136
+ (`ec group members <selfAid> <groupId>`)。写成「群 ID 在前」时命令会报错并给出正确写法。
137
+
135
138
  | 想知道 | 命令 |
136
139
  |---|---|
137
140
  | 群名、群主、成员数、描述 | `ec group info <selfAid> <groupId>` |
@@ -150,7 +153,7 @@ ec group history <selfAid> <groupId> --limit 50 --format json
150
153
  ec fs ls <groupId>:/
151
154
  ec fs stat <groupId>:/path/to/file --format json
152
155
  ec fs cat <groupId>:/path/to/file
153
- ec fs find <groupId>:/ -name "*.md"
156
+ ec fs find <groupId>:/ -name '*.md'
154
157
  ```
155
158
 
156
159
  **先 `ls` 再动别的**。新建的群空间可能是空的,`find` 返回 `[]` 是正常结果,不是命令出错;
@@ -113,11 +113,11 @@ ec thread history <peer>/<threadId> --self <selfAid> --after $SINCE --limit 100
113
113
  ec thread list <C的AID>
114
114
  # 如果有合适的话题(如 T2),记下 threadId
115
115
  # 如果没有,新建:
116
- ec thread create <C的AID> --name "项目进度查询"
116
+ ec thread create <C的AID> --name '项目进度查询'
117
117
  # 返回:{ threadId: "thread-xxx", ... }
118
118
 
119
119
  # 步骤 2:发消息(--check-every 一步搞定复查)
120
- ec msg send "项目当前进度如何?" --thread <T2的threadId> --check-every 5m
120
+ ec msg send '项目当前进度如何?' --thread <T2的threadId> --check-every 5m
121
121
  # --check-every 跨话题时必填(如 5m / 30m / 2h),周期唤醒直到显式 cancel
122
122
  # 返回:{ message_id: "m-yyy", ... }
123
123
  # 副作用:本端写入 thread-inbox + 创建周期复查 Trigger(kind=thread-check)
@@ -148,7 +148,7 @@ ec msg send "项目当前进度如何?" --thread <T2的threadId> --check-every
148
148
 
149
149
  # 步骤 2:决定是否回复
150
150
  # 情况 A:直接回复 B(在当前话题 T2 上)
151
- ec msg send "进度 70%,预计下周完成"
151
+ ec msg send '进度 70%,预计下周完成'
152
152
  # 不带 --thread,消息发在当前话题上
153
153
  # 托管会话中不需要指定 from 和 to,系统推断
154
154
 
@@ -169,14 +169,14 @@ ec thread history current --limit 10
169
169
  # 或从上下文直接判断
170
170
 
171
171
  # 步骤 2A:C 已回复 → 处理回复,汇报回 A
172
- ec msg send "C 回复:进度 70%" --thread <T1的threadId> --check-every 30m
172
+ ec msg send 'C 回复:进度 70%' --thread <T1的threadId> --check-every 30m
173
173
  # 汇报回 A 也是跨话题发送,同样必填 --check-every
174
174
 
175
175
  # 步骤 2B:C 还没回 → 决定下一步
176
176
  # 选项 1:继续等 → 什么都不做,原 Trigger 下个周期会再次唤醒
177
177
  # (如需调整频率:ec trigger update <triggerId> --every 5m)
178
178
  # 选项 2:放弃等待,直接回 A
179
- ec msg send "C 暂无回复" --thread <T1的threadId> --check-every 30m
179
+ ec msg send 'C 暂无回复' --thread <T1的threadId> --check-every 30m
180
180
 
181
181
  # 选项 3:什么都不做,turn 结束
182
182
  ```
@@ -191,8 +191,8 @@ ec msg send "C 暂无回复" --thread <T1的threadId> --check-every 30m
191
191
 
192
192
  ```bash
193
193
  # 步骤 1:同时发出两条委托,各自创建周期复查 Trigger(--check-every 一步搞定)
194
- ec msg send "技术评估" --thread <T2> --check-every 10m
195
- ec msg send "产品评估" --thread <T3> --check-every 10m
194
+ ec msg send '技术评估' --thread <T2> --check-every 10m
195
+ ec msg send '产品评估' --thread <T3> --check-every 10m
196
196
  # turn 结束
197
197
 
198
198
  # 10 分钟后,T2 和 T3 各自触发新 turn
@@ -206,7 +206,7 @@ ec thread history <D的AID>/<T3> --limit 5
206
206
  # 检查 C 是否也回了
207
207
  ec thread history <C的AID>/<T2> --limit 5
208
208
  # C 也回了,合并结果
209
- ec msg send "综合评估:技术……产品……" --thread <T1> --check-every 30m
209
+ ec msg send '综合评估:技术……产品……' --thread <T1> --check-every 30m
210
210
  ```
211
211
 
212
212
  **关键点**:没有"等齐"原语。想合并就在后到的 turn 里主动读另一话题,手动判断是否齐全。
@@ -221,13 +221,13 @@ ec msg send "综合评估:技术……产品……" --thread <T1> --check-ever
221
221
  # S2B 收到 C 的第一次回复:"卡在 Redis 并发问题"
222
222
  # B 判断需要更多细节
223
223
 
224
- ec msg send "Redis 并发问题影响范围多大?"
224
+ ec msg send 'Redis 并发问题影响范围多大?'
225
225
  # 不带 --thread,继续在当前话题上
226
226
  # 同话题追问无需 --check-every(不跨话题,不创建复查 Trigger)
227
227
 
228
228
  # C 再次回复后,触发新 turn
229
229
  # B 整合两轮对话,回 A
230
- ec msg send "C 反馈:Redis 问题影响……" --thread <T1>
230
+ ec msg send 'C 反馈:Redis 问题影响……' --thread <T1>
231
231
  ```
232
232
 
233
233
  ---
@@ -256,8 +256,8 @@ ec thread history <peer>/<threadId> --after <timestamp>
256
256
  ### 流程 G:修改话题属性
257
257
 
258
258
  ```bash
259
- ec thread rename current "新名称"
260
- ec thread label current "开发"
259
+ ec thread rename current '新名称'
260
+ ec thread label current '开发'
261
261
  ec thread status current in_progress
262
262
  # 状态值:pending | in_progress | completed | archived
263
263
  ```
@@ -363,10 +363,10 @@ ec thread summary show current
363
363
  # 2. 自己写摘要(100 字以内,见下方规范)。
364
364
  # 增量就是本轮对话,无需再读历史;游标自动推进。
365
365
  # --name 必填:一次写完摘要 + 标题。不想改名就显式传 `-`。
366
- ec thread summary set current "写好的摘要内容" --name "动词短语描述的核心动作"
367
- ec thread summary set current "写好的摘要内容" --name - # 保持原话题名
366
+ ec thread summary set current '写好的摘要内容' --name '动词短语描述的核心动作'
367
+ ec thread summary set current '写好的摘要内容' --name - # 保持原话题名
368
368
  # 多人协作同一话题时带 CAS 防覆盖
369
- ec thread summary set current "写好的摘要内容" --name "标题" --if-rev <步骤1的rev>
369
+ ec thread summary set current '写好的摘要内容' --name '标题' --if-rev <步骤1的rev>
370
370
  ```
371
371
 
372
372
  **情形 B:从别的话题(或别处)总结某话题**(需要读增量)
@@ -384,7 +384,7 @@ ec thread history <peer>/<threadId> --before <本页最早一条的ts> --limit 5
384
384
  # 翻到覆盖游标之前即可停;注意 before 是闭区间,用 <最早ts - 1> 避免边界重复
385
385
 
386
386
  # 4. 读完增量后写摘要(游标自动推进到现在);--name 必填,不改名传 -
387
- ec thread summary set <peer>/<threadId> "写好的摘要内容" --name "新名称"
387
+ ec thread summary set <peer>/<threadId> '写好的摘要内容' --name '新名称'
388
388
  ```
389
389
 
390
390
  **关键约束**:`summary set` 把游标设为**当时话题的最新一条**,所以跨话题总结**必须先把增量读完再写**。
@@ -470,7 +470,7 @@ ec thread summary show $PEER/<threadId> --self $SELF
470
470
 
471
471
  2. **不要忘记创建 Trigger**:如果不创建,对端不回复时你永远不会知道。分支合并场景必须用 Trigger。
472
472
 
473
- 3. **不要在托管会话中手动指定 from 和 to**:`ec msg send "文本" --thread T2` 就够了。
473
+ 3. **不要在托管会话中手动指定 from 和 to**:`ec msg send '文本' --thread T2` 就够了。
474
474
 
475
475
  4. **不要把 Trigger 当作"强制回复"或"执行脚本"**:Trigger 只是唤醒信号,到期后 agent 自主决定下一步。
476
476
 
@@ -487,6 +487,6 @@ ec thread summary show $PEER/<threadId> --self $SELF
487
487
  3. **Trigger 是唤醒信号,不是执行脚本**:到期时提醒检查,不指示执行任何操作,不保证对端已回复。
488
488
  4. **决策权在自己**:收到委托要不要回、何时回、回什么,完全自主判断。
489
489
  5. **分支合并靠主动查询**:想等多个对端都回,就在各自 turn 里用 `ec thread history` 读另一话题。
490
- 6. **from/to 托管会话中不需要**:会话唯一确定对端,命令简化为 `ec msg send "文本" --thread T`。
490
+ 6. **from/to 托管会话中不需要**:会话唯一确定对端,命令简化为 `ec msg send '文本' --thread T`。
491
491
  7. **话题名是本端的**:对端可能改名,threadId 才是跨端统一标识。
492
492
 
@@ -49,7 +49,7 @@ ec memory update consolidated/20261002-090000-refactor-plan.md --tags 'rule,done
49
49
 
50
50
  ### ④ 不值得长期保留 → 丢弃
51
51
 
52
- 一次性任务的进展、临时状态、闲聊内容。什么都不用写。
52
+ 一次性任务的进展、临时状态、闲聊内容。不写记忆,在反馈里列出丢弃了哪几条、为什么丢弃。
53
53
 
54
54
  ## 什么时候打升级标记
55
55
 
@@ -11,6 +11,40 @@
11
11
  5. **反馈**。结束前必须把本次整理的结果写到任务书给出的反馈文件路径(见下)。
12
12
  6. **结束**。写完直接结束,不需要在会话里汇报「已完成」——反馈由程序读取反馈文件后投递。
13
13
 
14
+ ## 工具使用约束
15
+
16
+ 整理会话的读取范围限于:**批次目录**、**关系记忆目录**(processing/、consolidated/、MEMORY.md)、**本次会话消息流水**。当前工作目录(cwd)本身不可读。
17
+
18
+ **只读工具的正确用法:**
19
+
20
+ - **Read**:传绝对路径,路径必须在可读范围内
21
+ ```
22
+ Read file_path=<任务书里给出的 consolidatedDir>/xxx.md
23
+ ```
24
+
25
+ - **Glob**:`path` 参数必填且必须是绝对路径(不传时起点是 cwd,会被拒绝)
26
+ ```
27
+ Glob path=<任务书里的 processingDir> pattern=*.md
28
+ ```
29
+
30
+ - **Grep**:`path` 参数必填且必须是绝对路径
31
+ ```
32
+ Grep path=<任务书里的 consolidatedDir> pattern=关键词
33
+ ```
34
+
35
+ - **Bash**:仅允许 `ec memory create|update|archive` 单条命令,或落在批次目录内的只读查询(不能拼接命令)
36
+ - ✅ 允许:`ec memory create --scope relation --slug xxx '...'`
37
+ - ✅ 允许:`ls "<批次目录>/threads"`(单条、绝对路径、无拼接)
38
+ - ❌ 不允许:`cd ... && ls ...`(用绝对路径代替 cd)
39
+ - ❌ 不允许:`ls ... 2>&1`(不需要,工具会同时收两路输出)
40
+ - ❌ 不允许:`ls "..."/*`(通配符不支持,用 Glob 代替)
41
+ - ❌ 不允许:`cmd1 && cmd2 && cmd3`(只允许单条命令或两条只读命令用 && 连接)
42
+
43
+ **任务书里已给出的可读路径**(复制粘贴即可):
44
+ - 批次目录:本次任务初始消息里的 `整理上下文文件路径` 的父目录
45
+ - processingDir / consolidatedDir / indexPath:任务书「整理目标」章节里列出
46
+ - 消息流水:任务书里的 `historyJsonlPath`(如有)
47
+
14
48
  ## 写入前必须先查重
15
49
 
16
50
  **先读目标作用域的 `MEMORY.md` 索引**,看已有条目的描述和关键词。
@@ -30,7 +64,7 @@
30
64
  - 会话内因上下文压缩会丢失的关键信息。
31
65
  - 对端明确表达过的态度。
32
66
 
33
- 不值得写的:一次性任务的进展、临时状态、闲聊内容。直接丢弃,不用写任何东西。
67
+ 不值得写的:一次性任务的进展、临时状态、闲聊内容。不写记忆,在反馈里说明丢弃了哪些、为什么。
34
68
 
35
69
  ## update 还是 create --replaces
36
70
 
@@ -71,5 +105,6 @@ update 只用于正文不变、状态变了的情况:
71
105
 
72
106
  - 成功 → 移入 `archive/notes/` 留底。
73
107
  - 失败 → 移回 `pending/`,下次重新整理。
108
+ - 认领了 note,却既没写记忆也没写反馈 → 按失败处理,note 移回 `pending/`。
74
109
 
75
110
  程序还会重建索引,并把本次整理的日志(模式、候选、产出)落到 `$EVOLCORE_HOME/memory/consolidation-batches/`。
@@ -0,0 +1,9 @@
1
+ [bash-description] Bash 调用的 description 格式(代码层强制校验)
2
+ 每次调用 Bash 都必须传 description,格式为 `<命令目标描述> [<风险等级>]`:
3
+ - 命令目标描述:一句话说明这条命令要达成什么,不复述命令原文、参数或路径
4
+ - 风险等级:写在末尾的方括号内,取 `低`、`中`、`高` 之一
5
+ - 低:只读,不改变文件、进程或远端状态
6
+ - 中:改变状态但可恢复(写或改工作区文件、安装依赖、构建、本地 git commit)
7
+ - 高:不可逆,或影响超出当前工作区(删除、丢弃未提交改动、git push、发布、终止进程、修改系统配置)
8
+ 示例:`查看工作区未提交的改动 [低]`、`安装项目依赖 [中]`、`推送 main 分支到远端 [高]`
9
+ 缺少目标描述、缺少风险等级标记或标记不在三个等级之内,调用都会被直接拒绝。
@@ -54,7 +54,7 @@ ec memory archive <路径...> # 下线记忆,移入 archi
54
54
 
55
55
  自由文本参数(`--desc`、正文、`--keywords`)用**单引号**包住(`'…'`);
56
56
  用双引号的话,文本里的 `` ` `` 或 `$` 会被 shell 展开,命令被拒。
57
- 单引号内部不要再出现半角撇号;需要时用 `ʼ`(U+02BC)或 `'`(U+FF07)代替。
57
+ 正文本身含单引号时,改用 `$'…'` 语法(ANSI-C quoting),支持 `\'` `\n` `\t` `\\`。
58
58
  | 参数 | 说明 |
59
59
  | --- | --- |
60
60
  | --scope | 必填,只能是本次模式允许的取值(见下表) |
@@ -64,7 +64,7 @@ ec memory archive <路径...> # 下线记忆,移入 archi
64
64
  | --keywords | 可选,串起相关记忆的内容关键词 |
65
65
  | --replaces | 可选,要替换的旧文件,自动归档。合并、纠正、升格作用域都走它,是唯一的防重复手段 |
66
66
 
67
- `--tags`、`--keywords`、`--replaces` 的值一律写成**单引号包住、逗号分隔**:`--tags 'rule,long-term'`、`--replaces 'consolidated/a.md,consolidated/b.md'`。
67
+ `--tags`、`--keywords`、`--replaces` 的值写成单引号包住、逗号分隔:`--tags 'rule,long-term'`、`--replaces 'consolidated/a.md,consolidated/b.md'`。
68
68
 
69
69
  **模式与允许的** `--scope`(越权会被 daemon 拒绝):
70
70
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "evolcore",
3
- "version": "0.0.34",
3
+ "version": "0.0.35",
4
4
  "description": "AI Agent gateway connecting Claude, Codex, Gemini, and the bundled ecagent runner to messaging channels with multi-project session management",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",