docs: add provider profile management spec

This commit is contained in:
Codex
2026-06-05 15:48:30 +08:00
parent 2ebb51eed7
commit 8e64a3974a
7 changed files with 208 additions and 0 deletions
+10
View File
@@ -49,6 +49,10 @@ CLI 官方 TypeScript 入口固定为 `scripts/agentrun-cli.ts`。在 G14 非交
./scripts/agentrun runner jobs --run-id <runId> [--command-id <commandId>]
./scripts/agentrun runner job-status [runnerJobId] --run-id <runId>
./scripts/agentrun secrets codex render --dry-run [--profile codex|deepseek|minimax-m3] [--codex-home <dir>]
./scripts/agentrun provider-profiles list
./scripts/agentrun provider-profiles show <profile>
./scripts/agentrun provider-profiles set-key <profile> --key-stdin
./scripts/agentrun provider-profiles validate <profile> [--wait] [--timeout-ms <ms>]
./scripts/agentrun backends list
./scripts/agentrun server start [--port <port>] [--host <host>] [--foreground]
./scripts/agentrun server status [--port <port>]
@@ -85,6 +89,7 @@ CLI 官方 TypeScript 入口固定为 `scripts/agentrun-cli.ts`。在 G14 非交
- `server logs` 必须返回有界日志尾部、bytes、truncated 和 logPath;找不到日志文件时也必须返回非空 JSON。
- `server stop` 必须按 pidFile 与端口进程清理本地 manager,并返回 before/after 状态;不得要求人工用 `ps/kill/ss` 组合命令清理常见临时服务。
- `secrets codex render --dry-run` 返回 Codex stdio profile Secret 创建计划、输入文件 bytes/hash、SecretRef、manifest 摘要和 apply 命令形状;`--profile codex` 默认 Secret name 为 `agentrun-v01-provider-codex``--profile deepseek` 默认 Secret name 为 `agentrun-v01-provider-deepseek``--profile minimax-m3` 默认 Secret name 为 `agentrun-v01-provider-minimax-m3`;它不得输出 Secret value 或执行 Kubernetes 写操作。
- `provider-profiles` 命令族调用 manager REST 管理 API,覆盖 profile status、API Key 写入和 canary 验证。`set-key --key-stdin` 从 stdin 读取 API Key,响应只显示 SecretRef、resourceVersion、hash 后缀和 failureKind;不得输出 key、Codex auth/config 或 Secret data。
- `backends list` 必须显示 `codex``deepseek``minimax-m3` profile 的 backendKind、protocol、transport、command、requiredSecretKeys 和状态;不得因为某个 provider Secret 尚未配置就隐藏 capability。
- `queue dispatch` 是 Q2 的受控手动调度入口,只对单个 task 显式创建 attempt 和 Core run/command/runner job;不得伪装成自动 scheduler。
- `queue refresh` 只根据 Queue task 中保存的 Core run/command 引用回写 Queue attempt 状态,不读取 Core trace 反推 commander 或统计。
@@ -124,6 +129,10 @@ CLI 官方 TypeScript 入口固定为 `scripts/agentrun-cli.ts`。在 G14 非交
阅读本文、[spec-v01-backend-codex.md](spec-v01-backend-codex.md) 和 [spec-v01-validation.md](spec-v01-validation.md),然后用正式 CLI 分别创建 `backendProfile=codex``backendProfile=deepseek``backendProfile=minimax-m3` 的 run,按 `codex -> deepseek -> minimax-m3 -> codex` 顺序执行真实 runner。确认 CLI 输出非空 JSONbackend_status 显示正确 profile/backendKind/protocol,缺失对应 profile SecretRef 时返回 `secret-unavailable`,不会 fallback 到 `codex` 或其他 profile。
### T5.1 Provider profile 管理 CLI
阅读本文和 [spec-v01-provider-profile-management.md](spec-v01-provider-profile-management.md),然后用 `./scripts/agentrun provider-profiles list``set-key deepseek --key-stdin``validate deepseek --wait` 验证 profile 管理闭环。确认 CLI 调 manager REST,不直连 Postgres,不读取 Kubernetes Secret value;输出包含 validationId/runId/commandId/jobName/resourceVersion/hash 后缀,且不包含 API Key、Codex auth/config 或 Secret data。
### T6 Queue 与 Session CLI 分层
阅读本文和 [spec-v01-queue.md](spec-v01-queue.md),然后用正式 CLI 创建一个 Queue task,轮询 `queue list/show/stats/commander/read`,再使用 `queue show` 返回的 `sessionPath` 调用 `sessions output/trace`。确认 Queue 命令只返回 summary/stats/read/sessionPath,不代理 output/traceSession 命令能查询输出和 trace。最终交互验收必须使用真实 runtime,不使用 mock,不写自动交互脚本。
@@ -144,4 +153,5 @@ CLI 官方 TypeScript 入口固定为 `scripts/agentrun-cli.ts`。在 G14 非交
| Session CLI | 已实现/Q3 | 已提供 `sessions ps/show/turn/steer/cancel/trace/output/read`;默认 ps 只显示 running/unreadterminal 后自动 unreadread cursor 由 CLI 标记。 |
| CLI 测试规格 | 已定义/已验证主闭环 | 综合联调见 [spec-v01-validation.md](spec-v01-validation.md);每次发布仍按手动交互验收复跑。 |
| `deepseek` profile CLI | 已实现/已通过主闭环 | `secrets codex render --profile deepseek``backends list``runner start --backend``runner job` 和 JSON 错误可见性已实现;真实 CLI/RESTful 联调已通过 `codex -> deepseek -> codex` 切换主闭环。 |
| Provider profile 管理 CLI | 目标状态 | 需要实现 `provider-profiles list/show/set-key/validate`,用于 HWLAB 委托和 operator 验收。 |
| `minimax-m3` profile CLI | 已实现/待真实主闭环 | `secrets codex render --profile minimax-m3``backends list``runner start --backend``runner job``sessions turn --profile minimax-m3|M3` 和 JSON 错误可见性已实现;真实 CLI/RESTful 联调需要按 `codex -> deepseek -> minimax-m3 -> codex` 手动验收。 |