---
date: 2026-05-15
type: learning
source: PR #369 补 learning 文件后与 #367 冲突
related: PR #367, PR #369, .agents/skills/ai-review
tags: [ai-review, pr-workflow, cross-pr-dependency, false-positive]
---

# AIBot review 的跨 PR 盲区：报"引用缺失"前先查同期 PR

## 场景

PR #367（备份与异地容灾 PRD）和 PR #369（doc-review 加 Lens E）同期开。

- #367 commit 里**自带** `.learnings/2026-05-14-doc-review-dr-lens-gap.md`
- #369 的 SKILL.md 改动**引用**了同一文件
- 两者各自基于 develop，互相看不见对方

AIBot review PR #369 时报 `hard-rules-block / should_fix`：引用的 learning 文件不存在（**断链**）。

实际上文件**就在 #367 里**，只是 #367 还没 merge 到 develop。

## 我的反应（错的）

看到 AIBot 报"断链"，直接在 #369 分支上**自己补写**了一份同名 learning 文件，提交 push。

结果：
- #367 先合并到 develop
- #369 rebase 时 add/add 冲突，且我**覆盖了 develop 上更详细的版本**（`--theirs` 含义在 rebase 里和 merge 反着）
- 不得不 `git reset --hard ORIG_HEAD` + `git rebase --skip` 撤回

## 正确反应

AIBot 报"引用的文件缺失"时，先停一拍问：

1. **同期 / 父 PR 是否有这个文件？** `git log origin/develop..HEAD --all -- <path>` 或者 grep 最近开的 PR
2. **是否依赖另一个 PR 先合？** 在 #369 评论里 ack AIBot 的发现，但说明"文件在 PR #367 中，待 #367 合并后本 PR rebase 即可消化"
3. **不要急着自己补内容**——会导致两份内容打架，谁覆盖谁靠 rebase 时间，纯运气

## 根因

AIBot 的 review 范围 = **单 PR diff vs base**，看不见**同期其他 PR** 的内容。它把"develop 没这个文件"判断成"作者忘了写"，但实际可能是**跨 PR 依赖**。

这是 AI review 的结构性盲区，不是 AIBot 的 bug——单 PR 视图是必要的（不然 review 会被无关 PR 噪音淹没）。

## 改进

`.agents/skills/ai-review`（review 流程文档）应该加一条：

> 当 AIBot 报某个引用文件 / 函数 / 路径"不存在"时，**作者**应先验证：
> - `git log origin/develop..HEAD --all -- <path>` 看是否有其他分支带
> - 查 Gitea 开 PR 列表里是否有同名引用的 PR
> - 找到 → 在 #PR 评论里说明跨 PR 依赖、等先合
> - 找不到 → 才是真缺，自己补

## 元教训

AI 工具的 review 输出**不是终局判断**，是**待验证 hypothesis**。
特别是涉及"X 不存在"这类 negative claim，跨 PR / 跨分支可能让它在单 PR 视野里看不见。
作者 30 秒的 `git log` 验证 > AI review 的 false positive 修复成本。

## 同时记录的 git 操作坑

**Rebase 中 `--ours` / `--theirs` 含义与 merge 反着**：

| 场景 | --ours | --theirs |
|---|---|---|
| merge feature → main | 当前分支（main） | 被合入的（feature）|
| rebase feature onto main | 上游（main，因 rebase 模拟"先做 main 再做我的"）| 被回放的我的 commit |

修复 rebase 冲突想"保留上游版本"时用 `--ours`，不是 `--theirs`。这次踩了。
