已合并
feat(cake): 引入 CAKE2 社区插件与 plugins-community 通道 #15
feat(cake): 引入 CAKE2 社区插件与 plugins-community 通道 #15
已合并
Junyi创建于 28 天前
Junyi
28 天前

概述

三个提交,建议逐个评审:

  1. b55ef86 — 打通 plugins-community/ 通道(7 个文件)。打包器与安装器原先写死
    plugins/,plugins-community/ 下只有 .gitkeep 且全仓无代码读取。
  2. c1bfbc1 — 引入 CAKE2 社区插件(19 技能),内容取自 cann/cannbot-skills 已合入
    master 的同一份副本,逐字节一致。
  3. aec2069 — 按开源软件成分扫描结果更正第三方署名(47 个文件)。

第 2 个提交是内容现状,第 3 个提交是全部许可相关改动。评审许可问题只需读第 3 个提交。

一、通道(b55ef86,7 文件)

社区插件的目录名与清单 name 不要求一致——cake 的目录是
collaborative-agent-kernel-evolution,清单 name 是 cake——因此社区通道按清单
name 建索引,目录名只作存放位置。plugins/ 保持原规则:目录名即插件 id,不一致即报错。

文件 内容
script/lib/plugin-bundle.js 新增 findPluginDirectory;社区根按清单 name 匹配,官方根保留目录名与 name 一致的断言;社区插件不套用插件根许可
script/bin/cannbot.js resolvePluginDir 增加 plugins-community 与 dist/plugins-community;新增 agent/workflow 正文的技能路径改写;新增跨插件技能重名判定
script/test/install.test.js 辅助函数插件根参数化;marketplace 断言按 source 前缀区分官方与社区;每个 git-subdir 条目一律断言 source.sha === gitlink;新增 6 项用例
script/scripts/assemble-plugins.js、plugins/README.md、docs/repository-guide.md、CHANGELOG.md 日志、文档与变更记录

三项行为变更:技能路径改写(agent 正文的 skills/<name>/ 改写为安装后的绝对路径,只匹配已解析出的技能名,散文不受影响);跨插件技能重名按解析后的源路径判定(源路径相同放行,即合法复用;不同则报错点名。安装记录新增 skillSources 字段,记录中路径已不存在时视为过期记录);preserveSkillInvocationPolicy 开关(置真时技能的 disable-model-invocation 保留作者原值;不设该键时行为与现状一致)。

二、cake 内容(c1bfbc1,498 文件)

495 个文件与 cann/cannbot-skills 02e9a93f 的同名文件逐字节一致(diff -r 验证)。唯一差异是 .claude-plugin/plugin.json 的三行:version 由 0.1.1 改为 0.2.0(使两仓并存期间两份副本在坐标上可区分),homepage 与 repository 改指 cannbot。

新增登记文件(cake 在 cannbot-skills 侧没有这些):plugin-sources.json(skillInstallMode 为 symlink,skills 为空数组——19 技能版本不引用 submodule 中的任何技能,因此本 PR 不涉及 gitlink;preserveSkillInvocationPolicy 置真)、init.sh(并补 CANN-2.0 许可头,所照的模板自身缺头)、.codex-plugin/plugin.json、marketplace 条目、OAT.xml 的 Chart.js filteritem。

TileLang、EasyAsc、CV 三条轨道的其余 12 个技能另行提交。

三、第三方署名更正(aec2069,47 文件)

扫描共 50 项命中、48 个文件。41 项登记为第三方,9 项申请判定误报。

登记(41 项)

40 个文件取自 just-it/ascendopgenagent(commit d530e7b,按 Apache-2.0 提供)。实测该仓库对应文件最早提交为 2026-03-14 至 03-16,CAKE2 侧为 2026-03-18,由同一次提交一次性引入。原「Copyright (c) 2026 Huawei Technologies Co., Ltd. + CANN-2.0」头替换为:

Derived from https://github.com/just-it/ascendopgenagent (commit d530e7b),
which distributes this content under the Apache License, Version 2.0.
See LICENSE-APACHE in the plugin root for the full text of that License.
Modifications Copyright (c) 2026 Huawei Technologies Co., Ltd.

署名只陈述取得途径、不陈述权利归属。 理由:该仓库文件内无任何版权头,其 LICENSE 的版权人字段留空未填;且它并非所记述 DSL 的源头——该 DSL 使用 Triton 的 tl.* 接口,另含 tl.num_vec_cores()、tl.copyout 等昇腾扩展,二者在 TileLang-Ascend 与 EasyAsc 中均不存在,其 README 自述为「基于 Triton/AscendC」并设有 AKG-Triton Agent。本次扫描本身两次把下游副本报成来源(见下),因此不以扫描结果作为权利归属的依据。写「取自何处、按何许可提供」在任何情况下都为真;若日后查明更上游的来源,补一行即可,不必撤回已公开的版权声明。

skills/reference-generation/references/hardtanh.py 改写自 Stanford KernelBench 的 KernelBench/level1/32_HardTanh.py(MIT,Copyright (c) 2023 Anne Ouyang, Simon Guo, Azalia Mirhoseini, Scaling Intelligence Lab, Stanford University)。forward 的 9 行文档字符串逐字一致,代码部分只有一行 F.hardtanh 调用。保留 Stanford 版权声明并加修改声明。扫描命中的 sakanaai/robust-kbench 是 KernelBench 的下游(其路径即 tasks/kernelbench/...)。

随本提交交付:LICENSE-APACHE(Apache-2.0 全文,取自上游)、LICENSE-MIT(MIT 全文,含 Stanford 声明)、README.OpenSource(新建,照 cannbot-skills 的 plugins-community/autoresearch 格式,登记三个组件)、OAT.xml(cake filteritem 由 1 条增至 44 条)。

申请判定误报(9 项)

csrc/op.cpp(47%,命中 wzzll123/multikernelbench)与 setup.py(7%×3,命中 ascend/samples 与 evotoolkit×2):源头是华为自有的昇腾官方样例 gitee.com/ascend/samples 的 operator/ascendc/0_introduction/1_add_frameworklaunch/CppExtensionInvocation/——扫描自身已将该样例列为 setup.py 的命中来源之一。setup.py 命中区间为第 22–26 行 5 行,与官方样例第 10–14 行逐字节一致;op.cpp 全文 36 行,命中区间 18–34 行即官方样例 csrc/add_custom.cpp 的算子注册块,连中文注释都一致,差异只有算子名,且该样例文件自带 Copyright (C) 2024-2025. Huawei Technologies Co., Ltd. 头。multikernelbench 与 evotoolkit 同为该样例的下游。

linear_softplus.py(12%,命中 mindspore-ai/akg):无逐字一致内容。概述句描述的运算不同(本项目为 linear + softplus,akg 为 weight-normalized linear 且不含 softplus),形参说明本项目用方括号、akg 用圆括号,代码行分别为 F.linear(x, self.weight) 与 self.linear(x)。相同的只是 Google 风格文档字符串骨架。akg 的该文件位于其自身 thirdparty/ 目录下,akg 亦非来源。

cake-docs-search/scripts/ 下 4 个文件(72–93%,命中 ascend-ai-coding/awesome-ascend-skills):本项目在先。CAKE2 于 2026-03-24(commit e03610da)引入 ascendc-docs-search,对方对应文件最早提交为 2026-05-19,晚约 8 周且该路径仅有 1 个提交;命中路径为 external/cannbot/ops/ascendc-docs-search/scripts/,即对方将本项目内容收录进其「外部依赖」目录;对方仓库无许可文件。同一批脚本此前已在 cannbot-skills 侧提交过同样的审核意见。

四、需要评审确认的一项

合入本 PR 即等于接受:从 40 个文件上移除华为版权声明、降为修改声明,并承认这些内容取自 ascendopgenagent。 这不是机械改动,请明确确认。

五、与 cannbot-skills 的差异说明

aec2069 使 cake 不再与 cannbot-skills 的同名文件逐字节一致:41 个文件的许可头不同,另新增 3 个文件。这是有意更正。cannbot-skills 侧的同一批文件仍带原署名并已公开,按迁移计划由后续步骤整体删除该副本——在该仓修改不能使已公开的旧版本失效(按 SHA 仍可取到),因此未在该仓另行提交。

.gitignore 的运行期产物条目不在本 PR:与在途 PR !14 在同一处重叠,待其合入后另行提交。

六、验证

  • npm --prefix script test:48 / 48 通过(含新增 6 项)。
  • npm --prefix script run build:plugins:组装为 plugins-community/cake,19 技能——目录名与清单 name 不一致的解析路径由此在真实内容上走通,而非只在夹具上。
  • 五种客户端各安装一次(opencode / codex / claude / trae / dsh):均为 19 技能 + 3 个 agent,退出码 0。
  • 19 个技能逐个比对源文件与 dist 产物中 disable-model-invocation 的取值:差异 0。
  • claude 下 hooks 注册到 settings.json:Stop、PostToolUse、PostToolUseFailure 各一条。
  • npm --prefix script run pack:check:通过,tarball 内 plugins-community 条目数为 0。
  • OAT.xml 登记的 44 个路径逐一存在;自行编写文件的 git diff --check 为 0 行。
  • 基线 c82cd77,落后 0 个提交。

七、已知项

导入内容中有 845 行尾随空格,git diff --check 会报出。这些行与 cannbot-skills 已合入的字节一致,未作改动——aec2069 之外不引入与来源无关的差异。本次自行编写的文件中该检查为 0 行。

likedislike
Pull Request已成功合入, 合并人@CANN-robot
(感谢 Junyi 的贡献)
JJunyi
28 天前 创建了 pull request,commit 3ffd55ae
CANN-robot
CANN-robot成员
28 天前 评论:

Hi @gcw_P2Mh5H1S, welcome to submitting your first PR to cannbot!

PR Merge Steps

1. CLA Signing

If the current PR label includes cann-cla/yes, it means you have signed the CLA and can proceed to the next step. If the label includes cann-cla/no, please sign the CLA first. If you have any questions, please refer to the FAQ.

2. CI Check

Please comment /compile to trigger the CI pipeline check. If the CI run is successful, the PR will be tagged with ci-pipeline-passed and you can proceed to the next step. If the CI run fails, the PR will be tagged with ci-pipeline-failed, please check the CI logs to fix the issues in the PR. If you have any questions, please refer to the FAQ.

3. Code Review

After CI passes, please refer to the PR Approval Progress and proactively @ the committers in the table to review the code. After approval, committers will comment /lgtm and /approve. Once the lgtm and approved labels are successfully added, the PR will be merged automatically.

likedislike
CANN-robotCANN-robot成员
28 天前 添加了label:stat/needs-squash
CANN-robotCANN-robot成员
28 天前 添加了label:cann-cla/yes
CANN-robot
CANN-robot成员
28 天前 评论:

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.
You can self-configure the PR merge rules for this repository. For more details, please refer to Here.
For more, you also can visit HICANN.


PR Approval Progress

✅ Congratulations! All modules have met the lgtm and approve requirements.

Module Approval Details

module lgtm status approve status
repo-cann/cannbot ✅ 汤平川, hanrui22 (2/2) ✅ 汤平川 (1/1)

💡 Tip:

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

CLA Signature Pass

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

likedislike
此处折叠了260条消息 查看更多
Hhanrui22成员
19 天前 添加了 squash commit 备注:1
Hhanrui22成员
19 天前 移除了pull request提交信息 “1”
hanrui22成员
19 天前 评论:

/lgtm

likedislike
CANN-robotCANN-robot成员
19 天前 添加了label:lgtm
CANN-robotCANN-robot成员
19 天前 合入了pull request