diff --git a/.agents/skills/unidesk-cicd/SKILL.md b/.agents/skills/unidesk-cicd/SKILL.md index 299abf2a..5613cafb 100644 --- a/.agents/skills/unidesk-cicd/SKILL.md +++ b/.agents/skills/unidesk-cicd/SKILL.md @@ -80,11 +80,17 @@ bun scripts/cli.ts hwlab nodes control-plane legacy-cicd --help - source PR 合并后不得再次调用 bootstrap 或 apply;正常验收不串联 mirror/status/history,只有失败归因才逐层下钻。 - 自动链路不通时必须修复自动链自身,并通过修复 PR 合并产生的新正常事件验收。禁止人工 mirror sync、直接 Gitea push、人工 PipelineRun、`trigger-current`、运行面 patch 或其他手段补齐当前交付;只读 status/history/events/logs/debug-step 可用于定位,但不得改变交付状态。`closeout` 只属于显式 compatibility diagnostics,不得进入默认观察或恢复路径。 - CI/CD、GitOps、rollout、PipelineRun、Argo、git-mirror 和 AgentRun 的观察、诊断与 legacy 控制必须走受控 CLI;不要用裸 `kubectl`、`argo`、`tkn`、`curl` 当正式控制入口。PaC migrated consumer 仍只由 GitHub PR merge 触发,不得因“必须走 CLI”而额外调用写命令。 +- CI/CD 校验默认不得阻塞交付: + - 除非用户明确要求某项校验成为门禁,禁止新增会让 Pipeline、artifact、GitOps promote、Argo reconcile、runtime rollout 或 `/health` closeout 失败的配置一致性、版本、契约、schema、preflight 或跨对象校验; + - 全局配置、非选中 target/consumer、跨 consumer 一致性和版本/契约漂移只输出结构化 typed warning,并固定 `blocking=false`; + - warning 必须保留对象、配置路径、错误码和修复入口,但不得改变交付成功终态、跳过业务功能、写回配置或触发补救 mutation; + - 发现既有阻塞实例时逐例降级为 non-blocking warning,不以历史测试、旧门禁或旧合同继续阻止滚动; + - 当前选中对象缺少渲染必需输入、Secret/权限不成立、目标无法唯一解析或 mutation target 不安全时,仍在 mutation 前 fail-closed;这类损害预防不得扩展成全局配置一致性门禁。 - CI/CD source authority 只能来自 YAML 声明的 Kubernetes 托管 source authority: - legacy lane 由受控命令在 k8s 内同步并创建不可变 `refs/unidesk/snapshots/.../` stage ref; - Gitea/PaC migrated lane 由 GitHub PR merge 自动驱动 GitHub webhook bridge、Gitea controlled mirror 与 immutable snapshot ref,禁止合并后人工同步或创建 snapshot; - build/status/publish 只消费对应 snapshot,host worktree、本地 `git fetch/pull`、可变 branch ref 或 Pipeline 内直连 GitHub 都不能作为 authoritative source。 -- CLI 必须组合 `config/platform-infra/gitea.yaml` 与 `config/platform-infra/pipelines-as-code.yaml`,按 consumer、node、lane、upstream repository、branch 和 Gitea repository 精确解析 delivery authority。不得用 URL 片段或 repo 专属条件判断迁移;零匹配、多匹配和配置错误都返回 `unknown`、`mutation=false` 并 fail-closed。 +- CLI 必须组合 `config/platform-infra/gitea.yaml` 与 `config/platform-infra/pipelines-as-code.yaml`,按 consumer、node、lane、upstream repository、branch 和 Gitea repository 精确解析 delivery authority。不得用 URL 片段或 repo 专属条件判断迁移;当前选中对象零匹配或多匹配时返回 `unknown`、`mutation=false` 并在 mutation 前 fail-closed,非选中对象和全局一致性错误只进入 `blocking=false` warning。 - PaC 与 `unknown` authority 的 help、plan、status、失败态 `Next`、`REPAIR` 和实际执行 guard 都不得包含或执行 mutation command。`trigger-current|refresh|sync|flush` 只在 YAML 精确解析为 `legacy-manual` 后进入旧实现,且只从 `legacy-cicd` / `legacy-ops` scoped help 发现;平台 bootstrap、Secret 与配置维护使用独立 scoped help,不得充当 source delivery recovery。 - JD01/NC01 `agentrun--v02`、`sentinel--v03`、`hwlab--v03` 的交付收口由自动链自行完成并写入状态。仅在显式调查自动链故障时读取 `cicd status --node ` 或 `platform-infra pipelines-as-code status|history --target --consumer `;主代理与子代理不得把 `closeout` 当作 PR 合并后的人工步骤。`cicd branch-follower` 和 `cicd gitea-actions-poc` 对这些 consumer 只保留历史/迁移只读用途。 - PaC `.tekton` 文件必须用 Repository CR 的 target/node 参数隔离 JD01/NC01,避免同一个 Gitea push 在一个 target cluster 内额外创建另一个 target 的 PipelineRun。`history --id` 必须按运行面 provenance 和实际 PipelineRun prefix 唯一归属 consumer;零匹配、多匹配或显式 consumer 不一致均 fail-closed,不得回退到默认 consumer 或默认 node。 @@ -136,7 +142,7 @@ bun scripts/cli.ts hwlab nodes control-plane legacy-cicd --help - CI/CD 必须检查 schema 语法、嵌套配置值匹配和功能到配置 property 的一对一关系,并输出有界 typed warning;输入快照缺失使用独立 typed warning,不得与 schema 非法混淆; - schema 缺失、非法、candidate 缺失、配置不匹配、重复 property、validator/依赖异常或 OTel 导出失败时,只允许记录 warning;embedded 命令必须以 `0` 退出,PipelineRun、artifact、GitOps promote、Argo reconcile、runtime rollout 和 `/health` closeout 必须继续; - schema 校验器只读,禁止写回配置、注入默认值、删除变量、关闭功能、切换架构路径或执行任何补救操作;运行时必须原样接收本次待发布配置; - - schema warning 必须实际导出 CI/CD OTel span/event;endpoint、serviceName、sampling 和 exporter timeout 只读 `config/platform-infra/pipelines-as-code.yaml#observability` 与精确 repository params,零/多 repository 匹配在 renderer 生成期 fail-closed; + - schema warning 必须实际导出 CI/CD OTel span/event;endpoint、serviceName、sampling 和 exporter timeout 只读 `config/platform-infra/pipelines-as-code.yaml#observability` 与精确 repository params;零/多 repository 匹配或 exporter 配置漂移只增加 `blocking=false` warning,不得阻断 renderer 或滚动; - OTel exporter 自身失败继续输出 `blocking=false` warning;warning 同时进入 `status|history|debug-step` 的同构有界投影,但不得改变成功/失败终态。 - 任一 CI/CD 阶段或总耗时超过 owning YAML 预算时,不要继续死等或把超长等待视为正常;先输出阶段耗时分解,并优先从 env reuse、git mirror、BuildKit/cache、GitOps/Argo watch 和 runtime readiness 探测方向优化后再继续交付。 - 仅 legacy lane 的 node-scoped `trigger-current --wait` 可以把 source sync、pre/post flush、PipelineRun、GitOps/Argo、runtime readiness 和 `/health` closeout 放进同一端到端 YAML 预算;超预算时由 CLI 输出阶段分解、Argo target revision、runtime/public 状态和 TaskRun/Pod drill-down。PaC migrated consumer 禁止执行 `trigger-current`,也禁止手动串联状态、sync 或 flush 命令补齐交付。 diff --git a/docs/MDTODO/details/pr-merge-driven-automatic-delivery/R6.2_Task_Report.md b/docs/MDTODO/details/pr-merge-driven-automatic-delivery/R6.2_Task_Report.md new file mode 100644 index 00000000..81e66ece --- /dev/null +++ b/docs/MDTODO/details/pr-merge-driven-automatic-delivery/R6.2_Task_Report.md @@ -0,0 +1,14 @@ +# R6.2 任务报告 + +## 结果 + +- `unidesk-cicd` 已明确:除非用户明确要求,配置一致性、版本、契约、schema、preflight 与跨对象校验不得阻断 Pipeline、artifact、GitOps、Argo、runtime rollout 或 health closeout。 +- 全局配置、非选中 target/consumer 与跨 consumer 漂移统一输出结构化 `blocking=false` warning。 +- 发现既有阻塞实例时逐例降级,不再以旧测试或旧合同阻止滚动。 +- 仅保留当前选中对象缺少必需输入、Secret/权限不成立、目标无法唯一解析或 mutation target 不安全的 mutation 前损害预防。 +- 已同步修正 delivery authority 与 feature-schema OTel 匹配的两处矛盾表述。 + +## 验证 + +- skill `quick_validate.py` 通过。 +- `git diff --check` 通过。 diff --git a/docs/MDTODO/pr-merge-driven-automatic-delivery.md b/docs/MDTODO/pr-merge-driven-automatic-delivery.md index 161f014f..fb2adbc7 100644 --- a/docs/MDTODO/pr-merge-driven-automatic-delivery.md +++ b/docs/MDTODO/pr-merge-driven-automatic-delivery.md @@ -91,6 +91,9 @@ 原 MDTODO R7 依据 [UniDesk #2005](https://github.com/pikasTech/unidesk/issues/2005) 实现 SELFMEDIA CI/CD 单次只读查询:从 owning YAML 解析 selfmedia-nc01,在一次受控 CLI 调用内关联 pikainc/selfmedia GitHub mergedAt、PaC PipelineRun/TaskRun、Argo/runtime health,直接披露 trigger wait、pipeline duration、end-to-end duration 与证据缺口;同步 unidesk-cicd skill 的唯一推荐入口,禁止新增第二状态源或交付 mutation,完成任务后将详细报告写入[任务报告](./details/pr-merge-driven-automatic-delivery/R7_Task_Report.md)。最新 master 已占用顶层 R7,本条仅调整索引层级,不改写任务报告身份与 checkpoint 语义。 +### R6.2 [completed] + +按用户要求将 CI/CD 全局配置一致性、版本、契约和跨 consumer 校验统一为 non-blocking warning:除非用户明确要求阻塞,禁止新增会导致 Pipeline、GitOps、Argo 或 rollout 失败的校验;发现既有阻塞实例时逐例降级为 `blocking=false` warning,同时保留当前选中对象自身的必要输入与安全校验,完成任务后将详细报告写入[任务报告](./details/pr-merge-driven-automatic-delivery/R6.2_Task_Report.md)。 ## R7 [in_progress] 执行 [UniDesk #2008](https://github.com/pikasTech/unidesk/issues/2008):按 PJ2026-01060106 建立 HWLAB 开发/生产双环境发布;v0.3 固定为 NC01 development,release 固定为 production,两个环境在 source、Pipeline、GitOps、Argo、namespace、public origin、PostgreSQL database/role/Secret/migration ledger 和 Kafka consumer group 上隔离,所有值由 owning YAML 控制,完成任务后将详细报告写入[任务报告](./details/pr-merge-driven-automatic-delivery/R7_Task_Report.md)。