Skip to content

fix(review): correct the borrowed lenses and vacuous-test severity (follow-up to #7735/#7736) - #7746

Merged
wenshao merged 3 commits into
QwenLM:mainfrom
wenshao:fix/review-lens-followup
Jul 26, 2026
Merged

fix(review): correct the borrowed lenses and vacuous-test severity (follow-up to #7735/#7736)#7746
wenshao merged 3 commits into
QwenLM:mainfrom
wenshao:fix/review-lens-followup

Conversation

@wenshao

@wenshao wenshao commented Jul 26, 2026

Copy link
Copy Markdown
Collaborator

What this PR does

Applies five review findings on the Agent-5/1b/2/4 lenses that #7735 and #7736 merged before the fixes could land:

  • Agent 2 (subprocess injection). The guidance said "terminate the argv with --", but -- ends option parsing without neutralizing a pathspec — for an overloaded command it creates one (git checkout -- release restores a path instead of switching branch; git checkout -- . still discards changes). Reworded to be command-aware: validate against the subcommand grammar, and use -- only where it keeps the operand's role — the value allowlist is what closes the injection.
  • Agent 5 (severity). A sole-guard vacuous test was graded Critical, but the shared severity ladder and Agent 7's efficacy probe grade an ineffective test as Suggestion, so Step 4's max-severity inflated it into a merge blocker. A vacuous test is now a Suggestion, escalated to Critical only when it asserts the opposite, was weakened in-diff, or lets a specific incorrect behaviour ship (in which case that behaviour is the Critical). Mirrored in the test-matrix brief and the SKILL dimension table.
  • Agent 1b (changed literal). A default ripgrep skips hidden .github/**, so a marker consumed only by a workflow reads as "no consumer". The lens now requires a hidden-path search (rg --hidden --glob '!.git/**' --fixed-strings).
  • Agent 4 (unreproducible benchmark). "Flag as unverified" conflicted with the actionable-findings-only contract; the lens now requests the script/env/raw numbers when the number is load-bearing, or produces no finding (recorded under not-verified) when incidental.
  • A buildRoleBrief(PLAN, '5') test pins the equivalent-mutant rule and the corrected severity, so a prompt-assembly regression or a semantic reversal reddens instead of passing the generic word-presence check.

Why it's needed

These are confirmed review findings (one Critical each from #7735 and #7736) that were replied to and marked fixed, but the two PRs squash-merged at a commit before the fix commits, so main carries the un-corrected lenses. Without this, Agent 2 gives injection guidance that -- does not actually satisfy, and Agent 5 inflates an ineffective-test finding into a Critical that can block a PR for lacking an effective test — the exact inflation the shared severity rules exist to prevent.

Reviewer Test Plan

How to verify

Prompt-copy changes to CLI-generated agent briefs plus one focused test. Run npx vitest run packages/cli/src/commands/review/agent-prompt.test.ts (144, green) and node scripts/lint.js --eslint. To see the behaviour, qwen review agent-prompt --role 5 --plan <plan> — the printed brief now says a vacuous test is a Suggestion and carries the equivalent-mutant rule; --role 2 carries the command-aware --/pathspec caveat.

Evidence (Before & After)

N/A — no user-visible or TUI change; review-skill prompt text.

Tested on

OS Status
🍏 macOS N/A
🪟 Windows N/A
🐧 Linux

Environment (optional)

Unit tests only (vitest); platform-independent prompt text.

Risk & Scope

  • Main risk or tradeoff: prompt-only; the severity change makes Agent 5 less aggressive on vacuous tests (Suggestion, not Critical), which is the intended de-inflation and matches Agent 7's probe.
  • Not validated / out of scope: no code-path or runtime change.
  • Breaking changes / migration notes: none.

Linked Issues

Follow-up to #7735 and #7736 (review comments addressed there; the fixes missed those merges).

中文说明

这个 PR 做了什么

补上 #7735#7736 合并时未能一起落地的五个针对 Agent 5/1b/2/4 lens 的评审修复:

  • Agent 2(子进程注入):原文说"用 -- 终止 argv",但 -- 只结束选项解析,并不中和pathspec——对重载命令反而会制造一个(git checkout -- release 是恢复路径而非切分支;git checkout -- . 仍丢弃改动)。改为命令感知:按子命令语法校验值,-- 仅在保持操作数角色时才用——真正堵住注入的是值白名单。
  • Agent 5(严重度):原本把"唯一守卫的空转测试"判为 Critical,但共享严重度阶梯与 Agent 7 的效力探针都把无效测试判为 Suggestion,Step 4 取最高严重度,于是被抬成阻断合并的 Critical。现在空转测试是 Suggestion,只有在它断言相反行为、在本 diff 被削弱、或放行某个具体错误行为时才升为 Critical(此时 Critical 是那个行为)。test-matrix brief 与 SKILL 维度表同步。
  • Agent 1b(字面量契约):默认 ripgrep 跳过隐藏的 .github/**,于是只被某工作流消费的标记会显示为"无消费者"。lens 现在要求隐藏路径搜索(rg --hidden --glob '!.git/**' --fixed-strings)。
  • Agent 4(不可复现基准):"标为 unverified"与"只暴露可执行 finding"的契约冲突;现在:数值是承重项时请求脚本/环境/原始数据,附带时不产生 finding(记入未验证项)。
  • 一个 buildRoleBrief(PLAN, '5') 测试,钉住等价变异规则与修正后的严重度,使 prompt 组装回归或语义反转会变红,而不是通过泛化的"词是否出现"检查。

为什么需要

这些是已确认的评审 finding(#7735#7736 各一个 Critical),已回复并标记为已修复,但那两个 PR 在修复 commit 之前 squash 合并了,因此 main 上是未修正的 lens。不修的话,Agent 2 给出的注入指引其实并不能靠 -- 满足,Agent 5 会把无效测试 finding 抬成 Critical、仅因缺少有效测试就阻断 PR——正是共享严重度规则要防止的抬高。

Reviewer 测试计划

如何验证

对 CLI 生成的 agent brief 的纯文案改动,外加一个聚焦测试。运行 npx vitest run packages/cli/src/commands/review/agent-prompt.test.ts(144,全绿)与 node scripts/lint.js --eslint。想看行为:qwen review agent-prompt --role 5 --plan <plan> —— 打印的 brief 现在说空转测试是 Suggestion,并带等价变异规则;--role 2 带命令感知的 --/pathspec 说明。

证据(修改前后)

N/A —— 无用户可见或 TUI 变化;审查技能 prompt 文案。

已测试平台

OS 状态
🍏 macOS N/A
🪟 Windows N/A
🐧 Linux

环境(可选)

仅单元测试(vitest);平台无关的 prompt 文案。

风险与范围

  • 主要风险或权衡:纯 prompt;严重度调整让 Agent 5 对空转测试不再那么激进(Suggestion 而非 Critical),这是有意的去抬高,并与 Agent 7 的探针一致。
  • 未验证 / 范围外:无代码路径或运行时改动。
  • 破坏性改动 / 迁移说明:无。

关联 Issue

#7735#7736 的后续(评审意见在那两处,但修复没赶上它们的合并)。

verify added 2 commits July 26, 2026 17:47
Four findings on the lenses this PR adds:

- **Agent 2 (subprocess injection), Critical.** The guidance said "terminate the
  argv with `--`", but `--` ends *option* parsing without neutralizing a
  *pathspec* — for an overloaded command it creates one (`git checkout -- release`
  restores a path instead of switching branch; `git checkout -- .` still discards
  changes). Reword: validate against the subcommand grammar; a `--` helps only
  where it keeps the operand's role, and the value allowlist is what closes it.
- **Agent 1b (changed literal).** A default ripgrep skips hidden `.github/**`, so
  a marker consumed only by a workflow reads as "no consumer". Require a
  hidden-path search (`rg --hidden --glob '!.git/**' --fixed-strings`).
- **Agent 4 (unreproducible benchmark).** "Flag as unverified" conflicts with the
  actionable-findings-only contract. Make it actionable when load-bearing (request
  the script/env/raw numbers) or no finding when incidental (record under
  not-verified), never a non-defect finding.
- **Agent 5 (equivalent mutant).** Add a focused `buildRoleBrief(PLAN, '5')` test
  pinning the equivalent-mutant rule and its discriminating-input requirement, so
  a prompt-assembly regression cannot silently drop it.
… the sole guard

Agent 5's mutation lens graded a sole-guard vacuous test as Critical, but the
shared severity ladder — and Agent 7's deterministic efficacy probe — grade an
ineffective test as Suggestion. Step 4 keeps the higher severity, so the same
inert guard arrived as Critical from Agent 5 and Suggestion from Agent 7, and
the Critical won: a PR could be blocked solely for lacking an *effective* test,
the exact inflation those shared rules exist to prevent.

Align it with the dimension's own "name the bug, not the gap" rule: a vacuous
test is a Suggestion, escalated to Critical only when it asserts the opposite of
the intended behaviour, was weakened in-diff, or lets a specific incorrect
behaviour ship (in which case that behaviour is the Critical, with the test as
evidence). Mirrored in the test-matrix brief and the SKILL.md dimension table,
and pinned by a buildRoleBrief(PLAN, '5') assertion so the semantic reversal
cannot pass the generic word-presence check again.
@qwen-code-ci-bot

qwen-code-ci-bot commented Jul 26, 2026

Copy link
Copy Markdown
Collaborator

Qwen Triage finishedview run. See the stage comments in this thread for the result.

Qwen Triage 已完成 —— 查看运行。结果见本线程中的各阶段评论。

@qwen-code-ci-bot

qwen-code-ci-bot commented Jul 26, 2026

Copy link
Copy Markdown
Collaborator

Thanks for the follow-up!

Template looks good ✓

Problem: observed and verifiable. The five corrections were made and marked fixed on #7735/#7736, but both PRs squash-merged before the fix commits landed — main still carries the un-corrected lenses (confirmed by reading the current source). This isn't theoretical; the old Agent 2 text literally advises "terminate the argv with --" as a blanket fix, and Agent 5 still grades a sole-guard vacuous test as Critical.

Direction: aligned. These are internal review-skill prompt corrections — no user-facing runtime change, no product direction question. The severity de-inflation for vacuous tests matches the shared ladder and Agent 7's efficacy probe, which is the right call.

Size: packages/core/src/skills/bundled/review/SKILL.md is a core path. Production lines: 38 (agent-briefs.ts 10 + SKILL.md 28). Test lines: 42. Well under any threshold — no escalation needed.

Approach: scope is tight — five targeted text corrections plus two focused tests that pin the corrected semantics. Every edit maps to a stated finding. No drive-by changes, nothing to split.

Moving on to code review. 🔍

中文说明

感谢跟进!

模板完整 ✓

问题:已观测且可验证。五个修正在 #7735/#7736 上已做并标记为已修复,但两个 PR 在修复 commit 之前 squash 合并了——main 上仍是未修正的 lens(已通过阅读当前源码确认)。这不是理论问题:旧的 Agent 2 文案确实写着"用 -- 终止 argv"作为万能修复,Agent 5 仍把唯一守卫的空转测试判为 Critical。

方向:对齐。这些是内部审查技能的 prompt 修正——无用户可见的运行时变化,无产品方向问题。空转测试的严重度去抬高与共享阶梯及 Agent 7 的效力探针一致,是正确的做法。

规模:packages/core/src/skills/bundled/review/SKILL.md 属于核心路径。生产行数:38(agent-briefs.ts 10 + SKILL.md 28)。测试行数:42。远低于任何阈值——无需上报。

方案:范围紧凑——五个定向文案修正加两个聚焦测试,钉住修正后的语义。每处改动都对应一个已陈述的 finding。无顺手改动,无需拆分。

进入代码审查 🔍

Qwen Code · qwen3.8-max-preview

Reviewed at c8cd679bbc2a06da2f842f60bc91e0b76fd234eb · re-run with @qwen-code /triage

@qwen-code-ci-bot

qwen-code-ci-bot commented Jul 26, 2026

Copy link
Copy Markdown
Collaborator

Code Review

Independent proposal: given that #7735/#7736 merged before the fix commits, I'd apply the five specific text corrections to agent-briefs.ts and mirror them in the SKILL.md dimension table, then add test assertions that pin the corrected wording (positive + negative) so a future revert reddens. That's exactly what this PR does.

Findings: none. Walked all three files:

  • Agent 2 (-- correction). The old text said "terminate the argv with -- so nothing after it is read as an option or pathspec" — but -- only ends option parsing; git checkout -- . still discards unstaged changes, and git checkout -- release restores a path instead of switching branch. The new wording is technically correct: validate against the subcommand grammar, use -- only where it preserves the operand's role, and the value allowlist is the real fix. SKILL.md table updated to match.
  • Agent 5 (severity). Old: sole-guard vacuous test → Critical. New: Suggestion, escalated only when it asserts the opposite, was weakened in-diff, or lets a specific incorrect behaviour ship (report the behaviour, not the gap). This aligns with the shared severity ladder and Agent 7's efficacy probe. The equivalent-mutant escape hatch is preserved. Test-matrix brief updated in lockstep.
  • Agent 1b (hidden paths). Adds rg --hidden --glob '!.git/**' --fixed-strings to the literal-consumer search. Correct — default ripgrep skips .github/, so a marker consumed only by a workflow file reads as "no consumer" without this.
  • Agent 4 (benchmark). Replaces "flag as unverified" with a two-path rule: load-bearing number → request script/env/raw results; incidental → no finding, record under not-verified. Resolves the conflict with the actionable-findings-only contract.
  • Tests. Two new cases in agent-prompt.test.ts pin Agent 5's severity + equivalent-mutant rule and Agent 2's -- correction, with positive assertions (correct text present), negative assertions (old text absent), and cross-role bleed checks. Well-structured.

No correctness bugs, no convention violations, no scope creep.

Testing

N/A — prompt-text and test-only changes with no user-visible or TUI behaviour.

Check Conclusion
Test (ubuntu-latest, Node 22.x) ✅ success
Test (macos-latest, Node 22.x) ⏭️ skipped
Test (windows-latest, Node 22.x) ⏭️ skipped
Integration Tests (CLI, No Sandbox) ⏭️ skipped
web-shell E2E Smoke (ubuntu-latest, Node 22.x) ✅ success
precheck-pr / precheck ✅ success
Classify PR ✅ success
label ✅ success
review-pr ✅ success

All completed checks green; no failures. macOS/Windows tests and integration tests skipped (fork PR).

中文说明

代码审查

独立方案: 鉴于 #7735/#7736 在修复 commit 之前合并,我会对 agent-briefs.ts 应用五处定向文案修正,同步到 SKILL.md 维度表,再添加钉住修正后措辞的测试断言(正向+反向)。这正是本 PR 所做的。

发现:无。 逐文件审查:

  • Agent 2(-- 修正):旧文案说"用 -- 终止 argv",但 -- 只结束选项解析,git checkout -- . 仍丢弃改动。新措辞技术正确:按子命令语法校验,-- 仅在保持操作数角色时使用,值白名单才是真正修复。
  • Agent 5(严重度):空转测试从 Critical 降为 Suggestion,仅在断言相反行为、在 diff 中被削弱、或放行具体错误行为时升级。与共享阶梯和 Agent 7 探针一致。test-matrix 同步更新。
  • Agent 1b(隐藏路径):添加 rg --hidden 搜索,修正默认 ripgrep 跳过 .github/ 的问题。
  • Agent 4(基准):用双路径规则替代"标为 unverified",解决与可执行 finding 契约的冲突。
  • 测试:两个新用例钉住 Agent 5 严重度 + 等价变异规则和 Agent 2 的 -- 修正,含正向、反向和跨角色断言。

无正确性问题,无规范违反,无范围蔓延。

测试

N/A——纯 prompt 文案和测试改动,无用户可见或 TUI 行为变化。

CI 全部完成且通过,无失败。macOS/Windows 测试和集成测试已跳过(fork PR)。

Qwen Code · qwen3.8-max-preview

Reviewed at c8cd679bbc2a06da2f842f60bc91e0b76fd234eb · re-run with @qwen-code /triage

@qwen-code-ci-bot

qwen-code-ci-bot commented Jul 26, 2026

Copy link
Copy Markdown
Collaborator

Confidence: 5/5 — clean across every stage; would merge without hesitation.

The problem is real and verifiable on main — the old Agent 2 text still advises -- as a blanket fix, and Agent 5 still inflates a sole-guard vacuous test to Critical. The corrections are technically accurate (the --/pathspec distinction is a genuine subtlety, and the severity de-inflation matches the shared ladder), the SKILL.md table stays in sync, and the two new tests pin the semantics with positive, negative, and cross-role assertions so a revert reddens. CI is green. Nothing to second-guess here — this is a clean follow-up that lands fixes that should have been in the original merges.

中文说明

置信度:5/5——每个阶段都干净,毫不犹豫可以合并。

问题真实且可在 main 上验证——旧的 Agent 2 文案仍把 -- 当万能修复,Agent 5 仍把唯一守卫的空转测试抬为 Critical。修正技术准确(--/pathspec 的区分是真正的微妙之处,严重度去抬高与共享阶梯一致),SKILL.md 表保持同步,两个新测试用正向、反向和跨角色断言钉住语义,回退会变红。CI 全绿。无需犹豫——这是一个干净的跟进,补上了本应在原始合并中落地的修复。

Qwen Code · qwen3.8-max-preview

Reviewed at c8cd679bbc2a06da2f842f60bc91e0b76fd234eb · re-run with @qwen-code /triage

@qwen-code-ci-bot qwen-code-ci-bot left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM, looks ready to ship — CI landed green after the review. ✅

@gwinthis

Copy link
Copy Markdown
Collaborator

Independent local verification report (Linux, real bundled CLI)

Verdict: all five corrections verified in the briefs the real binary actually renders. One Suggestion: the SKILL.md dimension table's row 2 still carries the exact -- guidance this PR's own Agent-2 correction refutes.

Method

Built this branch (npm run build && npm run bundle) and ran the real review agent-prompt subcommand in tmux against a fixture plan+diff, then grepped the rendered *.brief.md files — the text a review agent actually receives, not the source. Baseline established from origin/main's brief source and by applying the PR's test file onto main.

1. Baseline

  • origin/main carries all three old wordings: Agent 5's is a **Critical**: a green-no-matter-what, Agent 2's terminate the argv with \--`, test-matrix's vacuous test that is the sole guard … is a Critical`.
  • PR's agent-prompt.test.ts applied onto main code: 1 failed / 143 passed — the failure is exactly the new Agent-5 pin. On this branch: 144/144.

2. Rendered-brief assertions (patched binary, per role)

Role New text present Old text absent
5 A vacuous test is a **Suggestion** ✓ · equivalent mutant ✓ · report **that behaviour** as the Critical green-no-matter-what Critical wording gone ✓
2 does **not** neutralize a *pathspec* ✓ · git checkout -- release example ✓ · the value allowlist is what closes the injection terminate the argv gone ✓
test-matrix a **Suggestion** on its own, Critical only when … sole guard escalation gone ✓
1b rg --hidden --glob '!.git/**' --fixed-strings
4 request the benchmark script ✓ · incidental → produces **no finding**

The severity chain the fix reasons about checks out: Agent 5 and Agent 7's efficacy probe now grade the same inert test identically (Suggestion), so Step 4's max-severity can no longer inflate it into a blocker; the two real escalation triggers (opposite assertion, weakened in-diff) were already Critical under the existing rule and remain so.

3. Suggestion (non-blocking): stale -- guidance in the SKILL dimension table

packages/core/src/skills/bundled/review/SKILL.md:442 — the dimension table's row 2 still ends with "validate and terminate the argv with --". That is the same sentence this PR corrects in the Agent-2 brief for the same reason it gives (-- ends option parsing but can create a pathspec for overloaded commands). The PR updated the table's row 5 but not row 2, so the orchestrator-facing summary now contradicts the agent-facing brief. Same one-line fix as the brief: validate against the subcommand grammar; -- only where it keeps the operand's role.

Conclusion

Thesis: the operative severity/injection semantics live in the rendered briefs, and this PR fixes them there, verified at the artifact level rather than the source level. Evidence: main carries all three old wordings and fails exactly the new pin (§1); every corrected phrase is present and every corrected-away phrase absent in the real rendered briefs (§2). The one gap is the summary table's row 2 lagging its own brief (§3) — a Suggestion, since the brief is what the agent executes. LGTM with that follow-up.

中文摘要

Linux 真机验证:构建本分支后用真实 review agent-prompt 渲染 brief 文件逐条断言——五处修正(Agent 5 空转测试降为 Suggestion + 等价变异豁免、Agent 2 命令感知的 --/pathspec 修正、test-matrix 同步、1b 隐藏路径搜索、4 基准数据请求)全部落在真实产物中,三处旧表述全部消失。基线:main 源码带全部旧表述,PR 测试套 main 恰好 1 失败(新 pin)。一条 Suggestion:SKILL.md 维度表第 2 行仍是"validate and terminate the argv with --"——正是本 PR 在 Agent-2 brief 里修正掉的那句,表格第 5 行改了、第 2 行漏了,编排层摘要与执行层 brief 自相矛盾,建议同步。

— independent review loop, rendered-artifact verification on Linux

@qwen-code-ci-bot qwen-code-ci-bot left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Reviewed — no blockers. Suggestions are inline. 2 Suggestion-level finding(s) could not be anchored to a changed line and were dropped; nothing further to act on here.

中文说明

已审查——无阻断问题。 建议见行内评论。 2 条建议级发现无法锚定到改动行,已丢弃;此处无需进一步处理。

— qwen3.7-max via Qwen Code /review

Comment thread packages/cli/src/commands/review/agent-prompt.test.ts
Comment thread packages/cli/src/commands/review/agent-prompt.test.ts
@wenshao

wenshao commented Jul 26, 2026

Copy link
Copy Markdown
Collaborator Author

@qwen-code /takeover

@qwen-code-dev-bot qwen-code-dev-bot added the autofix/takeover Summon the autofix loop to manage this PR (remove to release; needs triage+) label Jul 26, 2026
@qwen-code-dev-bot

Copy link
Copy Markdown
Collaborator

🤝 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/takeover label (or comment @qwen-code /takeover stop) to release.

中文说明

🤝 已接管:autofix 循环现在管理此 PR —— 将持续处理新的评审反馈与 base 冲突,直到移除标签或达到轮次上限。移除 autofix/takeover 标签(或评论 @qwen-code /takeover stop)即可释放。

@qwen-code-dev-bot

qwen-code-dev-bot commented Jul 26, 2026

Copy link
Copy Markdown
Collaborator

AutoFix round 1 finishedview run. See this round's report below.

中文说明

AutoFix 第 1 轮已完成 —— 查看运行。本轮报告见下方。

@qwen-code-dev-bot

Copy link
Copy Markdown
Collaborator

🤖 Addressed the latest review feedback (round 1/100). What changed, and what I pushed back on: · 已处理最新评审反馈(第 1/100 轮)。改动内容与我反驳保留之处如下:

Autofix review round — PR #7746

All three feedback points were implemented. One commit:
fix(review): pin the Agent 2 and test-matrix brief corrections, sync the SKILL table.

Feedback triage

1. [Suggestion] Pin the Agent 2 subprocess-injection correction (rc:3652321695) — implemented.

Valid. This PR corrects Agent 2's brief so that -- is documented as ending option parsing but not neutralizing a pathspec (the value allowlist is the real fix), but no test asserted on that wording — a revert to the old "terminate the argv with --" guidance would leave the suite green. Added a dedicated test carries the command-aware subprocess-injection correction into Agent 2 that pins does **not** neutralize a *pathspec* and the value allowlist is what closes the injection, and asserts the old terminate the argv with phrasing is gone. Kept it in its own test (rather than appending to the Agent 5 test as the suggestion sketched) because the injection correction is a separate semantic from Agent 5's severity ladder — mirroring the file's existing one-lens-per-test pattern.

2. [Suggestion] Pin the test-matrix severity update (rc:3652321698) — implemented.

Valid. The same vacuous-test severity regrade was applied to the test-matrix agent (agent-briefs.ts:401) but nothing asserted on it, so the two agents could silently diverge on severity for the same PR. Added expect(buildRoleBrief(PLAN, 'test-matrix')).toContain('a **Suggestion** on its own, Critical only when') inside the existing Agent 5 test, because the whole point is that the test-matrix severity moves in lockstep with Agent 5's — co-locating the two assertions makes that coupling explicit.

3. [Suggestion] Stale -- guidance in the SKILL.md dimension table row 2 (@gwinthis independent report) — implemented.

Valid. The PR updated the table's row 5 but not row 2, which still ended with "validate and terminate the argv with --" — the exact guidance the Agent-2 brief correction refutes, leaving the orchestrator-facing summary contradicting the agent-facing brief. Rewrote row 2's closing clause to match the brief: validate the value against the subcommand grammar (allowlist, reject a leading -); a -- separator ends option parsing but does not neutralize a pathspec (checkout -- . still discards changes), so the value allowlist is the fix. Prettier re-aligned the table's column padding to the wider row (whitespace-only on the other rows).

Changes

  • packages/cli/src/commands/review/agent-prompt.test.ts — new Agent 2 injection-correction test; test-matrix severity pin added to the Agent 5 test.
  • packages/core/src/skills/bundled/review/SKILL.md — dimension-table row 2 corrected to match the Agent-2 brief; table re-padded by Prettier.

Conflict notes

--conflict false; no merge of origin/main was performed.

Verification

  • npx vitest run src/commands/review/agent-prompt.test.ts (packages/cli, touched) — 145 passed (was 144; +1 for the new Agent 2 test).
  • npm run typecheckpassed.
  • npm run lintpassed.
  • npm run buildpassed.
  • npx prettier --check on both changed files — clean (after --write re-aligned the SKILL.md table).
  • No settings source changed, so npm run generate:settings-schema was not required. The touched behavior (rendered brief text) is asserted directly via buildRoleBrief unit output, so no bundled-CLI integration run was needed.
中文说明

Autofix 审查轮次 — PR #7746

三条反馈全部已实现。一次提交:fix(review): pin the Agent 2 and test-matrix brief corrections, sync the SKILL table

反馈分类

1. [Suggestion] 钉住 Agent 2 子进程注入修正(rc:3652321695)——已实现。

有效。本 PR 修正了 Agent 2 的 brief,将 -- 描述为仅结束选项解析、并不能中和 pathspec(真正的修复是值白名单),但此前没有测试断言这些措词——若回退到旧的“terminate the argv with --”指引,测试套件仍为绿色。新增独立测试 carries the command-aware subprocess-injection correction into Agent 2,钉住 does **not** neutralize a *pathspec*the value allowlist is what closes the injection,并断言旧措词 terminate the argv with 已消失。没有按建议草稿那样追加进 Agent 5 的测试,而是单独成测,因为注入修正与 Agent 5 的严重度阶梯是不同的语义——沿用该文件“每个 lens 一个测试”的既有模式。

2. [Suggestion] 钉住 test-matrix 严重度更新(rc:3652321698)——已实现。

有效。同样的空转测试严重度调整也应用到了 test-matrix agent(agent-briefs.ts:401),但此前没有任何断言,两个 agent 可能在同一 PR 上悄悄出现严重度分歧。在已有的 Agent 5 测试中加入 expect(buildRoleBrief(PLAN, 'test-matrix')).toContain('a **Suggestion** on its own, Critical only when'),因为关键在于 test-matrix 的严重度必须与 Agent 5 同步——把两条断言放在一起正是为了显式表达这种耦合。

3. [Suggestion] SKILL.md 维度表第 2 行陈旧的 -- 指引(@gwinthis 独立验证报告)——已实现。

有效。本 PR 更新了表格第 5 行却漏了第 2 行,其结尾仍是“validate and terminate the argv with --”——正是 Agent-2 brief 修正所驳斥的那句,导致面向编排层的摘要与面向 agent 的 brief 自相矛盾。将第 2 行的结尾子句改写为与 brief 一致:对值按子命令语法做校验(白名单、拒绝以 - 开头);-- 分隔符结束选项解析但不能中和 pathspec(checkout -- . 仍会丢弃改动),因此值白名单才是修复。Prettier 随之重新对齐了表格列宽(其余行仅空白变化)。

改动

  • packages/cli/src/commands/review/agent-prompt.test.ts —— 新增 Agent 2 注入修正测试;在 Agent 5 测试中加入 test-matrix 严重度钉住。
  • packages/core/src/skills/bundled/review/SKILL.md —— 维度表第 2 行修正为与 Agent-2 brief 一致;表格由 Prettier 重新对齐。

冲突说明

--conflict false;未执行对 origin/main 的合并。

验证

  • npx vitest run src/commands/review/agent-prompt.test.ts(packages/cli,被改动)——145 通过(原 144;新增 Agent 2 测试 +1)。
  • npm run typecheck —— 通过
  • npm run lint —— 通过
  • npm run build —— 通过
  • 对两个被改动文件运行 npx prettier --check —— 干净(在 --write 重新对齐 SKILL.md 表格之后)。
  • 未改动任何 settings 源,因此无需运行 npm run generate:settings-schema。被改动的行为(渲染后的 brief 文本)通过 buildRoleBrief 单元输出直接断言,故无需 bundled-CLI 集成运行。

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/模型 qwen3.8-max-preview

@gwinthis

Copy link
Copy Markdown
Collaborator

Follow-up verification (new head c8cd679)

The Suggestion from my previous report is fixed and verified: the SKILL.md dimension table's row 2 no longer carries "terminate the argv with --" — it now reads "validate the value against the subcommand grammar (a ref/name allowlist, reject a leading -); a -- separator ends option parsing but does not neutralize a pathspec (checkout -- . still discards changes), so the value allowlist is the fix" — consistent with the Agent-2 brief. The orchestrator-facing summary and the agent-facing brief now agree.

agent-prompt.test.ts at the new head: 145/145 passed locally (one more than the previous round — the new pin included). Nothing further from my side; previous LGTM stands.

中文摘要

前次报告的 Suggestion 已修复并核实:SKILL.md 维度表第 2 行不再含 "terminate the argv with --",替换文本与 Agent-2 brief 完全一致(按子命令语法校验值、值白名单才是修法、-- 不中和 pathspec)。编排层摘要与执行层 brief 已对齐。新 head 本地 agent-prompt.test.ts 145/145 通过。维持 LGTM。

— independent review loop, incremental re-verification

@qwen-code-ci-bot qwen-code-ci-bot left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

⚠️ Downgraded from Approve to Comment: CI still running. Reviewed.

— qwen3.7-max via Qwen Code /review

@qwen-code-dev-bot

Copy link
Copy Markdown
Collaborator

🤖 Reviewed the latest feedback — no changes needed. Why, point by point: · 已审阅最新反馈——无需改动。逐点说明原因如下:

No action required

All feedback on this round is informational or confirmatory:

  • @qwen-code-ci-bot (automated review): Downgraded from Approve to Comment solely because CI was still running at review time. No code findings.
  • @gwinthis (maintainer): Confirmed the previous Suggestion is fixed and verified at the current head (c8cd679). agent-prompt.test.ts passes 145/145. Previous LGTM stands; nothing further requested.

No inline comments, no failed checks, and no still-red checks. No changes made.

中文说明

无需操作

本轮所有反馈均为信息性或确认性的:

  • @qwen-code-ci-bot(自动审查): 仅因审查时 CI 仍在运行而从 Approve 降级为 Comment,无代码问题。
  • @gwinthis(维护者): 确认前次 Suggestion 已在当前 head(c8cd679)修复并验证。agent-prompt.test.ts 本地 145/145 全部通过。维持此前的 LGTM,无进一步要求。

无行内评论、无失败检查、无持续红灯检查。未做任何更改。

Base-conflict check · 基分支冲突检查: no conflict with main. · 与 main 无冲突。


🧠 Handled by Qwen Code · model/模型 qwen3.8-max-preview

@doudouOUC doudouOUC left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Reviewed — no blockers. 1 Suggestion-level finding(s) could not be anchored to a changed line and were dropped; nothing further to act on here.

— qwen3.7-max via Qwen Code /review

@yiliang114 yiliang114 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Review Summary

This PR correctly addresses 5 review findings that were missed when #7735 and #7736 were squash-merged before the fix commits could land. The changes are well-justified and the test additions provide strong regression protection.


✅ Correctness

Agent 2 (Subprocess Injection Fix) — CORRECT

The original guidance "terminate the argv with --" was indeed incomplete:

  • -- ends option parsing but does not neutralize a pathspec
  • git checkout -- . still discards unstaged changes (pathspec behavior)
  • git checkout -- release restores a file path instead of switching branches

The fix correctly changes the guidance to be command-aware: validate against the subcommand grammar, use -- only where it preserves operand role, and emphasize that the value allowlist is what actually closes the injection. This is a substantive security correctness fix.

Agent 5 (Vacuous Test Severity Fix) — CORRECT

The severity alignment is correct:

  • Original: "sole-guard vacuous test = Critical" — this inflates severity
  • Agent 7's efficacy probe grades ineffective tests as Suggestion
  • Step 4 takes max severity → inflation to merge-blocker

The fix correctly aligns with the shared severity ladder:

  • Vacuous test = Suggestion (baseline)
  • Escalate to Critical only when: asserts opposite behavior, weakened in-diff, or lets specific incorrect behavior ship

This prevents the inflation the shared ladder was designed to avoid.

Agent 1b (Hidden Path Search) — CORRECT

Adding rg --hidden --glob '!.git/**' is the right fix. Default ripgrep skips .github/**, so workflow-only consumers (markers, sentinel strings) would appear as "no consumer" without this. Good catch.

Agent 4 (Unreproducible Benchmark) — CORRECT

The change from "flag as unverified" (which violates actionable-findings-only contract) to:

  • Load-bearing numbers: request script/env/raw data
  • Incidental numbers: no finding, record under not-verified

This maintains contract integrity while still providing useful guidance.


✅ Test Coverage

The two new tests are excellent:

  1. mutation-testing lens into Agent 5 test:

    • Verifies equivalent-mutant paragraph reaches Agent 5
    • Checks discriminating-input requirement
    • Confirms no bleed into sibling (Agent 2)
    • Pins severity alignment (Suggestion baseline, Critical only with named behavior)
    • Also verifies test-matrix agent stays in sync
  2. command-aware subprocess-injection correction into Agent 2 test:

    • Verifies the -- correction is present
    • Confirms old incorrect guidance is removed
    • Protects against semantic reverts

These tests go beyond "word presence" checks and pin semantic meaning, preventing prompt-assembly regressions or semantic reversions from passing silently.


✅ Code Quality

  • Changes are minimal and targeted (3 files, +61/-19)
  • The briefs are well-written with concrete examples
  • SKILL.md table stays synchronized with agent-briefs.ts
  • Test comments clearly explain the "why" behind each assertion

⚠️ Minor Observations (Non-blocking)

  1. Test file location: The test is in agent-prompt.test.ts which is appropriate for prompt assembly testing.

  2. No runtime change: This is purely prompt text, so the risk profile is very low. The severity change makes Agent 5 less aggressive on vacuous tests, which is the intended behavior.


Recommendation

Approve

This PR fixes genuine correctness issues in the review agent lenses:

  • A security guidance bug that gave incomplete injection mitigation advice
  • A severity inflation that could block PRs for lacking effective tests
  • Hidden path search omission that missed workflow consumers
  • Contract conflict in benchmark verification

The tests are well-designed and will prevent regressions. The changes align with the stated severity ladder and improve the accuracy of the review skill.

Good follow-up to the original review comments!

@wenshao

wenshao commented Jul 26, 2026

Copy link
Copy Markdown
Collaborator Author

@qwen-code /triage

@doudouOUC doudouOUC left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM✅

@wenshao
wenshao added this pull request to the merge queue Jul 26, 2026
Merged via the queue into QwenLM:main with commit 471141f Jul 26, 2026
77 checks passed

@qwen-code-ci-bot qwen-code-ci-bot left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM, looks ready to ship. ✅

@qwen-code-ci-bot

Copy link
Copy Markdown
Collaborator

Released in v0.21.1.

@yiliang114

Copy link
Copy Markdown
Collaborator

⚠️ Failed to process this request. Please re-mention the bot to retry.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

autofix/takeover Summon the autofix loop to manage this PR (remove to release; needs triage+)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants