docs: add provider profile management spec
This commit is contained in:
@@ -7,6 +7,7 @@
|
||||
- 提供 Manager 公共 API:创建和查询 run、提交 command、分页读取 events、查询 backend capability。
|
||||
- 提供手动调度 API:为已创建的 run/command 显式创建 Kubernetes runner Job,并快速返回 job identity、attempt 和轮询入口。
|
||||
- 提供 Runner 私有 API:runner register、claim run、lease heartbeat、poll commands、append events、ack command、上报 status。
|
||||
- 提供 Provider Profile 管理 API:服务端查询 profile 状态、写入 API Key、更新 Secret/config 和触发 canary;具体合同见 [spec-v01-provider-profile-management.md](spec-v01-provider-profile-management.md)。
|
||||
- 校验并持久化 `tenantId`、`projectId`、`workspaceRef`、`providerId`、`backendProfile`、`executionPolicy` 和 `traceSink`。
|
||||
- 执行最小 tenant policy boundary:只做 schema、allowlist、idempotency、secret scope 和 executionPolicy 范围检查;不内建 UniDesk/HWLAB 的业务授权。
|
||||
- 使用 Postgres 保存 runs、commands、events、runners、backends、leases 和 migration ledger。
|
||||
@@ -50,12 +51,19 @@ GET /api/v1/sessions/:sessionId/output?afterSeq=0&limit=100&runId=<runId>
|
||||
POST /api/v1/sessions/:sessionId/read
|
||||
POST /api/v1/sessions/:sessionId/control
|
||||
GET /api/v1/backends
|
||||
GET /api/v1/provider-profiles
|
||||
GET /api/v1/provider-profiles/:profile
|
||||
PUT /api/v1/provider-profiles/:profile/credential
|
||||
POST /api/v1/provider-profiles/:profile/validate
|
||||
GET /api/v1/provider-profiles/:profile/validations/:validationId
|
||||
```
|
||||
|
||||
Session API 是异步 subagent 的轻量控制面。`state=default` 必须只返回 running 和 unread session;`state=all` 才返回历史 read session。command/run 进入 terminal 后,所属 session 的 projection 必须进入 `executionState=terminal` 并 bump version,使未读 reader 在 `ps/default` 中看到它;`POST /read` 写入 reader cursor 后,该 session 不再出现在该 reader 的默认列表中。`trace/output` 只分页读取所属 run 的 events,不代理 Queue summary;`control action=cancel` 取消 active command 或 active run。
|
||||
|
||||
面向 HWLAB v0.2 canary 的手动调度 API 目标见 [spec-v01-hwlab-manual-dispatch.md](spec-v01-hwlab-manual-dispatch.md)。`runner-jobs` 只显式启动当前 run/command 的 runner Job,不扫描 pending queue,不等待完整模型 turn;自动 scheduler 仍是 deferred 能力。后续 durable cancel API 必须与同一 run/command 状态机衔接,不能让 HWLAB 直接删除 Kubernetes Job 作为正式取消语义。
|
||||
|
||||
Provider Profile 管理 API 是服务端委托面,不是浏览器用户 API。HWLAB `hwlab-cloud-api` 完成自身鉴权和授权后调用这些接口;AgentRun 只校验调用来源、profile allowlist、SecretRef scope、payload schema 和 redaction,不读取或判断 HWLAB Web session、用户角色或 OpenFGA relation。
|
||||
|
||||
Runner 私有 API 的 `v0.1` 范围:
|
||||
|
||||
```http
|
||||
|
||||
Reference in New Issue
Block a user