已开启
add ai declaration check guide #112
add ai declaration check guide #112
已开启
Guangyue-Xu创建于 8月3日
Guangyue-Xu
Guangyue-Xu
8月3日

当前PR是否有AI参与:

[ ] 否

[x] 是
__1. AI Agent 平台: Claude Code
__2. AI 模型: Deepseek V3
__3. Prompt上下文 : 针对ai声明检查功能,提供一份用户指导

PR功能描述 / 为什么需要这个合入**:

提供机器人AI声明检查工具的使用指导

后续失败提示如下:
image.png

该PR关联的issue

(格式为fixes #<issue号>, 或者resolves #<issue号>): fixes #223

希望检视人员了解:

改动类型 / Change Type

测试信息 / Testing

检查清单 / Checklist

likedislike
合并受阻
Guangyue-XuGuangyue-Xu
8月3日 创建了 pull request,commit 972f35f2
Guangyue-XuGuangyue-Xu
8月3日 关联了issue:PR AI声明合规检查提示不友好:AI Declaration Check Failed
atomgit-bot
atomgit-bot
8月3日 评论:

变更摘要

本次 PR 为 infrastructure 项目新增了机器人 AI 声明检查工具的使用指南文档,帮助开发者了解如何使用该工具对合入代码进行 AI 声明合规性检查。该变更纯属文档更新,对应 issue #223,不涉及任何代码逻辑修改。

主要改动

  • 新增 AI 声明检查指导文档: 添加了一份完整的 AI 声明检查工具使用指南(144 行),涵盖工具的背景说明、使用方法及操作步骤,为开发者提供自助式的合规检查参考。
likedislike
atomgit-bot
atomgit-bot
8月3日 评论:

代码审查

审查总结

我对 docs/robot/ai_declaration_check_guide.md(新增 144 行)进行了逐段审查,重点关注文档示例与机器人实际检查规则的一致性、安全隐患以及可能误导用户的内容。

审查结果

优先级 数量
P0 0
P1 1
P2 0
P3 0

各文件审查结论

  • docs/robot/ai_declaration_check_guide.md:发现 1 个 P1 问题——「完整示例」中的 commit message 与 PR 模板声明的 AI 模型不一致,按照机器人实际检查规则(Issue #223),用户照此示例操作会导致检查失败,属于文档自相矛盾的误导性问题。其余内容无安全隐患、无不安全命令、无敏感信息泄露。

整体风险评估

该文档新增了一个清晰的 AI 声明合规指南,整体结构合理、内容覆盖全面。但核心的「完整示例」存在自相矛盾——PR 模板声明模型为 DeepSeek-V3,而 commit 示例中完全没有体现该模型名称,这与机器人"commit 中必须包含 AI 模型名"的检查规则直接冲突。建议在合入前修正该示例,否则开发者按文档操作后仍会收到 ai-compliance-failed,违背了该文档"提供具体修改方法指导"的初衷(Issue #223)。

类型 数量
🔴 阻塞 1
🟡 建议 0

⛔ 需要修改

likedislike
CANN-robotCANN-robot成员
8月3日 添加了label:cann-cla/no
CANN-robot
CANN-robot成员
8月3日 评论:

Thanks for your pull-request.
The full list of commands accepted by me can be found at here
You can get sig-info at here


PR Approval Progress

⚠️ This PR does not yet meet the following requirements:lgtm (requires ≥ 2 person(s) per module)、approve (requires ≥ 1 person(s) per module)

Module Approval Details

module lgtm status approve status
repo-cann/infrastructure ❌ (0/2)(You can also ask: 李超然, weixin_39767879, linxi9527, aflyingto, yangbinhua) ❌ (0/1)(You can also ask: chrisffjx, yangbinhua, drizzlezyk, 李超然, linxi9527)

💡 Tip:

  • Committer can comment /approve or /lgtm
  • Commenting /approve implies both code review (lgtm) and intent to merge (approve)

CLA Signature Pass

Guangyue-Xu, thanks for your pull request. All authors of the commits have signed the CLA. 👍

likedislike
atomgit-bot
atomgit-bot8月3日进行代码检视1
docs/robot/ai_declaration_check_guide.md
@@ -0,0 +80,4 @@
80+refactor: extract user service interface
81+ 
82+Co-authored-by: Claude <noreply@anthropic.com>
83+```
atomgit-bot
atomgit-bot8月3日评论:

🟠 High Priority

问题链

  1. 变更行(第 73-74 行 vs 第 82 行):文档的「完整示例」中,PR 模板声明了 AI 模型为 DeepSeek-V3(第 74 行),但 commit message 中仅出现了 Co-authored-by: Claude <noreply@anthropic.com>(第 82 行),DeepSeek-V3 模型名称完全未出现在 commit message 中。

  2. 受影响的规则/合约:根据关联 Issue #223 中机器人实际的检查提示——"Commit messages must include the AI model, and it must be consistent with the PR description"(commit 中必须包含 AI 模型名且与 PR 描述一致),以及本文档自身第 110-114 行的规则——"模板中填写的工具/模型与 commit message 中声明的不一致"会导致检查不通过。

  3. 失败模式:用户如果严格按照这个「完整示例」来填写(模板写 DeepSeek-V3,commit 只写 Claude),机器人的模型一致性检查将会因为 commit 中找不到 DeepSeek-V3 而判定不通过(打上 ai-compliance-failed 标签)。这份文档的"正确示范"实际上会导致检查失败,严重误导开发者。

建议:在 commit message 示例中补充模型名称,使示例与机器人检查规则一致。可考虑两种方案:(1) 在 commit body 中增加模型说明,如 Used DeepSeek-V3 via Claude Code;(2) 若机器人实际以工具名匹配即可通过,则应在文档中明确说明匹配规则,消除歧义。同时将第 59 行的独立示例一并修正以保持一致。

likedislike
Guangyue-Xu
Guangyue-Xu
8月3日 评论:

/check-cla

likedislike
CANN-robotCANN-robot成员
8月3日 删除了label:cann-cla/no
CANN-robotCANN-robot成员
8月3日 添加了label:cann-cla/yes
CANN-robot
CANN-robot成员
8月3日 评论:

CLA检查已通过,详情可参考这里

likedislike
Guangyue-XuGuangyue-Xu
8月3日 update merge request[project id: 7990062, iid: 112, commit_id: e08bf705de74058a1de9f27c1811c14ffb260bd7] virtual merging success
此处折叠了7条事件消息 查看更多
CANN-robotCANN-robot成员
8月3日 添加了label:ai-compliance-failed
CANN-robot
CANN-robot成员
8月3日 评论:

AI Declaration Check Failed

@Guangyue-Xu, AI declaration is not compliant. AI tool: Claude

Please check:

  1. The AI tool and model declared in the PR description must be real.
  2. Commit messages must include the AI model, and it must be consistent with the PR description. ⚠️
likedislike
Guangyue-XuGuangyue-Xu
8月3日 update merge request[project id: 7990062, iid: 112, commit_id: 1823085522d540c7f9d84ac13a8ea015c38192fa] virtual merging success
此处折叠了8条事件消息 查看更多
Guangyue-XuGuangyue-Xu
8月3日 修改了pull request 的描述
zhunaipan
zhunaipan成员27 天前进行代码检视2
docs/robot/ai_declaration_check_guide.md
@@ -0,0 +43,4 @@
43+|------|------|------|
44+| **AI Agent 平台** | 使用的 AI 工具名称 | `Claude Code``Copilot``Cursor` |
45+| **AI 模型** | 使用的模型名称 | `DeepSeek-V3``GPT-4``Claude Opus 4` |
46+| **Prompt上下文** | 简要描述 AI 协助完成的任务 | `重构 user 模块,补充单元测试` |
zhunaipan
zhunaipan27 天前评论:

这里的信息是如何校验准确性的,如果是强校验,建议先作为参考信息;

加入我直接用的是网页版的DS去生成一些资料文档,那上面的AI Agent平台应该怎么填?

likedislike
Guangyue-Xu
Guangyue-Xu
27 天前 评论:

1、此处非强校验,不会校验大小写,书写格式,保证拼写正确即可
2、网页版的Deepseek如实写即可,比如Deepseek网页端 或者 Deepseek web端,可以识别

zhunaipan
zhunaipan成员27 天前进行代码检视4
docs/robot/ai_declaration_check_guide.md
已过期
@@ -0,0 +58,4 @@
58+ 
59+ Used DeepSeek-V3 via Claude Code
60+ 
61+ Co-authored-by: Claude <noreply@anthropic.com>
zhunaipan
zhunaipan27 天前评论:

那其它的平台邮箱是啥?都是noreply@anthropic.com?这里的示例名字跟上面‘Claude Code’还是“Claude Opus 4”对应,名字跟上面也不一样?开发者如何保障一致性?

最好能提供脚本工具帮助commit生成信息,然后相关信息标签和检查自动从模板中提取,不需要多出记录,给开发者增加负担。

likedislike
zhunaipan
zhunaipan成员
27 天前 评论:
System
系统消息系统
27 天前 评论:

changed this line on f7504f2a view diff detail

Guangyue-Xu
Guangyue-Xu
27 天前 评论:

1、此处邮箱非必须,防止误会,此处已去掉
2、此处commit信息应与前面的模型一致,举例有误,已修正,同样这里也不是强校验,不会校验大小写及书写格式
3、关于脚本,由于一般是提交commit msg在前,提交pr在后,我们建议开发者在提交commit msg时可以提供给ai提示词,让ai自己提交并携带自己的模型信息

zhunaipan
zhunaipan成员27 天前进行代码检视3
docs/robot/ai_declaration_check_guide.md
已过期
@@ -0,0 +101,4 @@
101+### 2. 工具或模型名称不真实
102+ 
103+- 工具名拼写错误、虚构或不明确
104+- 模型名无法归入已知系列(DeepSeek / Claude / GPT / Qwen / Gemini / Llama / Mistral / Grok)
zhunaipan
zhunaipan27 天前评论:

已知的有哪些,也不能强制限定范围?比如MinMax ? Kimi算不算?

likedislike
System
系统消息系统
27 天前 评论:

changed this line on f7504f2a view diff detail

Guangyue-Xu
Guangyue-Xu
27 天前 评论:

算,此处并非列举所有,已修正描述,多数热门平台和模型均已收录

Guangyue-XuGuangyue-Xu
27 天前 update merge request[project id: 7990062, iid: 112, commit_id: db09fc24c8fdf295c7a2938c847865f157c69b80] virtual merging success
此处折叠了8条事件消息 查看更多
CANN-robotCANN-robot成员
27 天前 添加了label:cann-cla/yes