docs: unify terminology — Percept/Understand/Execute + 一切皆业

This commit is contained in:
2026-04-14 15:33:46 +00:00
parent 36fd007573
commit 84a5e58c52
2 changed files with 41 additions and 11 deletions
+14 -8
View File
@@ -65,23 +65,29 @@ pulse/
## 架构
### 核心三原语
### 核心三原语:Percept → Understand → Execute
```
Collector(感知)→ Rule(认知)→ Executor(行动)
Percept(感知)→ Understand(认知)→ Execute(行动)
```
- **Collector = Watcher**:持续采集外部状态,写 vitals
- **Rule = 洋葱中间件**:`(prev, curr, inner) => [effects, tickMs]`
- **Executor = Effect handler**:执行 effects 产生的动作
| 层 | 英文 | 组件 | 输出 | 佛教映射 |
|---|---|---|---|---|
| **感知** | Percept | Watchers(六处) | Events(六入,按 sense 分类) | 六处触尘 |
| **认知** | Understand | Rules | Effects(序列化的行动参数) | 受想行 |
| **行动** | Execute | Executors | Events(执行结果) | 身口意业 |
**一切皆业**:Percept / Tick / Execute 都写 events。Events 是不可变的业的记录。
> Effects 不是行动本身,是行动的描述——序列化的参数,由 Executor 解释执行。
### 双层驱动
```
Autonomic 层(vitals.db)
Watchers 每 5s 采集 → 写 vitals → 唤醒判定 → wakeTick()
Percept 层(vitals.db)
Watchers 每 5s 感知 → 写 vitals → 唤醒判定 → wakeTick()
Tick 层(events.db) 中断 sleep
Understand + Execute 层(events.db) 中断 sleep
rebuildSnapshot → Rule Chain(洋葱)→ Executors
└── 被 timer 或 wakeTick 唤醒
```