feat(cicd): generate PaC source artifacts from YAML

This commit is contained in:
Codex
2026-07-11 06:10:20 +02:00
parent 06ce779608
commit 0aab8d35ad
16 changed files with 1901 additions and 42 deletions
@@ -0,0 +1,22 @@
# R1.1 任务报告
关联问题:[UniDesk #1745](https://github.com/pikasTech/unidesk/issues/1745)。
## 完成内容
-`config/platform-infra/pipelines-as-code.yaml` 为 NC01 AgentRun 与 HWLAB consumer 声明独立 `sourceArtifact` owner;未声明的 JD01 consumer 保持 fail-closed。
- 实现 `plan``check``write``status``verify-runtime` 五个受控动作,要求显式 target、consumer 和绝对 worktree。
- AgentRun 复用正式 control-plane Pipeline renderer 生成内联 `pipelineSpec`HWLAB 复用正式 runtime lane renderer、deploy overlay、postprocess 和 verify 生成远程 Pipeline。
- owning Pipeline、源码侧制品和运行面共用 config ref、effective config hash、renderer 与 mode provenance。
- runtime verify 强制绑定完整 source commit,并精确筛选同 commit PipelineRun;重复交付仅在 spec 与 provenance 一致时确定性选取,冲突 fail-closed。
- 远端 observer 已抽到原生 `.mjs`;完整大 spec 通过目标侧临时文件传递,避免 shell argv/env 的 `ARG_MAX`
## 验证证据
- AgentRun `plan` 成功识别旧内联 spec 漂移。
- HWLAB `plan``check` 稳定得到 desired `3fb6e00ba833`、source `7d51de639afa`,且不写消费仓。
- HWLAB e76 source commit 的真实 `status` 精确返回 live `3fb6e00ba833`、embedded `7d51de639afa` 和单一 PipelineRun`verify-runtime` 对旧 embedded drift 以失败退出。
## 未包含范围
- 本项不更新消费仓 artifact,不触发 rollout,也不从 live 反向导出 desired。
@@ -0,0 +1,23 @@
# R1.2 任务报告
关联问题:[UniDesk #1745](https://github.com/pikasTech/unidesk/issues/1745)。
## 完成内容
- 完整比较 Pipeline spec,并输出 canonical hash、provenance 与首个漂移路径,不输出完整 spec 或 Secret。
- canonicalizer 只移除六类已验证 Tekton admission default,并严格限定三个合法 spec 根。
- source worktree 校验绝对路径、Git 根、精确 remote identity 和 symlink 边界;写入采用同目录临时文件与 rename,重复写入无变化。
- 默认 validation error 为有界三行文本;显式 JSON/full 才保留结构化诊断。
- 外层 CLI 的 `source-artifact --help``<action> --help` 均返回专项帮助。
- `$unidesk-cicd` 的 PaC reference 已记录 desired authority、五动作、exact-commit 门禁、大 spec transport 和 fail-closed 规则。
## 测试证据
- 新增定向测试共十三项、七十二个断言,全部通过。
- 覆盖六类 admission default 正向与同名字段负向、本地/远端 canonicalizer 一致、同 commit retry/conflict、NotFound/transport 区分、未声明 JD01 owner、错误脱敏、共享 HWLAB overlay 等价性。
- 使用大于当前约 203 KiB HWLAB Pipeline 的 payload 实跑原生 observer 临时文件 transportlive 与 embedded 均完成完整 hash 比较。
- HWLAB postprocess、verify 与六个 Kafka refresh marker 逐项删除均能触发 fail-closed。
## 基线说明
- 额外运行历史 `scripts/src/agentrun.test.ts` 时出现五个既有失败,集中在旧测试 fixture 的 `version` 与已迁移路由断言;本分支未修改这些测试或 AgentRun client parser。
@@ -0,0 +1,22 @@
# YAML owning Pipeline 到 PaC source artifact 正规生成
- 来源:[UniDesk #1745](https://github.com/pikasTech/unidesk/issues/1745)
- 关联故障:[UniDesk #1726](https://github.com/pikasTech/unidesk/issues/1726)
- 范围:统一连接 owning YAML/domain renderer 与 consumer 声明的 source artifact;同时支持 PipelineRun inline `pipelineSpec``.tekton` annotation 引用 remote Pipeline 两种载体,禁止一次性手工 patch。
## R1 [in_progress]
落实 [UniDesk #1745](https://github.com/pikasTech/unidesk/issues/1745):建立 owning YAML/domain renderer 到 consumer-declared PaC source artifact 的生成、校验、部署和验收闭环,完成任务后将详细报告写入[任务报告](./details/yaml-owned-pac-source-artifacts/R1_Task_Report.md)。
### R1.1 [completed]
基于 [UniDesk #1745](https://github.com/pikasTech/unidesk/issues/1745) 实现 target/consumer 隔离的 source artifact schema、inline pipelineSpec/remote Pipeline renderer 与 plan/check/write/status/verify-runtime CLI,完成任务后将详细报告写入[任务报告](./details/yaml-owned-pac-source-artifacts/R1.1_Task_Report.md)。
### R1.2 [completed]
为 [UniDesk #1745](https://github.com/pikasTech/unidesk/issues/1745) 补齐完整 spec、provenance、canonical hash、first-drift、身份边界、脱敏输出测试和长期文档,完成任务后将详细报告写入[任务报告](./details/yaml-owned-pac-source-artifacts/R1.2_Task_Report.md)。
### R1.3 [in_progress]
落实 [UniDesk #1745](https://github.com/pikasTech/unidesk/issues/1745):使用生成器更新 AgentRun source artifact,并向 HWLAB 消费侧交付 remote Pipeline 接口与 fixture;经受控 PR/preflight 交付,不做手工 env/base64 patch,完成任务后将详细报告写入[任务报告](./details/yaml-owned-pac-source-artifacts/R1.3_Task_Report.md)。
### R1.4
协同 rollout owner 在 NC01 验证 runtime embedded spec、manager Healthy、stale-pending 周期回收及 dsflash Secret 未越权,并回写 [UniDesk #1726](https://github.com/pikasTech/unidesk/issues/1726) 与 #1745,完成任务后将详细报告写入[任务报告](./details/yaml-owned-pac-source-artifacts/R1.4_Task_Report.md)。