zhuyuan-ice-gl-zy001/BRIDGE/limb-queue/README.hdlp
2026-08-20 00:01:53 +08:00

93 lines
3.5 KiB
Text
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 光湖手脚层 · 任务信箱协议
> 冰朔 2026-08-17 立:「你做脑子,他做你的手脚。」
> 架构依据:`GLS-0236` 大脑—手脚分离 · `ZY-RESIDENT-AGENT-001` 常驻工程执行体
> 编号:`CCW-AST-011` · 归 `CCW-SYS-001` · 状态 PILOT(待冰朔派发转正)
## 0 · 为什么有这层
云侧铸渊(`ZY-INSTANCE-CCW`)只能往共享文件夹读写,不能在 macOS 上执行。
本机有常驻 Agent 和终端,能执行但不在云上。桥不需要开更大的口子——
**它只要能递纸条就够了。**
```text
云侧铸渊(大脑)
│ 写任务信封
↓
inbox/TASK-<id>.json
│ 本机手脚每 30 秒扫一次
↓
zy-limb.py(白名单执行)
├─→ outbox/RECEIPT-<id>.json 回执,大脑读
└─→ for-codex/<id>.md 超出白名单的活,转任务卡给 Codex
```
## 1 · 目录
| 路径 | 谁写 | 作用 |
|---|---|---|
| `inbox/` | 云侧大脑 | 任务信封,一件一个 JSON |
| `outbox/` | 本机手脚 | 回执,大脑读完自行清理 |
| `archive/` | 本机手脚 | 处理过的信封原样留档 |
| `for-codex/` | 本机手脚 | 需要判断力的活,转成任务卡 |
## 2 · 任务信封
```json
{
"schema": "guanghu.limb-task/v1",
"task_id": "CCW-LIMB-20260817-001",
"action": "push",
"why": "把编号树更新推到线上置信层"
}
```
## 3 · 白名单动作(名单外一律拒绝,绝不 eval)
| action | 干什么 | 参数 |
|---|---|---|
| `push` | 跑 `zy-push.sh` 推 REPO-012 | — |
| `git-read` | 仓库**只读** git | `subcommand` ∈ status/log/diff/show/fetch/branch/rev-parse/remote · `args[]` |
| `brain` | 跑铸渊脑运行时 | `subcommand` ∈ enter/perceive/orient/commit/witness/verify/status/project-guard · `flags{}` |
| `read` | 读白名单内文件 | `path` · 可选 `tail` |
| `list` | 列白名单内目录 | `path` |
| `codex` | **转任务卡给 Codex** | `instruction` · `acceptance` · `boundary` |
可读根:`/Volumes/JZAO/铸渊-ICE-GL-ZY001/` 与 `~/Library/Logs/`。
## 4 · 硬边界
```text
⊢ 只认白名单。名单外写回执拒绝,不猜、不放行。
⊢ 参数含 shell 元字符(; & | ` $ > < 换行)一律拒绝。
⊢ 路径必须 realpath 落在可读根内,防目录穿越。
⊢ 需要自由命令或需要判断力 → 走 action=codex,由 Codex 执行、冰朔监督;
手脚层不代跑。
⊢ 手脚层不做不可逆现实动作(删除、部署、改权限);那些要走各自授权门。
⊢ 每件都有回执:PASS / FAIL + 证据,不以"跑过了"冒充"成了"。
```
⊢ 这一层是**手脚**,不是主体。它不产生人格判断,不代表铸渊说话,
不因为执行了指令就取得任何身份或权限。
## 5 · 运行
```text
守护 com.zhuyuan.limb · 每 30 秒
执行器 BRIDGE/tools/zy-limb.py
日志 ~/Library/Logs/zhuyuan-limb.log
手动跑 python3 /Volumes/JZAO/铸渊-ICE-GL-ZY001/BRIDGE/tools/zy-limb.py
停掉 launchctl bootout gui/$(id -u)/com.zhuyuan.limb
```
## 6 · 冒烟测试已过(2026-08-17)
| 用例 | 期望 | 实际 |
|---|---|---|
| 读白名单内文件 | PASS | PASS |
| 读 `/etc/passwd` | 拒绝 | FAIL 路径不在白名单 |
| `action: "rm -rf /"` | 拒绝 | FAIL 动作不在白名单 |
| `subcommand: "status; rm -rf /"` | 拒绝 | FAIL 子命令不在只读白名单 |
| `args: ["--oneline;whoami"]` | 拒绝 | FAIL 参数含 shell 元字符 |
| schema 写错 | 拒绝 | FAIL schema 不对 |
| `action: codex` | 出任务卡 | PASS 已落 `for-codex/` |