Skip to content

fix(pr-review): preserve effective exact-head review history - #6182

Merged
huangruiteng merged 2 commits into
mainfrom
codex/review-conclusion-history-20261011
Oct 11, 2026
Merged

huangruiteng merged 2 commits into
mainfrom
codex/review-conclusion-history-20261011

Conversation

@loopx-agent

Copy link
Copy Markdown
Collaborator

A later brief formal approval from another reviewer currently hides an existing complete approval on the unchanged head, causing redundant audits and false merge-readiness failures. Queue selection now reuses the TypeScript approval-closeout owner for each reviewer's effective opinion; body qualification and public result schemas remain unchanged.

Newer formal opinions retire only that reviewer's prior opinion. Dismissed or malformed replacements cannot resurrect an old approval, ordinary comments and pending reviews cannot retire it, current-head dissent remains visible, and changed heads cannot inherit approval. The related refactor removes the duplicate history rule rather than adding another decision owner. This changes default queue/readiness classification; bilingual capability documentation names that behavior.

Validation: seven new semantic counterexamples fail on the exact base; 477 review tests pass (43 explicitly opted-in no-tools live qualification cases skipped), 15 runtime-dispatch tests pass, TypeScript typecheck and focused Ruff pass, and risk-based premerge including semantic/public-boundary checks passes. A real GitHub read through the source CLI preserved #6164's earlier complete approval, returned ready=true, and suppressed duplicate work for unchanged #6164 and #6174 without consulting CI or mutating GitHub reviews. Focused Python mypy has the same two existing import-export diagnostics at base and head; an initially unbounded import traversal was not a useful project-wide qualification.

Surfaces: existing PR-review queue, closeout, and readiness CLI/read models; no new configuration, UI operation, or GitHub authority. Source-checkout evidence does not claim an installed upgrade. Maintainer merge required for this control-plane change.

…ewers

Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>

@loopx-agent loopx-agent left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewer: model_agent; gpt-6.1-sol; OpenAI; runtime_reported; reasoning_effort=xhigh

Approval conclusion (author-owned PR; GitHub blocks formal self-approval)

精确 head 519b3ab4b358a13bf274c43377d32378b495498f,全 PR 基线 573c655879094d38aec2717e9b229962de8717a8。APPROVE:没有阻塞 finding;这是作者账户的 COMMENTED 自评审,正式独立批准及合并仍由维护者负责。

动机

使用既有 PR 评审队列和合并条件检查的维护者与评审 Agent 会遇到这个问题。同一提交已有完整批准后,另一评审者追加简短正式批准,旧队列会遮住原批准,重复要求完整评审并误报合并条件缺失。候选源码保留原有完整批准,真实 GitHub 读回的合并条件检查通过,未变化的目标不再进入重复评审。本次只修复历史意见选择;不补发重复评审,不自动撤回、合并或升级安装,也不宣称整个长期评审任务已经完成。

改动思路

旧队列只有“最新无效 COMMENTED 时向前找批准”的快捷规则,既不按评审者区分,也没有阻止跨过同一评审者已撤回或替换的旧意见。既有 closeout 的 TypeScript owner 已按每个评审者最新提交意见处理。复用该规则比新增 Python 规则或单纯跳过无效正文更合适:后一做法会复活已经失效的批准。

规范 loopx/capabilities/pr_review_queue/README.md,不可变 revision 573c655879094d38aec2717e9b229962de8717a8。逐项映射:Standalone exact-head conclusion → 原正文校验保持完整 head、五个中文块、英文 verdict、正式 state/作者标题要求;Latest submitted opinion per reviewer → effectiveOpinions 同时服务队列和 closeout,普通评论与 PENDING 不替换正式意见,DISMISSED 不复活旧批准;Separate read-only merge gate → 真正 GitHub head/thread 读回及既有合并条件 owner 保留,读回不授予撤回或合并权限。这些是修改前的规范依据,新增文档只披露默认分类修复。

具体改动

七个既有文件,新增 178 行、删除 22 行。没有新 capability、模块、用户配置或持久化格式。

  • _review_conclusion.evaluate 继续独立校验每份正文;多份意见仅传紧凑 metadata 与校验结果到 typed owner,删除 Python 的历史快捷扫描。单份校验路径保留。
  • effectiveOpinions 复用 ReviewState,按大小写不敏感的 login 替换同一 actor 的正式意见;selectPrReviewConclusion 先保留当前 head 阻塞,再选择仍有效的合格当前意见,否则输出失效诊断。局部数组位置不是 GitHub review ID。
  • approval_closeout.py 只适配 RPC 并检查返回 index 的整数/范围;runtime catalog 加一条 lazy dispatch。closeout 的完整 REST 历史、审批快照和 blocker 清单仍由原 owner 处理。
  • 两个既有测试文件补充语义反例;README 用中英文解释新的默认分类,明确无权限扩张。未来重构检查已应用:删除重复决策知识,保留正文解析和 GitHub IO 的不同职责,无需通用 review 框架。

对主干的风险

最危险的反方向是为了保留批准而复活同一评审者撤回的意见,或忽略另一人的实际阻塞。七个新增反例在不可变基线均失败,当前 head 验证 foreign 简短批准、同 actor 的 DISMISSED/CHANGES_REQUESTED/不完整 APPROVED、后续普通评论、独立当前 head 阻塞、PENDING 与 head 变化。头变更仍不能继承旧批准。

完整评审测试 477 passed,43 项显式 opt-in no-tools live 资格测试未运行;最后 adapter 修改后的 owner 测试 92 passed。runtime 分发 15 passed,TypeScript typecheck、focused Ruff、精确 head 的风险 premerge 通过(5 项直接检查、6 项 catalog、8 项 risk、1 项 public-boundary 检查;无 manual hold)。开发语义 advisory 与完整 semantic canary 通过;空 advisory 不是语义等价证明,真正依据是 typed owner/调用者与双向反例。

真实 GitHub:#6164 仍为 ce95406da4b3bccd7fa69fc0923035b22fe5a9cf。基线队列选择格式不完整的新批准,合并条件 ready=false;原 typed closeout 已找到 loopx-agent 的完整正式批准并 clear。候选源码 CLI 正确保留该批准,ready=true;记录当前条件后,再读 #6164 与 #6174 的精确目标,两者均 action=null。未补发评审、撤回意见、切账户、合并或查询/轮询/等待 CI。

类型检查的失败也保留:最初未限制 Python import traversal 产生大量全仓诊断,不作为这次全仓资格;focused mypy 在 base/head 都恰为两个既有常量 import/export 诊断。新增 index-return 诊断已用类型和范围校验修复。候选没有新增 focused 错误,不能把这些基线诊断描述成“mypy 全绿”。

我的整体评价

复用既有 typed owner,删除队列重复规则,无需新增状态库、配置服务或通用评审框架。本 PR 交付源码态意见分类修复;维护者合并和本机安装采用继续分开。这个 source slice 达到已复现的历史分类修复目标。long_horizon=improved 指匹配当前意见与合并条件后停止重复工作,头部/意见变化仍重新开放;user_experience=improved 指原有命令少一次无意义重审,无新设置、确认或 UI 操作。所有 shared surface 复用现有字段和权限;这不是新 optional/default-off capability,已明确披露故障默认行为的纠正。新局部 structural type 复用 GitHub 状态集,没有 substring denylist、平行持久化 source 或产品特定的 generic control-plane 文字。

APPROVE 仅是这个 exact head 的自评审结论。它不证明本机已安装、不完成整体长期 Goal,也不替代维护者对控制面变更的 merge。真实路径和负例足以支持这个可回退候选,权限/安装采用边界保留。

English verdict: APPROVE - head 519b3ab4b358a13bf274c43377d32378b495498f. No blocking findings. Shared typed per-reviewer history preserves earned exact-head approvals while rejecting retired/old-head approvals and retaining dissent. Seven base failures, 477 review tests, 92 final owner tests, 15 dispatch tests, TypeScript/Ruff/premerge and real GitHub queue/readiness readback support this source candidate; CI and installed adoption are not claimed.

@huangruiteng
huangruiteng merged commit 1914352 into main Oct 11, 2026
13 checks passed
@huangruiteng
huangruiteng deleted the codex/review-conclusion-history-20261011 branch October 11, 2026 05:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants