[Bug] Agent evaluates PR against stale base, confounds variables in before/after comparison, produces false conflicts
Bug Description
Title: Agent assesses a PR against a stale branch base and confounds before/after comparisons, producing false conflicts
## Summary
When asked to judge whether a proposed change (e.g., a pull request) is safe to merge, the agent evaluated it against a superseded snapshot of the integration target and ran a before/after comparison in which more than one variable differed. It then attributed the entire observed difference to its hypothesized cause. The result was a false-positive conflict/regression that nearly caused the agent to reject a beneficial, time-sensitive change. This is a reasoning-level (model behavior) issue, not a CLI defect.
## What happened (generalized)
1. Task: determine, before merging, whether integrating a change was safe.
2. The agent checked out the change's branch. That branch had been cut from an older commit of the target and had since diverged (the target advanced after the branch was created).
3. The agent took a "before" measurement from the current target state and an "after" measurement from the diverged branch. The two measurements therefore differed by two independent variables: the intended change and the drift between the two snapshots.
4. The agent attributed the full observed delta to the intended change alone, concluding the change introduced a conflict/regression.
5. The conclusion was internally contradictory — the artifact it blamed the change for did not exist in the branch it had actually tested. The agent recognized this only after the user challenged the contradiction; left unchallenged, it was on track to reject the change.
## Expected behavior
- Correct reference state. A change's integration effect is current-target-HEAD + the change's diff — the only frame in which merge conflicts exist. Evaluate the change applied onto the current target (apply the diff to a clean current target, or check out the branch and rebase/merge the current target into it), never the raw branch as originally cut.
- Control variables in any A/B comparison. Treat a before/after test as an experiment: hold everything constant except the one variable under test. If the two arms differ in more than that variable, the result is uninterpretable — isolate the variable before drawing any conclusion.
- Surface self-contradiction proactively. If two of the agent's own statements cannot both be true, it should flag and resolve the contradiction itself rather than continuing to reason from it.
## Why it matters
This failure mode manufactures false blockers (and, symmetrically, can hide real ones). Here it nearly caused rejection of a beneficial, time-sensitive change, and was caught only because a human pushed back. An agent that silently rejects good changes — or accepts bad ones — on the strength of a confounded comparison is a correctness and safety risk, and the risk is highest in autonomous or low-oversight runs where no one challenges the reasoning.
## Suggested guardrails
- When assessing merge/integration impact, default to evaluating target-HEAD + diff (rebase/merge the current target into the branch, or apply the diff onto a clean current target) rather than the branch as-is.
- Before attributing an observed difference to a cause, enumerate everything that differs between the two states; if more than the intended variable differs, do not attribute — isolate first.
- Prefer authoritative sources over generated/derived artifacts when measuring, and cross-check surprising conclusions against the history / source of truth before acting on them.
## Severity / frequency
Single observed incident — offered as a signal, not evidence of a systematic pattern.
Environment Info
- Platform: darwin
- Terminal: Apple_Terminal
- Version: 2.1.220
- Feedback ID: a2237735-63e6-415b-b4e4-feb5f7164018
Errors
[]