docs: add capability plugin architecture to README
This commit is contained in:
parent
9f2294bf6e
commit
17550199f6
42
README.md
42
README.md
@ -112,13 +112,14 @@ PI_CODING_AGENT_DIR=/tmp/pi-agent \
|
||||
|
||||
### 4.1 分层与依赖方向
|
||||
|
||||
```text
|
||||
Pi Runtime
|
||||
→ Pi Extension / Composition Root
|
||||
→ Diagnosis Core
|
||||
→ Core 拥有的稳定合同
|
||||
← Product / Peripheral / Capability 实现
|
||||
← SSH Transport / Persistence / Knowledge 实现
|
||||
```mermaid
|
||||
graph TD
|
||||
Runtime["Pi Runtime"] --> Ext["Pi Extension / Composition Root"]
|
||||
Ext --> Core["Diagnosis Core<br/>capability-agnostic"]
|
||||
Core --> Contracts["Core-owned stable contracts"]
|
||||
Profiles["Product / Peripheral Profiles<br/>declarative data"] -.->|implements| Contracts
|
||||
Caps["Capability Plugins<br/>Inspectors / Parsers"] -.->|implements| Contracts
|
||||
Infra["SSH Transport / Persistence / Knowledge"] -.->|implements| Contracts
|
||||
```
|
||||
|
||||
核心规则:
|
||||
@ -128,7 +129,30 @@ Pi Runtime
|
||||
- Profile 是声明式数据;Capability 拥有领域 Inspector/Parser;Infrastructure 实现端口,不产生诊断结论。
|
||||
- 共享代码只有一个明确所有者;跨模块协作通过稳定 ID 和经过校验的 schema。
|
||||
|
||||
### 4.2 运行时主流程
|
||||
### 4.2 能力插件体系(Capability Plugin Architecture)
|
||||
|
||||
诊断推理框架是通用的,但具体的检测能力以 **Capability 插件**形式接入。当前唯一完整插件是 Camera;Core 不包含任何产品/外设特判。
|
||||
|
||||
| 关注点 | Core 负责 | Capability 插件负责 |
|
||||
|---|---|---|
|
||||
| 状态机与实体 | ✅ Diagnosis/Action/Observation/Evidence/Hypothesis | ❌ 不拥有状态机 |
|
||||
| 证据门与结论门槛 | ✅ EvidenceGate 统一校验 | ❌ 不能放宽 |
|
||||
| 执行安全 | ✅ 审批、Policy、fail-closed 守护链 | ❌ 只能提供固定命令模板 |
|
||||
| 领域检查 | ❌ 不知道 S100/GS130W/Camera | ✅ Inspector、Parser、领域知识 |
|
||||
|
||||
新增一个外设能力(以 WiFi 为例)的扩展路径:
|
||||
|
||||
```text
|
||||
1. src/profiles/ 增加 WiFi 相关 Product/Peripheral Profile 声明
|
||||
2. src/capabilities/wifi/ 实现 Inspector + Transport + Parser
|
||||
3. knowledge/ 增加 WiFi 诊断规则与历史案例
|
||||
4. extensions/rdk-diagnose.ts 注册 rdk_diag_wifi_* 语义工具
|
||||
5. src/journeys/ 如需高层自动化,新增 wifi-diagnosis.ts
|
||||
```
|
||||
|
||||
关键约束:**插件只能决定“能查什么”,不能放宽“能下什么结论”或“能执行什么风险操作”。** 所有插件都受同一套 EvidenceGate、审批和 fail-closed 守护链约束。
|
||||
|
||||
### 4.3 运行时主流程
|
||||
|
||||
```text
|
||||
Preparation Flow:
|
||||
@ -152,7 +176,7 @@ Recovery Flow:
|
||||
→ 从当前暂停边界继续,不重复执行已完成 Action
|
||||
```
|
||||
|
||||
### 4.3 目录结构
|
||||
### 4.4 目录结构
|
||||
|
||||
| 路径 | 职责 |
|
||||
|---|---|
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user