Skip to content

ci: 为共享运行时维护 PR 建立受信原生检查 - #317

Merged
axiomoth merged 12 commits into
mainfrom
codex/maintenance-ci-trust-20261110
Nov 10, 2026
Merged

axiomoth merged 12 commits into
mainfrom
codex/maintenance-ci-trust-20261110

Conversation

@axiomoth

@axiomoth axiomoth commented Nov 10, 2026 •

Copy link
Copy Markdown
Member

摘要

为共享旧运行时的普通维护 PR 提供中央受信原生检查,支持工作流、调用者、测试及工具版本在同一 PR 中更新。变更类型:构建与依赖、测试。

变更原因

PR307 的一次性身份合同不能接收日常维护;候选自身的同名检查也不能替代固定中央来源。普通工作流更新应由受信原生扫描验证,无需先另合一个允许变更的结构或 SHA 合同。

主要改动

  • source/final 分别核对同仓 PR、准确 base/head/merge、有效签名、平台 workflow 来源及新鲜 refs;候选测试在独立只读 job 执行。
  • 复用中央文件发现、jactionlint、zizmor、mise 锁和官方 Actions 锁验证器,扫描候选真实 YAML、本地调用与复合 Action;候选 npm/mise/ignore 配置不能决定扫描器。
  • 普通工作流增删、改名、命令、needs/matrix 与同项目 Action SHA 更新不再依赖精确结构清单或另一份 SHA 批准表。原生项目许可、完整 SHA、安全扫描、审查及必要配置交接继续适用。
  • Node/npm 读取维护声明并可同 PR 更新;npm 由维护 package-lock 中的 devDependencies.npm 锁定,必须与 packageManager 一致,bootstrap 后使用该 CLI 执行检查。API 复用 fix: 统一 GitHub API 版本来源并接入官方更新发现 #309 唯一 helper/config,不新增发现器。
  • PR307 evaluator 和原恢复合同仅保留历史字节。候选业务测试是自检,不能替代可信扫描;检查器自身升级沿旧 P 检查候选、合入验证后提升来源的既有机制。

关联事项

相关 #307、#309。本 PR 只交付中央入口;维护树适配和原生 required-workflow 采用另按准确阶段交接。维护树须先具备 npm 工具锁、Actions 锁和原生扫描兼容性,不能直接把历史树视为已接入。

验证结果

  • Windows Node26.12.1:独立 Node 6项、Vitest 2项通过;真实扫描覆盖普通路径增改/改名、matrix/命令、完整 SHA 变化,错误 needs 与候选 ignore/命令注入仍拒绝;类型/源码边界、中央18文件原生扫描及官方 Actions 锁检查通过。
  • 配套维护树11工作流经真实 jactionlint/zizmor通过,exceptions为空;原生锁验证通过,runner dist逐字节验证通过。相关历史合同及新入口回归已验证;准确 Node24.22.0/npm11.19.1 全量84文件、1969项通过、5项既有跳过。配套维护改动不包含在线部署。
  • 当前 H6e0779a8 已由 GitHub 原生 update-branch 同步主线 b87eb99,签名 valid、相对 main 仍7文件;本地6项Node/2项扫描测试通过,新H Native42878150571 attempt1 success(最终job130055158443);同head Copilot无未解决问题、Codex code completed/false、security completed/null=UNKNOWN。实际运行P=f1796f9;待F来源提升后按有效规则、merge eligibility和受影响实现判断结果适用性,不自动重跑或冒称新P。此前 a8f1112 的 Native42865688367成功及完整AI终态仅保留为历史,不替代新head验收。

影响分析

仅 contents/pull-requests read,无 Environment、生产秘密、迁移或部署权限。source/final不执行候选业务代码,候选自检不自动证明测试语义可信,测试/依赖修改仍由完整PR审查承担。security null保留未知;同名status不能替代ruleset来源绑定。

发布与迁移

中央代码完成审查/CI并采用后,固定required workflow来源,再以真实维护PR验证适配并交接必需检查。保留strict、标题、签名、人工审批和线程解决。受信来源、必需检查、特权身份或未批准外部项目变化仍需准确原生配置交接。业务Worker保持未部署。

回退方式

线上采用前可回退本源码PR;采用后先恢复已验证的受信来源并保持检查,不关闭规则绕过。无持久业务数据修改。

AI 使用声明

本次贡献由AI编程助手代理生成;人类批准任务范围,审查状态以本PR实际记录为准。

补充材料

接入边界见 docs/maintenance-validation.md。维护实际required workflow运行与服务切换分别验收,不以本地检查替代。

Copilot AI lite review requested due to automatic review settings November 10, 2026 16:17
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 10, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-10T18:45:41.960917Z 6e0779a New commits
🔒 Security Review ✅ Completed 2026-11-10T18:49:05.276507Z 6e0779a New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@github-actions github-actions Bot added auto/tests Test paths changed auto/workflows GitHub workflow paths changed auto/docs Documentation paths changed labels Nov 10, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

关键校验存在未锁定实际 action 引用、未可靠激活受信工具链及允许候选篡改验证脚本等问题,导致维护验证无法证明工作流和候选变更经过可信检查。

5 open issues
What changed in this PR

该 PR 为共享旧运行时维护分支新增中央受信原生验证入口,分离来源身份校验、候选测试、依赖审查和最终结果汇总,并补充工具链发现、回归测试、配置文档及 Actions 锁定记录。

Changes:

  • 新增维护验证工作流,校验 PR 身份、提交签名、merge tree、工作流来源和最终结果。
  • 新增维护 CI、工具链发现及工作流语义验证逻辑,并补充相关测试和配置契约。
  • 更新接入文档与 Actions 依赖锁定记录。
File Description
scripts/​test/​maintenance-ci.test.mjs 新增维护 CI 身份、结果、Git tree、工作流语义和权限隔离验证测试。
scripts/​maintenance-ci.mjs 实现维护 PR 的 API 身份核验、受信 Git tree、工作流语义和最终结果验证。
scripts/​discover-maintenance-toolchain.mjs 提供从官方来源发现 Node/npm 工具链版本且不执行批准升级的命令。
packages/​runner/​test/​maintenance-discovery.test.ts 测试工具链版本发现与批准流程的边界。
packages/​runner/​test/​maintenance-ci.test.ts 测试维护工作流权限隔离及 Actions 摘要行为。
docs/​maintenance-validation.md 记录受信验证入口、工具链发现、权限边界和采用顺序。
config/​maintenance-ci.json 声明维护工作流、不可变文件及批准工具链来源契约。
.github/​workflows/​maintenance-validation.yml 定义受信 source、候选测试、依赖审查和 final 验证 jobs。
.github/​workflows/​actions.lock 登记维护验证工作流所使用的 Actions 版本与提交映射。

Review effort: Lite

Comment thread .github/workflows/actions.lock Resolved
Comment thread config/maintenance-ci.json Resolved
Comment thread scripts/maintenance-ci.mjs Resolved
Copilot AI lite review requested due to automatic review settings November 10, 2026 16:27

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: bb68872ea4

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread scripts/maintenance-ci.mjs Resolved

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Active critical issues remain: the workflow lock entry is inconsistent with the referenced SHAs, and the maintenance policy lacks the new workflow inventory and approved action digests, causing verification to fail.

1 open issue
5 resolved since last review

Review effort: Lite

Comment thread config/maintenance-ci.json Resolved
Copilot AI lite review requested due to automatic review settings November 10, 2026 16:38

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

关键验证路径仍可被候选树中的未锁定源文件、产物或 workspace 脚本篡改,且缺失的 Action allowlist 会导致校验失效,因此当前存在未解决的严重绕过风险。

No open issues 🎉

3 previously missed issues

In code that hasn't changed since last review

High severity 未锁定 workspace 测试脚本,可能绕过必需测试

scripts/​maintenance-ci.mjs:103

这里仅锁定根 package.json 的 scripts,但候选执行的 npm test 还会调用 npm run test:settings-events,其实际命令来自 services/settings-events/package.json。维护 PR 可以把该 workspace 的 scripts.test 改成 true/echo pass,而 verifyTree 不会发现,导致必需测试被静默绕过;请把所有被根脚本调用的 workspace manifest 脚本也纳入批准来源核对。

High severity 受信校验清单遗漏被加载的 runner 源码与产物

scripts/​maintenance-ci.mjs:109

这里固定的验证实现只覆盖 scripts/** 及少数配置文件,但后续 npm run verify:workflows 实际从候选树加载 packages/runner/dist/index.js;verify:dist 又会把候选的 packages/runner/src/** 重新打包后与候选产物比对。因此候选可以同时修改 packages/runner/src/workflow-tools.ts(例如让 discoverWorkflowFiles 返回空结果)和生成的 dist,既通过 verify:dist,又绕过工作流校验;同理依赖该 bundle 的其他 verify:* 也不再是受信实现。请把这些被验证命令加载的源文件/产物纳入中央固定清单,或改为由 policy 中的受信实现直接对 target tree 执行。

High severity 缺失 allowedActions 时校验未能 fail closed

scripts/​maintenance-ci.mjs:125

这里把 policy.allowedActions 直接传给了带可选 allowlist 的 workflowDigest,但没有先验证该字段存在且为非空数组;一旦中央配置误删/误拼这个字段,workflowDigest 会退化为只做 SHA 格式和语义摘要,所有任意 owner/commit 的 uses 都能通过,绕过文档所述的完整 Action allowlist。请在受信 source 校验 policy schema(至少要求每项为完整 pinned ref)并对缺失字段 fail closed。

1 resolved since last review

Review effort: Lite

Copilot AI lite review requested due to automatic review settings November 10, 2026 16:49
@axiomoth

Copy link
Copy Markdown
Member Author

本轮完整AI终态后集中修正至2cafccfd。针对Copilot摘要的3条补充意见:

  1. 实际维护来源21be466的根test是vitest run,不调用test:settings-events,亦无services/settings-events workspace;该意见引用main接口,不适用本入口的target维护树。
  2. 所举workflow-tools.ts同属main接口。中央source独立读Git tree校验workflow inventory/semantics/完整Action与immutable,不加载候选dist;候选测试和dist一致性检查不替代中央准入。文档已明确这条边界,避免把候选自检误称为中央受信实现。
  3. 已采纳allowedActions缺失必须拒绝:必填非空数组且每项完整SHA引用,缺失/空/非法负例均通过。Node7项及实际维护双父merge树验证通过。

2cafccfd的完整AI/原生CI仍待本轮结果;此前security completed/null保留UNKNOWN,未写成零发现。

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

需要人工评估,因为维护 CI 的受信来源未涵盖既有测试及测试工具依赖,候选版本可能在改变验证语义后仍通过 required 测试。

No open issues 🎉

Review effort: Lite

@axiomoth

Copy link
Copy Markdown
Member Author

最终head 2cafccf 的Copilot摘要边界裁定:维护PR允许修改业务实现、测试和测试工具依赖,相关变更必须经完整AI与人工采用裁定;required job运行候选测试,不声称对任意候选测试的语义正确性作独立证明。中央source独立保证来源/签名/base-head-merge、工作流清单/语义/完整Action及历史合同,检查命令、npm与自动测试配置受批准来源约束。候选测试与依赖仍由PR审查及依赖审查负责,不能把候选自检替代中央来源证明,也不为解决这个一般PR审查边界而永久冻结所有测试依赖。该残余边界连同security结果实际确定程度交中央判断;不据此自动合并。

Copilot AI lite review requested due to automatic review settings November 10, 2026 17:22

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Critical active issues allow the candidate tree to bypass required validation through untrusted scripts and workflow references, while the toolchain contract also rejects the target maintenance tree.

3 open issues

Review effort: Lite

Comment thread scripts/maintenance-ci.mjs Resolved
Comment thread scripts/maintenance-ci.mjs Resolved
Comment thread scripts/maintenance-ci.mjs Resolved
Copilot AI lite review requested due to automatic review settings November 10, 2026 17:30

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

This change establishes a trusted required-workflow boundary whose source binding, permissions, merge-ref identity, and final native CI state depend on external GitHub ruleset configuration and runtime evidence not verifiable from the repository diff alone.

No open issues 🎉

3 resolved since last review

Review effort: Lite

Copilot AI lite review requested due to automatic review settings November 10, 2026 18:43

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

核心准入与安全保证依赖差异之外的 required workflow 来源绑定、Actions 权限及分支保护配置,静态审查无法验证合并后的检查交接,因此需人工结合真实配置和准确提交复核。

No open issues 🎉

Review effort: Lite

@axiomoth axiomoth closed this Nov 10, 2026
@axiomoth axiomoth reopened this Nov 10, 2026
@axiomoth
axiomoth merged commit 466092d into main Nov 10, 2026
32 of 33 checks passed
@axiomoth
axiomoth deleted the codex/maintenance-ci-trust-20261110 branch November 10, 2026 19:31
axiomoth added a commit that referenced this pull request Nov 11, 2026
## 摘要

将旧运行时维护分支接入中央受信维护校验,支持后续普通维护 PR。变更类型:构建与依赖、测试、文档。

## 变更原因

PR307 的一次性旧校验不能承接普通维护;本 PR 为维护树补齐可信扫描兼容性及可重现工具锁。

## 主要改动

- 后续维护 PR 使用中央 required workflow;旧 validate 仅为 PR307 保留入口。仓库 ID/profile
经环境变量传入 shell。
- 移除三个旧 workflow_run 自动入口,保留其余触发器和 job。
- 为 11 个本地工作流及中央 required workflow 生成官方 Actions 锁。
- 将 npm 11.21.2 纳入 package-lock 工具依赖,内置 brace-expansion 5.0.12 修复
GHSA-6j4f-fj2g-mc7p、GHSA-qhr7-859c-m2p7;Node 保持 24.22.0。
- 历史合同测试读取固定 21be466 提交的真实文件;当前维护入口使用独立固定 P 的扫描与来源核对。

## 关联事项

相关 #307、#317、#319、#322、#323。本 PR 完成维护树首次接入;旧服务部署、消费者切换及资源退役按独立交接窗口执行。

## 验证结果

- 当前
H:85734db63ae4f37429a598975a8514eb976c465f;tree:542370c781f90199e8cfa25bcb104adcefd368ee。
- 前一 H7c69 的真实 required
[42980492484](https://github.com/splrad/steward/actions/runs/42980492484)
全部通过:来源身份、构建测试、dependency review、最终检查。
- 实际 WORKFLOW_SHA 为
0e6ad89;source/final 记录事件 merge 与
liveMerge 均为 de4170b。
- 托管测试 84 文件、1964 项通过、10 项跳过;typecheck、verify:config、verify:dist
通过。平台跳过项保留,不记为通过。
- 11 个工作流经受信 jactionlint/zizmor 扫描通过,exceptions=[];官方 Actions
锁验证通过。工具原始警告及外部根信息项保留。
- Node 24.22.0 / npm 11.21.2 本地 npm ci 与维护入口合同测试通过。
- 当前准确 H 的最终 AI 审查正在完成。此前 H8b 的五条裁定保留历史。H7c69 的两条 Copilot
意见已分别按历史事件不可达裁定、同步维护文档版本处理并解决线程;其 Codex code 无发现,security null 记为
UNKNOWN。H8e的摘要high已按[公开证据裁定](https://github.com/splrad/steward/pull/321#issuecomment-6790356691)修正README与workflow-validation文档范围,旧镜像不恢复;当前最终文档H正在重新完成审查/CI。

## 影响分析

runtime 源码、runner dist、PR307 evaluator 和原 workflow-contract
历史字节保持一致。本次影响维护验证、工具依赖与自动工作流入口,无生产权限增加或业务数据迁移。

## 发布与迁移

中央来源固定 0e6ad89。准确 H
的必要审查结束后,仅将维护规则26795348的 validate/App15368 替换为 SPLRAD Maintenance
Validation/App15368,保留其余保护和 approval26795350,再按期望 H 正常 squash 合并。服务窗口
NOT_OPEN。

## 回退方式

采用前可关闭本 PR;采用后通过正常受保护 PR 回退适配,并协调有效检查来源和 context。

## AI 使用声明

本次贡献由 AI 编程助手代理生成;人类已批准任务范围,代码审查状态以本 PR 实际记录为准。

## 补充材料

维护与恢复边界见 CONTRIBUTING.md;完整 CI 与审查证据保留在本 PR,未知结果不记为通过。
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

auto/docs Documentation paths changed auto/tests Test paths changed auto/workflows GitHub workflow paths changed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants