Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
c50f173
refactor(review): build the incremental scope from the PR's diff, not…
wenshao Aug 16, 2026
a4339fe
docs(review): retire the oracle's refusal reasons from the skill
wenshao Aug 16, 2026
0806cbc
fix(review): keep narrowed rounds displayed-only across rename, mode,…
qwen-code-dev-bot Aug 16, 2026
bba8deb
fix(review): close the rename-key divergence in incremental narrowing
qwen-code-dev-bot Aug 16, 2026
1a55008
Merge branch 'main' into feat/review-scope-from-pr-diff
qwen-code-dev-bot Aug 17, 2026
1e592dc
fix(review): keep header-level changes in the narrowed incremental scope
qwen-code-dev-bot Aug 17, 2026
59207d8
Merge branch 'main' into feat/review-scope-from-pr-diff
qwen-code-dev-bot Aug 17, 2026
356aecf
test(review): close the narrowing battery's mutation holes (#9267)
qwen-code-dev-bot Aug 17, 2026
ceccd55
Merge branch 'main' into feat/review-scope-from-pr-diff
qwen-code-dev-bot Aug 17, 2026
62572c8
Merge remote-tracking branch 'origin/main' into feat/review-scope-fro…
qwen-code-dev-bot Aug 18, 2026
2dde9e6
Merge branch 'main' into feat/review-scope-from-pr-diff
wenshao Aug 18, 2026
cef5952
fix(review): carry position-divergent hunks through the narrowing joi…
qwen-code-dev-bot Aug 18, 2026
b66bded
fix(review): fail closed when a delta hunk lacks a corroborating full…
qwen-code-dev-bot Aug 18, 2026
8c5d94b
fix(review): key changed-line corroboration by new-side junction (#9267)
qwen-code-dev-bot Aug 18, 2026
c25efbe
fix(review): narrow between files, not within them
wenshao Aug 19, 2026
8ae07e3
fix(review): split a base-free round by why the base is missing
wenshao Aug 19, 2026
45bf8fc
fix(review): split merge-base surface failures from deterministic ref…
qwen-code-dev-bot Aug 20, 2026
9d53584
Merge branch 'main' into feat/review-scope-from-pr-diff
wenshao Aug 20, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 0 additions & 11 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/cli/src/commands/review/agent-prompt.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2865,7 +2865,7 @@ describe('buildRoleBrief — every agent, not just the territory ones', () => {
incremental: {
since: 'a'.repeat(40),
effective: false,
reason: 'hunks-outside-pr-diff',
reason: 'nothing-to-narrow',
diffBase: 'de17aba5e',
},
},
Expand Down
12 changes: 7 additions & 5 deletions packages/cli/src/commands/review/agent-prompt.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1541,11 +1541,13 @@ export function buildRoleBrief(
`\`${wt}\`. Do not \`cd\` elsewhere and do not build the user's main checkout.`,
);
}
// On a delta-scoped incremental round the probe's range must match the
// round's scope: test-efficacy recomputes its own diff as base..HEAD, and
// handed the merge base it would reverse hunks and delete mutants from
// commits an earlier round already reviewed — spending the probe budget
// out of scope and reporting survivors this round's diff never contains.
// On a narrowed incremental round the probe's range must cover the
// published scope: test-efficacy recomputes its own diff as base..HEAD.
Comment on lines +1544 to +1545

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.

[Suggestion] R4-4 (re-post, still stands): welding Agent 7's probe --base to the merge base re-expands test-efficacy's mutant/hunk selection to the PR's entire range on every effective incremental round — the out-of-scope budget spend this thread named. Deferred in round 4 ("the two available fixes differ sharply in size"); unfixed at this commit: on narrowed rounds diffBase is the merge base (fetch-pr.ts publish arm) and this weld feeds mergeBase..HEAD to the probe. — Failure scenario: on a large long-lived PR, every effective incremental round spends the probe/mutant-selection budget over the PR's entire range rather than the round's scope.

Witness: not run — code inspection at the reviewed commit: anchor.incremental.diffBase = mergeBaseSha on the publish arm, and shaOrNull(inc.diffBase) ?? shaOrNull(report.mergeBaseSha) here.

As discussed in the thread: feed test-efficacy the published diff/plan instead of recomputing a second range, or weld the probe base to the anchor range on narrowed rounds with hunk-level filtering against the published plan.

中文说明

[建议] R4-4(重新发布,仍然存在):把 Agent 7 探针的 --base 焊到 merge base,会使 test-efficacy 的突变体/hunk 选择在每个有效增量轮重新扩张到 PR 的整个区间——即本线程指出的范围外预算开销。第 4 轮已推迟处理(「两种可行修复的规模差异很大」);本提交仍未修复:收窄轮次中 diffBase 即 merge base(fetch-pr.ts 的发布分支),此焊点把 mergeBase..HEAD 交给探针。— 失败场景:在大型长命 PR 上,每个有效增量轮都把探针/突变体选择的预算花在整个 PR 区间上,而不是本轮范围上。

见证:未运行——在受审提交上直接读码:发布分支写入 anchor.incremental.diffBase = mergeBaseSha,此处读取 shaOrNull(inc.diffBase) ?? shaOrNull(report.mergeBaseSha)

按线程中的讨论:把已发布的 diff/plan 交给 test-efficacy,而不是重算第二个区间;或在收窄轮次把探针 base 焊到锚点区间,并按已发布 plan 做 hunk 级过滤。

— qwen3.8-max via Qwen Code /review (v0.21.13)

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.

Deferred to the follow-up queue (verified real, fix out of this PR's footprint). The claim is confirmed at this commit by code inspection: fetch-pr.ts's publish arm sets anchor.incremental.diffBase = mergeBaseSha, so the incremental arm in agent-prompt.ts (shaOrNull(inc.diffBase) ?? shaOrNull(report.mergeBaseSha)) always resolves to the merge base, and on every effective incremental round the test-efficacy probe recomputes mergeBase..HEAD — spending mutant/hunk selection over the PR's entire range rather than the round's scope. Both fixes discussed in this thread (feeding test-efficacy the published diff/plan, or welding the probe base to the anchor range with hunk-level filtering against the published plan) require changing test-efficacy.ts's own range recomputation, a file this PR never touches, and they differ sharply in size — so the choice belongs to a follow-up rather than this PR's remaining rounds. The thread stays open and the finding is recorded in the deferred-findings queue so it survives merge.

中文说明

推迟到后续跟进队列(已核实属实,修复超出本 PR 的 footprint)。通过在本提交上读码确认该论断:fetch-pr.ts 的发布分支把 anchor.incremental.diffBase 设为 mergeBaseSha,因此 agent-prompt.ts 的增量分支(shaOrNull(inc.diffBase) ?? shaOrNull(report.mergeBaseSha))总是落到 merge base,每个有效增量轮中 test-efficacy 探针都重算 mergeBase..HEAD——把突变体/hunk 选择预算花在整个 PR 区间上,而不是本轮范围。线程中讨论的两种修复(把已发布的 diff/plan 交给 test-efficacy,或把探针 base 焊到锚点区间并按已发布 plan 做 hunk 级过滤)都需要修改 test-efficacy.ts 自身的区间重算——该文件不在本 PR 改动范围内——且两者规模差异很大,因此取舍应由后续 PR 决定,不属于本 PR 的剩余轮次。线程保持打开,发现已记入 deferred-findings 队列,合并后不会丢失。

// The published hunks are hunks of `diffBase..head` — the merge-base
// range the producer assembled them from — so that range covers every
// one of them and never a byte the PR's diff does not display; the
Comment on lines +1546 to +1548

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.

[Suggestion] R4-4: Welding Agent 7's probe --base to the merge base re-expands test-efficacy's mutant/hunk selection to the PR's entire range on every effective incremental round — reintroducing the out-of-scope budget spend the comment this diff deletes warned about. The superset soundness argument in this comment is correct, but the budget cost is unaddressed where the old warning stood.

Failure scenario: long-lived PR, round N; file F edited in earlier rounds (which added safety-verb statements at earlier line positions) and again this round. The published scope is this round's hunks only, but the probe recomputes mergeBase..HEAD for F: selectMutants caps at 8 candidates ordered "new tests first, then diff order, then line order", so earlier rounds' lines fill the cap and this round's added lines land in mutantsSkippedForCap — the round's own new code gets zero mutant probing; the 6-hunk revert-probe cap competes the same way.

Witness (executed — verifier probe driving the real selectMutants with the long-lived-PR shape):

MAX_MUTANTS = 8
selected lines = 2,5,8,11,14,17,20,23   ← all earlier rounds
skippedForCap = 1
this-round line selected? false

Consistent with Agent 7's own efficacy run on this small PR (5 mutants / 6 hunks skippedForCap).

Suggested fix: constrain the probe to the published scope where the data already exists — the plan report test-efficacy reads carries per-file diffRange; intersect parseAddedLines output (and hunk candidates) with those ranges — or at minimum document the trade-off where the old warning used to stand.

中文说明

[Suggestion] R4-4:把 Agent 7 探针的 --base 焊到 merge base,会在每个生效的增量轮把 test-efficacy 的 mutant/hunk 选择重新扩展到整个 PR 区间——重新引入了本 diff 所删除注释曾警告的「范围外预算消耗」。本注释的超集可靠性论证是正确的,但旧警告原本所在的位置对预算代价只字未提。

失败场景:长命 PR 的第 N 轮;文件 F 在更早的轮次中被编辑过(在较早行位置加入过安全动词语句),本轮又被编辑。发布范围只含本轮 hunk,但探针对 F 重算 mergeBase..HEADselectMutants 上限 8 个候选、排序为「新测试优先、其次 diff 顺序、再其次行序」,于是早轮的行占满上限,本轮新增的行落入 mutantsSkippedForCap——本轮自己的新代码完全得不到 mutant 探测;6 个 hunk 的反向应用探针上限以同样方式被争抢。

见证(已执行——验证者探针用长命 PR 形状驱动真实 selectMutants):如上——被选中的行全部来自早轮,本轮的行未被选中。与 Agent 7 在本小 PR 上的 efficacy 运行一致(5 个 mutant / 6 个 hunk 被 skippedForCap)。

建议修复:在数据已经存在的地方把探针约束到发布范围——test-efficacy 读取的 plan 报告携带逐文件的 diffRange;把 parseAddedLines 的输出(与 hunk 候选)和这些区间求交——或至少把这一权衡写回旧警告原本所在的位置。

— qwen3.8-max via Qwen Code /review (v0.21.12)

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.

Deferred to the next round. The soundness half of this finding is already documented in code (the comment at the weld site states the superset argument), and the budget cost is real — but the two available fixes differ sharply in size. Restoring the trade-off warning is a comment; constraining the probe to the published scope needs a new seam (per-file scope ranges from the fetch report into test-efficacy's mutant/hunk selection) with its own tests. This round's batch budget went to the Critical (R4-1) and the battery-power scenarios first; the probe-scope fix is queued for the next round, where the seam can be tested on its own. Until then the spend is not silent: mutants.skippedForCap / hunks.skippedForCap disclose it in every efficacy report.

中文说明

推迟至下一轮。本发现中「可靠性」的一半已在代码中记录在案(焊接处的注释已陈述超集论证),预算代价也确实存在——但两种可行修复的体量相差悬殊。把权衡警告写回原处只是一条注释;而把探针约束到发布范围需要一条新的数据接缝(从 fetch 报告把逐文件范围传给 test-efficacy 的 mutant/hunk 选择),并需要配套的测试。本轮的批处理预算优先用于 Critical(R4-1)与各测试组威力场景;探针范围的修复排入下一轮,届时该接缝可以单独获得测试。在此之前,这部分消耗并非无声无息:每一份 efficacy 报告都会通过 mutants.skippedForCap / hunks.skippedForCap 披露它。

// anchor range, by contrast, can carry hunks an undo round netted out
// of the PR's diff, which no comment can anchor on.
const inc = report.incremental as
| { effective?: unknown; upToDate?: unknown; diffBase?: unknown }
| undefined;
Expand Down
130 changes: 0 additions & 130 deletions packages/cli/src/commands/review/fetch-pr.integration.test.ts

This file was deleted.

Loading
Loading