Problem
The Consolidate phase took ~5 minutes on the #1165 dogfood. Root cause: the design assumes "the common case is no overlap (clean picks); the rare overlap surfaces as a cherry-pick conflict." For be-review's own PRs that assumption is inverted — the change is concentrated in one file (be-review.workflow.js + SKILL.md), so all three tracks edit the same lines:
codex → be-review.workflow.js, SKILL.md
lens → be-review.workflow.js, SKILL.md
police → be-review.workflow.js, SKILL.md
Consolidation replays each track's commits onto the branch in sequence (codex 3 + lens 5 + police 5 = 13 commits), and with everyone on the same lines nearly every commit after the first conflicts. The single consolidate:cherry-pick agent then hand-reconciles them serially. Measured on this run:
- 246 KB agent transcript, 110 tool calls
- 15
git cherry-pick invocations
- 48 conflict/
cherry-pick --continue cycles
So consolidation is effectively O(overlapping commits) of serial read-both-sides → merge → continue, in one Sonnet agent. It's correct (preserves the per-commit ledger, never silently clobbers) but slow exactly when the PR is single-file — which is most of our agent-tooling work.
Why it's not just "rare overlap"
The "rare overlap → reconcile" path was designed for PRs that span many files where tracks touch different files (clean picks). A single-file PR makes overlap the default, turning the reconcile fast-path into the hot path.
Possible fixes (weigh tradeoffs)
- Squash each track to its net diff, then 3-way merge the final per-track file states instead of replaying 13 individual commits. ~3 merges instead of ~13 cherry-picks → far fewer conflict cycles. Cost: loses the per-commit debate ledger in history (the per-track PR comment already carries the narrative, so this may be acceptable).
- Detect high overlap up front (all live tracks touch a shared file set) and switch to a single reconcile of the combined result rather than per-commit cherry-pick.
- Parallelize across non-overlapping file groups — cherry-pick file-disjoint commit subsets concurrently, reconcile only the shared files. Helps multi-file PRs, not single-file ones.
- Keep as-is but set expectations — document that consolidation is slow for single-file/high-overlap PRs; it's the price of per-commit cherry-pick correctness.
#1 is the highest-leverage for the single-file case. Worth measuring reconcile-cycle count before/after on a be-review self-PR.
Acceptance
- A
/be-review run on a single-file PR (all tracks touching the same file) consolidates in materially fewer reconcile cycles / less wall-clock, with the same final tree.
Filed from the #1165 dogfood, where Consolidate ran 48 reconcile cycles on a single-file diff.
🤖 Generated with Claude Code
Problem
The Consolidate phase took ~5 minutes on the #1165 dogfood. Root cause: the design assumes "the common case is no overlap (clean picks); the rare overlap surfaces as a cherry-pick conflict." For be-review's own PRs that assumption is inverted — the change is concentrated in one file (
be-review.workflow.js+SKILL.md), so all three tracks edit the same lines:Consolidation replays each track's commits onto the branch in sequence (codex 3 + lens 5 + police 5 = 13 commits), and with everyone on the same lines nearly every commit after the first conflicts. The single
consolidate:cherry-pickagent then hand-reconciles them serially. Measured on this run:git cherry-pickinvocationscherry-pick --continuecyclesSo consolidation is effectively O(overlapping commits) of serial read-both-sides → merge → continue, in one Sonnet agent. It's correct (preserves the per-commit ledger, never silently clobbers) but slow exactly when the PR is single-file — which is most of our agent-tooling work.
Why it's not just "rare overlap"
The "rare overlap → reconcile" path was designed for PRs that span many files where tracks touch different files (clean picks). A single-file PR makes overlap the default, turning the reconcile fast-path into the hot path.
Possible fixes (weigh tradeoffs)
#1 is the highest-leverage for the single-file case. Worth measuring reconcile-cycle count before/after on a be-review self-PR.
Acceptance
/be-reviewrun on a single-file PR (all tracks touching the same file) consolidates in materially fewer reconcile cycles / less wall-clock, with the same final tree.Filed from the #1165 dogfood, where Consolidate ran 48 reconcile cycles on a single-file diff.
🤖 Generated with Claude Code