An agent asked to work from the latest origin/main cannot do so through the supported lane flow, and the Diff tab then reviews the lane against the wrong base.
Reproduction
- The project checkout (
~/code/ace2) is on feat/github-cache at ce1bd9b, 45 commits behind origin/main (1ab91be). Agents must not edit or switch the project checkout.
- In a channel, the agent starts a lane with the
lane tool. The tool has no base option and always runs git worktree add -b <channel>/<name> from the project's current HEAD, so the lane starts at ce1bd9b.
- The agent runs
git reset --hard origin/main in the lane and makes a 2-file, +20 change.
- The channel's Diff tab shows
image-paste-91 -> ce1bd9b with 35 files, +3580/-128, including CI and native-desktop changes that already landed on main. git diff --shortstat origin/main in the lane shows the real change: 2 files, +20.
Cause
packages/channel/src/lanes.ts creates the worktree from the project checkout's HEAD.
packages/channel/src/changes.ts measures a lane from merge-base HEAD <project HEAD>. When the project checkout is behind or on an unrelated feature branch, that base predates commits the lane already contains.
Expected
- Starting a lane can branch from the up-to-date remote default branch (or an explicit base) without touching the project checkout.
- The Diff tab compares a lane against the base its PR will target, so it matches the eventual PR diff.
Observed while dogfooding #91 in Ace Canary 0.0.11. Related to #28. Part of #5.
An agent asked to work from the latest
origin/maincannot do so through the supported lane flow, and the Diff tab then reviews the lane against the wrong base.Reproduction
~/code/ace2) is onfeat/github-cacheatce1bd9b, 45 commits behindorigin/main(1ab91be). Agents must not edit or switch the project checkout.lanetool. The tool has no base option and always runsgit worktree add -b <channel>/<name>from the project's current HEAD, so the lane starts atce1bd9b.git reset --hard origin/mainin the lane and makes a 2-file, +20 change.image-paste-91 -> ce1bd9bwith 35 files, +3580/-128, including CI and native-desktop changes that already landed on main.git diff --shortstat origin/mainin the lane shows the real change: 2 files, +20.Cause
packages/channel/src/lanes.tscreates the worktree from the project checkout's HEAD.packages/channel/src/changes.tsmeasures a lane frommerge-base HEAD <project HEAD>. When the project checkout is behind or on an unrelated feature branch, that base predates commits the lane already contains.Expected
Observed while dogfooding #91 in Ace Canary 0.0.11. Related to #28. Part of #5.