Repository navigation
feat(review): PR review 回写通道与 finding 渲染器 - #121
Merged
Merged
Conversation
对比 PR-Agent / Qodo v2 后确认的最小缺口:cortex 能产出经过机械校验的 review artifact,但没有出口——finding 只活在文件里,没有人在 PR 上看到它。 治理仓侧(.agent gitlink → 19d50601,PR #27): - vcs-pr github backend 新增 getDiff / listComments / listReviews / createComment / submitReview - CLI 新增 diff / comments / reviews / comment / review - comment 与 review 归入 GATE_USER_ONLY——发布到别人会读的 PR - backend 未实现某操作时报 capability_unavailable,不以空列表冒充数据 - agent-review-benchmark 新增 render-pr-comment.js:artifact → PR 评论体 - 新增 CI workflow 覆盖此前未被任何 workflow 触达的两个 skill 主仓侧(L1 分发面 + 测试): - 同步 _shared / en 两层的 vcs-pr 实现与 SKILL.md - _shared 的 vcs-pr SKILL.md 此前缺少 update 命令、fail-closed run 关联 等章节,zh 层项目拿到的是它——已补齐为与 en 层同构 - 同步治理仓 #23 引入的 4 个实现文件与 2 个 schema 漂移 - 新增 tests/review-surface/(双副本:治理仓 + L1 各跑一遍) - issue-15 测试改为断言新契约:decisions resolve 不再释放 Waitpoint 验证:484/484 全量通过,三道门禁零违规。
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.
背景
docs/architecture/review-capability-gap-vs-pr-agent.md(PR #120)对比 Qodo v2 后确认的最小缺口:cortex 能产出经过机械校验的 review artifact,但没有出口。finding 只活在文件里,没有人在 PR 上看到它。这是 A1,是四条能力链(生命周期 / 摘要 / 采纳率 / toolbox)的共同上游。
双仓配对
cortex-agent-agentcortex-agent(本 PR)gitlink:
1d4de9bc→19d50601改动
vcs-pr 新增 review surface(github backend)
getDiffpulls/{n}+ diff media typelistCommentsissues/{n}/commentspulls/{n}/comments会 404listReviewspulls/{n}/reviewscreateCommentissues/{n}/commentssubmitReviewpulls/{n}/reviewsCLI 新增
diff/comments/reviews/comment/review。三条设计约束
comment/review归入GATE_USER_ONLY——它们发布到别人会读的 PR,必须--gate usercapability_unavailable,不以空列表冒充"没有数据"。返回空会让调用方以为"这个 PR 没有评论没有 review"——一个 backend 从未验证过的断言send()支持额外 headers,diff media type 需要它render-pr-comment.js(artifact → PR 评论体)
纯函数、无网络、不发明内容、字节确定。空 follow-up 不产出空章节(改为该章节不出现);标题里的换行被压平,不能注入新的 markdown 标题;未识别的 risk 标签仍然渲染(隐藏 finding 比标签写错严重)。
顺带修掉的 collateral 问题
1. 治理仓 #23 引入的分发面漂移(8 个文件 + 2 个 schema)
#23 改了 L3 的 4 个实现文件和 2 个 schema,但没同步 L1。内容对等门禁直接报出:
evolution-pipeline/scripts/evolve.js(+352/−17)knowledge-lint/scripts/index.js(+133/−19)management-api/scripts/index.js(±47)runtime-continuity/scripts/index.js(+21)decisions/decision.schema.json、waitpoints/waitpoint.schema.json同步方向逐文件由 diff 证据定(都是 L3 更新)。其中
management-api的变更带批准安全语义:Decision resolution 不再自动释放 Waitpoint。2.
_shared层 vcs-pr 文档残缺en 层 SKILL.md 有
update命令、fail-closed run 关联说明等 7 个段落,_shared层全缺——而 zh 层没有 vcs-pr,靠_shared兜底,zh 层项目根本发现不了update命令。已补齐为与 en 层同构。3. issue-15 测试断言了已废弃的行为
原断言
decision resolve reports every auto-released waitpoint path固化了"resolve 自动释放 Waitpoint"——而这正是 PR #69 明确废除的。已改为断言新契约,且比原来更强:验证 waitpoint 文件字节级未被修改。验证
tests/review-surface/github-backend.test.js24 项(双副本:治理仓 + L1_shared+ L1en各 8 项)tests/review-surface/render-pr-comment.test.js18 项(双副本各 9 项)tests/guided-review/pr-review-loop.test.js8 项(端到端,双副本各 4 项)tests/agent-skills/vcs-pr-review-surface.test.js6 项(CLI gate 与 capability 降级)端到端实测跑通:raw findings → reviewer-backend(拒掉 1 条越界 finding)→ artifact → PR 评论 markdown。
已知限制
vcs-pr update --labels在 CLI 层未接线(index.js的 update 分支没传 labels 给 backend),而 en 层 SKILL.md 描述了该能力。未在本次范围内修,已记录。check-runs/{id}/annotations)。相同测试已在主仓(public 仓,分钟不计入配额)验证通过。