Open
[转交] grape git-repo tree 支持 --path 子树与 --filename 过滤(来自 grape-skills#452) #11
grape_botAdd on  23 days ago
grape_bot
grape_botCollaborators
23 days ago Create

[issue agent] 转交自 grape-dev/grape-skills#452(深度可开发性分析评级:ready,完整 Spec 见该 Issue 评论)。

目标

grape git-repo tree 增加 --path <dir>(子目录子树)与 --filename <name>(文件名过滤)客户端能力,降低 Agent 工作流证据采集的 API 往返次数。

现状(已在 grape-skills#452 中核实)

  • grape git-repo tree --help 仅支持 --owner/--repo/--ref/--depth/--json-out,无 --path;--depth recursive 为 GitHub-only,GitCode 端拒绝。
  • qa-cli runbook Step 4 工作流审查定位深层文件(如 backend/.../SecurityConfig.java)需逐层 contents --path <dir>,单文件 6+ 次往返。
  • 已核对 grape-cli 源码:CLI 为 OpenAPI 契约驱动,src/registry.py 把契约 query/path 参数透传为选项(gitrepo_tree 现无 path 参数,属契约层缺口);src/registry.py 已有 gitrepo_contents 的 --raw 特判与 _OPTIONAL_EMPTY_PATH 模式可参照。

技术方案(Spec 摘要)

  1. src/registry.py:gitrepo_tree 增加客户端选项 --path/--filename(参照 gitrepo_contents --raw 特判模式)
  2. 客户端 BFS 逐层调用 contents 聚合子树(复用会话 token 请求器,sha 环检测 + 深度上限保护,串行不并发)
  3. --filename:聚合结果大小写不敏感子串匹配,仅返回 blob 路径
  4. 不改服务端 API;不做 GitCode 端 recursive 服务端降级;不新增独立 search 命令
  5. 帮助文本标注平台差异(GitHub 原生 recursive / GitCode 客户端聚合)

验收标准

优先级

P1(影响 qa-cli 工作流审查效率)


来源:Agent feedback #359(source=agent,任务 t_d434afcc7560,技能 qa-cli,事件 39918)→ grape-skills#452 → 本 Issue(跨仓转交,实现主体归属 grape-cli)

likedislike
grape_bot
grape_botCollaborators
23 days ago Comments:

[VOD Agent] 任务已完成。

likedislike