feat(mcp-server): 新增 zcode_pr_review — PR 审查模式 (git diff + mimosa 聚焦深扫) - #11
Merged
Conversation
- git diff base...HEAD (三点 merge-base 语义) 算改动清单与完整 diff; base 不传自动探测 (origin/HEAD → main/master → origin/main|master) - mimosa 全仓扫描 focus_files=改动文件 (deep 档业务逻辑投研聚焦, 默认 deep) - diff+findings 作附件喂 zcode 出 PR 复核报告 (P0/P1/P2 + findings 核实 + 能否合并结论); diff 超 ZCODE_BRIDGE_PR_DIFF_MAX (默认 500KB) 截断保清单 - 相对 base 无改动直接返回提示, 不消耗 LLM 调用 - 新增 6 个测试用例 (43 全绿); README/SKILL/agent-help 同步
- P1-1: base/head 统一 _validate_rev 校验 (拒绝 - 开头防 --output= 等选项注入; head 此前完全无校验); diff 命令补 -- 分隔符 - P1-2: diff 截断改按字节切 + errors=ignore 容错解码, 防多字节字符切半 - 新增 PR6/PR7 注入拒绝用例 (45 全绿)
- P1-1 补强: rev-parse/diff 全面加 --end-of-options (git≥2.24), 关掉 rev 被当选项解析的残余路径 - P1-2: diff 截断先退到最后完整行再容错解码, 防半行误导 diff 结构 - P2-1: focus_files (改动清单) 与 security_review 对齐 200 上限 - P2-3: focus 参数三个 review tool 统一 _clamp_focus 钳 2000 字符 - P2-4: 补 base 探测失败/mimosa 失败/附件清理三个用例 (48 全绿) - P2-2 (ref 名含 ...): git refname 规则本就不允许 '..', 记录为无需修
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
动机
zcode_security_review是全仓审查。本 PR 新增zcode_pr_review——PR 审查模式:改动多大查多重,合并前自动验收。流程
ZCODE_BRIDGE_PR_DIFF_MAX(默认 500KB)→ 字节级截断(退到完整行 + 容错解码),改动文件清单完整保留狗食验证(本 PR 由 zcode_pr_review 自审两轮)
f867053):base/head git 选项注入防护(--output=类注入可让只读 diff 写出文件)+ UTF-8 截断按字符切的问题435c3bf):--end-of-options全面加固、截断退完整行、focus_files/focus 长度上限、补 3 个测试缺口用例;P2-2(ref 名含...)经查 git refname 规则本就不允许..,记录为无需修参数
path(仓库目录)/base(自动探测)/head(默认 HEAD)/depth(默认 deep)/focus/cwd