Skip to content

ci(commands): add independent rerun and cancel - #393

Merged
SigureMo merged 6 commits into
codex/ci-controlfrom
codex/ci-rerun-cancel
Oct 1, 2026
Merged

SigureMo merged 6 commits into
codex/ci-controlfrom
codex/ci-rerun-cancel

Conversation

@SigureMo

@SigureMo SigureMo commented Sep 30, 2026 •

Copy link
Copy Markdown
Member

What

通过独立 action 和 workflow 提供 /rerun、/cancel、/help,操作当前 PR 的 CI。

Why

使权限、运行状态判断、API 操作与评论回复各自清晰,贡献者可以直接在 PR 中操作 CI。

How

  • index.mjs 分离首行指令解析、公开帮助、权限检查与评论回复流程。
  • runs.mjs 分离 run 筛选、状态判断、job 查询和 API 操作选择;写入前统一核对 PR head。
  • 同一 head 下优先选活跃 run,其次选未取消的 run;各组按 run number 取最新值,避免 concurrency 取消的重复 run 遮住实际运行。
  • /rerun 默认重跑当前 head 最新失败或超时 workflow 中失败的 job,也支持精确指定 workflow 或 workflow/job;ci 只选择 pre-commit/CPU workflow,all 选择全部已配置 workflow。/help 展示相同命名和范围,取消仅接受 workflow target。
  • 首行之后可写普通正文,不包含针对特定账号或 agent 署名的解析分支。
  • 使用 workflow GITHUB_TOKEN;只加载默认分支代码,按源评论 ID 去重,写入超时后不自动重复操作。
  • 公开帮助仅介绍贡献者日常指令;bypass 和 Nyanpasu review 各自独立处理。

原生 gh-stack 第 2/6 层,依赖 #392 的共享 JSON。

Testing

全量 pre-commit 和 actionlint 已通过。临时 Node 冒烟检查覆盖首行解析、公开帮助、权限、去重、fork run 匹配、API 操作选择、head 变化和不明确写入结果。另以真实运行数据验证 6 个并发重复运行场景,包括被取消的高编号 run 与活跃、失败、成功 run 共存,以及全部取消时的显式重跑。另通过 27 个临时指令场景检查:7 个新 job target 精确重跑、7 个旧短名称拒绝、7 个 job 取消请求拒绝,以及 workflow/all/default/help 的范围。未提交测试文件。

未在本地运行 pytest tests/ 或 GPU/NPU 训练:本次涉及 CI 自动化与文档。欢迎/评论指令的真实 GitHub 交互需进入默认分支后验证。

  • pre-commit run --all-files passes
  • Tests pass (pytest tests/)
  • New tests added (if applicable)
  • Documentation updated (if applicable)

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update
  • Refactoring (no functional changes)
  • Performance improvement
  • CI/CD or build changes

Screenshots / Logs

This PR is co-authored with @codex (gpt-6-astra, reasoning: xhigh).

@chatgpt-codex-connector

Copy link
Copy Markdown

To use Codex here, create an environment for this repo.

@SigureMo
SigureMo added this pull request to stack #397 September 30, 2026 17:05

@SigureMo SigureMo left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

有点奇怪,我们 ci 目录有必要存在吗?是否可以用自定义 actions 目录?

Comment thread .github/ci/tests/control.test.js Resolved
Comment thread .github/ci/tests/runs.test.js Resolved
@SigureMo
SigureMo force-pushed the codex/ci-rerun-cancel branch from 879ff73 to 41569df Compare September 30, 2026 18:19
@SigureMo SigureMo changed the title ci(commands): support rerun and cancel ci(commands): add independent rerun and cancel Sep 30, 2026
@SigureMo

Copy link
Copy Markdown
Member Author

关于 review 中提到的 ci/ 与自定义 action 划分,已按整套功能重新拆分:.github/ci/ 仅保留共享 JSON 和格式化配置;本 PR 的 rerun/cancel/help 在 .github/actions/ci-commands/;欢迎发布在 #395 的 .github/actions/pr-welcome/;bypass 与 synchronize 清理在 #394 的独立 workflows。没有统一指令注册表或 control 调度层。当前实现见 41569df。

This reply was automatically generated by @codex.

@chatgpt-codex-connector

This comment was marked as spam.

Comment thread .github/actions/ci-commands/index.mjs Resolved
@SigureMo
SigureMo marked this pull request as ready for review September 30, 2026 20:19
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 30, 2026 •

Copy link
Copy Markdown

Codex Review Summary

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-01T09:07:35.799338Z a94f8f1 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.

@rai-studio-bot

rai-studio-bot commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

Nyanpasu 审查看板

审查状态: ✅ 已通过

审查版本: bb59f3e

目标分支: codex/ci-control

审查通过:本 head 为 rebase 后的同内容提交——本 PR 自身 4 个文件与上一轮已批准的 4435b13 字节一致(diff 为空),基线层增量仅为贡献者文档(CONTRIBUTING.md 与 how-to-contribute),不涉及代码、配置或本 PR 的行为。CI 正在运行(Pre-commit 已通过,其余进行中;同一字节内容在上一 head 曾全部通过)。F1 保持已解决。深度阶段沿用既有独立设计对比与必要性审计结论。

审查阶段进度范围与结果
常规审查 ✅ 已完成 本轮核对完成:rebase 后自身文件与已批准内容字节一致;基线增量仅为文档;无新增人类评论或审查;CI 无失败(运行中)。
深度审查 ✅ 已完成 机制与需求未变(内容与已批准状态完全一致),沿用既有独立设计对比与必要性审计结论;未派发新的子任务。

审查发现

待处理
编号 严重性 问题状态规则来源
暂无待处理的记录。
已解决或已取代
编号 严重性 问题状态规则来源
F1 Low severity 统一 per-run 错误回复的句点拼接,避免出现双句点 ✅ 已解决 —
提交范围 · 接收 4 · 建议移出 0 · 待确认 0

接收 4 个文件 · 建议移出 0 个文件 · 待确认 0 个文件。移出与待确认部分暂停深审,不代表审查通过。

文件结论仓库维护必要性依据替代去向或方案
.github/workflows/ci-commands.yml
.github/actions/ci-commands/action.yml
.github/actions/ci-commands/index.mjs
.github/actions/ci-commands/runs.mjs
接收 四个文件共同实现 PR 要求的功能:以评论指令 /rerun、/cancel、/help 操作当前 PR 的 CI。issue_comment 触发的 workflow 是生产入口,composite action 是其被调方,两个 .mjs 模块承载指令解析、权限检查、run 匹配与 Actions API 操作。本 head 文件与已批准的 4435b13 字节一致,职责与需求自始未变。 PR #393 描述(What/How);生产调用方为 .github/workflows/ci-commands.yml 调用 ./.github/actions/ci-commands。 GitHub 要求 workflow 与 action 定义位于仓库 .github 目录内,且 action 通过相对路径导入 #392 的 .github/ci/config.json,仅在树内可解析;外部工件或一次性实验无法提供仓库可见的贡献者指令面。
精简审查与验证依据
审查范围进度结论
生产代码 ✅ 已完成 沿用独立最小设计对照的必要性结论:未发现可删除/合并的冗余机制,四项均为 retain;本 head 内容与已批准状态完全一致,无新增机制。
测试 ➖ 无需执行 本 diff 不含测试文件,无适用测试范围:维护者已在已解决的 review 讨论中明确移除为该功能提交的测试,作者改用未提交的临时冒烟检查并补充了真实运行数据的并发场景验证(PR 描述 Testing)。行为由本次审查的独立模拟 harness 与作者的实测共同覆盖。

生产代码的必要性与替代方案

范围必须保留的契约更简单的方案结论依据与限制
index.mjs 的标记去重与先落盘回复生命周期(<!-- relax-ci:command:{id} --> 在任何 Actions 写入前创建) PR 描述 How:'按源评论 ID 去重,写入超时后不自动重复操作';工作流重放或写入结果不明确时不得自动重复写入。 不做先落盘声明,直接写入后回复(参考设计 §4-C 同样拒绝:违反不可自动重复写入的显式要求);或改用 reaction/缓存/工件账本(引入第二套写入机制或新状态)。 保留 重放同一评论事件的模拟场景显示零次额外写入;独立参考设计在仅给定需求的情况下推导出完全相同的机制。格式化变更未改动该路径。
runs.mjs 的 assertHead(每次写入前重新拉取 PR 并校验 open 状态与 head SHA) PR 描述 How:'写入前统一核对 PR head';head 变化或 PR 关闭时不执行操作。 仅在处理开始时读取一次 PR(参考设计的文档化选择:接受秒级 TOCTOU 窗口)。 保留 模拟场景:写入前 head 变化 → 抛错且零次写入。该复核是 PR 显式声明的契约,作者实现比参考设计更严格。
runs.mjs 的 run 关联与选择(belongsToPR 的 pull_requests 优先 + 分支/仓库回退、并发存活选择、显式 run_number 降序排序) 操作仅作用于该 PR 当前 head 的 run(含 fork PR);/rerun 默认重跑最新失败或超时 workflow 中失败的 job;target 采用基线层的层级命名(如 ci/pre-commit),job 目标仅支持 rerun。 仅按 head_sha 关联(无法区分同 SHA 的跨 PR 匹配);取最新 run_number 一律 [0](修复前缺陷:最新 run 被取消时拒绝重跑仍存在的失败 run);依赖 API 返回顺序取最新。 保留 7 项选择场景模拟验证(回退重跑、queued 优先、全取消回退、最新成功跳过等);参考设计的只读探测确认同仓库 PR 的 pull_requests 数组也为空,回退匹配是实际承载路径;作者另以真实运行数据验证 6 个并发重复运行场景(PR 描述 Testing)。
结构选择:github-script@v8 composite action + index/runs 双模块拆分 + 每评论 ID 的 workflow concurrency 组 + retries: 0;以及 a94f8f1 应用的共享 oxfmt 格式化 维护者要求的职责分离与纯函数化;对同一评论的处理串行化;仓库统一格式化配置(基线层的 .oxfmtrc.json 与 pre-commit 钩子)。 参考设计的零依赖单文件 node 脚本且不带 concurrency 组:复杂度相当但需手写分页与错误处理、失去串行保护。 保留 与参考设计逐项对比无冗余包装层;格式化变更经 81/81 行机械配对与行为冒烟确认等价,pre-commit 的 oxfmt 钩子(types_or: javascript/json,排除 acquire-devices 与 docs)仍覆盖 ci-commands 文件。
Powered by Nyanpasu with glm-5.3[1m] xhigh, please check the suggestions carefully.

@SigureMo
SigureMo force-pushed the codex/ci-rerun-cancel branch from 2ff596e to 3730bf0 Compare September 30, 2026 21:01

@rai-studio-bot rai-studio-bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

常规审查完成 · 深度审查进行中

已完整审查本 PR 相对直接基线 codex/ci-control 的全部 4 个新增文件(workflow、composite action 与两个 .mjs 模块,共 260 行),并用模拟 GitHub 客户端完成 20 项端到端场景验证,覆盖权限检查、源评论去重、fork run 匹配、写入前 head 校验、rerun/cancel 的 API 操作选择,以及新加入的并发存活 run 选择逻辑(含最新 run 被 cancel 时回退到可重跑 run 的场景)。未发现阻塞问题;仅有一个 P3 级文案瑕疵,见行内评论。环境核对:ubuntu-slim 为有效托管 runner 标签,github-script@v8(node24)支持所用 JSON import 属性,共享配置中的 job 名称与三个目标 workflow 的实际 job 名称一致。独立设计参考与生产/测试必要性审计仍在进行,结论将在深度审查完成后更新。

审查看板:#393 (comment)

Powered by Nyanpasu with glm-5.3[1m] xhigh, please check the suggestions carefully.

Comment thread .github/actions/ci-commands/runs.mjs Resolved

@rai-studio-bot rai-studio-bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

审查完成 · 无阻塞问题(1 个 P3 建议待处理)

常规与深度审查均已完成。相对直接基线 codex/ci-control 的 4 个新增文件经全量审查,并以模拟 GitHub 客户端完成 21 项端到端场景验证(权限、源评论去重、fork 匹配、写入前 head 校验、rerun/cancel 的 API 操作选择、并发存活 run 选择),未发现 P1/P2 缺陷;唯一行内发现为 F1(P3,非阻塞的文案瑕疵,已附单行建议)。深度阶段使用仅基于需求与基线树独立推导的最小设计参考进行对比:两个设计在核心机制上独立收敛(写入前先落盘带源评论 ID 的回复作为去重账本、按 head_sha 关联 run、目标集合由共享配置派生、作者或 write 权限授权),未发现可删除的冗余机制;作者实现在写入前 head 复核、Bot 评论过滤与 run 选择上更严格。生产与测试必要性审计结论及证据见看板。待 F1 处理或明确拒绝后,可给出通过结论。

审查看板:#393 (comment)

Powered by Nyanpasu with glm-5.3[1m] xhigh, please check the suggestions carefully.

@rai-studio-bot rai-studio-bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

审查通过 ✅

F1(P3,per-run 错误回复的双句点)已在 fec92d7 按建议修复,并同步处理了同一评论中提到的 no-run 提示文案(现按指令命名);本地 mock 复验输出均为单句点、job 名保持代码样式,13 项基础场景与 7 项 run 选择场景重跑无回归,确认回复见原线程。相对直接基线 codex/ci-control 的 4 个新增文件已在本轮与此前两轮完成全量审查与端到端场景验证;深度阶段(独立最小设计参考对比、生产与测试必要性审计)无新增发现,相关结论与证据见看板。F1 线程的 resolve 按钮请由有权限的维护者点击(本账号无该权限)。

CI 备注:本 head 必需检查 Tests (Python 3.12) 失败于 tests/engine/rewards/test_custom_reward_worker.py——该测试模块在无关分支(feat/task5-spec-metrics,2026-09-29)同样失败过,同一套件在本 PR 上一 head 及 Python 3.10/3.11 均通过,与本 PR 仅改 .github/ 下文件的 diff 无关,属既有 flaky 测试,可直接重跑。

审查看板:#393 (comment)

Powered by Nyanpasu with glm-5.3[1m] xhigh, please check the suggestions carefully.

@SigureMo
SigureMo force-pushed the codex/ci-rerun-cancel branch 2 times, most recently from a94f8f1 to 9210eed Compare October 1, 2026 09:33
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

1 similar comment
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

@SigureMo SigureMo mentioned this pull request Oct 1, 2026
3 of 11 tasks

@rai-studio-bot rai-studio-bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

审查通过 ✅

本 head 的 4 个文件与此前已完整审查并验证的内容字节一致:9210eed6 相对已批准的 fec92d7a 仅为 oxfmt 格式化变更(经 diff 归一化配对、语法检查与行为冒烟确认语义不变),其间的基线层重组(defer repository-wide formatting)不影响本 PR——pre-commit 的 oxfmt 钩子仍覆盖 ci-commands 文件,共享 config.json 未变。PR 描述编辑仅补充既有行为的文档说明(run 选择逻辑、栈位置 2/6、并发重复场景的真实数据验证),需求未变。CI 8 项检查全部通过(含上轮 flaky 的 Python 3.12)。F1 保持已解决(fec92d7a 修复,格式化后行为不变;线程待维护者点击 resolve)。完整审查证据(20+ 项模拟场景、独立最小设计对照、生产与测试必要性审计)见看板。

审查看板:#393 (comment)

Powered by Nyanpasu with glm-5.3[1m] xhigh, please check the suggestions carefully.

@SigureMo
SigureMo force-pushed the codex/ci-rerun-cancel branch from 9210eed to 4435b13 Compare October 1, 2026 10:15
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

1 similar comment
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

@rai-studio-bot rai-studio-bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

审查通过 ✅

本 head 相对已批准状态的增量仅为 index.mjs help 文案两行,用于说明基线层新的层级 target 命名。已验证与基线新配置(ci/pre-commit 等 7 处改名)完全兼容:复合键正确解析为 job 目标并触发对应 job 重跑、job 目标按文案所述拒绝 /cancel、help 表格按新键渲染、旧扁平名按预期报 Unknown target。CI 8 项检查全部通过。此前各轮的完整审查证据(20+ 项模拟场景、独立最小设计对照、生产与测试必要性审计、F1 修复验证)见看板;F1 保持已解决。

审查看板:#393 (comment)

Powered by Nyanpasu with glm-5.3[1m] xhigh, please check the suggestions carefully.

- Resolve allowlisted workflows and exact matrix jobs against the current PR head.
- Support failed-job and whole-workflow reruns, and explicit workflow cancellation.
- Reject stale heads and avoid automatically retrying ambiguous API writes.

Co-authored-by: Codex <[email protected]>
SigureMo and others added 5 commits October 1, 2026 21:25
# ♻️ Refactor

- Separate permission checks and command dispatch from the comment lifecycle.
- Select Actions API operations with pure functions and keep writes at one boundary.
- Parse commands from the first line without account-specific attribution handling.
- Keep public help focused on contributor operations.

# ✅ Validation

- Check permissions, deduplication, fork run selection, head changes and ambiguous API writes with temporary smoke checks.
- Pass all pre-commit hooks without adding test files.

Co-authored-by: Codex <[email protected]>
# 🐛 Bug Fix

- Prefer active runs on the current PR head, then the newest non-cancelled run.
- Keep the newest cancelled run as a fallback when no surviving run exists.
- Prevent a higher-numbered cancelled duplicate from hiding an active or failed run.

Co-authored-by: Codex <[email protected]>
# 🐛 Bug Fix

- Normalize trailing periods before appending per-run retry guidance.
- Name the invoked command when no workflow run matches the current head.

Co-authored-by: RAI Studio Bot <[email protected]>
Co-authored-by: Codex <[email protected]>
# 🎨 Style

- Format the rerun/cancel action with the repository-wide oxfmt settings introduced in the base PR.
- Keep the command behavior unchanged and verify both ESM files with node --check.
- Run all pre-commit hooks successfully.

Co-authored-by: Codex <[email protected]>
# 📝 Documentation

- Explain workflow/job target names in command help.
- Distinguish the CI workflow from all workflows and retain workflow-only cancellation.

Co-authored-by: Codex <[email protected]>
@SigureMo
SigureMo force-pushed the codex/ci-rerun-cancel branch from 4435b13 to bb59f3e Compare October 1, 2026 13:31
@chatgpt-codex-connector

This comment was marked as spam.

1 similar comment
@chatgpt-codex-connector

This comment was marked as spam.

@rai-studio-bot rai-studio-bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

审查通过 ✅

本 head 是 rebase 后的同内容提交:本 PR 自身的 4 个文件与上一轮已批准并验证的 4435b138 字节一致(diff 为空),基线层增量仅为贡献者文档,不涉及代码、共享配置或本 PR 的行为。CI 正在运行(Pre-commit 已通过;其余进行中,同一字节内容在上一 head 曾全部通过,无失败记录)。此前各轮的完整审查证据(20+ 项模拟场景、独立最小设计对照、生产与测试必要性审计、F1 修复验证)见看板;F1 保持已解决。

审查看板:#393 (comment)

Powered by Nyanpasu with glm-5.3[1m] xhigh, please check the suggestions carefully.

@DrRyanHuang DrRyanHuang left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTMeow 🐾

@SigureMo
SigureMo merged commit 0c91e77 into main Oct 1, 2026
8 of 17 checks passed
@SigureMo
SigureMo deleted the codex/ci-rerun-cancel branch October 1, 2026 17:57
SigureMo added a commit that referenced this pull request Oct 1, 2026
## What

<!-- What changes does this PR introduce? -->

集中维护 CI team 与 target 映射,并接入 oxfmt mirror 和共享格式化配置。在 `.github/` 的
CODEOWNERS 中追加 `@SigureMo`,保留原有负责人。

## Why

<!-- Why are these changes needed? Link related issues with "Fixes #123"
or "Relates to #456". -->

后续各功能有独立入口,仅共享必要的数据配置,使维护者能直接看懂配置和各层职责。

## How

<!-- How do the changes work? Describe the technical approach. -->

- `.github/ci/config.json` 仅包含 `ciTeam` 和 workflow/job target
映射,JavaScript 原生读取 JSON。workflow 使用 `ci`、`gpu-unit`、`integration`;job 使用
`ci/pre-commit`、`ci/cpu-310` 等 `workflow/job` 名称,不保留旧短名称别名。
- CI team 为 `SigureMo`、`NINGBENZHE`、`Yangruipis`,使用实际 GitHub login 大小写。
- 保留 `ShigureLab/[email protected]` 和 JavaScript/JSON
类型选择;clang-format 通过 `exclude_types: [javascript, json]` 排除这两类文件。
- oxfmt 配置移到根目录 `.oxfmtrc.json`,参考 [yutto
的格式化选项](https://github.com/yutto-dev/yutto/blob/main/docs/vite.config.ts):100
列、两空格缩进、单引号、ES5 尾逗号、无分号、箭头参数始终加括号,并关闭 package.json 排序。
- 暂时排除既有 `acquire-devices` action 与 `docs/` 的 oxfmt 格式化;这 9 个既有文件的风格
diff 已移到栈顶专门的格式化层 #398,由该层移除临时路径排除,统一格式化 JS/TS、JSON、样式表和 GraphQL,暂不处理
YAML/TOML。
- 本层只包含共享配置、格式化工具配置和 CODEOWNERS,共 4 个文件;指令入口在 #393,bypass 在 #394,欢迎与指南在
#395,skill 在 #396,全仓格式化在 #398。

原生 gh-stack 第 1/6 层,base 为 `main`。

## Testing

<!-- How were the changes tested? Include commands, test results, or
screenshots. -->

本层通过全量 `pre-commit run --all-files`;既有 action 和 docs 文件与 `main` 保持一致,格式化
diff 单独位于栈顶。未新增测试文件。

未在本地运行 `pytest tests/`:本次涉及 CI 自动化及文档,未改动训练代码。

- [x] `pre-commit run --all-files` passes
- [ ] Tests pass (`pytest tests/`)
- [ ] New tests added (if applicable)
- [ ] Documentation updated (if applicable)

## Type of Change

- [ ] Bug fix (non-breaking change that fixes an issue)
- [ ] New feature (non-breaking change that adds functionality)
- [ ] Breaking change (fix or feature that would cause existing
functionality to change)
- [ ] Documentation update
- [ ] Refactoring (no functional changes)
- [ ] Performance improvement
- [x] CI/CD or build changes

## Screenshots / Logs

<!-- If applicable, add screenshots or log output to help explain the
changes. -->

<div align="right">
<sup>This PR is co-authored with @codex (gpt-6-astra, reasoning:
xhigh).</sup>
</div>

---------

Co-authored-by: Codex <[email protected]>
Co-authored-by: RAI Studio Bot <[email protected]>
SigureMo added a commit that referenced this pull request Oct 1, 2026
## What

<!-- What changes does this PR introduce? -->

通过 `ShigureLab/ci-bypass@v2` 判断 CI team 的标签或评论豁免,并在 synchronize 时独立清理
bypass 标签。

## Why

<!-- Why are these changes needed? Link related issues with "Fixes #123"
or "Relates to #456". -->

将豁免判断集中到可复用 workflow,由 ci-bypass 处理规则匹配与授权检查,CI workflow 根据结果决定是否运行测试。

## How

<!-- How do the changes work? Describe the technical approach. -->

- 可复用 `check-bypass.yml` 在 `ubuntu-slim` 上运行,CPU、GPU unit 和 integration
workflow 分别传入 target。
- 从共享 JSON 读取三人 CI team,支持 workflow/all 标签和 `/bypass` 评论,理由可选。
- 使用 `ShigureLab/ci-bypass@v2`,不锁定具体 commit。
- 独立 synchronize workflow 分页获取并移除 `ci-bypass:` 标签。历史 bypass 评论仍遵循上游规则。
- Gate 失败时运行原测试;只在 gate 成功且明确输出 `can-skip=true` 时跳过测试,workflow
取消后不继续启动测试。

原生 gh-stack 第 3/6 层,base 为 #393。豁免与维护操作记录在 #396 的 skill 参考页。

## Testing

<!-- How were the changes tested? Include commands, test results, or
screenshots. -->

全量 pre-commit 和 actionlint 已通过。

未在本地运行 `pytest tests/` 或 GPU/NPU 训练:本次涉及 CI 自动化与文档。欢迎/评论指令的真实 GitHub
交互需进入默认分支后验证。

- [x] `pre-commit run --all-files` passes
- [ ] Tests pass (`pytest tests/`)
- [ ] New tests added (if applicable)
- [ ] Documentation updated (if applicable)

## Type of Change

- [ ] Bug fix (non-breaking change that fixes an issue)
- [x] New feature (non-breaking change that adds functionality)
- [ ] Breaking change (fix or feature that would cause existing
functionality to change)
- [ ] Documentation update
- [ ] Refactoring (no functional changes)
- [ ] Performance improvement
- [x] CI/CD or build changes

## Screenshots / Logs

<!-- If applicable, add screenshots or log output to help explain the
changes. -->

<div align="right">
<sup>This PR is co-authored with @codex (gpt-6-astra, reasoning:
xhigh).</sup>
</div>

---------

Co-authored-by: Codex <[email protected]>
SigureMo added a commit that referenced this pull request Oct 1, 2026
## What

<!-- What changes does this PR introduce? -->

新增专门的格式化层,把既有文件的风格调整从 #392 移到栈顶,并使用无 Node 运行时的 oxfmt mirror 统一格式化
JS/TS、JSON 和样式表,暂不处理 YAML/TOML。

## Why

<!-- Why are these changes needed? Link related issues with "Fixes #123"
or "Relates to #456". -->

CI 基础设施改动与全仓风格调整分开审查;同时补齐 TypeScript、样式表和 JSON 配置的格式化覆盖。

## How

<!-- How do the changes work? Describe the technical approach. -->

- 保留 `ShigureLab/[email protected]` 和根目录 `.oxfmtrc.json`
的现有风格。
- 使用 `types_or: [text]` 把格式识别交给 standalone oxfmt,避免 pre-commit 类型识别漏掉
`.mts`、`.jsonc`、`.gql` 及特殊配置文件名。`--no-error-on-unmatched-pattern`
允许仅包含不支持格式的批次,受支持文件的语法错误仍然会失败。
- 移除 #392 的临时路径排除,覆盖
JS/JSX、TS/TSX、JSON/JSONC/JSON5、CSS/SCSS/Less、GraphQL;现有
`transfer_queue/` 全局排除继续生效。
- 使用 `exclude_types: [yaml, toml]` 暂时排除
YAML/TOML;这些文件的风格调整均已撤回,`.pre-commit-config.yaml` 只保留必要的 hook 配置修改。
- HTML、Vue、Markdown 不在当前 standalone 版本的支持范围内;Markdown 沿用现有 mdformat。
- clang-format 继续按语言排除 JavaScript/JSON,避免重复格式化。
- 本层共修改 14 个文件;完整栈中 oxfmt 实际匹配 22 个文件。

原生 gh-stack 第 6/6 层,base 为 #396;前五层仍为 #392 → #393 → #394 → #395 → #396。

## Testing

<!-- How were the changes tested? Include commands, test results, or
screenshots. -->

- 全量 `pre-commit run --all-files --show-diff-on-failure` 通过,重复运行后无新增
diff。
- 在不含 Node 的 PATH 下实测 16 种启用的扩展名;HTML/Vue/Markdown 确认为不支持。
- 实际 pre-commit 文件选择覆盖 `.mts`、`.jsonc`、`.gql`;oxfmt 全仓 `--check`
通过,且忽略不匹配文件的选项不会掩盖 TypeScript 语法错误。
- 验证全部已跟踪 YAML/TOML 均被 hook 排除,内容与父层一致(必要的 hook 配置修改除外);5 个 JSON
文件解析值一致,7 个 JS/TS 文件经 esbuild 规范化后的输出一致。
- `vitepress build docs` 与 `node docs/fix-chunk-names.js` 通过。

未运行训练单测及多节点 GPU/NPU 集成测试:本层仅调整格式化配置和代码风格,本地也不具备相应集成测试硬件;未新增测试文件。

- [x] `pre-commit run --all-files` passes
- [ ] Tests pass (`pytest tests/`)
- [ ] New tests added (if applicable)
- [ ] Documentation updated (if applicable)

## Type of Change

- [ ] Bug fix (non-breaking change that fixes an issue)
- [ ] New feature (non-breaking change that adds functionality)
- [ ] Breaking change (fix or feature that would cause existing
functionality to change)
- [ ] Documentation update
- [x] Refactoring (no functional changes)
- [ ] Performance improvement
- [x] CI/CD or build changes

## Screenshots / Logs

<!-- If applicable, add screenshots or log output to help explain the
changes. -->

<div align="right">
<sup>This PR is co-authored with @codex (gpt-6-astra, reasoning:
xhigh).</sup>
</div>

---------

Co-authored-by: Codex <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants