Skip to content

docs(citation): add GitHub native citation support - #405

Merged
SigureMo merged 1 commit into
redai-studio:mainfrom
ShigureNyako:session/sess_dev_neko_add_native_github_citation_support_to_relax_with
Oct 2, 2026
Merged

SigureMo merged 1 commit into
redai-studio:mainfrom
ShigureNyako:session/sess_dev_neko_add_native_github_citation_support_to_relax_with

Conversation

@ShigureNyako

Copy link
Copy Markdown
Contributor

What

仅在仓库根目录新增 CITATION.cff,提供 GitHub 原生 “Cite this repository” 功能所需的引用元数据。文件包含软件引用与 preferred-citation;不修改 README、依赖、配置或运行时代码。

Why

让研究者可以直接从 GitHub 获取 Relax 的引用信息,而不必手工整理。根目录此前没有 CITATION.cff,且已检查所有开放 PR 的变更文件,未发现重复的引用文件改动。

How

  • 使用 CFF 1.2.0,完整保留提供的引用内容,两处 type 均为 software,作者均为 Relax Contributors,首选引用年份为 2026。
  • 官方 schema 允许 authors 中使用实体作者,实体的必需字段是 name;因此保留 name: 'Relax Contributors',不改写成人名,也不替换为论文作者列表。
  • 保留仓库地址及两处 arXiv 地址;已核对 arXiv:2604.11554 的实际标题与文件中的两处标题完全一致,论文发布日期为 2026-04-13。
  • 无需任何 schema 合法化改写;最终文件与提供的内容逐字节一致。GitHub 引用入口是否实际显示,需在文件进入默认分支后确认。

Testing

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

验证结果:

  • 使用独立临时验证环境检查 UTF-8、单文档 YAML、重复键及提供内容的逐字节一致性,全部通过。
  • 使用官方 CFF 1.2.0 schema 与 jsonschema Draft 7 验证整个文件及两处实体作者,全部通过。
  • uv tool run --python 3.11 --from cffconvert==2.0.0 cffconvert --validate -i CITATION.cff:通过。
  • 默认 Python 3.14 下的 pre-commit 首次尝试被既有 docformatter==1.3.1 的安装兼容性问题阻塞;改用项目 CI 所用的 Python 3.10,运行 uv run --no-project --python 3.10 --with pre-commit==4.3.0 pre-commit run --all-files --show-diff-on-failure,全部 16 个 hooks 通过。未跳过 hooks,未修改项目依赖或配置。
  • git diff --cached --check:通过;自审确认变更仅为新增 CITATION.cff,共 15 行。
  • 未运行 pytest tests/ 或新增代码测试:此次仅新增静态引用元数据,不涉及 Python 运行逻辑。GPU / 分布式集成测试也未运行,本地为 macOS arm64,未提供所需的多节点 GPU 环境。

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

CFF 验证器输出:

Citation metadata are valid according to schema version 1.2.0.

# 📝 Documentation

## Add repository citation metadata

- Add only the root CITATION.cff using the supplied CFF 1.2.0 metadata.
- Preserve Relax Contributors entity authors and the preferred software citation.
- Validate YAML, the official schema, the arXiv title, and all pre-commit hooks on Python 3.10.
@rai-studio-bot

Copy link
Copy Markdown
Contributor

Thanks for contributing to Relax, @ShigureNyako! 感谢你为 Relax 做出贡献!

Contribution guide / 贡献指南

Describe the problem, your changes, and how you validated them. Keep each PR focused and run pre-commit run --all-files before submitting.

请说明问题、改动和验证方式,保持 PR 聚焦,并在提交前运行 pre-commit run --all-files。

English contribution guide · 中文贡献指南

CI commands / CI 指令
Command / 指令 Usage / 用途
/rerun Retry failed CI / 重跑失败的 CI
/rerun <target> Rerun a workflow or check / 重跑指定 workflow 或检查
/cancel <workflow> Cancel an entire workflow / 取消整个 workflow
/help Show commands and targets / 查看指令和 target
/review Request a code review / 请求代码 review

Put one command on the first line of a new PR comment. Rerun/cancel require PR authorship or repository write access.

在新 PR 评论的首行写一条指令。PR 作者或有仓库写权限的贡献者可以重跑、取消 CI。

CI usage and targets · CI 用法与 target

@rai-studio-bot

rai-studio-bot commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

Nyanpasu 审查看板

审查状态: ✅ 已通过

审查版本: a39d038

目标分支: main

审查完成,未发现问题。变更仅为根目录新增 15 行 CITATION.cff(CFF 1.2.0):官方 schema 与 cffconvert 2.0.0 验证均独立复验通过;arXiv:2604.11554 标题与两处引用逐字一致(v1 发布于 2026-04-13);内容与 README.md / README_zh.md 既有 BibTeX 引用完全一致;GitHub 官方文档确认默认分支根目录的 CITATION.cff(含 preferred-citation 渲染)即启用原生 'Cite this repository' 入口。仓库代码与 CI 均不读取该文件,无运行时影响;必需 CI 检查仍在进行,与本静态文件无耦合。

审查阶段进度范围与结果
常规审查 ✅ 已完成 已完整核对唯一变更文件:YAML 单文档且无重复键、官方 CFF 1.2.0 schema(jsonschema 4.26.0)与 cffconvert 2.0.0 验证通过、arXiv 标题/日期与 PR 描述一致、与 README 双语引用块一致、GitHub 引用功能契约(根目录 + preferred-citation 渲染)满足、无代码/CI/pre-commit 挂钩耦合、其他开放 PR 无重复引用文件改动。未确认任何问题。
深度审查 ✅ 已完成 无子任务:变更为机械性静态元数据新增,独立设计按记录跳过;生产/测试必要性审计由主审直接完成(见 simplification),证据已复核归并。

没有未解决的审查问题。

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

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

文件结论仓库维护必要性依据替代去向或方案
CITATION.cff
接收 GitHub 原生 'Cite this repository' 功能仅从默认分支根目录的 CITATION.cff 读取引用元数据并渲染(含 preferred-citation);该文件是启用此用户工作流的唯一机制,属于仓库需长期维护的根级元数据,与 README 既有引用内容一致。 PR #405 描述(add GitHub native citation support);GitHub Docs 'About CITATION files';README.md:308-318 与 README_zh.md:308-318 既有引用章节 维持仅 README 内嵌 BibTeX(PR 前状态):GitHub 引用入口不会出现,研究者需手工整理引用,不满足本 PR 目标;外部归档或 PR artifact 无法被 GitHub 平台功能读取。
精简审查与验证依据
审查范围进度结论
生产代码 ✅ 已完成 生产必要性审计:根目录 CITATION.cff 是 GitHub 原生引用功能读取的唯一载体,无更小的现存机制可替代;顶层数据与 preferred-citation 各自承担软件引用与偏好引用输出,不构成冗余实现。保留原样。
测试 ➖ 无需执行 无适用测试范围:变更为静态引用元数据,无可执行代码路径;relax/ 与 tests/ 均无代码读取该文件(grep 验证),CI 亦无 YAML/CFF 校验步骤,不存在可回归的生产行为,也未新增或修改任何测试。为静态文件新增 schema 校验测试属于零收益维护负担。

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

范围必须保留的契约更简单的方案结论依据与限制
根目录 CITATION.cff(顶层软件引用 + preferred-citation,共 15 行) GitHub 在默认分支根目录读取 CITATION.cff,为 'Cite this repository' 渲染 APA/BibTeX(含 preferred-citation 输出);来源/调用方为 GitHub 平台功能,内容与 README.md:308-318、README_zh.md:308-318 既有引用契约一致。 不新增文件,仅维持 README 内嵌 BibTeX;或删去 preferred-citation 仅保留顶层引用(GitHub 偏好引用输出将缺失 year: 2026 等字段)。 保留 GitHub Docs 确认根目录 CFF 与 preferred-citation 均被渲染;官方 CFF 1.2.0 schema 与 cffconvert 2.0.0 验证通过;README 双语 bibtex 与文件内容一致;仓库代码零引用(grep 验证),维护成本为单一静态文件。局限:GitHub 入口实际展示需合并到默认分支后最终确认(PR 描述已如实说明)。
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.

审查结论:通过 ✅

本 PR 仅在仓库根目录新增 15 行 CITATION.cff(CFF 1.2.0),未改动其他文件。审查独立复核:YAML 单文档、无重复键;官方 CFF 1.2.0 schema(jsonschema 4.26.0)与 cffconvert 2.0.0 --validate 均通过;arXiv:2604.11554 的实际标题与文件中两处标题逐字一致(v1 发布于 2026-04-13);内容与 README.md:308 / README_zh.md:308 既有 BibTeX 引用一致;GitHub 官方文档确认默认分支根目录的 CITATION.cff(含 preferred-citation 渲染)即启用 "Cite this repository" 入口。仓库代码与 CI 均不读取该文件,无运行时影响。未发现问题。

审查看板:#405 (comment)

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

@SigureMo
SigureMo merged commit 653c43c into redai-studio:main Oct 2, 2026
12 checks passed
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