Skip to content

style(repo): expand oxfmt formatting coverage - #398

Merged
SigureMo merged 3 commits into
codex/ci-skillfrom
codex/oxfmt-formats
Oct 1, 2026
Merged

SigureMo merged 3 commits into
codex/ci-skillfrom
codex/oxfmt-formats

Conversation

@SigureMo

@SigureMo SigureMo commented Oct 1, 2026 •

Copy link
Copy Markdown
Member

What

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

Why

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

How

  • 保留 ShigureLab/[email protected] 和根目录 .oxfmtrc.json 的现有风格。
  • 使用 types_or: [text] 把格式识别交给 standalone oxfmt,避免 pre-commit 类型识别漏掉 .mts、.jsonc、.gql 及特殊配置文件名。--no-error-on-unmatched-pattern 允许仅包含不支持格式的批次,受支持文件的语法错误仍然会失败。
  • 移除 ci(config): add shared configuration and ownership #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

  • 全量 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 集成测试:本层仅调整格式化配置和代码风格,本地也不具备相应集成测试硬件;未新增测试文件。

  • 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

This comment was marked as spam.

@rai-studio-bot

rai-studio-bot commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

Nyanpasu 审查看板

审查状态: ✅ 已通过

审查版本: 2c7cdd3

目标分支: codex/ci-skill

审查完成,未发现问题,建议合入。head 2c7cdd3 为重触发 CI 的空提交,栈基线同步重排;直接基线 diff(8a11df74..2c7cdd3)与已完整验证并批准的补丁逐字节一致,本层 14 个文件内容不变:7 个 JS/TS 文件经 esbuild 规范化输出与基线一致,5 个 JSON 解析值一致,CSS 仅等价空白与引号变化;.pre-commit-config.yaml 的语义变化恰为四处有意变更(types_or [text]、--no-error-on-unmatched-pattern、移除 #392 临时排除、exclude_types [yaml, toml] 延期 YAML/TOML)。已用镜像实际安装的 PyPI oxfmt 0.69.0 在本 head 按模拟 pre-commit 选择复现门禁:匹配 22 个文件全部格式正确。CI 全部检查(含 GPU 单测与集成测试)在本 head 通过。

审查阶段进度范围与结果
常规审查 ✅ 已完成 确认重排后直接基线 diff 与已验证补丁逐字节一致,复核 oxfmt 门禁(22 个匹配文件全部格式正确);CI 全部检查通过。无新发现问题。
深度审查 ✅ 已完成 必要性与替代方案审计结论复用(范围逐字节一致):生产范围为 oxfmt hook 配置块(含 YAML/TOML 延期决策)与 13 个重排文件,均给出更简替代方案并保留;测试范围无适用的仓库内改动。未发现正当精简项。

没有未解决的审查问题。

提交范围 · 接收 14 · 建议移出 0 · 待确认 0

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

文件结论仓库维护必要性依据替代去向或方案
.pre-commit-config.yaml
接收 Production change of this PR: expands the oxfmt hook to the formats the standalone binary supports (types_or [text] plus --no-error-on-unmatched-pattern, removing #392's temporary path exclude) while deferring YAML/TOML via exclude_types so those files keep their existing style. The repo must maintain this config for the CI style gate to pass. Rebased range (8a11df7..2c7cdd3, top commit is a CI-retrigger empty commit) verified byte-identical to the previously approved patch; responsibilities and requirements unchanged. PR #398 description (What/How, exclude_types deferral); .github/workflows/ci.yml runs prek over all files; commit 5bb594d 'ci(format): defer YAML and TOML formatting'. Enumerating pre-commit type tags misses .mts/.jsonc/.gql (identify assigns them no filename tags, verified); formatting YAML/TOML now would touch 16 more files including runtime configs and user examples — deferral keeps the layer minimal, and no external artifact can hold the repo's formatting gate.
.github/actions/acquire-devices/common.js
.github/actions/acquire-devices/main.js
.github/actions/acquire-devices/post.js
docs/.vitepress/config.mts
docs/.vitepress/plugins/source-links.ts
docs/.vitepress/theme/custom.css
docs/.vitepress/theme/index.ts
docs/.vitepress/tsconfig.json
docs/fix-chunk-names.js
docs/public/openapi/actor.json
docs/public/openapi/actor_fwd.json
docs/public/openapi/genrm.json
docs/public/openapi/rollout.json
接收 Existing CI-infrastructure and docs-site files reformatted in place; after the hook expansion the repository must carry the oxfmt-formatted state or the pre-commit/prek gate fails on them. Semantics verified unchanged versus the direct base (esbuild-normalized output identical for JS/TS, parsed values identical for JSON, CSS equivalent). Rebased range (8a11df7..2c7cdd3, top commit is a CI-retrigger empty commit) verified byte-identical to the previously approved patch; responsibilities and requirements unchanged. PR #398 description (moves acquire-devices and docs formatting out of #392's temporary exclude); verified PyPI oxfmt 0.69.0 matches all of these files at head and reports them correctly formatted. Keeping the files unformatted or excluding these paths permanently would fail or split the style gate; no external artifact can hold checked-in workflow action code, docs build code, or published OpenAPI specs.
精简审查与验证依据
审查范围进度结论
生产代码 ✅ 已完成 检查了 oxfmt hook 扩展(含 YAML/TOML 延期)与 13 个重排文件的更简替代方案;结论为全部保留,无正当精简项。
测试 ➖ 无需执行 本 PR 未新增、修改或删除任何测试文件;格式化层无可供测试精简审计的仓库内范围。其行为由 CI pre-commit/prek 全量门禁作为可执行 oracle 覆盖(本地已用模拟 pre-commit 选择独立复现 22 个匹配文件全部通过),语义中立性由 esbuild AST 与解析值比对一次性验证,不适合固化为常驻测试。

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

范围必须保留的契约更简单的方案结论依据与限制
.pre-commit-config.yaml 中 oxfmt hook 的 types_or [text]、--no-error-on-unmatched-pattern、移除 #392 临时 exclude,以及 exclude_types [yaml, toml] 延期 CI pre-commit/prek 门禁须在本 head 全量通过并覆盖 standalone oxfmt 支持的 JS/TS/JSON/样式表/GraphQL 等格式,同时 YAML/TOML 保持原风格;调用方为 .github/workflows/ci.yml 的 prek-action。 枚举 pre-commit 类型标签:identify 对 .mts/.jsonc/.gql 不给任何文件名标签(已验证),枚举会静默漏检;不加旗标则仅含不支持格式的批次以 rc=2 失败(已实测);不延期而立即格式化 YAML/TOML:会额外改动 16 个文件(含运行时配置与用户示例),扩大审查面而无功能收益。 保留 用镜像实际安装的 PyPI oxfmt 0.69.0 在本 head 复现:模拟 pre-commit 选择(1319 个候选)下 oxfmt 匹配 22 个文件且全部格式正确;受支持格式语法错误仍失败;延期方案与撤回的 YAML/TOML 内容一致,仓库内无其他工具格式化 YAML/TOML,不引入风格冲突。。CI 全部检查(含 GPU 单测与集成测试)已在本 head 通过。。CI 全部检查(含 GPU 单测与集成测试)已在本 head 通过。
13 个由 oxfmt 重排的既有文件(acquire-devices 三个 JS、docs 站点 6 个 TS/CSS/JSON/JS 文件、4 个 OpenAPI JSON) 仓库必须持有与扩展后门禁一致的已格式化状态,否则 pre-commit/prek 在下次运行时改写并失败。 保持文件未格式化或继续排除这些路径:前者使门禁在本 head 失败,后者在 CI 动作目录与文档站内永久保留两套风格机制。 保留 逐文件验证 13 个改动均在 oxfmt 匹配集内且 --check 通过;语义等价性经 esbuild AST 比对与 JSON 解析值比对确认,无行为风险。CI 全部检查(含 GPU 单测与集成测试)已在本 head 通过。。CI 全部检查(含 GPU 单测与集成测试)已在本 head 通过。
Powered by Nyanpasu with glm-5.3[1m] xhigh, please check the suggestions carefully.

@SigureMo SigureMo changed the title style(repo): format all supported oxfmt files style(repo): expand oxfmt formatting coverage Oct 1, 2026
@SigureMo
SigureMo force-pushed the codex/oxfmt-formats branch from 746464d to 5bb594d Compare October 1, 2026 10:15

@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 #398(style(repo): expand oxfmt formatting coverage)在 head 5bb594d3 相对直接基线 codex/ci-skill(8fa80e90)的 14 个文件完成了常规与深度审查。7 个 JS/TS 文件经 esbuild 规范化输出与基线逐字节一致,5 个 JSON 文件解析值一致,CSS 仅等价空白与引号变化;.pre-commit-config.yaml 的语义变化恰为四处有意变更(types_or: [text]、--no-error-on-unmatched-pattern、移除 #392 的临时路径排除、新增 exclude_types: [yaml, toml] 延期 YAML/TOML)。使用镜像实际安装的 PyPI oxfmt 0.69.0 按模拟 pre-commit 文件选择独立复现了门禁行为:1319 个候选文件中 oxfmt 匹配 22 个且全部格式正确(与描述一致);无该旗标时仅含不支持格式的批次会以 rc=2 失败,受支持格式的语法错误仍会失败。必要性与替代方案审计未发现正当精简项;延期方案与撤回的 YAML/TOML 内容一致,且仓库内无其他工具格式化 YAML/TOML,不引入风格冲突。CI 全部必需检查(含 Pre-commit Checks)在本 head 通过。

详见审查看板:#398 (comment)

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

@SigureMo
SigureMo force-pushed the codex/oxfmt-formats branch from 5bb594d to f7a4118 Compare October 1, 2026 13:31
@SigureMo
SigureMo force-pushed the codex/oxfmt-formats branch from f7a4118 to b6fadbf Compare October 1, 2026 13:38

@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 #398(style(repo): expand oxfmt formatting coverage)在 head b6fadbf 相对直接基线 codex/ci-skill(8cfb0eb9)的 14 个文件完成了常规与深度审查。本范围为既有已验证补丁的纯重排:直接基线 diff 与此前完整审查并通过的补丁逐字节一致,本层文件内容不变。此前的独立验证结论全部复核有效:7 个 JS/TS 文件经 esbuild 规范化输出与基线逐字节一致,5 个 JSON 文件解析值一致,CSS 仅等价空白与引号变化;.pre-commit-config.yaml 的语义变化恰为四处有意变更(types_or: [text]、--no-error-on-unmatched-pattern、移除 #392 的临时路径排除、exclude_types: [yaml, toml] 延期 YAML/TOML)。使用镜像实际安装的 PyPI oxfmt 0.69.0 在本 head 按模拟 pre-commit 文件选择复现了门禁:1319 个候选文件中 oxfmt 匹配 22 个且全部格式正确。CI 中与本层直接相关的检查(Pre-commit Checks、Python 3.10–3.12 测试)在本 head 通过;GPU 单测与集成测试仍在排队/运行(同一补丁在更早 head 已全部通过,本层不含运行时代码路径改动)。必要性与替代方案审计未发现正当精简项。

详见审查看板:#398 (comment)

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

rai-studio-bot
rai-studio-bot previously approved these changes Oct 1, 2026

@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 #398(style(repo): expand oxfmt formatting coverage)在 head c99d140a 相对直接基线 codex/ci-skill(8cfb0eb9)的审查已完成。本 head 为重触发 CI 的空提交,树与已完整审查并通过的 b6fadbf 完全一致,直接基线 diff 逐字节不变。独立验证结论全部复核有效:7 个 JS/TS 文件经 esbuild 规范化输出与基线逐字节一致,5 个 JSON 文件解析值一致,CSS 仅等价空白与引号变化;.pre-commit-config.yaml 的语义变化恰为四处有意变更(types_or: [text]、--no-error-on-unmatched-pattern、移除 #392 的临时路径排除、exclude_types: [yaml, toml] 延期 YAML/TOML)。使用镜像实际安装的 PyPI oxfmt 0.69.0 按模拟 pre-commit 文件选择复现门禁:1319 个候选文件中 oxfmt 匹配 22 个且全部格式正确。重触发后 CI 全部检查(含此前受阻的 GPU 单测与集成测试)在本 head 通过。必要性与替代方案审计未发现正当精简项。

详见审查看板:#398 (comment)

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

DrRyanHuang
DrRyanHuang previously approved these changes Oct 1, 2026
SigureMo and others added 3 commits October 2, 2026 01:15
- Let the standalone oxfmt mirror select supported formats from tracked text files.
- Cover TypeScript, JSON variants, stylesheets, GraphQL, YAML, and TOML without Node.js.
- Remove the temporary formatting exclusions while keeping JS/JSON out of clang-format.

- Apply the shared root formatting options across the repository.
- Preserve structured configuration values and verify JavaScript/TypeScript output, documentation build, and all pre-commit hooks.

Co-authored-by: Codex <[email protected]>
# 🔧 CI/CD

- Exclude YAML and TOML from the oxfmt hook by file type.
- Restore their original formatting, including the pre-commit configuration layout.
- Keep the JavaScript, TypeScript, JSON, stylesheet, and GraphQL formatting scope.

Co-authored-by: Codex <[email protected]>
# 🔧 CI/CD

- Publish an empty commit to request fresh checks for this pull request.

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

@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 #398(style(repo): expand oxfmt formatting coverage)在 head 2c7cdd3c 相对直接基线 codex/ci-skill(8a11df74)的审查已完成。本 head 为重触发 CI 的空提交,栈基线同步重排;直接基线 diff 与此前完整审查并通过的补丁逐字节一致,本层 14 个文件内容不变。独立验证结论全部复核有效:7 个 JS/TS 文件经 esbuild 规范化输出与基线逐字节一致,5 个 JSON 文件解析值一致,CSS 仅等价空白与引号变化;.pre-commit-config.yaml 的语义变化恰为四处有意变更(types_or: [text]、--no-error-on-unmatched-pattern、移除 #392 的临时路径排除、exclude_types: [yaml, toml] 延期 YAML/TOML)。使用镜像实际安装的 PyPI oxfmt 0.69.0 按模拟 pre-commit 文件选择复现门禁:1319 个候选文件中 oxfmt 匹配 22 个且全部格式正确。重触发后 CI 全部检查(含此前受阻的 GPU 单测与集成测试)在本 head 通过。必要性与替代方案审计未发现正当精简项。

详见审查看板:#398 (comment)

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

@SigureMo
SigureMo merged commit e36db4b into main Oct 1, 2026
11 checks passed
@SigureMo
SigureMo deleted the codex/oxfmt-formats 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]>
Mukayi added a commit to Mukayi/Relax that referenced this pull request Oct 4, 2026
…er-profiler

Brings in upstream/main 99a0b6a..653c43c (redai-studio#302, redai-studio#392-redai-studio#396, redai-studio#398, redai-studio#401,
redai-studio#403, redai-studio#405).

The only conflict is the guide sidebar in docs/.vitepress/config.mts:
redai-studio#398 reformatted it with oxfmt (trailing commas, long entries split), and
this branch adds the "Straggler Analysis" / "Straggler 分析" entries next
to the same lines. Resolved by taking upstream's formatting and keeping
the two straggler entries in their previous position.
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