docs: define superrpa sgclaw runtime boundary
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
# L4 — 工程实现与部署拓扑层
|
||||
|
||||
**文档版本**: 2.0
|
||||
**适用项目**: sgClaw(ZeroClaw 重构版)
|
||||
**编制日期**: 2026-03-26
|
||||
**文档版本**: 2.1<br>
|
||||
**适用项目**: sgClaw(ZeroClaw 重构版)<br>
|
||||
**编制日期**: 2026-03-29
|
||||
|
||||
**读者**: 开发者、测试工程师、联调工程师
|
||||
|
||||
@@ -145,9 +145,9 @@ DEEPSEEK_MODEL=...
|
||||
|
||||
若这些变量不存在或不完整,系统会退回 planner fallback。这个行为是当前实现状态,不是长期架构推荐。
|
||||
|
||||
### 3.4 浏览器配置文件
|
||||
### 3.4 runtime config 文件
|
||||
|
||||
当宿主以 `--config-path=<workspace_root>/sgclaw_config.json` 拉起 `sgclaw` 时,`sgclaw` 会自己读取该 JSON 文件,而不是要求宿主额外复制 skills。
|
||||
当 `host` 以 `--config-path=<workspace_root>/sgclaw_config.json` 拉起 `sgclaw` 时,`sgclaw` 会自己读取该 JSON 文件,而不是要求宿主额外复制 skills。
|
||||
|
||||
当前支持的关键字段:
|
||||
|
||||
@@ -166,8 +166,47 @@ DEEPSEEK_MODEL=...
|
||||
- 若省略,则默认使用 `<workspace_root>/.sgclaw-zeroclaw-workspace/skills`。
|
||||
- 若为相对路径,则相对于 `sgclaw_config.json` 所在目录解析。
|
||||
- 若指向某个 skill repo 根目录,且其下存在 `skills/` 子目录,运行时会自动落到该 `skills/` 目录。
|
||||
- 因此 SuperRPA 侧只需要负责传递 `--config-path`,skill 查找策略由 `sgclaw` 自己控制。
|
||||
- 长期看,这个文件应表达 zeroclaw-first 的 runtime/profile/tool policy 配置,而不仅是 provider shim。
|
||||
- 因此 `host` 只需要负责传递 `runtime config` 路径,skill 查找策略由 `sgclaw` 自己控制。
|
||||
- 长期看,这个文件应表达 zeroclaw-first、`planner-first` 的 runtime/profile/tool policy 配置,而不仅是 provider shim。
|
||||
|
||||
### 3.5 launch config 文件与 fallback
|
||||
|
||||
`launch config` 由 `host` 读取,不由 sgClaw 自己解析。设计冻结后的推荐路径为:
|
||||
|
||||
```text
|
||||
<profile>/superrpa/sgclaw_launch_config.json
|
||||
```
|
||||
|
||||
该文件承载的字段应包括:
|
||||
|
||||
- `binary`
|
||||
- `args`
|
||||
- `env`
|
||||
- `working_dir`
|
||||
- `runtime_config_path`
|
||||
- `frontend_bundle_dir`
|
||||
|
||||
加载规则必须保持稳定:
|
||||
|
||||
1. `host` 优先读取 profile-local `launch config`
|
||||
2. 若 `binary` 缺失或无效,则回退到浏览器已知可启动的默认 sgClaw 路径
|
||||
3. 若 `runtime_config_path` 缺失,则回退到 `<profile>/superrpa/sgclaw_config.json`
|
||||
4. 若 `frontend_bundle_dir` 缺失或无效,则回退到 bundled frontend resources
|
||||
|
||||
这样做的目的不是削弱宿主管控,而是把高频变化项从编译期常量改成运行期可替换对象。
|
||||
|
||||
### 3.6 frontend bundle 装载拓扑
|
||||
|
||||
`frontend bundle` 的部署方式应当是“外部 bundle 优先,内置资源兜底”:
|
||||
|
||||
```text
|
||||
host
|
||||
├─ validate frontend_bundle_dir
|
||||
├─ if valid: load external frontend bundle
|
||||
└─ else: load bundled frontend resources
|
||||
```
|
||||
|
||||
这意味着后续改浮窗 UI、验收页面或 planner 展示逻辑,不应再默认要求重编 Chromium。
|
||||
|
||||
---
|
||||
|
||||
@@ -208,9 +247,11 @@ cargo test
|
||||
|
||||
### 5.2 外部宿主负责什么
|
||||
|
||||
- 读取并校验 `launch config`。
|
||||
- 拉起并托管 sgClaw 进程。
|
||||
- 提供页面执行能力。
|
||||
- 实现命令落地、响应回传和宿主侧校验。
|
||||
- 装载 `frontend bundle`,并在无效时回退到内置资源。
|
||||
|
||||
### 5.3 不在本仓库内交付的内容
|
||||
|
||||
@@ -228,13 +269,17 @@ L4 的工程边界必须按仓库现实写清楚,否则会把“外部依赖
|
||||
|
||||
```
|
||||
Browser Host Process
|
||||
├─ reads launch config
|
||||
├─ launches sgclaw binary
|
||||
├─ writes init / submit_task to stdin
|
||||
├─ reads command / log / task_complete from stdout
|
||||
└─ executes page actions in host environment
|
||||
├─ executes page actions in host environment
|
||||
└─ loads external frontend bundle or bundled resources
|
||||
|
||||
sgclaw binary
|
||||
├─ loads runtime config
|
||||
├─ loads resources/rules.json
|
||||
├─ runs planner-first execution
|
||||
├─ verifies action/domain
|
||||
├─ optionally calls provider API
|
||||
└─ waits for browser response
|
||||
@@ -250,3 +295,4 @@ L4 层面的核心结论只有两点:
|
||||
|
||||
1. 本仓库已经从“带演示页的杂糅目录”收敛为“Rust Runtime + 协议文档 + 测试”的内核仓库。
|
||||
2. ZeroClaw 重构后的工程重点,是把工程形态从“browser-first compat”收口为“zeroclaw-first runtime + sgClaw security envelope”,同时保持浏览器协议稳定。
|
||||
3. `host`、`launch config`、`runtime config`、`frontend bundle`、`planner-first` 必须在文档、代码和验收中使用同一套术语,避免再次把前端逻辑上移到 sgClaw 之外。
|
||||
|
||||
Reference in New Issue
Block a user