| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
fix(install-helper): 多源真相漂移根治 + agent/skills 多层发现 + external repo 修复 Co-authored-by: yanhf<yanhaifeng5@huawei.com> # message auto-generated for no-merge-commit merge: !798 merge master into master fix(install-helper): 多源真相漂移根治 + agent/skills 多层发现 + external repo 修复 Created-by: yanhf Commit-by: yanhf Merged-by: cann-robot Description: ## 描述 ### 根因 install-helper 的插件元数据(agents/version)散落在 yml、plugin.json、embedded-plugins.json、optionalDependencies 四处,采用"yml 非空即采信"的回退式调和,无任何交叉校验。agent 改名后 yml 变陈旧,非空即静默覆盖正确值,导致安装时报「Agent 未找到」。同时发现 external repo git pull 失败后 continue 跳过 symlink 创建、skill-registry 离线回退陈旧、yml 与 init.sh INCLUDED_SKILLS 漂移、externalRepos 配置不完整等问题。 ### 修复内容 #### Bug 修复 - **【install-helper】pypto-op-orchestrator 安装时 3 个 agent 未找到**:yml installAgents 引用 3 个已废弃的 agent 名(pypto-op-analyst/developer/perf-tuner),与 plugin.json 的 8 个实际 agent 零交集。修复后正确安装 8 agents。 - **【install-helper】ops-registry-invoke 漏装 4 个 agent + spec-to-design skill**:yml 仅列 3 个陈旧 agent(实际 7 个);spec-to-design skill 位于插件本地 skills/ 目录,findSkillSourceDir 仅查 scanDirs 被静默丢弃。修复后正确安装 7 agents + 30 skills。 - **【install-helper】external repo git pull 失败后跳过 symlink 创建**:installExternalRepos 中 pull 失败的 continue 跳过了后续 symlink 逻辑,导致项目目录缺少 external repo 符号链接。删除 continue,pull 失败后仅 warn 并继续创建 symlink(与 init.sh 行为一致)。 - **【install-helper】optionalDependencies 版本漂移**:5 个平台子包版本硬编码,与 package.json version 独立,多次发版后漂移。新增 V6 校验门禁确保一致。 - **【install-helper】torch-compile.yml 缺少 torch-npugraph-ex-performance-diagnosis**:主线 commit d853845a 在 init.sh INCLUDED_SKILLS 中新增了该 skill,但 yml 未同步更新,导致 install-helper 只装 6 个 skill(init.sh 装 7 个)。修复后 yml skills 6→7。 - **【install-helper】ops-direct-invoke.yml 漏列 ops-tensor externalRepo**:init.sh 克隆 https://gitcode.com/cann/ops-tensor.git(depth=1 + recursive),但 yml externalRepos 未声明,导致 install-helper 安装后缺少 Blaze/tensor_api 源码,5 个 Blaze 相关 skill 工作流中断。修复后 yml 补齐 ops-tensor externalRepo。 - **【install-helper】ops-registry-invoke.yml 漏列 ops-tensor externalRepo**:同上,init.sh 克隆 ops-tensor 但 yml 未声明。修复后补齐。 - **【install-helper】ops-registry-invoke.yml asc-devkit 路径不一致**:init.sh 克隆到 reference/cann/asc-devkit(depth=1),yml 声明为 asc-devkit(无 depth),导致 install-helper 克隆到错误路径,API 文档搜索路径不匹配。修复后 yml 路径改为 reference/cann/asc-devkit + depth=1。 #### 特性增强 - **【install-helper】plugin.json 成为 agents/version 单一真相源**:gen-embedded 和 metadata-sync 始终从 plugin.json 派生 agents/version,yml installAgents 作为文档 + Layer 3 兜底(与 installSkills 同构),V5 一致性校验确保 yml 与 plugin.json 不漂移。 - **【install-helper】agent 三层发现机制**:Layer 1 plugin.json agents[](SoT,过滤 ./AGENTS.md)→ Layer 2 init.sh INCLUDED_AGENT_PATTERN(globSync 匹配,支持 extglob)→ Layer 3 yml installAgents/embedded 兜底。 - **【install-helper】skills 多层发现机制**:Layer 1 yml installSkills → Layer 2 init.sh INCLUDED_SKILLS(mergeInitSkills 补充)→ Layer 3 init.sh ALL_SKILLS(静态解析,动态 $() 跳过)→ Layer 4 <plugin>/skills/ 目录查找(findSkillSourceDir 扩展)。 - **【install-helper】V1-V7 校验门禁**:gen-embedded 构建前强制校验(plugin.json 可解析/agent .md 磁盘存在/skill 源目录存在/skills 计数一致/yml agents 一致性/optionalDependencies==version),FAIL 即 exit 1,build/build:npm/pretest 全路径强制。 - **【install-helper】skill-registry 离线回退刷新**:删除陈旧条目 cuda2ascend-simt(source: ops-lab/,已删除);新增 4 个 skill(model-train-accuracy-debug、model-train-log-visualization、model-train-oom-analysis、ge-fusion-pass-skill)。 - **【install-helper】刷新 4 个 plugins-official 陈旧 yml**:ops-direct-invoke/ops-registry-invoke/pypto-op-orchestrator/triton-op-generator 的 installSkills 同步 init.sh INCLUDED_SKILLS 完整列表。 - **【install-helper】SCAN_DIRS 改为从 repository.yaml 读取**:validate-plugins.cjs 和 gen-embedded.cjs 的 SCAN_DIRS 从硬编码改为从 src/config/repository.yaml 读取(与 scanner.ts/metadata-sync.ts 统一单一来源),消除三处硬编码漂移风险。 #### 测试看护增强(+28 用例,212→234) - **externalRepos 配置测试(8 个)**:ops-tensor 存在性 + depth=1 + recursive=true / asc-devkit 路径含 reference/cann/ / embedded externalRepos URL 匹配 yml / 无重复 URL - **5 个新 skill 注册断言(5 个)**:ascendc-simt-tiling-design / cann-env-setup / torch-ops-profiler / ascendc-direct-invoke-to-registry-invoke / ascendc-registry-invoke-to-direct-invoke 在 skill-registry 静态表中存在 - **yml skills 计数 vs init.sh 一致性(3 个)**:ops-direct-invoke(21) / ops-registry-invoke(30) / torch-compile(7) 三方计数一致 - **SCAN_DIRS 验证(3 个)**:repository.yaml scanDirs 含 runtime / validate-plugins + gen-embedded 可加载 - **多 skill 批量安装(2 个)**:3 个 skill 一次性安装 / 混合 ops + infra 来源 - **跨 plugin 共享 skill 不冲突(1 个)**:同一 skill 二次安装不破坏已有 symlink - **plugins-consistency 测试健壮性**:8 处 try/finally 包裹临时目录清理 + 4 处 return 改 expect 显式失败 ## 关联的Issue - install-helper 安装 PyPTO 插件时 3 个 Agent 全部报「未找到」(pypto-op-analyst/developer/perf-tuner) - install-helper external repo git pull 失败后跳过 symlink 创建 - install-helper yml 与 init.sh INCLUDED_SKILLS 漂移(torch-compile 缺 skill、ops-direct-invoke/ops-registry-invoke 缺 ops-tensor externalRepo) ## 测试 - **单元测试**:234 个测试全部通过(含 28 新增测试:externalRepos 配置 / 新 skill 注册断言 / yml-init.sh 计数一致性 / SCAN_DIRS / 多 skill 批量 / 跨 plugin 共享) - **init.sh 静态测试**:359 PASS(test-init-install.sh Check 1-7) - **validate-plugins 校验**:V1-V7 全部通过 - **gen-embedded 生成**:10 plugins 元数据校验通过 - **E2E 回归**: - ops-direct-invoke:21 skills, 4 agents, asc-devkit + ops-tensor externalRepo ✓ - ops-registry-invoke:30 skills, 7 agents, reference/cann/asc-devkit + ops-tensor ✓ - torch-compile:7 skills, 1 agent ✓ - install-helper vs init.sh 安装结果对比:skills/agents/externalRepos 全部一致(0 差异) - 单个 skill 安装:1 skill ✓ - 多 skill 安装:3 skills ✓ - --all 全量安装:173 skills, 0 失败 ✓ - doctor 健康检查:0 warnings ✓ - **npm 发版验证**: - 1.1.11-beta.0(beta tag)E2E 回归通过 - 1.1.12(latest tag)正式版 E2E 回归 + install-helper vs init.sh 对比测试通过 ## 文档更新 - 12 个 yml 文件更新(删除 agents/version 硬编码字段,恢复 installAgents 作为文档 + 兜底,刷新 installSkills,补齐 externalRepos) - .gitignore 补全外部仓库排除规则(ops-tensor / asc-devkit / reference/) ## 类型标签 - [x] 🐛 Bug 修复 - [x] ✨ 特性增强 - [x] 🧪 测试用例 - [x] 📦 构建 / CI See merge request: cann/cannbot-skills!798 | 13 天前 | |
fix(install-helper): 多源真相漂移根治 + agent/skills 多层发现 + external repo 修复 Co-authored-by: yanhf<yanhaifeng5@huawei.com> # message auto-generated for no-merge-commit merge: !798 merge master into master fix(install-helper): 多源真相漂移根治 + agent/skills 多层发现 + external repo 修复 Created-by: yanhf Commit-by: yanhf Merged-by: cann-robot Description: ## 描述 ### 根因 install-helper 的插件元数据(agents/version)散落在 yml、plugin.json、embedded-plugins.json、optionalDependencies 四处,采用"yml 非空即采信"的回退式调和,无任何交叉校验。agent 改名后 yml 变陈旧,非空即静默覆盖正确值,导致安装时报「Agent 未找到」。同时发现 external repo git pull 失败后 continue 跳过 symlink 创建、skill-registry 离线回退陈旧、yml 与 init.sh INCLUDED_SKILLS 漂移、externalRepos 配置不完整等问题。 ### 修复内容 #### Bug 修复 - **【install-helper】pypto-op-orchestrator 安装时 3 个 agent 未找到**:yml installAgents 引用 3 个已废弃的 agent 名(pypto-op-analyst/developer/perf-tuner),与 plugin.json 的 8 个实际 agent 零交集。修复后正确安装 8 agents。 - **【install-helper】ops-registry-invoke 漏装 4 个 agent + spec-to-design skill**:yml 仅列 3 个陈旧 agent(实际 7 个);spec-to-design skill 位于插件本地 skills/ 目录,findSkillSourceDir 仅查 scanDirs 被静默丢弃。修复后正确安装 7 agents + 30 skills。 - **【install-helper】external repo git pull 失败后跳过 symlink 创建**:installExternalRepos 中 pull 失败的 continue 跳过了后续 symlink 逻辑,导致项目目录缺少 external repo 符号链接。删除 continue,pull 失败后仅 warn 并继续创建 symlink(与 init.sh 行为一致)。 - **【install-helper】optionalDependencies 版本漂移**:5 个平台子包版本硬编码,与 package.json version 独立,多次发版后漂移。新增 V6 校验门禁确保一致。 - **【install-helper】torch-compile.yml 缺少 torch-npugraph-ex-performance-diagnosis**:主线 commit d853845a 在 init.sh INCLUDED_SKILLS 中新增了该 skill,但 yml 未同步更新,导致 install-helper 只装 6 个 skill(init.sh 装 7 个)。修复后 yml skills 6→7。 - **【install-helper】ops-direct-invoke.yml 漏列 ops-tensor externalRepo**:init.sh 克隆 https://gitcode.com/cann/ops-tensor.git(depth=1 + recursive),但 yml externalRepos 未声明,导致 install-helper 安装后缺少 Blaze/tensor_api 源码,5 个 Blaze 相关 skill 工作流中断。修复后 yml 补齐 ops-tensor externalRepo。 - **【install-helper】ops-registry-invoke.yml 漏列 ops-tensor externalRepo**:同上,init.sh 克隆 ops-tensor 但 yml 未声明。修复后补齐。 - **【install-helper】ops-registry-invoke.yml asc-devkit 路径不一致**:init.sh 克隆到 reference/cann/asc-devkit(depth=1),yml 声明为 asc-devkit(无 depth),导致 install-helper 克隆到错误路径,API 文档搜索路径不匹配。修复后 yml 路径改为 reference/cann/asc-devkit + depth=1。 #### 特性增强 - **【install-helper】plugin.json 成为 agents/version 单一真相源**:gen-embedded 和 metadata-sync 始终从 plugin.json 派生 agents/version,yml installAgents 作为文档 + Layer 3 兜底(与 installSkills 同构),V5 一致性校验确保 yml 与 plugin.json 不漂移。 - **【install-helper】agent 三层发现机制**:Layer 1 plugin.json agents[](SoT,过滤 ./AGENTS.md)→ Layer 2 init.sh INCLUDED_AGENT_PATTERN(globSync 匹配,支持 extglob)→ Layer 3 yml installAgents/embedded 兜底。 - **【install-helper】skills 多层发现机制**:Layer 1 yml installSkills → Layer 2 init.sh INCLUDED_SKILLS(mergeInitSkills 补充)→ Layer 3 init.sh ALL_SKILLS(静态解析,动态 $() 跳过)→ Layer 4 <plugin>/skills/ 目录查找(findSkillSourceDir 扩展)。 - **【install-helper】V1-V7 校验门禁**:gen-embedded 构建前强制校验(plugin.json 可解析/agent .md 磁盘存在/skill 源目录存在/skills 计数一致/yml agents 一致性/optionalDependencies==version),FAIL 即 exit 1,build/build:npm/pretest 全路径强制。 - **【install-helper】skill-registry 离线回退刷新**:删除陈旧条目 cuda2ascend-simt(source: ops-lab/,已删除);新增 4 个 skill(model-train-accuracy-debug、model-train-log-visualization、model-train-oom-analysis、ge-fusion-pass-skill)。 - **【install-helper】刷新 4 个 plugins-official 陈旧 yml**:ops-direct-invoke/ops-registry-invoke/pypto-op-orchestrator/triton-op-generator 的 installSkills 同步 init.sh INCLUDED_SKILLS 完整列表。 - **【install-helper】SCAN_DIRS 改为从 repository.yaml 读取**:validate-plugins.cjs 和 gen-embedded.cjs 的 SCAN_DIRS 从硬编码改为从 src/config/repository.yaml 读取(与 scanner.ts/metadata-sync.ts 统一单一来源),消除三处硬编码漂移风险。 #### 测试看护增强(+28 用例,212→234) - **externalRepos 配置测试(8 个)**:ops-tensor 存在性 + depth=1 + recursive=true / asc-devkit 路径含 reference/cann/ / embedded externalRepos URL 匹配 yml / 无重复 URL - **5 个新 skill 注册断言(5 个)**:ascendc-simt-tiling-design / cann-env-setup / torch-ops-profiler / ascendc-direct-invoke-to-registry-invoke / ascendc-registry-invoke-to-direct-invoke 在 skill-registry 静态表中存在 - **yml skills 计数 vs init.sh 一致性(3 个)**:ops-direct-invoke(21) / ops-registry-invoke(30) / torch-compile(7) 三方计数一致 - **SCAN_DIRS 验证(3 个)**:repository.yaml scanDirs 含 runtime / validate-plugins + gen-embedded 可加载 - **多 skill 批量安装(2 个)**:3 个 skill 一次性安装 / 混合 ops + infra 来源 - **跨 plugin 共享 skill 不冲突(1 个)**:同一 skill 二次安装不破坏已有 symlink - **plugins-consistency 测试健壮性**:8 处 try/finally 包裹临时目录清理 + 4 处 return 改 expect 显式失败 ## 关联的Issue - install-helper 安装 PyPTO 插件时 3 个 Agent 全部报「未找到」(pypto-op-analyst/developer/perf-tuner) - install-helper external repo git pull 失败后跳过 symlink 创建 - install-helper yml 与 init.sh INCLUDED_SKILLS 漂移(torch-compile 缺 skill、ops-direct-invoke/ops-registry-invoke 缺 ops-tensor externalRepo) ## 测试 - **单元测试**:234 个测试全部通过(含 28 新增测试:externalRepos 配置 / 新 skill 注册断言 / yml-init.sh 计数一致性 / SCAN_DIRS / 多 skill 批量 / 跨 plugin 共享) - **init.sh 静态测试**:359 PASS(test-init-install.sh Check 1-7) - **validate-plugins 校验**:V1-V7 全部通过 - **gen-embedded 生成**:10 plugins 元数据校验通过 - **E2E 回归**: - ops-direct-invoke:21 skills, 4 agents, asc-devkit + ops-tensor externalRepo ✓ - ops-registry-invoke:30 skills, 7 agents, reference/cann/asc-devkit + ops-tensor ✓ - torch-compile:7 skills, 1 agent ✓ - install-helper vs init.sh 安装结果对比:skills/agents/externalRepos 全部一致(0 差异) - 单个 skill 安装:1 skill ✓ - 多 skill 安装:3 skills ✓ - --all 全量安装:173 skills, 0 失败 ✓ - doctor 健康检查:0 warnings ✓ - **npm 发版验证**: - 1.1.11-beta.0(beta tag)E2E 回归通过 - 1.1.12(latest tag)正式版 E2E 回归 + install-helper vs init.sh 对比测试通过 ## 文档更新 - 12 个 yml 文件更新(删除 agents/version 硬编码字段,恢复 installAgents 作为文档 + 兜底,刷新 installSkills,补齐 externalRepos) - .gitignore 补全外部仓库排除规则(ops-tensor / asc-devkit / reference/) ## 类型标签 - [x] 🐛 Bug 修复 - [x] ✨ 特性增强 - [x] 🧪 测试用例 - [x] 📦 构建 / CI See merge request: cann/cannbot-skills!798 | 13 天前 | |
fix(install-helper): 多源真相漂移根治 + agent/skills 多层发现 + external repo 修复 Co-authored-by: yanhf<yanhaifeng5@huawei.com> # message auto-generated for no-merge-commit merge: !798 merge master into master fix(install-helper): 多源真相漂移根治 + agent/skills 多层发现 + external repo 修复 Created-by: yanhf Commit-by: yanhf Merged-by: cann-robot Description: ## 描述 ### 根因 install-helper 的插件元数据(agents/version)散落在 yml、plugin.json、embedded-plugins.json、optionalDependencies 四处,采用"yml 非空即采信"的回退式调和,无任何交叉校验。agent 改名后 yml 变陈旧,非空即静默覆盖正确值,导致安装时报「Agent 未找到」。同时发现 external repo git pull 失败后 continue 跳过 symlink 创建、skill-registry 离线回退陈旧、yml 与 init.sh INCLUDED_SKILLS 漂移、externalRepos 配置不完整等问题。 ### 修复内容 #### Bug 修复 - **【install-helper】pypto-op-orchestrator 安装时 3 个 agent 未找到**:yml installAgents 引用 3 个已废弃的 agent 名(pypto-op-analyst/developer/perf-tuner),与 plugin.json 的 8 个实际 agent 零交集。修复后正确安装 8 agents。 - **【install-helper】ops-registry-invoke 漏装 4 个 agent + spec-to-design skill**:yml 仅列 3 个陈旧 agent(实际 7 个);spec-to-design skill 位于插件本地 skills/ 目录,findSkillSourceDir 仅查 scanDirs 被静默丢弃。修复后正确安装 7 agents + 30 skills。 - **【install-helper】external repo git pull 失败后跳过 symlink 创建**:installExternalRepos 中 pull 失败的 continue 跳过了后续 symlink 逻辑,导致项目目录缺少 external repo 符号链接。删除 continue,pull 失败后仅 warn 并继续创建 symlink(与 init.sh 行为一致)。 - **【install-helper】optionalDependencies 版本漂移**:5 个平台子包版本硬编码,与 package.json version 独立,多次发版后漂移。新增 V6 校验门禁确保一致。 - **【install-helper】torch-compile.yml 缺少 torch-npugraph-ex-performance-diagnosis**:主线 commit d853845a 在 init.sh INCLUDED_SKILLS 中新增了该 skill,但 yml 未同步更新,导致 install-helper 只装 6 个 skill(init.sh 装 7 个)。修复后 yml skills 6→7。 - **【install-helper】ops-direct-invoke.yml 漏列 ops-tensor externalRepo**:init.sh 克隆 https://gitcode.com/cann/ops-tensor.git(depth=1 + recursive),但 yml externalRepos 未声明,导致 install-helper 安装后缺少 Blaze/tensor_api 源码,5 个 Blaze 相关 skill 工作流中断。修复后 yml 补齐 ops-tensor externalRepo。 - **【install-helper】ops-registry-invoke.yml 漏列 ops-tensor externalRepo**:同上,init.sh 克隆 ops-tensor 但 yml 未声明。修复后补齐。 - **【install-helper】ops-registry-invoke.yml asc-devkit 路径不一致**:init.sh 克隆到 reference/cann/asc-devkit(depth=1),yml 声明为 asc-devkit(无 depth),导致 install-helper 克隆到错误路径,API 文档搜索路径不匹配。修复后 yml 路径改为 reference/cann/asc-devkit + depth=1。 #### 特性增强 - **【install-helper】plugin.json 成为 agents/version 单一真相源**:gen-embedded 和 metadata-sync 始终从 plugin.json 派生 agents/version,yml installAgents 作为文档 + Layer 3 兜底(与 installSkills 同构),V5 一致性校验确保 yml 与 plugin.json 不漂移。 - **【install-helper】agent 三层发现机制**:Layer 1 plugin.json agents[](SoT,过滤 ./AGENTS.md)→ Layer 2 init.sh INCLUDED_AGENT_PATTERN(globSync 匹配,支持 extglob)→ Layer 3 yml installAgents/embedded 兜底。 - **【install-helper】skills 多层发现机制**:Layer 1 yml installSkills → Layer 2 init.sh INCLUDED_SKILLS(mergeInitSkills 补充)→ Layer 3 init.sh ALL_SKILLS(静态解析,动态 $() 跳过)→ Layer 4 <plugin>/skills/ 目录查找(findSkillSourceDir 扩展)。 - **【install-helper】V1-V7 校验门禁**:gen-embedded 构建前强制校验(plugin.json 可解析/agent .md 磁盘存在/skill 源目录存在/skills 计数一致/yml agents 一致性/optionalDependencies==version),FAIL 即 exit 1,build/build:npm/pretest 全路径强制。 - **【install-helper】skill-registry 离线回退刷新**:删除陈旧条目 cuda2ascend-simt(source: ops-lab/,已删除);新增 4 个 skill(model-train-accuracy-debug、model-train-log-visualization、model-train-oom-analysis、ge-fusion-pass-skill)。 - **【install-helper】刷新 4 个 plugins-official 陈旧 yml**:ops-direct-invoke/ops-registry-invoke/pypto-op-orchestrator/triton-op-generator 的 installSkills 同步 init.sh INCLUDED_SKILLS 完整列表。 - **【install-helper】SCAN_DIRS 改为从 repository.yaml 读取**:validate-plugins.cjs 和 gen-embedded.cjs 的 SCAN_DIRS 从硬编码改为从 src/config/repository.yaml 读取(与 scanner.ts/metadata-sync.ts 统一单一来源),消除三处硬编码漂移风险。 #### 测试看护增强(+28 用例,212→234) - **externalRepos 配置测试(8 个)**:ops-tensor 存在性 + depth=1 + recursive=true / asc-devkit 路径含 reference/cann/ / embedded externalRepos URL 匹配 yml / 无重复 URL - **5 个新 skill 注册断言(5 个)**:ascendc-simt-tiling-design / cann-env-setup / torch-ops-profiler / ascendc-direct-invoke-to-registry-invoke / ascendc-registry-invoke-to-direct-invoke 在 skill-registry 静态表中存在 - **yml skills 计数 vs init.sh 一致性(3 个)**:ops-direct-invoke(21) / ops-registry-invoke(30) / torch-compile(7) 三方计数一致 - **SCAN_DIRS 验证(3 个)**:repository.yaml scanDirs 含 runtime / validate-plugins + gen-embedded 可加载 - **多 skill 批量安装(2 个)**:3 个 skill 一次性安装 / 混合 ops + infra 来源 - **跨 plugin 共享 skill 不冲突(1 个)**:同一 skill 二次安装不破坏已有 symlink - **plugins-consistency 测试健壮性**:8 处 try/finally 包裹临时目录清理 + 4 处 return 改 expect 显式失败 ## 关联的Issue - install-helper 安装 PyPTO 插件时 3 个 Agent 全部报「未找到」(pypto-op-analyst/developer/perf-tuner) - install-helper external repo git pull 失败后跳过 symlink 创建 - install-helper yml 与 init.sh INCLUDED_SKILLS 漂移(torch-compile 缺 skill、ops-direct-invoke/ops-registry-invoke 缺 ops-tensor externalRepo) ## 测试 - **单元测试**:234 个测试全部通过(含 28 新增测试:externalRepos 配置 / 新 skill 注册断言 / yml-init.sh 计数一致性 / SCAN_DIRS / 多 skill 批量 / 跨 plugin 共享) - **init.sh 静态测试**:359 PASS(test-init-install.sh Check 1-7) - **validate-plugins 校验**:V1-V7 全部通过 - **gen-embedded 生成**:10 plugins 元数据校验通过 - **E2E 回归**: - ops-direct-invoke:21 skills, 4 agents, asc-devkit + ops-tensor externalRepo ✓ - ops-registry-invoke:30 skills, 7 agents, reference/cann/asc-devkit + ops-tensor ✓ - torch-compile:7 skills, 1 agent ✓ - install-helper vs init.sh 安装结果对比:skills/agents/externalRepos 全部一致(0 差异) - 单个 skill 安装:1 skill ✓ - 多 skill 安装:3 skills ✓ - --all 全量安装:173 skills, 0 失败 ✓ - doctor 健康检查:0 warnings ✓ - **npm 发版验证**: - 1.1.11-beta.0(beta tag)E2E 回归通过 - 1.1.12(latest tag)正式版 E2E 回归 + install-helper vs init.sh 对比测试通过 ## 文档更新 - 12 个 yml 文件更新(删除 agents/version 硬编码字段,恢复 installAgents 作为文档 + 兜底,刷新 installSkills,补齐 externalRepos) - .gitignore 补全外部仓库排除规则(ops-tensor / asc-devkit / reference/) ## 类型标签 - [x] 🐛 Bug 修复 - [x] ✨ 特性增强 - [x] 🧪 测试用例 - [x] 📦 构建 / CI See merge request: cann/cannbot-skills!798 | 13 天前 | |
fix(install-helper): 多源真相漂移根治 + agent/skills 多层发现 + external repo 修复 Co-authored-by: yanhf<yanhaifeng5@huawei.com> # message auto-generated for no-merge-commit merge: !798 merge master into master fix(install-helper): 多源真相漂移根治 + agent/skills 多层发现 + external repo 修复 Created-by: yanhf Commit-by: yanhf Merged-by: cann-robot Description: ## 描述 ### 根因 install-helper 的插件元数据(agents/version)散落在 yml、plugin.json、embedded-plugins.json、optionalDependencies 四处,采用"yml 非空即采信"的回退式调和,无任何交叉校验。agent 改名后 yml 变陈旧,非空即静默覆盖正确值,导致安装时报「Agent 未找到」。同时发现 external repo git pull 失败后 continue 跳过 symlink 创建、skill-registry 离线回退陈旧、yml 与 init.sh INCLUDED_SKILLS 漂移、externalRepos 配置不完整等问题。 ### 修复内容 #### Bug 修复 - **【install-helper】pypto-op-orchestrator 安装时 3 个 agent 未找到**:yml installAgents 引用 3 个已废弃的 agent 名(pypto-op-analyst/developer/perf-tuner),与 plugin.json 的 8 个实际 agent 零交集。修复后正确安装 8 agents。 - **【install-helper】ops-registry-invoke 漏装 4 个 agent + spec-to-design skill**:yml 仅列 3 个陈旧 agent(实际 7 个);spec-to-design skill 位于插件本地 skills/ 目录,findSkillSourceDir 仅查 scanDirs 被静默丢弃。修复后正确安装 7 agents + 30 skills。 - **【install-helper】external repo git pull 失败后跳过 symlink 创建**:installExternalRepos 中 pull 失败的 continue 跳过了后续 symlink 逻辑,导致项目目录缺少 external repo 符号链接。删除 continue,pull 失败后仅 warn 并继续创建 symlink(与 init.sh 行为一致)。 - **【install-helper】optionalDependencies 版本漂移**:5 个平台子包版本硬编码,与 package.json version 独立,多次发版后漂移。新增 V6 校验门禁确保一致。 - **【install-helper】torch-compile.yml 缺少 torch-npugraph-ex-performance-diagnosis**:主线 commit d853845a 在 init.sh INCLUDED_SKILLS 中新增了该 skill,但 yml 未同步更新,导致 install-helper 只装 6 个 skill(init.sh 装 7 个)。修复后 yml skills 6→7。 - **【install-helper】ops-direct-invoke.yml 漏列 ops-tensor externalRepo**:init.sh 克隆 https://gitcode.com/cann/ops-tensor.git(depth=1 + recursive),但 yml externalRepos 未声明,导致 install-helper 安装后缺少 Blaze/tensor_api 源码,5 个 Blaze 相关 skill 工作流中断。修复后 yml 补齐 ops-tensor externalRepo。 - **【install-helper】ops-registry-invoke.yml 漏列 ops-tensor externalRepo**:同上,init.sh 克隆 ops-tensor 但 yml 未声明。修复后补齐。 - **【install-helper】ops-registry-invoke.yml asc-devkit 路径不一致**:init.sh 克隆到 reference/cann/asc-devkit(depth=1),yml 声明为 asc-devkit(无 depth),导致 install-helper 克隆到错误路径,API 文档搜索路径不匹配。修复后 yml 路径改为 reference/cann/asc-devkit + depth=1。 #### 特性增强 - **【install-helper】plugin.json 成为 agents/version 单一真相源**:gen-embedded 和 metadata-sync 始终从 plugin.json 派生 agents/version,yml installAgents 作为文档 + Layer 3 兜底(与 installSkills 同构),V5 一致性校验确保 yml 与 plugin.json 不漂移。 - **【install-helper】agent 三层发现机制**:Layer 1 plugin.json agents[](SoT,过滤 ./AGENTS.md)→ Layer 2 init.sh INCLUDED_AGENT_PATTERN(globSync 匹配,支持 extglob)→ Layer 3 yml installAgents/embedded 兜底。 - **【install-helper】skills 多层发现机制**:Layer 1 yml installSkills → Layer 2 init.sh INCLUDED_SKILLS(mergeInitSkills 补充)→ Layer 3 init.sh ALL_SKILLS(静态解析,动态 $() 跳过)→ Layer 4 <plugin>/skills/ 目录查找(findSkillSourceDir 扩展)。 - **【install-helper】V1-V7 校验门禁**:gen-embedded 构建前强制校验(plugin.json 可解析/agent .md 磁盘存在/skill 源目录存在/skills 计数一致/yml agents 一致性/optionalDependencies==version),FAIL 即 exit 1,build/build:npm/pretest 全路径强制。 - **【install-helper】skill-registry 离线回退刷新**:删除陈旧条目 cuda2ascend-simt(source: ops-lab/,已删除);新增 4 个 skill(model-train-accuracy-debug、model-train-log-visualization、model-train-oom-analysis、ge-fusion-pass-skill)。 - **【install-helper】刷新 4 个 plugins-official 陈旧 yml**:ops-direct-invoke/ops-registry-invoke/pypto-op-orchestrator/triton-op-generator 的 installSkills 同步 init.sh INCLUDED_SKILLS 完整列表。 - **【install-helper】SCAN_DIRS 改为从 repository.yaml 读取**:validate-plugins.cjs 和 gen-embedded.cjs 的 SCAN_DIRS 从硬编码改为从 src/config/repository.yaml 读取(与 scanner.ts/metadata-sync.ts 统一单一来源),消除三处硬编码漂移风险。 #### 测试看护增强(+28 用例,212→234) - **externalRepos 配置测试(8 个)**:ops-tensor 存在性 + depth=1 + recursive=true / asc-devkit 路径含 reference/cann/ / embedded externalRepos URL 匹配 yml / 无重复 URL - **5 个新 skill 注册断言(5 个)**:ascendc-simt-tiling-design / cann-env-setup / torch-ops-profiler / ascendc-direct-invoke-to-registry-invoke / ascendc-registry-invoke-to-direct-invoke 在 skill-registry 静态表中存在 - **yml skills 计数 vs init.sh 一致性(3 个)**:ops-direct-invoke(21) / ops-registry-invoke(30) / torch-compile(7) 三方计数一致 - **SCAN_DIRS 验证(3 个)**:repository.yaml scanDirs 含 runtime / validate-plugins + gen-embedded 可加载 - **多 skill 批量安装(2 个)**:3 个 skill 一次性安装 / 混合 ops + infra 来源 - **跨 plugin 共享 skill 不冲突(1 个)**:同一 skill 二次安装不破坏已有 symlink - **plugins-consistency 测试健壮性**:8 处 try/finally 包裹临时目录清理 + 4 处 return 改 expect 显式失败 ## 关联的Issue - install-helper 安装 PyPTO 插件时 3 个 Agent 全部报「未找到」(pypto-op-analyst/developer/perf-tuner) - install-helper external repo git pull 失败后跳过 symlink 创建 - install-helper yml 与 init.sh INCLUDED_SKILLS 漂移(torch-compile 缺 skill、ops-direct-invoke/ops-registry-invoke 缺 ops-tensor externalRepo) ## 测试 - **单元测试**:234 个测试全部通过(含 28 新增测试:externalRepos 配置 / 新 skill 注册断言 / yml-init.sh 计数一致性 / SCAN_DIRS / 多 skill 批量 / 跨 plugin 共享) - **init.sh 静态测试**:359 PASS(test-init-install.sh Check 1-7) - **validate-plugins 校验**:V1-V7 全部通过 - **gen-embedded 生成**:10 plugins 元数据校验通过 - **E2E 回归**: - ops-direct-invoke:21 skills, 4 agents, asc-devkit + ops-tensor externalRepo ✓ - ops-registry-invoke:30 skills, 7 agents, reference/cann/asc-devkit + ops-tensor ✓ - torch-compile:7 skills, 1 agent ✓ - install-helper vs init.sh 安装结果对比:skills/agents/externalRepos 全部一致(0 差异) - 单个 skill 安装:1 skill ✓ - 多 skill 安装:3 skills ✓ - --all 全量安装:173 skills, 0 失败 ✓ - doctor 健康检查:0 warnings ✓ - **npm 发版验证**: - 1.1.11-beta.0(beta tag)E2E 回归通过 - 1.1.12(latest tag)正式版 E2E 回归 + install-helper vs init.sh 对比测试通过 ## 文档更新 - 12 个 yml 文件更新(删除 agents/version 硬编码字段,恢复 installAgents 作为文档 + 兜底,刷新 installSkills,补齐 externalRepos) - .gitignore 补全外部仓库排除规则(ops-tensor / asc-devkit / reference/) ## 类型标签 - [x] 🐛 Bug 修复 - [x] ✨ 特性增强 - [x] 🧪 测试用例 - [x] 📦 构建 / CI See merge request: cann/cannbot-skills!798 | 13 天前 | |
fix(install-helper): 多源真相漂移根治 + agent/skills 多层发现 + external repo 修复 Co-authored-by: yanhf<yanhaifeng5@huawei.com> # message auto-generated for no-merge-commit merge: !798 merge master into master fix(install-helper): 多源真相漂移根治 + agent/skills 多层发现 + external repo 修复 Created-by: yanhf Commit-by: yanhf Merged-by: cann-robot Description: ## 描述 ### 根因 install-helper 的插件元数据(agents/version)散落在 yml、plugin.json、embedded-plugins.json、optionalDependencies 四处,采用"yml 非空即采信"的回退式调和,无任何交叉校验。agent 改名后 yml 变陈旧,非空即静默覆盖正确值,导致安装时报「Agent 未找到」。同时发现 external repo git pull 失败后 continue 跳过 symlink 创建、skill-registry 离线回退陈旧、yml 与 init.sh INCLUDED_SKILLS 漂移、externalRepos 配置不完整等问题。 ### 修复内容 #### Bug 修复 - **【install-helper】pypto-op-orchestrator 安装时 3 个 agent 未找到**:yml installAgents 引用 3 个已废弃的 agent 名(pypto-op-analyst/developer/perf-tuner),与 plugin.json 的 8 个实际 agent 零交集。修复后正确安装 8 agents。 - **【install-helper】ops-registry-invoke 漏装 4 个 agent + spec-to-design skill**:yml 仅列 3 个陈旧 agent(实际 7 个);spec-to-design skill 位于插件本地 skills/ 目录,findSkillSourceDir 仅查 scanDirs 被静默丢弃。修复后正确安装 7 agents + 30 skills。 - **【install-helper】external repo git pull 失败后跳过 symlink 创建**:installExternalRepos 中 pull 失败的 continue 跳过了后续 symlink 逻辑,导致项目目录缺少 external repo 符号链接。删除 continue,pull 失败后仅 warn 并继续创建 symlink(与 init.sh 行为一致)。 - **【install-helper】optionalDependencies 版本漂移**:5 个平台子包版本硬编码,与 package.json version 独立,多次发版后漂移。新增 V6 校验门禁确保一致。 - **【install-helper】torch-compile.yml 缺少 torch-npugraph-ex-performance-diagnosis**:主线 commit d853845a 在 init.sh INCLUDED_SKILLS 中新增了该 skill,但 yml 未同步更新,导致 install-helper 只装 6 个 skill(init.sh 装 7 个)。修复后 yml skills 6→7。 - **【install-helper】ops-direct-invoke.yml 漏列 ops-tensor externalRepo**:init.sh 克隆 https://gitcode.com/cann/ops-tensor.git(depth=1 + recursive),但 yml externalRepos 未声明,导致 install-helper 安装后缺少 Blaze/tensor_api 源码,5 个 Blaze 相关 skill 工作流中断。修复后 yml 补齐 ops-tensor externalRepo。 - **【install-helper】ops-registry-invoke.yml 漏列 ops-tensor externalRepo**:同上,init.sh 克隆 ops-tensor 但 yml 未声明。修复后补齐。 - **【install-helper】ops-registry-invoke.yml asc-devkit 路径不一致**:init.sh 克隆到 reference/cann/asc-devkit(depth=1),yml 声明为 asc-devkit(无 depth),导致 install-helper 克隆到错误路径,API 文档搜索路径不匹配。修复后 yml 路径改为 reference/cann/asc-devkit + depth=1。 #### 特性增强 - **【install-helper】plugin.json 成为 agents/version 单一真相源**:gen-embedded 和 metadata-sync 始终从 plugin.json 派生 agents/version,yml installAgents 作为文档 + Layer 3 兜底(与 installSkills 同构),V5 一致性校验确保 yml 与 plugin.json 不漂移。 - **【install-helper】agent 三层发现机制**:Layer 1 plugin.json agents[](SoT,过滤 ./AGENTS.md)→ Layer 2 init.sh INCLUDED_AGENT_PATTERN(globSync 匹配,支持 extglob)→ Layer 3 yml installAgents/embedded 兜底。 - **【install-helper】skills 多层发现机制**:Layer 1 yml installSkills → Layer 2 init.sh INCLUDED_SKILLS(mergeInitSkills 补充)→ Layer 3 init.sh ALL_SKILLS(静态解析,动态 $() 跳过)→ Layer 4 <plugin>/skills/ 目录查找(findSkillSourceDir 扩展)。 - **【install-helper】V1-V7 校验门禁**:gen-embedded 构建前强制校验(plugin.json 可解析/agent .md 磁盘存在/skill 源目录存在/skills 计数一致/yml agents 一致性/optionalDependencies==version),FAIL 即 exit 1,build/build:npm/pretest 全路径强制。 - **【install-helper】skill-registry 离线回退刷新**:删除陈旧条目 cuda2ascend-simt(source: ops-lab/,已删除);新增 4 个 skill(model-train-accuracy-debug、model-train-log-visualization、model-train-oom-analysis、ge-fusion-pass-skill)。 - **【install-helper】刷新 4 个 plugins-official 陈旧 yml**:ops-direct-invoke/ops-registry-invoke/pypto-op-orchestrator/triton-op-generator 的 installSkills 同步 init.sh INCLUDED_SKILLS 完整列表。 - **【install-helper】SCAN_DIRS 改为从 repository.yaml 读取**:validate-plugins.cjs 和 gen-embedded.cjs 的 SCAN_DIRS 从硬编码改为从 src/config/repository.yaml 读取(与 scanner.ts/metadata-sync.ts 统一单一来源),消除三处硬编码漂移风险。 #### 测试看护增强(+28 用例,212→234) - **externalRepos 配置测试(8 个)**:ops-tensor 存在性 + depth=1 + recursive=true / asc-devkit 路径含 reference/cann/ / embedded externalRepos URL 匹配 yml / 无重复 URL - **5 个新 skill 注册断言(5 个)**:ascendc-simt-tiling-design / cann-env-setup / torch-ops-profiler / ascendc-direct-invoke-to-registry-invoke / ascendc-registry-invoke-to-direct-invoke 在 skill-registry 静态表中存在 - **yml skills 计数 vs init.sh 一致性(3 个)**:ops-direct-invoke(21) / ops-registry-invoke(30) / torch-compile(7) 三方计数一致 - **SCAN_DIRS 验证(3 个)**:repository.yaml scanDirs 含 runtime / validate-plugins + gen-embedded 可加载 - **多 skill 批量安装(2 个)**:3 个 skill 一次性安装 / 混合 ops + infra 来源 - **跨 plugin 共享 skill 不冲突(1 个)**:同一 skill 二次安装不破坏已有 symlink - **plugins-consistency 测试健壮性**:8 处 try/finally 包裹临时目录清理 + 4 处 return 改 expect 显式失败 ## 关联的Issue - install-helper 安装 PyPTO 插件时 3 个 Agent 全部报「未找到」(pypto-op-analyst/developer/perf-tuner) - install-helper external repo git pull 失败后跳过 symlink 创建 - install-helper yml 与 init.sh INCLUDED_SKILLS 漂移(torch-compile 缺 skill、ops-direct-invoke/ops-registry-invoke 缺 ops-tensor externalRepo) ## 测试 - **单元测试**:234 个测试全部通过(含 28 新增测试:externalRepos 配置 / 新 skill 注册断言 / yml-init.sh 计数一致性 / SCAN_DIRS / 多 skill 批量 / 跨 plugin 共享) - **init.sh 静态测试**:359 PASS(test-init-install.sh Check 1-7) - **validate-plugins 校验**:V1-V7 全部通过 - **gen-embedded 生成**:10 plugins 元数据校验通过 - **E2E 回归**: - ops-direct-invoke:21 skills, 4 agents, asc-devkit + ops-tensor externalRepo ✓ - ops-registry-invoke:30 skills, 7 agents, reference/cann/asc-devkit + ops-tensor ✓ - torch-compile:7 skills, 1 agent ✓ - install-helper vs init.sh 安装结果对比:skills/agents/externalRepos 全部一致(0 差异) - 单个 skill 安装:1 skill ✓ - 多 skill 安装:3 skills ✓ - --all 全量安装:173 skills, 0 失败 ✓ - doctor 健康检查:0 warnings ✓ - **npm 发版验证**: - 1.1.11-beta.0(beta tag)E2E 回归通过 - 1.1.12(latest tag)正式版 E2E 回归 + install-helper vs init.sh 对比测试通过 ## 文档更新 - 12 个 yml 文件更新(删除 agents/version 硬编码字段,恢复 installAgents 作为文档 + 兜底,刷新 installSkills,补齐 externalRepos) - .gitignore 补全外部仓库排除规则(ops-tensor / asc-devkit / reference/) ## 类型标签 - [x] 🐛 Bug 修复 - [x] ✨ 特性增强 - [x] 🧪 测试用例 - [x] 📦 构建 / CI See merge request: cann/cannbot-skills!798 | 13 天前 | |
refactor(ops-direct-invoke): 重构为 skill 驱动的多角色编排工作流,支持算子仓继承与静默模式 Co-authored-by: tangpingchuan<tangpingchuan@huawei.com> Co-authored-by: xutianze<xutianze2@huawei.com> # message auto-generated for no-merge-commit merge: !982 merge feat/ops-direct-invoke-skill-workflow into master refactor(ops-direct-invoke): 重构为 skill 驱动的多角色编排工作流,支持算子仓继承与静默模式 Created-by: iuyi Commit-by: xutianze;tangpingchuan Merged-by: cann-robot Description: ## 描述 本次重构将 ops-direct-invoke 插件的工作流实现从「静态 agents + workflows 目录」模型改为 **skill 驱动的多角色编排**模型,借鉴面向对象设计思想,将通用工作流沉淀为 CANNBot 维护的「基类」,各算子仓作为「子类」继承编排流程、仅覆写与自身耦合的领域知识,达到一套核心流程服务所有算子仓、消除重复建设的目的。 #### 主要变更 - **角色重构**:由 4 个角色(ascendc-kernel-architect / design-reviewer / developer / reviewer)扩展为 6 个专业角色(architect、developer、developer-code、developer-test、developer-doc、QA),PM 主 Agent 只调度不执行,执行与验收职责分离。 - **工作流引擎化**:删除旧 workflows/ 静态目录,新增 16 个子 skill: - ops-direct-invoke-workflow:统一流程编排(阶段 0-7、CP0-CP5 检查点、任务回退、静默模式) - ops-direct-invoke-workflow-maintain:维护红线与 SOLID 设计约束看护 - plugin-experience-summary / plugin-perf-iteration / plugin-pr-submit:可插拔流程插件,frontmatter 声明挂载点、init 注册到 .cannbot/settings.json,自闭环可单独触发 - repo-build-guide / repo-coding-rules / repo-knowledge / repo-op-templates / repo-test-develop:仓库领域知识 - workflow-cp0 ~ workflow-cp5:各检查点验收 skill - workflow-doc-templates / workflow-agent-permissions:文档模板与权限管理 - **跨平台权限守卫**:旧 hooks(hooks.json / run-hook.cmd / session-start-ops-direct)替换为按角色写权限隔离的 permission-guard hooks,覆盖 claude / codex / dsh / opencode / trae 五类 CLI(dsh 提供可选部署级 Cordis 守卫插件)。 - **配置统一与静默模式**:运行时配置收敛到 .cannbot/settings.json 唯一权威(工作流模式、插件注册与启用状态、问卷状态);新增静默模式(--mode silent 完全无人值守,支持会话内「开启/关闭静默模式」切换与权限预检)。 - **init.sh 重写为 constructor 模式**:装配 .cannbot/permissions、权限 hook、.cannbot/settings.json、依赖仓 clone 到 .cannbot/;example/init.sh 提供算子仓接入范例。 - **安装一致性**:install-helper 不再声明 installSkills / externalRepos,改由 init.sh 完成装配;dependency_validator.py 增强 DG-11 校验,支持从 agents/*.md frontmatter 解析 skill 白名单。 ## 关联的Issue - #595 ## 测试 我们在 [CannBench](https://cannbench.com/leaderboard) 官方任务集上完成 53 个算子的全量实现与评测(方案名 direct-invoke@Claude deepseek-v4-flash),标准集用例通过率 98.8%、隐藏集 95.5%,总分 7383.64,平均加速比标准集 0.53、隐藏集 0.85。 ## 文档更新 - 新增 plugins-official/ops-direct-invoke/README.md:设计思想、知识分层、角色与流程概览、设计约束、静默模式说明 ## 类型标签 - [x] ♻️ 代码重构 ## 流水线故障排查 <!-- 如果下方的流水线检查未通过,可参考以下指引进行自助修复 --> See merge request: cann/cannbot-skills!982 | 1 小时前 | |
fix(install-helper): 多源真相漂移根治 + agent/skills 多层发现 + external repo 修复 Co-authored-by: yanhf<yanhaifeng5@huawei.com> # message auto-generated for no-merge-commit merge: !798 merge master into master fix(install-helper): 多源真相漂移根治 + agent/skills 多层发现 + external repo 修复 Created-by: yanhf Commit-by: yanhf Merged-by: cann-robot Description: ## 描述 ### 根因 install-helper 的插件元数据(agents/version)散落在 yml、plugin.json、embedded-plugins.json、optionalDependencies 四处,采用"yml 非空即采信"的回退式调和,无任何交叉校验。agent 改名后 yml 变陈旧,非空即静默覆盖正确值,导致安装时报「Agent 未找到」。同时发现 external repo git pull 失败后 continue 跳过 symlink 创建、skill-registry 离线回退陈旧、yml 与 init.sh INCLUDED_SKILLS 漂移、externalRepos 配置不完整等问题。 ### 修复内容 #### Bug 修复 - **【install-helper】pypto-op-orchestrator 安装时 3 个 agent 未找到**:yml installAgents 引用 3 个已废弃的 agent 名(pypto-op-analyst/developer/perf-tuner),与 plugin.json 的 8 个实际 agent 零交集。修复后正确安装 8 agents。 - **【install-helper】ops-registry-invoke 漏装 4 个 agent + spec-to-design skill**:yml 仅列 3 个陈旧 agent(实际 7 个);spec-to-design skill 位于插件本地 skills/ 目录,findSkillSourceDir 仅查 scanDirs 被静默丢弃。修复后正确安装 7 agents + 30 skills。 - **【install-helper】external repo git pull 失败后跳过 symlink 创建**:installExternalRepos 中 pull 失败的 continue 跳过了后续 symlink 逻辑,导致项目目录缺少 external repo 符号链接。删除 continue,pull 失败后仅 warn 并继续创建 symlink(与 init.sh 行为一致)。 - **【install-helper】optionalDependencies 版本漂移**:5 个平台子包版本硬编码,与 package.json version 独立,多次发版后漂移。新增 V6 校验门禁确保一致。 - **【install-helper】torch-compile.yml 缺少 torch-npugraph-ex-performance-diagnosis**:主线 commit d853845a 在 init.sh INCLUDED_SKILLS 中新增了该 skill,但 yml 未同步更新,导致 install-helper 只装 6 个 skill(init.sh 装 7 个)。修复后 yml skills 6→7。 - **【install-helper】ops-direct-invoke.yml 漏列 ops-tensor externalRepo**:init.sh 克隆 https://gitcode.com/cann/ops-tensor.git(depth=1 + recursive),但 yml externalRepos 未声明,导致 install-helper 安装后缺少 Blaze/tensor_api 源码,5 个 Blaze 相关 skill 工作流中断。修复后 yml 补齐 ops-tensor externalRepo。 - **【install-helper】ops-registry-invoke.yml 漏列 ops-tensor externalRepo**:同上,init.sh 克隆 ops-tensor 但 yml 未声明。修复后补齐。 - **【install-helper】ops-registry-invoke.yml asc-devkit 路径不一致**:init.sh 克隆到 reference/cann/asc-devkit(depth=1),yml 声明为 asc-devkit(无 depth),导致 install-helper 克隆到错误路径,API 文档搜索路径不匹配。修复后 yml 路径改为 reference/cann/asc-devkit + depth=1。 #### 特性增强 - **【install-helper】plugin.json 成为 agents/version 单一真相源**:gen-embedded 和 metadata-sync 始终从 plugin.json 派生 agents/version,yml installAgents 作为文档 + Layer 3 兜底(与 installSkills 同构),V5 一致性校验确保 yml 与 plugin.json 不漂移。 - **【install-helper】agent 三层发现机制**:Layer 1 plugin.json agents[](SoT,过滤 ./AGENTS.md)→ Layer 2 init.sh INCLUDED_AGENT_PATTERN(globSync 匹配,支持 extglob)→ Layer 3 yml installAgents/embedded 兜底。 - **【install-helper】skills 多层发现机制**:Layer 1 yml installSkills → Layer 2 init.sh INCLUDED_SKILLS(mergeInitSkills 补充)→ Layer 3 init.sh ALL_SKILLS(静态解析,动态 $() 跳过)→ Layer 4 <plugin>/skills/ 目录查找(findSkillSourceDir 扩展)。 - **【install-helper】V1-V7 校验门禁**:gen-embedded 构建前强制校验(plugin.json 可解析/agent .md 磁盘存在/skill 源目录存在/skills 计数一致/yml agents 一致性/optionalDependencies==version),FAIL 即 exit 1,build/build:npm/pretest 全路径强制。 - **【install-helper】skill-registry 离线回退刷新**:删除陈旧条目 cuda2ascend-simt(source: ops-lab/,已删除);新增 4 个 skill(model-train-accuracy-debug、model-train-log-visualization、model-train-oom-analysis、ge-fusion-pass-skill)。 - **【install-helper】刷新 4 个 plugins-official 陈旧 yml**:ops-direct-invoke/ops-registry-invoke/pypto-op-orchestrator/triton-op-generator 的 installSkills 同步 init.sh INCLUDED_SKILLS 完整列表。 - **【install-helper】SCAN_DIRS 改为从 repository.yaml 读取**:validate-plugins.cjs 和 gen-embedded.cjs 的 SCAN_DIRS 从硬编码改为从 src/config/repository.yaml 读取(与 scanner.ts/metadata-sync.ts 统一单一来源),消除三处硬编码漂移风险。 #### 测试看护增强(+28 用例,212→234) - **externalRepos 配置测试(8 个)**:ops-tensor 存在性 + depth=1 + recursive=true / asc-devkit 路径含 reference/cann/ / embedded externalRepos URL 匹配 yml / 无重复 URL - **5 个新 skill 注册断言(5 个)**:ascendc-simt-tiling-design / cann-env-setup / torch-ops-profiler / ascendc-direct-invoke-to-registry-invoke / ascendc-registry-invoke-to-direct-invoke 在 skill-registry 静态表中存在 - **yml skills 计数 vs init.sh 一致性(3 个)**:ops-direct-invoke(21) / ops-registry-invoke(30) / torch-compile(7) 三方计数一致 - **SCAN_DIRS 验证(3 个)**:repository.yaml scanDirs 含 runtime / validate-plugins + gen-embedded 可加载 - **多 skill 批量安装(2 个)**:3 个 skill 一次性安装 / 混合 ops + infra 来源 - **跨 plugin 共享 skill 不冲突(1 个)**:同一 skill 二次安装不破坏已有 symlink - **plugins-consistency 测试健壮性**:8 处 try/finally 包裹临时目录清理 + 4 处 return 改 expect 显式失败 ## 关联的Issue - install-helper 安装 PyPTO 插件时 3 个 Agent 全部报「未找到」(pypto-op-analyst/developer/perf-tuner) - install-helper external repo git pull 失败后跳过 symlink 创建 - install-helper yml 与 init.sh INCLUDED_SKILLS 漂移(torch-compile 缺 skill、ops-direct-invoke/ops-registry-invoke 缺 ops-tensor externalRepo) ## 测试 - **单元测试**:234 个测试全部通过(含 28 新增测试:externalRepos 配置 / 新 skill 注册断言 / yml-init.sh 计数一致性 / SCAN_DIRS / 多 skill 批量 / 跨 plugin 共享) - **init.sh 静态测试**:359 PASS(test-init-install.sh Check 1-7) - **validate-plugins 校验**:V1-V7 全部通过 - **gen-embedded 生成**:10 plugins 元数据校验通过 - **E2E 回归**: - ops-direct-invoke:21 skills, 4 agents, asc-devkit + ops-tensor externalRepo ✓ - ops-registry-invoke:30 skills, 7 agents, reference/cann/asc-devkit + ops-tensor ✓ - torch-compile:7 skills, 1 agent ✓ - install-helper vs init.sh 安装结果对比:skills/agents/externalRepos 全部一致(0 差异) - 单个 skill 安装:1 skill ✓ - 多 skill 安装:3 skills ✓ - --all 全量安装:173 skills, 0 失败 ✓ - doctor 健康检查:0 warnings ✓ - **npm 发版验证**: - 1.1.11-beta.0(beta tag)E2E 回归通过 - 1.1.12(latest tag)正式版 E2E 回归 + install-helper vs init.sh 对比测试通过 ## 文档更新 - 12 个 yml 文件更新(删除 agents/version 硬编码字段,恢复 installAgents 作为文档 + 兜底,刷新 installSkills,补齐 externalRepos) - .gitignore 补全外部仓库排除规则(ops-tensor / asc-devkit / reference/) ## 类型标签 - [x] 🐛 Bug 修复 - [x] ✨ 特性增强 - [x] 🧪 测试用例 - [x] 📦 构建 / CI See merge request: cann/cannbot-skills!798 | 13 天前 | |
fix(install-helper): 多源真相漂移根治 + agent/skills 多层发现 + external repo 修复 Co-authored-by: yanhf<yanhaifeng5@huawei.com> # message auto-generated for no-merge-commit merge: !798 merge master into master fix(install-helper): 多源真相漂移根治 + agent/skills 多层发现 + external repo 修复 Created-by: yanhf Commit-by: yanhf Merged-by: cann-robot Description: ## 描述 ### 根因 install-helper 的插件元数据(agents/version)散落在 yml、plugin.json、embedded-plugins.json、optionalDependencies 四处,采用"yml 非空即采信"的回退式调和,无任何交叉校验。agent 改名后 yml 变陈旧,非空即静默覆盖正确值,导致安装时报「Agent 未找到」。同时发现 external repo git pull 失败后 continue 跳过 symlink 创建、skill-registry 离线回退陈旧、yml 与 init.sh INCLUDED_SKILLS 漂移、externalRepos 配置不完整等问题。 ### 修复内容 #### Bug 修复 - **【install-helper】pypto-op-orchestrator 安装时 3 个 agent 未找到**:yml installAgents 引用 3 个已废弃的 agent 名(pypto-op-analyst/developer/perf-tuner),与 plugin.json 的 8 个实际 agent 零交集。修复后正确安装 8 agents。 - **【install-helper】ops-registry-invoke 漏装 4 个 agent + spec-to-design skill**:yml 仅列 3 个陈旧 agent(实际 7 个);spec-to-design skill 位于插件本地 skills/ 目录,findSkillSourceDir 仅查 scanDirs 被静默丢弃。修复后正确安装 7 agents + 30 skills。 - **【install-helper】external repo git pull 失败后跳过 symlink 创建**:installExternalRepos 中 pull 失败的 continue 跳过了后续 symlink 逻辑,导致项目目录缺少 external repo 符号链接。删除 continue,pull 失败后仅 warn 并继续创建 symlink(与 init.sh 行为一致)。 - **【install-helper】optionalDependencies 版本漂移**:5 个平台子包版本硬编码,与 package.json version 独立,多次发版后漂移。新增 V6 校验门禁确保一致。 - **【install-helper】torch-compile.yml 缺少 torch-npugraph-ex-performance-diagnosis**:主线 commit d853845a 在 init.sh INCLUDED_SKILLS 中新增了该 skill,但 yml 未同步更新,导致 install-helper 只装 6 个 skill(init.sh 装 7 个)。修复后 yml skills 6→7。 - **【install-helper】ops-direct-invoke.yml 漏列 ops-tensor externalRepo**:init.sh 克隆 https://gitcode.com/cann/ops-tensor.git(depth=1 + recursive),但 yml externalRepos 未声明,导致 install-helper 安装后缺少 Blaze/tensor_api 源码,5 个 Blaze 相关 skill 工作流中断。修复后 yml 补齐 ops-tensor externalRepo。 - **【install-helper】ops-registry-invoke.yml 漏列 ops-tensor externalRepo**:同上,init.sh 克隆 ops-tensor 但 yml 未声明。修复后补齐。 - **【install-helper】ops-registry-invoke.yml asc-devkit 路径不一致**:init.sh 克隆到 reference/cann/asc-devkit(depth=1),yml 声明为 asc-devkit(无 depth),导致 install-helper 克隆到错误路径,API 文档搜索路径不匹配。修复后 yml 路径改为 reference/cann/asc-devkit + depth=1。 #### 特性增强 - **【install-helper】plugin.json 成为 agents/version 单一真相源**:gen-embedded 和 metadata-sync 始终从 plugin.json 派生 agents/version,yml installAgents 作为文档 + Layer 3 兜底(与 installSkills 同构),V5 一致性校验确保 yml 与 plugin.json 不漂移。 - **【install-helper】agent 三层发现机制**:Layer 1 plugin.json agents[](SoT,过滤 ./AGENTS.md)→ Layer 2 init.sh INCLUDED_AGENT_PATTERN(globSync 匹配,支持 extglob)→ Layer 3 yml installAgents/embedded 兜底。 - **【install-helper】skills 多层发现机制**:Layer 1 yml installSkills → Layer 2 init.sh INCLUDED_SKILLS(mergeInitSkills 补充)→ Layer 3 init.sh ALL_SKILLS(静态解析,动态 $() 跳过)→ Layer 4 <plugin>/skills/ 目录查找(findSkillSourceDir 扩展)。 - **【install-helper】V1-V7 校验门禁**:gen-embedded 构建前强制校验(plugin.json 可解析/agent .md 磁盘存在/skill 源目录存在/skills 计数一致/yml agents 一致性/optionalDependencies==version),FAIL 即 exit 1,build/build:npm/pretest 全路径强制。 - **【install-helper】skill-registry 离线回退刷新**:删除陈旧条目 cuda2ascend-simt(source: ops-lab/,已删除);新增 4 个 skill(model-train-accuracy-debug、model-train-log-visualization、model-train-oom-analysis、ge-fusion-pass-skill)。 - **【install-helper】刷新 4 个 plugins-official 陈旧 yml**:ops-direct-invoke/ops-registry-invoke/pypto-op-orchestrator/triton-op-generator 的 installSkills 同步 init.sh INCLUDED_SKILLS 完整列表。 - **【install-helper】SCAN_DIRS 改为从 repository.yaml 读取**:validate-plugins.cjs 和 gen-embedded.cjs 的 SCAN_DIRS 从硬编码改为从 src/config/repository.yaml 读取(与 scanner.ts/metadata-sync.ts 统一单一来源),消除三处硬编码漂移风险。 #### 测试看护增强(+28 用例,212→234) - **externalRepos 配置测试(8 个)**:ops-tensor 存在性 + depth=1 + recursive=true / asc-devkit 路径含 reference/cann/ / embedded externalRepos URL 匹配 yml / 无重复 URL - **5 个新 skill 注册断言(5 个)**:ascendc-simt-tiling-design / cann-env-setup / torch-ops-profiler / ascendc-direct-invoke-to-registry-invoke / ascendc-registry-invoke-to-direct-invoke 在 skill-registry 静态表中存在 - **yml skills 计数 vs init.sh 一致性(3 个)**:ops-direct-invoke(21) / ops-registry-invoke(30) / torch-compile(7) 三方计数一致 - **SCAN_DIRS 验证(3 个)**:repository.yaml scanDirs 含 runtime / validate-plugins + gen-embedded 可加载 - **多 skill 批量安装(2 个)**:3 个 skill 一次性安装 / 混合 ops + infra 来源 - **跨 plugin 共享 skill 不冲突(1 个)**:同一 skill 二次安装不破坏已有 symlink - **plugins-consistency 测试健壮性**:8 处 try/finally 包裹临时目录清理 + 4 处 return 改 expect 显式失败 ## 关联的Issue - install-helper 安装 PyPTO 插件时 3 个 Agent 全部报「未找到」(pypto-op-analyst/developer/perf-tuner) - install-helper external repo git pull 失败后跳过 symlink 创建 - install-helper yml 与 init.sh INCLUDED_SKILLS 漂移(torch-compile 缺 skill、ops-direct-invoke/ops-registry-invoke 缺 ops-tensor externalRepo) ## 测试 - **单元测试**:234 个测试全部通过(含 28 新增测试:externalRepos 配置 / 新 skill 注册断言 / yml-init.sh 计数一致性 / SCAN_DIRS / 多 skill 批量 / 跨 plugin 共享) - **init.sh 静态测试**:359 PASS(test-init-install.sh Check 1-7) - **validate-plugins 校验**:V1-V7 全部通过 - **gen-embedded 生成**:10 plugins 元数据校验通过 - **E2E 回归**: - ops-direct-invoke:21 skills, 4 agents, asc-devkit + ops-tensor externalRepo ✓ - ops-registry-invoke:30 skills, 7 agents, reference/cann/asc-devkit + ops-tensor ✓ - torch-compile:7 skills, 1 agent ✓ - install-helper vs init.sh 安装结果对比:skills/agents/externalRepos 全部一致(0 差异) - 单个 skill 安装:1 skill ✓ - 多 skill 安装:3 skills ✓ - --all 全量安装:173 skills, 0 失败 ✓ - doctor 健康检查:0 warnings ✓ - **npm 发版验证**: - 1.1.11-beta.0(beta tag)E2E 回归通过 - 1.1.12(latest tag)正式版 E2E 回归 + install-helper vs init.sh 对比测试通过 ## 文档更新 - 12 个 yml 文件更新(删除 agents/version 硬编码字段,恢复 installAgents 作为文档 + 兜底,刷新 installSkills,补齐 externalRepos) - .gitignore 补全外部仓库排除规则(ops-tensor / asc-devkit / reference/) ## 类型标签 - [x] 🐛 Bug 修复 - [x] ✨ 特性增强 - [x] 🧪 测试用例 - [x] 📦 构建 / CI See merge request: cann/cannbot-skills!798 | 13 天前 | |
fix(install-helper): 多源真相漂移根治 + agent/skills 多层发现 + external repo 修复 Co-authored-by: yanhf<yanhaifeng5@huawei.com> # message auto-generated for no-merge-commit merge: !798 merge master into master fix(install-helper): 多源真相漂移根治 + agent/skills 多层发现 + external repo 修复 Created-by: yanhf Commit-by: yanhf Merged-by: cann-robot Description: ## 描述 ### 根因 install-helper 的插件元数据(agents/version)散落在 yml、plugin.json、embedded-plugins.json、optionalDependencies 四处,采用"yml 非空即采信"的回退式调和,无任何交叉校验。agent 改名后 yml 变陈旧,非空即静默覆盖正确值,导致安装时报「Agent 未找到」。同时发现 external repo git pull 失败后 continue 跳过 symlink 创建、skill-registry 离线回退陈旧、yml 与 init.sh INCLUDED_SKILLS 漂移、externalRepos 配置不完整等问题。 ### 修复内容 #### Bug 修复 - **【install-helper】pypto-op-orchestrator 安装时 3 个 agent 未找到**:yml installAgents 引用 3 个已废弃的 agent 名(pypto-op-analyst/developer/perf-tuner),与 plugin.json 的 8 个实际 agent 零交集。修复后正确安装 8 agents。 - **【install-helper】ops-registry-invoke 漏装 4 个 agent + spec-to-design skill**:yml 仅列 3 个陈旧 agent(实际 7 个);spec-to-design skill 位于插件本地 skills/ 目录,findSkillSourceDir 仅查 scanDirs 被静默丢弃。修复后正确安装 7 agents + 30 skills。 - **【install-helper】external repo git pull 失败后跳过 symlink 创建**:installExternalRepos 中 pull 失败的 continue 跳过了后续 symlink 逻辑,导致项目目录缺少 external repo 符号链接。删除 continue,pull 失败后仅 warn 并继续创建 symlink(与 init.sh 行为一致)。 - **【install-helper】optionalDependencies 版本漂移**:5 个平台子包版本硬编码,与 package.json version 独立,多次发版后漂移。新增 V6 校验门禁确保一致。 - **【install-helper】torch-compile.yml 缺少 torch-npugraph-ex-performance-diagnosis**:主线 commit d853845a 在 init.sh INCLUDED_SKILLS 中新增了该 skill,但 yml 未同步更新,导致 install-helper 只装 6 个 skill(init.sh 装 7 个)。修复后 yml skills 6→7。 - **【install-helper】ops-direct-invoke.yml 漏列 ops-tensor externalRepo**:init.sh 克隆 https://gitcode.com/cann/ops-tensor.git(depth=1 + recursive),但 yml externalRepos 未声明,导致 install-helper 安装后缺少 Blaze/tensor_api 源码,5 个 Blaze 相关 skill 工作流中断。修复后 yml 补齐 ops-tensor externalRepo。 - **【install-helper】ops-registry-invoke.yml 漏列 ops-tensor externalRepo**:同上,init.sh 克隆 ops-tensor 但 yml 未声明。修复后补齐。 - **【install-helper】ops-registry-invoke.yml asc-devkit 路径不一致**:init.sh 克隆到 reference/cann/asc-devkit(depth=1),yml 声明为 asc-devkit(无 depth),导致 install-helper 克隆到错误路径,API 文档搜索路径不匹配。修复后 yml 路径改为 reference/cann/asc-devkit + depth=1。 #### 特性增强 - **【install-helper】plugin.json 成为 agents/version 单一真相源**:gen-embedded 和 metadata-sync 始终从 plugin.json 派生 agents/version,yml installAgents 作为文档 + Layer 3 兜底(与 installSkills 同构),V5 一致性校验确保 yml 与 plugin.json 不漂移。 - **【install-helper】agent 三层发现机制**:Layer 1 plugin.json agents[](SoT,过滤 ./AGENTS.md)→ Layer 2 init.sh INCLUDED_AGENT_PATTERN(globSync 匹配,支持 extglob)→ Layer 3 yml installAgents/embedded 兜底。 - **【install-helper】skills 多层发现机制**:Layer 1 yml installSkills → Layer 2 init.sh INCLUDED_SKILLS(mergeInitSkills 补充)→ Layer 3 init.sh ALL_SKILLS(静态解析,动态 $() 跳过)→ Layer 4 <plugin>/skills/ 目录查找(findSkillSourceDir 扩展)。 - **【install-helper】V1-V7 校验门禁**:gen-embedded 构建前强制校验(plugin.json 可解析/agent .md 磁盘存在/skill 源目录存在/skills 计数一致/yml agents 一致性/optionalDependencies==version),FAIL 即 exit 1,build/build:npm/pretest 全路径强制。 - **【install-helper】skill-registry 离线回退刷新**:删除陈旧条目 cuda2ascend-simt(source: ops-lab/,已删除);新增 4 个 skill(model-train-accuracy-debug、model-train-log-visualization、model-train-oom-analysis、ge-fusion-pass-skill)。 - **【install-helper】刷新 4 个 plugins-official 陈旧 yml**:ops-direct-invoke/ops-registry-invoke/pypto-op-orchestrator/triton-op-generator 的 installSkills 同步 init.sh INCLUDED_SKILLS 完整列表。 - **【install-helper】SCAN_DIRS 改为从 repository.yaml 读取**:validate-plugins.cjs 和 gen-embedded.cjs 的 SCAN_DIRS 从硬编码改为从 src/config/repository.yaml 读取(与 scanner.ts/metadata-sync.ts 统一单一来源),消除三处硬编码漂移风险。 #### 测试看护增强(+28 用例,212→234) - **externalRepos 配置测试(8 个)**:ops-tensor 存在性 + depth=1 + recursive=true / asc-devkit 路径含 reference/cann/ / embedded externalRepos URL 匹配 yml / 无重复 URL - **5 个新 skill 注册断言(5 个)**:ascendc-simt-tiling-design / cann-env-setup / torch-ops-profiler / ascendc-direct-invoke-to-registry-invoke / ascendc-registry-invoke-to-direct-invoke 在 skill-registry 静态表中存在 - **yml skills 计数 vs init.sh 一致性(3 个)**:ops-direct-invoke(21) / ops-registry-invoke(30) / torch-compile(7) 三方计数一致 - **SCAN_DIRS 验证(3 个)**:repository.yaml scanDirs 含 runtime / validate-plugins + gen-embedded 可加载 - **多 skill 批量安装(2 个)**:3 个 skill 一次性安装 / 混合 ops + infra 来源 - **跨 plugin 共享 skill 不冲突(1 个)**:同一 skill 二次安装不破坏已有 symlink - **plugins-consistency 测试健壮性**:8 处 try/finally 包裹临时目录清理 + 4 处 return 改 expect 显式失败 ## 关联的Issue - install-helper 安装 PyPTO 插件时 3 个 Agent 全部报「未找到」(pypto-op-analyst/developer/perf-tuner) - install-helper external repo git pull 失败后跳过 symlink 创建 - install-helper yml 与 init.sh INCLUDED_SKILLS 漂移(torch-compile 缺 skill、ops-direct-invoke/ops-registry-invoke 缺 ops-tensor externalRepo) ## 测试 - **单元测试**:234 个测试全部通过(含 28 新增测试:externalRepos 配置 / 新 skill 注册断言 / yml-init.sh 计数一致性 / SCAN_DIRS / 多 skill 批量 / 跨 plugin 共享) - **init.sh 静态测试**:359 PASS(test-init-install.sh Check 1-7) - **validate-plugins 校验**:V1-V7 全部通过 - **gen-embedded 生成**:10 plugins 元数据校验通过 - **E2E 回归**: - ops-direct-invoke:21 skills, 4 agents, asc-devkit + ops-tensor externalRepo ✓ - ops-registry-invoke:30 skills, 7 agents, reference/cann/asc-devkit + ops-tensor ✓ - torch-compile:7 skills, 1 agent ✓ - install-helper vs init.sh 安装结果对比:skills/agents/externalRepos 全部一致(0 差异) - 单个 skill 安装:1 skill ✓ - 多 skill 安装:3 skills ✓ - --all 全量安装:173 skills, 0 失败 ✓ - doctor 健康检查:0 warnings ✓ - **npm 发版验证**: - 1.1.11-beta.0(beta tag)E2E 回归通过 - 1.1.12(latest tag)正式版 E2E 回归 + install-helper vs init.sh 对比测试通过 ## 文档更新 - 12 个 yml 文件更新(删除 agents/version 硬编码字段,恢复 installAgents 作为文档 + 兜底,刷新 installSkills,补齐 externalRepos) - .gitignore 补全外部仓库排除规则(ops-tensor / asc-devkit / reference/) ## 类型标签 - [x] 🐛 Bug 修复 - [x] ✨ 特性增强 - [x] 🧪 测试用例 - [x] 📦 构建 / CI See merge request: cann/cannbot-skills!798 | 13 天前 | |
fix(install-helper): 多源真相漂移根治 + agent/skills 多层发现 + external repo 修复 Co-authored-by: yanhf<yanhaifeng5@huawei.com> # message auto-generated for no-merge-commit merge: !798 merge master into master fix(install-helper): 多源真相漂移根治 + agent/skills 多层发现 + external repo 修复 Created-by: yanhf Commit-by: yanhf Merged-by: cann-robot Description: ## 描述 ### 根因 install-helper 的插件元数据(agents/version)散落在 yml、plugin.json、embedded-plugins.json、optionalDependencies 四处,采用"yml 非空即采信"的回退式调和,无任何交叉校验。agent 改名后 yml 变陈旧,非空即静默覆盖正确值,导致安装时报「Agent 未找到」。同时发现 external repo git pull 失败后 continue 跳过 symlink 创建、skill-registry 离线回退陈旧、yml 与 init.sh INCLUDED_SKILLS 漂移、externalRepos 配置不完整等问题。 ### 修复内容 #### Bug 修复 - **【install-helper】pypto-op-orchestrator 安装时 3 个 agent 未找到**:yml installAgents 引用 3 个已废弃的 agent 名(pypto-op-analyst/developer/perf-tuner),与 plugin.json 的 8 个实际 agent 零交集。修复后正确安装 8 agents。 - **【install-helper】ops-registry-invoke 漏装 4 个 agent + spec-to-design skill**:yml 仅列 3 个陈旧 agent(实际 7 个);spec-to-design skill 位于插件本地 skills/ 目录,findSkillSourceDir 仅查 scanDirs 被静默丢弃。修复后正确安装 7 agents + 30 skills。 - **【install-helper】external repo git pull 失败后跳过 symlink 创建**:installExternalRepos 中 pull 失败的 continue 跳过了后续 symlink 逻辑,导致项目目录缺少 external repo 符号链接。删除 continue,pull 失败后仅 warn 并继续创建 symlink(与 init.sh 行为一致)。 - **【install-helper】optionalDependencies 版本漂移**:5 个平台子包版本硬编码,与 package.json version 独立,多次发版后漂移。新增 V6 校验门禁确保一致。 - **【install-helper】torch-compile.yml 缺少 torch-npugraph-ex-performance-diagnosis**:主线 commit d853845a 在 init.sh INCLUDED_SKILLS 中新增了该 skill,但 yml 未同步更新,导致 install-helper 只装 6 个 skill(init.sh 装 7 个)。修复后 yml skills 6→7。 - **【install-helper】ops-direct-invoke.yml 漏列 ops-tensor externalRepo**:init.sh 克隆 https://gitcode.com/cann/ops-tensor.git(depth=1 + recursive),但 yml externalRepos 未声明,导致 install-helper 安装后缺少 Blaze/tensor_api 源码,5 个 Blaze 相关 skill 工作流中断。修复后 yml 补齐 ops-tensor externalRepo。 - **【install-helper】ops-registry-invoke.yml 漏列 ops-tensor externalRepo**:同上,init.sh 克隆 ops-tensor 但 yml 未声明。修复后补齐。 - **【install-helper】ops-registry-invoke.yml asc-devkit 路径不一致**:init.sh 克隆到 reference/cann/asc-devkit(depth=1),yml 声明为 asc-devkit(无 depth),导致 install-helper 克隆到错误路径,API 文档搜索路径不匹配。修复后 yml 路径改为 reference/cann/asc-devkit + depth=1。 #### 特性增强 - **【install-helper】plugin.json 成为 agents/version 单一真相源**:gen-embedded 和 metadata-sync 始终从 plugin.json 派生 agents/version,yml installAgents 作为文档 + Layer 3 兜底(与 installSkills 同构),V5 一致性校验确保 yml 与 plugin.json 不漂移。 - **【install-helper】agent 三层发现机制**:Layer 1 plugin.json agents[](SoT,过滤 ./AGENTS.md)→ Layer 2 init.sh INCLUDED_AGENT_PATTERN(globSync 匹配,支持 extglob)→ Layer 3 yml installAgents/embedded 兜底。 - **【install-helper】skills 多层发现机制**:Layer 1 yml installSkills → Layer 2 init.sh INCLUDED_SKILLS(mergeInitSkills 补充)→ Layer 3 init.sh ALL_SKILLS(静态解析,动态 $() 跳过)→ Layer 4 <plugin>/skills/ 目录查找(findSkillSourceDir 扩展)。 - **【install-helper】V1-V7 校验门禁**:gen-embedded 构建前强制校验(plugin.json 可解析/agent .md 磁盘存在/skill 源目录存在/skills 计数一致/yml agents 一致性/optionalDependencies==version),FAIL 即 exit 1,build/build:npm/pretest 全路径强制。 - **【install-helper】skill-registry 离线回退刷新**:删除陈旧条目 cuda2ascend-simt(source: ops-lab/,已删除);新增 4 个 skill(model-train-accuracy-debug、model-train-log-visualization、model-train-oom-analysis、ge-fusion-pass-skill)。 - **【install-helper】刷新 4 个 plugins-official 陈旧 yml**:ops-direct-invoke/ops-registry-invoke/pypto-op-orchestrator/triton-op-generator 的 installSkills 同步 init.sh INCLUDED_SKILLS 完整列表。 - **【install-helper】SCAN_DIRS 改为从 repository.yaml 读取**:validate-plugins.cjs 和 gen-embedded.cjs 的 SCAN_DIRS 从硬编码改为从 src/config/repository.yaml 读取(与 scanner.ts/metadata-sync.ts 统一单一来源),消除三处硬编码漂移风险。 #### 测试看护增强(+28 用例,212→234) - **externalRepos 配置测试(8 个)**:ops-tensor 存在性 + depth=1 + recursive=true / asc-devkit 路径含 reference/cann/ / embedded externalRepos URL 匹配 yml / 无重复 URL - **5 个新 skill 注册断言(5 个)**:ascendc-simt-tiling-design / cann-env-setup / torch-ops-profiler / ascendc-direct-invoke-to-registry-invoke / ascendc-registry-invoke-to-direct-invoke 在 skill-registry 静态表中存在 - **yml skills 计数 vs init.sh 一致性(3 个)**:ops-direct-invoke(21) / ops-registry-invoke(30) / torch-compile(7) 三方计数一致 - **SCAN_DIRS 验证(3 个)**:repository.yaml scanDirs 含 runtime / validate-plugins + gen-embedded 可加载 - **多 skill 批量安装(2 个)**:3 个 skill 一次性安装 / 混合 ops + infra 来源 - **跨 plugin 共享 skill 不冲突(1 个)**:同一 skill 二次安装不破坏已有 symlink - **plugins-consistency 测试健壮性**:8 处 try/finally 包裹临时目录清理 + 4 处 return 改 expect 显式失败 ## 关联的Issue - install-helper 安装 PyPTO 插件时 3 个 Agent 全部报「未找到」(pypto-op-analyst/developer/perf-tuner) - install-helper external repo git pull 失败后跳过 symlink 创建 - install-helper yml 与 init.sh INCLUDED_SKILLS 漂移(torch-compile 缺 skill、ops-direct-invoke/ops-registry-invoke 缺 ops-tensor externalRepo) ## 测试 - **单元测试**:234 个测试全部通过(含 28 新增测试:externalRepos 配置 / 新 skill 注册断言 / yml-init.sh 计数一致性 / SCAN_DIRS / 多 skill 批量 / 跨 plugin 共享) - **init.sh 静态测试**:359 PASS(test-init-install.sh Check 1-7) - **validate-plugins 校验**:V1-V7 全部通过 - **gen-embedded 生成**:10 plugins 元数据校验通过 - **E2E 回归**: - ops-direct-invoke:21 skills, 4 agents, asc-devkit + ops-tensor externalRepo ✓ - ops-registry-invoke:30 skills, 7 agents, reference/cann/asc-devkit + ops-tensor ✓ - torch-compile:7 skills, 1 agent ✓ - install-helper vs init.sh 安装结果对比:skills/agents/externalRepos 全部一致(0 差异) - 单个 skill 安装:1 skill ✓ - 多 skill 安装:3 skills ✓ - --all 全量安装:173 skills, 0 失败 ✓ - doctor 健康检查:0 warnings ✓ - **npm 发版验证**: - 1.1.11-beta.0(beta tag)E2E 回归通过 - 1.1.12(latest tag)正式版 E2E 回归 + install-helper vs init.sh 对比测试通过 ## 文档更新 - 12 个 yml 文件更新(删除 agents/version 硬编码字段,恢复 installAgents 作为文档 + 兜底,刷新 installSkills,补齐 externalRepos) - .gitignore 补全外部仓库排除规则(ops-tensor / asc-devkit / reference/) ## 类型标签 - [x] 🐛 Bug 修复 - [x] ✨ 特性增强 - [x] 🧪 测试用例 - [x] 📦 构建 / CI See merge request: cann/cannbot-skills!798 | 13 天前 | |
fix(install-helper): 多源真相漂移根治 + agent/skills 多层发现 + external repo 修复 Co-authored-by: yanhf<yanhaifeng5@huawei.com> # message auto-generated for no-merge-commit merge: !798 merge master into master fix(install-helper): 多源真相漂移根治 + agent/skills 多层发现 + external repo 修复 Created-by: yanhf Commit-by: yanhf Merged-by: cann-robot Description: ## 描述 ### 根因 install-helper 的插件元数据(agents/version)散落在 yml、plugin.json、embedded-plugins.json、optionalDependencies 四处,采用"yml 非空即采信"的回退式调和,无任何交叉校验。agent 改名后 yml 变陈旧,非空即静默覆盖正确值,导致安装时报「Agent 未找到」。同时发现 external repo git pull 失败后 continue 跳过 symlink 创建、skill-registry 离线回退陈旧、yml 与 init.sh INCLUDED_SKILLS 漂移、externalRepos 配置不完整等问题。 ### 修复内容 #### Bug 修复 - **【install-helper】pypto-op-orchestrator 安装时 3 个 agent 未找到**:yml installAgents 引用 3 个已废弃的 agent 名(pypto-op-analyst/developer/perf-tuner),与 plugin.json 的 8 个实际 agent 零交集。修复后正确安装 8 agents。 - **【install-helper】ops-registry-invoke 漏装 4 个 agent + spec-to-design skill**:yml 仅列 3 个陈旧 agent(实际 7 个);spec-to-design skill 位于插件本地 skills/ 目录,findSkillSourceDir 仅查 scanDirs 被静默丢弃。修复后正确安装 7 agents + 30 skills。 - **【install-helper】external repo git pull 失败后跳过 symlink 创建**:installExternalRepos 中 pull 失败的 continue 跳过了后续 symlink 逻辑,导致项目目录缺少 external repo 符号链接。删除 continue,pull 失败后仅 warn 并继续创建 symlink(与 init.sh 行为一致)。 - **【install-helper】optionalDependencies 版本漂移**:5 个平台子包版本硬编码,与 package.json version 独立,多次发版后漂移。新增 V6 校验门禁确保一致。 - **【install-helper】torch-compile.yml 缺少 torch-npugraph-ex-performance-diagnosis**:主线 commit d853845a 在 init.sh INCLUDED_SKILLS 中新增了该 skill,但 yml 未同步更新,导致 install-helper 只装 6 个 skill(init.sh 装 7 个)。修复后 yml skills 6→7。 - **【install-helper】ops-direct-invoke.yml 漏列 ops-tensor externalRepo**:init.sh 克隆 https://gitcode.com/cann/ops-tensor.git(depth=1 + recursive),但 yml externalRepos 未声明,导致 install-helper 安装后缺少 Blaze/tensor_api 源码,5 个 Blaze 相关 skill 工作流中断。修复后 yml 补齐 ops-tensor externalRepo。 - **【install-helper】ops-registry-invoke.yml 漏列 ops-tensor externalRepo**:同上,init.sh 克隆 ops-tensor 但 yml 未声明。修复后补齐。 - **【install-helper】ops-registry-invoke.yml asc-devkit 路径不一致**:init.sh 克隆到 reference/cann/asc-devkit(depth=1),yml 声明为 asc-devkit(无 depth),导致 install-helper 克隆到错误路径,API 文档搜索路径不匹配。修复后 yml 路径改为 reference/cann/asc-devkit + depth=1。 #### 特性增强 - **【install-helper】plugin.json 成为 agents/version 单一真相源**:gen-embedded 和 metadata-sync 始终从 plugin.json 派生 agents/version,yml installAgents 作为文档 + Layer 3 兜底(与 installSkills 同构),V5 一致性校验确保 yml 与 plugin.json 不漂移。 - **【install-helper】agent 三层发现机制**:Layer 1 plugin.json agents[](SoT,过滤 ./AGENTS.md)→ Layer 2 init.sh INCLUDED_AGENT_PATTERN(globSync 匹配,支持 extglob)→ Layer 3 yml installAgents/embedded 兜底。 - **【install-helper】skills 多层发现机制**:Layer 1 yml installSkills → Layer 2 init.sh INCLUDED_SKILLS(mergeInitSkills 补充)→ Layer 3 init.sh ALL_SKILLS(静态解析,动态 $() 跳过)→ Layer 4 <plugin>/skills/ 目录查找(findSkillSourceDir 扩展)。 - **【install-helper】V1-V7 校验门禁**:gen-embedded 构建前强制校验(plugin.json 可解析/agent .md 磁盘存在/skill 源目录存在/skills 计数一致/yml agents 一致性/optionalDependencies==version),FAIL 即 exit 1,build/build:npm/pretest 全路径强制。 - **【install-helper】skill-registry 离线回退刷新**:删除陈旧条目 cuda2ascend-simt(source: ops-lab/,已删除);新增 4 个 skill(model-train-accuracy-debug、model-train-log-visualization、model-train-oom-analysis、ge-fusion-pass-skill)。 - **【install-helper】刷新 4 个 plugins-official 陈旧 yml**:ops-direct-invoke/ops-registry-invoke/pypto-op-orchestrator/triton-op-generator 的 installSkills 同步 init.sh INCLUDED_SKILLS 完整列表。 - **【install-helper】SCAN_DIRS 改为从 repository.yaml 读取**:validate-plugins.cjs 和 gen-embedded.cjs 的 SCAN_DIRS 从硬编码改为从 src/config/repository.yaml 读取(与 scanner.ts/metadata-sync.ts 统一单一来源),消除三处硬编码漂移风险。 #### 测试看护增强(+28 用例,212→234) - **externalRepos 配置测试(8 个)**:ops-tensor 存在性 + depth=1 + recursive=true / asc-devkit 路径含 reference/cann/ / embedded externalRepos URL 匹配 yml / 无重复 URL - **5 个新 skill 注册断言(5 个)**:ascendc-simt-tiling-design / cann-env-setup / torch-ops-profiler / ascendc-direct-invoke-to-registry-invoke / ascendc-registry-invoke-to-direct-invoke 在 skill-registry 静态表中存在 - **yml skills 计数 vs init.sh 一致性(3 个)**:ops-direct-invoke(21) / ops-registry-invoke(30) / torch-compile(7) 三方计数一致 - **SCAN_DIRS 验证(3 个)**:repository.yaml scanDirs 含 runtime / validate-plugins + gen-embedded 可加载 - **多 skill 批量安装(2 个)**:3 个 skill 一次性安装 / 混合 ops + infra 来源 - **跨 plugin 共享 skill 不冲突(1 个)**:同一 skill 二次安装不破坏已有 symlink - **plugins-consistency 测试健壮性**:8 处 try/finally 包裹临时目录清理 + 4 处 return 改 expect 显式失败 ## 关联的Issue - install-helper 安装 PyPTO 插件时 3 个 Agent 全部报「未找到」(pypto-op-analyst/developer/perf-tuner) - install-helper external repo git pull 失败后跳过 symlink 创建 - install-helper yml 与 init.sh INCLUDED_SKILLS 漂移(torch-compile 缺 skill、ops-direct-invoke/ops-registry-invoke 缺 ops-tensor externalRepo) ## 测试 - **单元测试**:234 个测试全部通过(含 28 新增测试:externalRepos 配置 / 新 skill 注册断言 / yml-init.sh 计数一致性 / SCAN_DIRS / 多 skill 批量 / 跨 plugin 共享) - **init.sh 静态测试**:359 PASS(test-init-install.sh Check 1-7) - **validate-plugins 校验**:V1-V7 全部通过 - **gen-embedded 生成**:10 plugins 元数据校验通过 - **E2E 回归**: - ops-direct-invoke:21 skills, 4 agents, asc-devkit + ops-tensor externalRepo ✓ - ops-registry-invoke:30 skills, 7 agents, reference/cann/asc-devkit + ops-tensor ✓ - torch-compile:7 skills, 1 agent ✓ - install-helper vs init.sh 安装结果对比:skills/agents/externalRepos 全部一致(0 差异) - 单个 skill 安装:1 skill ✓ - 多 skill 安装:3 skills ✓ - --all 全量安装:173 skills, 0 失败 ✓ - doctor 健康检查:0 warnings ✓ - **npm 发版验证**: - 1.1.11-beta.0(beta tag)E2E 回归通过 - 1.1.12(latest tag)正式版 E2E 回归 + install-helper vs init.sh 对比测试通过 ## 文档更新 - 12 个 yml 文件更新(删除 agents/version 硬编码字段,恢复 installAgents 作为文档 + 兜底,刷新 installSkills,补齐 externalRepos) - .gitignore 补全外部仓库排除规则(ops-tensor / asc-devkit / reference/) ## 类型标签 - [x] 🐛 Bug 修复 - [x] ✨ 特性增强 - [x] 🧪 测试用例 - [x] 📦 构建 / CI See merge request: cann/cannbot-skills!798 | 13 天前 |
| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
| 13 天前 | ||
| 13 天前 | ||
| 13 天前 | ||
| 13 天前 | ||
| 13 天前 | ||
| 1 小时前 | ||
| 13 天前 | ||
| 13 天前 | ||
| 13 天前 | ||
| 13 天前 | ||
| 13 天前 |