docs: 完成 ApiState workflow 输出收口
Pipelines as Code CI / hwlab-web-probe-sentinel-nc01- Success
Pipelines as Code CI / platform-infra-gitea-nc01- Success
Pipelines as Code CI / unidesk-host- Success

This commit is contained in:
Codex
2026-07-17 04:24:46 +02:00
parent 213edcc286
commit 858ae6fc77
3 changed files with 32 additions and 1 deletions
+4
View File
@@ -52,6 +52,10 @@ bun scripts/cli.ts platform-infra sub2api codex-pool runtime get --target PK01 -
- Secret 只输出对象名、key 名、presence、fingerprint 或 redacted prefix;禁止打印完整 token/key。
- 默认 active target 以 YAML `defaults.targetId` 和 target role 为准;当前 `api.pikapython.com` 对应 PK01 host-Docker target。
- 原生运维快照统一走 `ops diagnosis|channels`:默认输出紧凑文本,显式 `--json` 输出结构化结果;命令只读且不在前台模拟自动刷新。
- ApiState 评分 workflow 的状态查询走 `/root/apistate/scripts/apistate-cli.ts workflow status --id <workflow-id>`
- 默认文本只披露 workflow 身份、终态、错误、评分窗口和分组/账号计数;
- 需要完整 `groups/accounts` 结果时显式增加 `--json`
- 禁止为确认终态先展开完整评分 payload。
- `ops diagnosis` 的指标来自原生 admin/ops APIv0.1.155 没有独立 diagnosis/advice endpointCLI 必须把官方前端投影建议与 API 已验证事实分开呈现。
- `ops channels` 使用原生渠道监控的 `7d``15d``30d` 窗口,支持平台、渠道和模型下钻;渠道历史固定分页并用 `--page-token <record-id>` 向更早记录翻页,`--record <record-id>` 精确下钻,不提供手工 `--limit`;原生响应未提供刷新倒计时时必须显示 unsupported。
- Codex pool、统一 API key、master `~/.codex` 配置、FRP/Caddy 暴露、账号增删都必须走本技能的受控 CLI。
@@ -0,0 +1,27 @@
# R17 任务报告
## 结论
ApiState `workflow status` 的默认文本输出已改为有界摘要。终态不再把完整评分结果序列化到单个 `result` 字段;显式 `--json` 继续保留完整 Temporal/HTTP payload,未改变 workflow、dispatcher、Temporal 或 HTTP 合同。
## 实现
-`scripts/src/cli.ts` 增加通用 workflow status 摘要投影。
- 默认文本保留 target、transport、workflowId、runId、state、terminal、error,以及结果的 ok、status、refreshedAt、window、groupCount 和 accountCount。
- 非对象结果只披露类型和 JSON 下钻提示。
- `--json` 跳过摘要投影,完整结果保持不变。
-`$unidesk-sub2api` 固化默认摘要、显式 JSON 下钻的最短查询规则。
## 验证
- `bun run check` 通过。
- 本地 completed fixture 验证摘要不包含大结果字段,分组与账号计数正确。
- production workflow `apistate-scores-refresh-c0030f9a-f4d3-4a12-92b8-c7085776749f` 默认输出为 15 个摘要字段,显示 3 个分组、13 个账号。
- 同一 workflow 显式 `--json` 可解析完整 `groups/accounts` 数组。
- [ApiState PR #14](https://github.com/pikasTech/apistate/pull/14) 已合并,merge commit 为 `cbdda6e7d9c215aa0219174596a9f33b12a6fa5e`[Issue #13](https://github.com/pikasTech/apistate/issues/13) 已关闭。
- `source-artifact verify-runtime` 显示 source、embedded PipelineRun 与 runtime provenance 对齐该 merge commit。
- `platform-infra sub2rank status --target NC01` 显示 API 与 worker 均为 `1/1 Ready`Service endpoint 可用。
## 已知边界
共享 PaC `history` 观察入口仍在 YAML 声明的 25 秒预算后返回 `pac-read-timeout`;该问题继续由 UniDesk #2165 跟踪。本次以 source artifact、runtime provenance 和 Sub2Rank 原生状态完成发布验收,没有人工触发 PipelineRun、mirror sync 或 Argo sync。
+1 -1
View File
@@ -340,6 +340,6 @@
执行 [ApiState #11](https://github.com/pikasTech/apistate/issues/11):完成后端 Temporal 化,抽取共享 contracts/repository/dispatcher/workflow/activity,拆分独立 API 与 workerCLI 默认 local dispatcher 并支持同合同 `--over-api`,前端支持独立 HMR native 测试服务;先完成 native worker、API、CLI 与前端 smoke,再由原 PaC/Tekton/GitOps/Argo 自动链交付并回归公网 Web/CLI,保留 SQLite 数据兼容,禁止人工 CI/CD 或第二 authority,完成任务后将详细报告写入[任务报告](./details/sub2api-upstream-reliability/R16_Task_Report.md)。
## R17
## R17 [completed]
执行 [ApiState #13](https://github.com/pikasTech/apistate/issues/13):将 workflow 终态默认文本改为有界摘要,完整评分结果仅由显式 JSON 或精确下钻披露,保持 running/completed/failed/not-found 非空可诊断,不改变 Temporal、dispatcher 或 HTTP 合同,完成任务后将详细报告写入[任务报告](./details/sub2api-upstream-reliability/R17_Task_Report.md)。