Merged
feat(governance): 接入兼容旧知识的可选 Scope 基础契约 #171
feat(governance): 接入兼容旧知识的可选 Scope 基础契约 #171
Merged
汪超Add on 12 days ago
汪超Collaborators
12 days ago

变更说明

PR143 的知识卡新增了可选 scope,但现有知识 CI 从目标分支加载受信规则和脚本,只覆盖 PR 的 knowledge/。目标规则尚不支持该字段,导致 57 张卡触发 114 条 Schema/Profile 错误,GraphCheck 也在加载卡片时失败。本 PR 先接入兼容旧知识的 Scope 基础治理,供后续知识迁移使用。

主要改动:

  1. 在 JSON Schema、四类 Profile(Concept/Guide/Optimization/Runbook)和 Registry 中声明可选 Scope,接入同版本 Contract 校验与三态比较;Lint、索引和构图复用同一实现。保留 additionalProperties: false,继续拒绝未知字段、非法维度、错误路径绑定和不支持的 Profile。
  2. Scope 保持可选,允许来源支持且有过滤价值的部分条件,不以填写率验收。各领域独立定义 namespace、适用范围、维度和匹配语义;处理器只从受审查的 Contract 静态表选择,数据不能加载外部可执行代码。
  3. 补充治理 Spec、AGENTS、Ingest/Lint 说明及回归,解释治理能力先于依赖知识接入的 CI 边界。当前只提供校验和 Contract 比较接口,Query 的公开参数和排序保持原样。

知识树与目标分支逐字节一致;不移动卡片、不补写 Scope、不禁用 experience,不修改 .gitcode/、Query、原检索用例、安装器或检查入口。知识迁移、场景查询参数和目录禁用继续由 PR143 承载。本地 RFC、生成报告和实验产物未纳入提交。

上游同步与冲突处理

合并上游 master 3cc093df,将 logs/2026-10-26.md 的双方三条完整记录按 21:03 → 20:53 → 17:15 排列,原文保持不变。Scope 校验仍为 P0,沿用上游日志格式 P0、日志乱序 P1 及 CI 日志快照处理;此前的日志排序与快照问题已由上游修复,无需再单独前置日志修复提交。

本 PR 相对目标分支不含知识或 .gitcode/ 差异。期间 master 后续提交 91ef56f3 已通过自动合并检查,无新增冲突;下面的完整验证对应源提交 5562b722 的合并树。

变更类型

验证

likedislike
Pull Request has been successfully merged by CANN-robot.
(Thank you for 汪超's contribution.)
汪汪超Collaborators
12 days ago Created pull request, commit 7822bb5f
汪汪超Collaborators
12 days ago Associated issue: [RFC] 优化模型推理知识的分类、结构和检索范围
CANN-robotCANN-robotCollaborators
12 days ago Added label: cann-cla/yes
CANN-robot
CANN-robotCollaborators
12 days ago Comments:

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-knowledge ✅ zhanghz1, wangsj0012 (2/2) ✅ zhanghz1, wangsj0012 (2/1)

💡 Tip:

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

CLA Signature Pass

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

likedislike
CANN-robotCANN-robotCollaborators
12 days ago Set wangsj0012,jon_jin,zhanghz1,fafahan,zhengshencn_hwca,linghuis,OpSphere,xfwang_ecnu as approver
50 messages are collapsed here。 See more
zhanghz1
zhanghz1Collaborators
11 days ago Comments:

/approve

likedislike
wangshaojun
wangshaojunCollaborators
11 days ago Comments:

/approve

likedislike
zhanghz1
zhanghz1Collaborators
11 days ago Comments:

/lgtm

likedislike
CANN-robotCANN-robotCollaborators
11 days ago Added label: lgtmapproved
CANN-robotCANN-robotCollaborators
11 days ago Merged pull request