Skip to content

/review: incremental-review anchor is lost permanently after a round fails to close cleanly, forcing full-diff re-reads #9902

Description

@wenshao

What happened?

/review does incremental re-review across rounds using an anchor recorded in the previous round's posted marker, so a later round only re-reads what changed. Observed over a multi-round review: once a round failed to close cleanly, the anchor was withheld — and it never came back. The reviewer stated this itself:

Mechanism health: this round did not close cleanly, so it withholds the incremental anchor — and the round it recovered had none either, so the next review re-reads the whole diff and will keep doing so until a round's marker carries an anchor again.

So the degradation is sticky: a single non-clean round drops the incremental state, and every subsequent round then re-reads the entire diff from scratch. On a large PR each round's review-pr job already runs multiple hours; losing incrementality makes every later round pay full-diff cost, with no path back on its own.

A related visible symptom: the reviewer kept referencing a stale test path (packages/cli/src/utils/findings.test.ts — no such file or directory) after that file had moved to packages/cli/src/commands/review/, consistent with the incremental cache pointing at a pre-move snapshot.

What did you expect to happen?

  • A round that does not close cleanly should still be able to re-establish the incremental anchor on the next successful round, rather than permanently falling back to full-diff re-reads.
  • Failing that, the reviewer should treat "anchor lost" as a recoverable state (recompute the anchor from the current posted comments / head SHA) rather than a one-way latch.

Anything else we need to know?

  • This compounds the cost of long review loops: a PR that takes several rounds to converge pays full-diff review time on every round after the first non-clean one.
  • It is self-reported by the tool in the round body ("Mechanism health"), so the condition is already detected — the gap is the lack of recovery.
中文

问题

/review 跨轮做增量复审,靠上一轮已发布 marker 里记录的锚点,让后续轮只重读变更部分。在一次多轮评审里观察到:某轮未能干净收尾后,锚点被扣留——而且再也没回来。reviewer 自己也说明了:

Mechanism health: this round did not close cleanly, so it withholds the incremental anchor — and the round it recovered had none either, so the next review re-reads the whole diff and will keep doing so until a round's marker carries an anchor again.

即这个退化是粘性的:一次不干净收尾就丢掉增量状态,之后每一轮都从头全量重读整个 diff。在大 PR 上每轮 review-pr job 本就要跑好几小时,失去增量后每个后续轮都付全量成本,且自身无法恢复。

一个相关的可见症状:文件从 packages/cli/src/utils/findings.test.ts 移到 packages/cli/src/commands/review/ 之后,reviewer 仍反复引用旧路径(no such file or directory),与增量缓存指向移动前的快照一致。

期望

  • 未干净收尾的一轮,应仍能在下一次成功轮重建增量锚点,而不是永久退回全量重读。
  • 退一步,reviewer 应把"锚点丢失"当作可恢复状态(从当前已发布评论 / head SHA 重算锚点),而非单向锁死。

补充

  • 这会放大长评审循环的成本:需要多轮才收敛的 PR,第一次不干净收尾之后的每一轮都付全量评审时间。
  • tool 已在轮次正文("Mechanism health")里自述该状态,即条件已被检测到——缺的是恢复机制。

Metadata

Metadata

Assignees

No one assigned

    Labels

    category/developmentDevelopment experiencepriority/P2Medium - Moderately impactful, noticeable problemtype/bugSomething isn't working as expected

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions