refactor(autofix): extract review verification runner - #7644
Conversation
|
Re-run on the current head (the autofix loop pushed changes since the last pass). Template looks good ✓ Problem: This is phase 2 of the maintainer-driven plan in #7638 ("extract the review verification gate into a reusable trusted runner without changing behavior"). It's structural prep, not a bug fix — the motivation is concrete and maintainer-defined: same-run repair (phase 3) needs to execute the same deterministic verification more than once without duplicating a large inline shell block. So the usual before/after reproduction doesn't apply here; the "problem" is the duplication that phase 3 would otherwise have to carry. Direction: Aligned. It implements exactly the second bullet of #7638, and the issue's constraints (preserve the push-after-independent-verification boundary, behavior-preserving, covered by workflow tests) are precisely what this PR targets. Size: Not applicable — no core-module paths. The change is confined to Approach: Scope feels right and genuinely minimal — it's a pure extraction with no drive-by changes. I verified separately (Stage 2) that the extracted body is byte-for-byte identical to the inline block it replaces, so there's nothing to cut. Moving on to code review. 🔍 中文说明基于最新 head 重跑(autofix loop 自上次审查后又推送了改动)。 模板完整 ✓ 问题: 这是 maintainer 主导的 #7638 计划的第二阶段("将 review verification gate 抽取为可复用的 trusted runner,且不改变行为")。它是结构性铺垫,而非 bug 修复——动机具体且由 maintainer 定义:同轮修复(第三阶段)需要多次执行同一套 deterministic verification,而又不能复制一大段 inline shell。因此通常的 before/after 复现在此不适用;这里的"问题"是第三阶段 otherwise 必须承担的重复代码。 方向: 对齐。它精确实现了 #7638 的第二条,且 issue 的约束(保留"独立验证通过后才 push"的边界、行为等价、由 workflow 测试覆盖)正是本 PR 的目标。 规模: 不适用——未触及核心模块路径。改动仅限于 方案: 范围合理且确实最小化——纯粹抽取,没有顺手改动。我已在 Stage 2 单独验证抽取后的主体与被替换的 inline 块逐字节一致,因此没有可砍的部分。 进入代码审查 🔍 — Qwen Code · qwen3.8-max-preview Reviewed at |
Code reviewIndependent proposal first. Given "run the same deterministic verification more than once without duplicating the inline shell," I'd move the gate body into a standalone script that is staged from the trusted base checkout into Findings — no blockers.
No correctness, security, or AGENTS.md concerns. Test evidence (this PR's own CI — I did not run any PR code)Fetched check-runs for the reviewed commit
Not a TUI surface, so no real-scenario tmux run applies (and this is an unattended CI re-run, where live runs are out of scope by rule). Not verified: hosted-runner end-to-end execution of the refactored gate — the PR itself scopes that out, and the structural tests + green CI are the appropriate signal here. 中文说明代码审查先独立提出方案。 给定"多次执行同一套 deterministic verification 而不复制 inline shell"这个目标,我会把 gate 主体移入一个独立脚本,从 trusted base checkout 暂存到 结论——无阻塞项。
无正确性、安全性或 AGENTS.md 问题。 测试证据(来自本 PR 自身的 CI——我未运行任何 PR 代码)针对被审查 commit
非 TUI 界面,因此不适用真实场景 tmux 测试(且这是无人值守的 CI 重跑,按规则不做实时运行)。未验证:重构后 gate 的 hosted-runner 端到端执行——PR 本身已将其排除在范围外,此处结构测试 + 绿色 CI 即为恰当的信号。 — Qwen Code · qwen3.8-max-preview Reviewed at |
|
Confidence: 3/5 — clean, verifiably behavior-preserving review; capped at 3 purely by the fork- Going back to my independent proposal: the PR matches it precisely. I asked "extract the gate body into a trusted-staged runner, invoked from If I had to maintain this in six months I'd thank the author: the verification logic now lives in one reviewable file instead of an inline block, which is exactly what phase 3 (same-run repair) needs, and the security boundary that makes this gate trustworthy is intact. CI is fully green (46 checks, no failures; the workflow structural tests pass on Ubuntu). I'm not approving only because the deterministic guardrail bars the bot from auto-approving any cross-repo ⏸️ Deferring to @wenshao — fork- 中文说明置信度:3/5 —— 审查干净、可验证地行为等价;3 分纯粹由 fork- 回到我的独立方案:PR 与之精确吻合。我提出"将 gate 主体抽取为 trusted 暂存的 runner,从 如果六个月后由我维护,我会感谢作者:验证逻辑现在位于一个可审查的文件中,而非 inline 块,这正是第三阶段(同轮修复)所需的,而使该 gate 值得信赖的安全边界完好无损。CI 全绿(46 个检查,零失败;workflow 结构测试在 Ubuntu 上通过)。 我之所以不批准,仅因为确定性护栏禁止 bot 自动批准任何跨仓库 ⏸️ 转交 @wenshao —— fork- — Qwen Code · qwen3.8-max-preview Reviewed at |
Code Review —
|
qwen-code-ci-bot
left a comment
There was a problem hiding this comment.
— qwen3.7-max via Qwen Code /review
|
@qwen-code /triage |
|
Triage re-run completed without a new review. The stage comments above were updated with the latest result. View workflow run. |
|
@qwen-code /resolve |
|
Qwen Code attempted to resolve merge conflicts but the run did not complete successfully. address-summary.mdMerge resolution summaryRoot causePR #7642 ( Textual or semanticSemantic. Both sides modified the same verification logic — main added a new check to the inline gate, and the PR extracted the entire gate into a script. The resolution is not just textual; the contracts check must appear in the extracted script at the correct position for the verification pipeline to work. Resolved extracted script ( bash "${RUNNER_TEMP}/check-settings-schema.sh"
git diff --name-only "origin/main...${BRANCH}" \
| bash "${RUNNER_TEMP}/check-autofix-contracts.sh"
if git diff --quiet "origin/${BRANCH}...${BRANCH}"; thenWhat is load-bearing
What I could not verify
中文说明根本原因PR #7642( 解决方式保留提取方案(工作流 YAML 调用外部脚本),并将合约检查以相同位置(在 关键约束
Check the workflow run for full logs. |
|
@qwen-code /takeover |
…w-verification-runner # Conflicts: # .github/workflows/qwen-autofix.yml # scripts/tests/qwen-autofix-workflow.test.js
qwen-code-ci-bot
left a comment
There was a problem hiding this comment.
— qwen3.7-max via Qwen Code /review
|
🤝 Takeover engaged: the autofix loop now manages this PR — it will address new review feedback and resolve base conflicts until the label is removed or the round cap is reached. Remove the 中文说明🤝 已接管:autofix 循环现在管理此 PR —— 将持续处理新的评审反馈与 base 冲突,直到移除标签或达到轮次上限。移除 |
Code Review — PR #7644
|
|
@qwen-code /triage |
|
Triage re-run completed without a new review. The stage comments above were updated with the latest result. View workflow run. |
|
🤖 Addressed the latest review feedback (round 1/100). What changed, and what I pushed back on: · 已处理最新评审反馈(第 1/100 轮)。改动内容与我反驳保留之处如下: Review feedback addressedThanks to @wenshao for the two thorough merge-ready reviews, and to the automated reviewer. Feedback points and decisions
Changes
Conflict notes
Notes
Verification
No settings source changed, so 中文说明已处理的评审反馈感谢 @wenshao 两次详尽的「可合并」评审,以及自动评审机器人。 反馈点与处理决定
改动
冲突说明
备注
验证
未改动任何 settings 源,因此无需运行 Base-conflict check · 基分支冲突检查: no conflict with main. · 与 main 无冲突。 Re-review when you have a moment. After round 100 this bot stops and leaves the PR for a human. · 有空请复审;第 100 轮后本 bot 停止并将 PR 交给人工。 🧠 Handled by Qwen Code · model/模型 |
qwen-code-ci-bot
left a comment
There was a problem hiding this comment.
— qwen3.7-max via Qwen Code /review
|
@qwen-code /triage |
|
🤖 Reviewed the latest feedback — no changes needed. Why, point by point: · 已审阅最新反馈——无需改动。逐点说明原因如下: No action requiredThe only review on this PR is a There are no inline comments, no issue-level comments, no failed checks, and no still-red checks to address. No code changes are needed this round. 中文说明无需操作本 PR 上唯一的评审是来自自动评审器( 没有行内评论、没有 issue 级别的评论、没有失败的检查、也没有持续未通过的检查需要处理。 本轮无需进行代码变更。 Base-conflict check · 基分支冲突检查: no conflict with main. · 与 main 无冲突。 🧠 Handled by Qwen Code · model/模型 |
|
Triage re-run completed without a new review. The stage comments above were updated with the latest result. View workflow run. |
yiliang114
left a comment
There was a problem hiding this comment.
LGTM. Clean behavior-preserving refactor — verification gate inline script extracted to standalone runner, faithful line-by-line extraction, correct security isolation (script staged from trusted base checkout, not from PR branch). Tests adapted correctly (regex de-indent, verificationGateBodies array covers both paths).
One thing to confirm: the staging step rename from 'Stage trusted schema gate' to 'Stage trusted schema gate and agent runner' — is this already in the base branch? If not, the test indexOf will return -1 and fail.
— qwen3.8-max-preview via Qwen Code /review
|
Released in v0.21.1. |
|
PR #7644 已合并(2026-07-24)并已随 v0.21.1 发布。新评论只是 CI bot 的发版通知,无需代码改动或回复。 ✅ completed |
What this PR does
Extracts the review-address deterministic verification body into a reusable trusted runner. The workflow stages that runner from the trusted base checkout and invokes it from the existing verification step.
This is a behavior-preserving refactor: the existing condition, step id, environment inputs, output keys, no-op handling, failure classification, deterministic checks, changed-workspace tests, hook isolation, and push/report consumers remain unchanged.
Why it's needed
Same-run repair needs to execute the same deterministic verification more than once without duplicating a large inline shell block. Establishing one trusted runner first makes the later control-flow change small and reviewable while preserving the current push-after-independent-verification boundary.
Reviewer Test Plan
How to verify
Evidence (Before & After)
N/A — behavior-preserving workflow refactor.
Tested on
Environment (optional)
Local Node.js 22 workspace. Verified with exact old/new shell-body comparison, focused workflow tests (101/101), full build, typecheck, ESLint, Bash syntax validation, and targeted Prettier check.
Risk & Scope
Linked Issues
Refs #7638
中文说明
本 PR 做了什么
将 review-address 的 deterministic verification 主体抽取为可复用的 trusted runner。workflow 会从 trusted base checkout 暂存该 runner,并在现有 verification step 中调用。
这是行为等价重构:现有 condition、step id、环境输入、输出 key、no-op 处理、失败分类、deterministic checks、changed-workspace tests、hook 隔离以及 push/report 消费逻辑均保持不变。
为什么需要
同轮修复需要多次执行同一套 deterministic verification,同时不能复制一大段 inline shell。先建立单一 trusted runner,可以让后续控制流变更更小、更容易评审,并保留“独立验证通过后才 push”的现有安全边界。
Reviewer Test Plan
如何验证
证据(Before & After)
不适用——这是行为等价的 workflow 重构。
测试平台
环境(可选)
本地 Node.js 22 workspace。已验证新旧 shell body 精确对比、focused workflow tests(101/101)、完整 build、typecheck、ESLint、Bash 语法和定向 Prettier 检查。
风险与范围
关联 Issue
Refs #7638