已合并
docs(agent): finish #321 P0 rules cleanup and catalog drift fixes #1130
docs(agent): finish #321 P0 rules cleanup and catalog drift fixes #1130
已合并
changzherui创建于 8月7日
changzherui
changzherui成员
8月7日

What type of PR is this?
/kind clean_code


What does this PR do / why do we need it:

完成 #321 剩余 P0(#1110 已合入瘦身主轴之后)。本 PR 不改产品代码,只整理 .agent/ + AGENTS.md

1. Rules / Skills 分层

  • unit_test 流程指南迁到 skill add-unit-testreferences/guide.md
  • rules 侧保留短约束 unit-test.md
  • 统一 rules frontmatter(补 namemulti-platform-featurespaths

2. 内容漂移归一

  • pytest runner vs unittest.TestCase authoring 口径统一(testing.md / distributed-op-testing.md / guide)
  • 断言格式:distributed-op-testing 指向 test-assertion-style(不再双份复述)
  • commit subject:~80 统一到 code-style.md,修正 gen-commit-msg 的 50–72 冲突
  • distributed-guidelines.md 标明 SoT = rules/distributed.md,压缩 Platform API 复述

3. AGENTS.md / 集成边界

  • 新增 Hooks(harness-specific) 说明与跨工具降级
  • Testing / Git Workflow 与 rules 对齐;索引加入 add-unit-test
  • llamafactory-hpactivation-dev 交叉引用,避免 activation 细节双写

4. 短 why 注释 + catalog 校验

  • code-style.md 增加行内 why-only 规则;review checklist 同步
  • 新增 .agent/scripts/check_agents_catalog.py(Skills/Agents 表 vs 磁盘)

Which issue(s) this PR fixes:

Related to #321(关闭剩余 P0;P1/P2 仍 open)


Test Plan and Test result

检查 结果
python3 .agent/scripts/check_agents_catalog.py OK(8 skills / 12 agents)
rules frontmatter 含 name 全部 OK
相对 upstream/master commit 数 1
产品 UT/ST 未跑(无生产代码 diff)

Self-checklist:

likedislike
Pull Request已成功合入, 合并人@MindSpore-Bot
(感谢 changzherui 的贡献)
changzheruichangzherui成员
8月7日 创建了 pull request,commit cb82efc9
changzheruichangzherui成员
8月7日 关联了issue:[RFC]: 重构 .agent 体系,提升 Agent 编程能力(progressive disclosure)
atomgit-bot
atomgit-bot
8月7日 评论:

变更摘要

此 PR 完成 #321 剩余的 P0 清理工作,仅涉及 .agent/ 目录与 AGENTS.md 的文档整理,不修改任何产品代码。核心目标是将 rules(硬约束)与 skill(流程指南)分层、统一多处内容漂移的口径、新增 catalog 校验脚本以检测 AGENTS.md 中 Skills/Agents 表格与磁盘文件之间的不一致。

主要改动

  • 新增 catalog 校验脚本:添加 .agent/scripts/check_agents_catalog.py,通过解析 AGENTS.md### Skills### Agents 表格的加粗名称,与 .agent/skills/ 下的 SKILL.md.agent/agents/ 下的 .md 文件逐一比对,不一致时以非零退出码报错,确保文档表格与磁盘文件始终同步
  • Rules / Skills 分层:将 unit_test 流程指南从 rules 迁入 skill add-unit-testreferences/guide.md),rules 侧仅保留短约束 unit-test.md;同时为 rules frontmatter 统一补充 name 字段,multi-platform-features 补全 paths 声明
  • 内容漂移归一:统一 pytest runner 与 unittest.TestCase authoring 的口径(涉及 testing.mddistributed-op-testing.md 与 guide);断言格式在 distributed-op-testing 中改为指向 test-assertion-style 规则而非重复复述;commit subject 长度统一为 ~80 字符并收敛至 code-style.md,修正 gen-commit-msg 中原 50–72 的冲突定义
  • AGENTS.md 集成边界与交叉引用更新:新增 Hooks(harness-specific)说明与跨工具降级策略;Testing / Git Workflow 章节与 rules 对齐,索引加入 add-unit-test;增加 llamafactory-hpactivation-dev 交叉引用以避免 activation 细节双写;distributed-guidelines.md 标明 SoT 为 rules/distributed.md 并压缩 Platform API 复述
likedislike
不准确?
atomgit-bot
atomgit-bot
8月7日 评论:

代码审查

✅ 未发现问题

likedislike
不准确?
MindSpore-BotMindSpore-Bot成员
8月7日 添加了label:mindspore-cla/yes
司小南(机器人)司小南(机器人)成员
8月7日 添加了label:pr-check-pass
changzherui
changzherui成员
8月7日 评论:

/retest

likedislike
司小南(机器人)
司小南(机器人)成员
8月7日 评论:

🔵 The pipeline #6613 is running. Please wait a moment... (Link)

likedislike
司小南(机器人)司小南(机器人)成员
8月7日 添加了label:ci-pipeline-running
changzheruichangzherui成员
8月7日 修改了pull request 的描述
changzheruichangzherui成员
8月7日 预合并成功(commit_id: b84c1572eddd4c9afe6d4c8e005304fcae4750e7)
changzheruichangzherui成员
8月7日 审查状态已重置,审查人: yangzhenzhang,yao_yf,suteng
changzheruichangzherui成员
8月7日 强制推送  1 个提交:593116f0-docs(agent): finish #321 P0 rules cleanup and catalog drift fixes
changzheruichangzherui成员
8月7日 预合并成功(commit_id: 24905d1953aa20cf8b8182ad8eb5ae1fd30337ed)
司小南(机器人)
司小南(机器人)成员
8月7日 评论:
Project Name Build_Stage Build Result Details
Hyper-parallel_Atomgit_Gate - FAILURE 6613
likedislike
MindSpore-Bot
MindSpore-Bot成员
8月7日 评论:

CLA Signature Pass

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

likedislike
司小南(机器人)司小南(机器人)成员
8月7日 删除了label:ci-pipeline-running
司小南(机器人)司小南(机器人)成员
8月7日 添加了label:ci-pipeline-failed
司小南(机器人)
司小南(机器人)成员
8月7日 评论:

检测到Pull Request代码更新,即将终止当前正在执行的门禁任务(若存在),请基于当前版本的代码重新触发。

likedislike
changzherui
changzherui成员
8月7日 评论:

/retest

likedislike
司小南(机器人)
司小南(机器人)成员
8月7日 评论:

🔵 The pipeline #6615 is running. Please wait a moment... (Link)

likedislike
司小南(机器人)司小南(机器人)成员
8月7日 删除了label:ci-pipeline-failed
司小南(机器人)司小南(机器人)成员
8月7日 添加了label:ci-pipeline-running
Yyangzhenzhang成员
8月7日 通过审查
Yyao_yf成员
8月7日 通过审查
司小南(机器人)
司小南(机器人)成员
8月7日 评论:

🎉 恭喜!代码检查通过

本次 PR 未发现关键问题 ✅

此评论由 AI Code Review Bot 自动生成

likedislike
司小南(机器人)
司小南(机器人)成员
8月7日 评论:

📖 Markdown文件检查:

1.💡问题描述:代码块前缺少空行

  • 📄 文件: .agent/skills/code-review/distributed-guidelines.md
  • 修改建议
    - **Good:**
    - ```python
    + **Good:**
    + 
    + ```python
    

2.💡问题描述:行尾存在多余空格

  • 📄 文件: .agent/skills/code-review/distributed-guidelines.md
  • 修改建议
    - This document covers distributed system correctness for HyperParallel PR reviews
    - **with Bad/Good examples**. 
    + This document covers distributed system correctness for HyperParallel PR reviews
    + **with Bad/Good examples**.
    

3.💡问题描述:文件末尾缺少换行符

  • 📄 文件: .agent/rules/distributed-op-testing.md
  • 修改建议
    - Op-specific extras above (e.g. `assertRaisesRegex` substring matching) still apply.
    \ No newline at end of file
    + Op-specific extras above (e.g. `assertRaisesRegex` substring matching) still apply.
    

🤗 上述内容仅供参考。

likedislike
司小南(机器人)司小南(机器人)成员
8月7日 添加了label:ai-reviewed
阿苏阿苏成员
8月7日 通过审查
司小南(机器人)
司小南(机器人)成员
8月7日 评论:
Project Name Build_Stage Build Result Details(Full/Incremental) Detail
Coverage Line Coverage SUCCESS 70%/0% Link
likedislike
司小南(机器人)
司小南(机器人)成员
8月7日 评论:
Platform Type Module Excution Time Time Limit
_mindspore - - -
- activation_checkpoint 280.394s 300.0s
- shard 610.409s 600.0s
- pipeline_parallel 682.29525s 675.0s
- fully_shard 1245.145s 1375.0s
- swap_optimizer 110.062s 120.0s
- context_parallel 89.89s 120.0s
- process_group 91.778s 120.0s
- checkpoint 89.812s 120.0s
- init_weights 82.876s 120.0s
- st 10.10575s 15.0s
_torch - - -
- shard 208.412s 300.0s
- pipeline_parallel 346.804s 600.0s
- context_parallel 108.047s 120.0s
- expert_parallel 76.023s 120.0s
- activation_checkpoint 129.17688s 143.75s
- tensor_parallel 258.171s 300.0s
- fully_shard 453.913s 600.0s
- accuracy 86.479s 120.0s
- clip_grad 88.532s 120.0s
- init_weights 77.858s 118.75s
- dtensor 76.713s 120.0s
- checkpoint 107.024s 120.0s
- trainer 81.949s 120.0s
- swap_optimizer 77.617s 120.0s
- process_group 67.161s 90.0s
- llama3_examples 61.858s 120.0s
likedislike
司小南(机器人)
司小南(机器人)成员
8月7日 评论:
Project Name Build_Stage Build Result Details
Hyper-parallel_Atomgit_Gate - SUCCESS 6615
likedislike
司小南(机器人)司小南(机器人)成员
8月7日 删除了label:ci-pipeline-running
司小南(机器人)司小南(机器人)成员
8月7日 添加了label:ci-pipeline-passed
MindSpore-BotMindSpore-Bot成员
8月7日 合入了pull request,合并节点 SHA:8b4036a80275c3a4d8235f4cf23e355d9720cdf5
司小南(机器人)
司小南(机器人)成员
8月7日 评论:

🎉 恭喜!代码检查通过

本次 PR 未发现关键问题 ✅

此评论由 AI Code Review Bot 自动生成

likedislike
司小南(机器人)
司小南(机器人)成员
8月7日 评论:

📖 Markdown文件检查:

调用LLM超时:连接超时=20s, 读取超时=300s, 上次成功request_id=6da2545e712f06eb790f349b4e1a32ef

🤗 上述内容仅供参考。

likedislike
司小南(机器人)
司小南(机器人)成员
8月7日 评论:

📖 Python注释检查:

1.💡问题描述:Args部分参数格式不规范。参数定义中有默认值,但文档字符串中缺少参数类型、optional标识及Default说明。

  • 📄 文件: .agent/skills/autogit/scripts/lint_check.py
  • 修改建议
    -     Args:
    -         files: Unused; kept so this checker fits ``_build_check_plan``.
    +     Args:
    +         files (Optional[List[str]], optional): Unused; kept so this checker fits ``_build_check_plan``. Default: ``None``.
    

🤗 上述内容仅供参考。

likedislike