docs: 固化 HWLAB 基线承接 SPEC

This commit is contained in:
Codex
2026-06-01 13:07:11 +08:00
parent 6d1fe9b2cf
commit 4efae91e42
6 changed files with 117 additions and 1 deletions
+13 -1
View File
@@ -34,6 +34,18 @@ P0 最小 JSON 形态:
`executionPolicy``observabilityPolicy`、tenant identity、network、GC、failureKind、provenance 和 resource limit 都不是新的要素;它们分别挂在四要素或 run policy 上。
## HWLAB v0.2 承接口径
HWLAB v0.2 原有 Code Agent 已经验证了 profile、session、workspace 和 Secret 的基本边界。RuntimeAssembly 需要把这些边界固化为 AgentRun 自身四要素,避免 runner 继续依赖 HWLAB cloud-api Pod 内路径或本地进程状态。
| HWLAB v0.2 基线能力 | HWLAB 参考入口 | RuntimeAssembly 承接字段 | 承接规则 |
| --- | --- | --- | --- |
| provider profile 可切换 | `internal/cloud/code-agent-contract.ts` | `ProfileRef.profile``ProfileRef.secretRef` | `deepseek``codex` 只选择 profile/config/SecretRef,不复制 backend 协议;缺失 Secret 必须失败,不 fallback。 |
| Codex app-server thread 复用 | `internal/cloud/codex-stdio-session.ts``internal/cloud/code-agent-session-registry.ts` | `SessionRef.sessionId``conversationId``threadId` | AgentRun 保存 backend thread/session 摘要;不保存 API KEY、`auth.json``config.toml` 或完整 `CODEX_HOME`。 |
| 固定 `/workspace/hwlab` 代码上下文 | `internal/cloud/code-agent-contract.ts` | `ResourceBundleRef.repoUrl``commitId` | 用 Git-only full commit 取代 HWLAB Pod 内固定路径;runner checkout 到隔离 workspace。 |
| writable `CODEX_HOME` 与 Secret 投影分离 | `docs/reference/code-agent-chat-readiness.md` | `ProfileRef` + runner runtime home | Secret 只读投影,复制到当前 run/profile writable runtime homeprofile 间不共享。 |
| runner/image 可追溯 | HWLAB live build/source metadata | `BackendImageRef.image` | runner/backend image 必须可追溯 digest/source commit,不能由调用方任意传未受控镜像。 |
## 四要素边界
### BackendImageRef
@@ -53,7 +65,7 @@ P0 最小 JSON 形态:
### SessionRef
- P0 允许 `sessionRef=null`,表示不持久化 backend session 文件。
- 面向 HWLAB 手动调度 canarySessionRef 是 P1 必补能力:需要支持 `conversationId/sessionId/threadId` 到 backend session identity 的稳定映射。
- 面向 HWLAB v0.2 原有长会话能力SessionRef 是承接 Code Agent thread 复用的核心字段:需要支持 `conversationId/sessionId/threadId` 到 backend session identity 的稳定映射。
- 一旦启用 session,必须只保存 backend session/cache,不保存 API KEY、`auth.json``config.toml` 或完整 `CODEX_HOME`
- session 文件目录必须和 profile credential、Git workspace 分开。
- runner 启动时,有 SessionRef 则执行 `thread/resume`,没有 SessionRef 则执行 `thread/start`;profile 切换不得复用另一 profile 的 session。