docs: unify terminology — Percept/Understand/Execute + 一切皆业
This commit is contained in:
@@ -6,17 +6,29 @@ Agent 的自主神经系统。
|
||||
Rule = (prev, curr, inner) => Promise<[Effect[], tickMs]>
|
||||
```
|
||||
|
||||
有状态响应式循环:持续感知 → 认知判断 → 自主行动。确定性任务自己做,不确定才上报 Agent。
|
||||
有状态响应式循环:**Percept → Understand → Execute**。确定性任务自己做,不确定才上报 Agent。
|
||||
|
||||
## 三原语
|
||||
|
||||
| 层 | 英文 | 组件 | 输出 | 佛教映射 |
|
||||
|---|---|---|---|---|
|
||||
| **感知** | Percept | Watchers(六处) | Events(六入,按 sense 分类) | 六处触尘 |
|
||||
| **认知** | Understand | Rules | Effects(序列化的行动参数) | 受想行 |
|
||||
| **行动** | Execute | Executors | Events(执行结果) | 身口意业 |
|
||||
|
||||
**一切皆业**:Percept / Tick / Execute 都写 events。Events 是不可变的业的记录。
|
||||
|
||||
> Effects 不是行动本身,是行动的描述——序列化的参数,由 Executor 解释执行。
|
||||
|
||||
## 架构
|
||||
|
||||
```
|
||||
Autonomic 层(vitals.db) Tick 层(events.db)
|
||||
Percept 层(vitals.db) Understand + Execute 层(events.db)
|
||||
Watchers → 写 vitals → 唤醒判定 rebuildSnapshot → Rule Chain → Executors
|
||||
└── wakeTick() ──────────────→ 提前唤醒 tick
|
||||
```
|
||||
|
||||
**双层驱动**:Watchers 每 5s 采集写 vitals,关键事件提前唤醒 tick。Tick 层重建 snapshot,跑 Rule Chain 产生 effects,Executors 执行。
|
||||
**双层驱动**:Watchers 每 5s 感知写 vitals,关键事件提前唤醒 tick。Tick 层重建 snapshot,Rules 认知产生 effects,Executors 执行。
|
||||
|
||||
**洋葱 Rule 模型**:每个 Rule 接收 `inner`(剩余 rule chain),可以放行、bypass(跳过内层)、修饰结果、变换 snapshot。保命 rules 硬编码在最外层,agent 的业务 rules 在内层。
|
||||
|
||||
@@ -59,6 +71,18 @@ upulse daemon start
|
||||
|
||||
## 核心概念
|
||||
|
||||
### 三原语:Percept → Understand → Execute
|
||||
|
||||
| 层 | 英文 | 组件 | 输出 | 佛教映射 |
|
||||
|---|---|---|---|---|
|
||||
| **感知** | Percept | Watchers(六处) | Events(六入,按 sense 分类) | 六处触尘 |
|
||||
| **认知** | Understand | Rules | Effects(序列化的行动参数) | 受想行 |
|
||||
| **行动** | Execute | Executors | Events(执行结果) | 身口意业 |
|
||||
|
||||
**一切皆业**:Percept / Tick / Execute 都写 events。Events 是不可变的业的记录。
|
||||
|
||||
> Effects 不是行动本身,是行动的描述——序列化的参数,由 Executor 解释执行。
|
||||
|
||||
### Rule(洋葱中间件)
|
||||
|
||||
```typescript
|
||||
|
||||
Reference in New Issue
Block a user