Pull Request已成功合入, 合并人@CANN-robot
(感谢 bububu 的贡献)Hi @LiJianhao2, welcome to submitting your first PR to cannbot-knowledge!
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.


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 | ✅ qq_41667743, zhanghz1 (2/2) | ✅ qq_41667743 (1/1) |
💡 Tip:
- Committer can comment
/approveor/lgtm- Commenting
/approveimplies both code review (lgtm) and intent to merge (approve)
CLA Signature Pass
LiJianhao2, thanks for your pull request. All authors of the commits have signed the CLA. 👍


| 🚀 CI 流水线已启动 |
|---|
| 📋 执行详情: 点击查看流水线 |


/lgtm


描述
严格来源导航此前以本地 Git 路径末级名称是否包含
.推断文件类型,导致固定提交 checkout 中实际存在的无扩展名文件无法作为源码文件链接;checkout 缺失时也会按名称猜测类型,与离线规则不符。修复仅使用已登记来源和当前 checkout 状态:checkout 缺失时不作无法验证的文件类型判断;checkout 存在时通过
Path.is_file()/Path.is_dir()确认来源和导航目标的真实类型,且只接受同仓库、同 revision 的实际文件链接。逐 hunk 对账:
governance/contracts/checks/source_navigation.py:离线缺失 checkout 时跳过类型检查;恢复时按实际文件/目录类型判定,导航目标必须是文件。evals/test_source_resources.py:真实临时 Git fixture 覆盖无扩展名Makefile可通过、带点号的目录不能冒充文件、缺失 checkout 不误报。logs/2026-09-26.md:记录本次治理修复、回归结果及统一门禁的真实结果。关联的Issue
关联 issue #14
测试
PYTHONDONTWRITEBYTECODE=1 python3 -m unittest evals.test_source_resourcesgit diff --check:退出码 0,无输出。ruff check governance/contracts/checks/source_navigation.py evals/test_source_resources.py:未运行,环境返回/bin/bash: ruff: command not found(退出码 127);未安装全局依赖。bash check.sh:未通过,退出码 1。真实摘要:严格 Lintchecked=7718 P0=0 P1=0 P2=0;索引同步Checked 662 indexes, stale 0;索引构建与完整验证均为ok cards=7056;29 个检索断言全部 PASS、recall@k=1.000 MRR=1.000,但性能门槛失败:该失败与本次源码导航修复无关;
check.sh因set -e未继续执行后续全库 unittest、ruff 和 shell 检查。本 PR 不改动无关检索逻辑。文档更新
无。现有
governance/specs/schemas.md已明确规定离线缺根时只校验路径形状。类型标签
当前PR是否有AI参与:
[x] 是
__1. Agent平台信息: Codex CLI 0.153.4
__2. 模型信息: gpt-5.6-luna
__3. Prompt摘要: 根据已提交 issue #14 独立复现无扩展名源码误报,核对离线规范,实施并定向验证最小修复。
希望检视人员了解: