| docs(spec): 引入 AI 治理规范与跨会话经验池框架 Co-authored-by: jhon-117<fangkai15@huawei.com> # message auto-generated for no-merge-commit merge: !586 merge feat/ai-governance-spec into master docs(spec): 引入 AI 治理规范与跨会话经验池框架 Created-by: jhon-117 Commit-by: jhon-117 Merged-by: ascend-robot Description: # PR Template Thanks for your contribution; we appreciate it a lot. The following instructions will make your pull request healthier and help you get feedback more easily. If you do not understand some items, don't worry, just make the pull request and seek help from maintainers. 感谢您的贡献,我们非常重视。以下说明将使您的拉取请求更健康,更易于获得反馈。如果您不理解某些项目,请不要担心,只需提交拉取请求并从维护人员那里寻求帮助即可。 **PR Type / PR类型** - [ ] Feature(功能新增) - [ ] Bugfix(Bug 修复) - [x] Docs(文档更新) - [ ] CI/CD(持续集成/持续部署) - [ ] Refactor(代码重构) - [ ] Perf(性能优化) - [ ] Test-Cases(测试用例更新) - [ ] Other(其他) ## 🔍 Motivation / 变更动机 **Please describe the motivation of this PR and the goal you want to achieve through this PR.** **请描述您的拉取请求的动机和您希望通过此拉取请求实现的目标。** msmodeling 已有 sig-review AI 检视、AGENTS.md 规范、test_map 测试自动化等 AI 提效实践,但缺少两个治理层: 1. **文档优先级治理**:AGENTS.md、CONTRIBUTING.md、各 skill SKILL.md 对同一事项描述不一致时无裁决依据,AI agent 与人类贡献者容易基于过期文档操作。 2. **跨会话经验积累**:AI agent 踩到的坑无法跨会话复用,相同问题反复出现。 本 PR 补齐这两层治理,不改动任何现有代码与 skill 逻辑。 ------ ## 📝 Modification / 修改内容 **Please briefly describe what modification is made in this PR.** **请简要描述此拉取请求中进行的修改。** 新增 2 份规范文档,修改 1 份入口文件(3 files changed, +264/-4): - **新增 spec/governance/source-of-truth-matrix.md**:单一事实来源矩阵,定义文档优先级 spec/ > docs/RFC/ > docs/design/ > CONTRIBUTING.md > AGENTS.md > .agents/skills/ > README.md,明确入口文件与规范源的区分、冲突解决规则、何时写 spec/RFC/design/skill。 - **新增 .loop/memory/lessons.md**:跨会话经验教训库,含 11 条 msmodeling 真实教训: - 代码架构 4 条(DeviceProfile name 唯一、CommGrid 约束、不直接改上游依赖、hot path 禁用 tensor.item()) - 新模型适配 1 条(遵循 model-adaptation 标准流程) - 文档与北向接口 1 条(接口变更同步更新文档) - Skill 治理 2 条(结构树易过期、frontmatter 统一格式) - Agent 可靠性 1 条(防止基于不存在的 issue/PR 编造内容) - 测试与 CI 2 条(pytest 前启动虚拟环境、PR 推送前本地门禁) - **修改 AGENTS.md 项目结构树**:补齐 spec/、.loop/、sig-review/、docs/design/、optix/、web_ui/,删除不存在的 skill_eval/ 声明。 ------ ## 📐 Associated Test Results / 关联测试结果 **Please provide the related test results, such as test reports, etc.** **请提供相关测试结果,例如测试报告等。** 本 PR 为纯文档变更,不涉及代码逻辑,无需运行 UT/ST。 pre-commit 检查通过(trim trailing whitespace / codespell / typos / detect private key / check for merge conflicts 均 Passed;ruff / pylint / bandit 因无 Python 文件 Skipped)。 ------ ## 🌟 Use cases (Optional) / 使用案例(可选) **If this PR introduces a new feature, it is better to list some use cases here and update the documentation.** **如果此拉取请求引入了新功能,最好在此处列出一些用例并更新文档。** SIG会议评审通过,增加AI自动化与AI约束。 - AI agent 执行任务时遇文档描述冲突,按 source-of-truth-matrix.md 优先级裁决,以 spec/ 为准。 - AI agent 会话启动时读 .loop/memory/lessons.md,复用历史教训(如 DeviceProfile name 冲突、hot path 性能陷阱),避免重复踩坑。 - 新贡献者通过 AGENTS.md 项目结构树快速定位 spec/(规范)、.loop/(经验池)、docs/design/(实现设计)等目录。 ------ ## ✅ Checklist / 检查列表 **Before PR**: - [ ] Bug fixes are fully covered by unit tests, the case that causes the bug should be added in the unit tests. / 修复的 Bug 已完全由单元测试覆盖,导致 Bug 的情况应在单元测试中添加。(N/A:非 bugfix) - [ ] The modification is covered by complete unit tests. If not, please add more unit tests to ensure the correctness. / 此拉取请求中的修改已完全由单元测试覆盖。如果不是,请添加更多单元测试以确保正确性。(N/A:纯文档变更,无代码逻辑) - [x] All relevant documentation (API docs, docstrings, example tutorials) has been updated to reflect these changes. / 所有相关文档(API 文档、文档字符串、示例教程)已更新以反映这些更改。 - [ ] Please ensure code files contain no Chinese comments. / 请保证代码文件中不含中文注释。(N/A:本 PR 无代码文件) ------ See merge request: Ascend/msmodeling!586 | 8 天前 |