feat(delivery/mcp): get_delivery_status 支持按 pr_number/branch 查询,结论绑定 Gitea head SHA(使者回传 #203) #32

Merged
lanrtop merged 3 commits from feat/delivery-status-by-pr into master 2026-10-03 05:36:38 +08:00

3 Commits

Author SHA1 Message Date
lanrtop
df5832f41b fix(delivery/mcp): 补 get_delivery_status 经 scoped dispatch 转发 pr_number/branch 的回归测试(P3-F 审查)
All checks were successful
Push & PR Check / check (push) Successful in 59s
Push & PR Check / check (pull_request) Successful in 1m2s
使者回传 #203 的症状是「传 pr_number 也不起作用」,但原有 MCP 层测试只覆盖非法参数报错,
dispatch 若丢弃已解析的查询目标、改传默认值,全部测试仍通过。新增 scoped dispatch 正向测试,
断言 pr_number/branch/null 分别得到 pull_request/branch/local_branch 目标;已用变异
(dispatch 改传 DeliveryQuery::default())确认该测试会失败。

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-03 06:34:06 +09:00
lanrtop
1e3989d0d7 feat(delivery/mcp): get_delivery_status 支持按 pr_number/branch 查询,结论绑定 Gitea head SHA(使者回传 #203)
All checks were successful
Push & PR Check / check (push) Successful in 1m0s
Push & PR Check / check (pull_request) Successful in 1m2s
Enterprise 2026-10-03 实测:为避开主工作区里其他会话的在制品,在独立 worktree
分支上开 PR 交付时,get_delivery_status 只读主工作区当前分支,返回「当前分支没有
开放 PR」、CI 停在主工作区 HEAD,传 pr_number 也被忽略,只能用 git ls-remote 与
get_ci_status(commit_sha) 兜底。

- MCP schema 新增可选 pr_number(优先)与 branch;都不给时保持原行为
- pr_number:GET /pulls/{n} 取 head 分支与 head SHA,CI 与 review 均绑定该 PR;
  PR 不存在(404)返回 not_found,与 Gitea 不可达(unavailable)区分;
  同时传 branch 且与 PR head 分支不一致时以 pr_number 为准并在 detail 提示
- branch:匹配该分支的开放 PR 并以其 head SHA 查 CI;无开放 PR 时取 Gitea 上
  该分支 head SHA;远端分支不存在时 CI 为 unknown
- 顶层新增 target(mode/pr_number/branch/head_sha/source/detail),
  pull_request.data 增 head_sha;git 字段仍反映主工作区,既有字段兼容
- 取值校验在能力本体 DeliveryQuery 单点实现,MCP 只解析 JSON 类型;显式给出的
  非法值直接报错,不静默回退主工作区
- Gitea 读取拆为本地/PR/分支三种目标,凭证存储注入以便合成 Gitea 测试;
  merge_pull_request 门禁代码未改
- lian-jing skill 第 6 条改为 get_delivery_status(project_id, pr_number),
  base-onboarding 1.8.0→1.9.0(BASE_ONBOARDING_PACK_VERSION、模板
  capability-packs.json、TEMPLATE_FINGERPRINTS);Codex 插件 skill 同步
- 契约说明同步 docs/ai-context/project-context.yaml;蓝图 P3-F 标 ✅

Feature-Confirmed: true
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-03 06:22:09 +09:00
lanrtop
d8ba9dbf40 docs(blueprint/delivery): 立卡 P3-F get_delivery_status 按 PR/分支查询(使者回传 #203)
Enterprise 2026-10-03 实测:在独立 worktree 分支开 PR 交付时,get_delivery_status
只读主工作区当前分支,PR/CI 结论与目标 PR 脱节。本卡开始执行,标 🔵。

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-03 06:09:25 +09:00