Skip to content

Cluster related bravebot issues into one iteration - #208

Merged
bbondy merged 1 commit into
masterfrom
cluster-related-bravebot-issues
Nov 1, 2026
Merged

bbondy merged 1 commit into
masterfrom
cluster-related-bravebot-issues

Conversation

@netzenbot

Copy link
Copy Markdown
Collaborator

User impact: a bravebot iteration given one issue can now also fix the related open issues in the same branch and PR, up to a cap set by the lead issue's size label.

The problem

Bravebot issues that touch the same code are each worked in their own iteration, worktree and PR. Reviewers get several small PRs that overlap, and each one repeats the same presubmit run. The loop has no way to hand an iteration a second issue.

Reproduce

  1. In a checkout with the bravebot profile, give ./run.sh a pending issue labelled size/1 while other pending size/1 issues exist.
  2. Read the prompt the agent receives.

Observed: the prompt names only the lead issue, and the other pending issues stay pending until later iterations. Expected: the prompt offers the related pending issues, up to 10 for a size/1 lead.

/usr/bin/python3 -m pytest tests/test_cluster.py covers the ceilings, the pool, the claims and the status propagation.

The fix

run.sh now adds a "Clustering:" paragraph to the prompt when the profile has a clustering block and the lead issue has a size label. It lists pending issues no larger than the lead that no other run holds, and points the agent at projects/bravebot/docs/clustering.md, which adapts the implement-issues skill: screen for real relatedness, claim, one worktree, branch and PR, one commit per issue, one presubmit run.

The caps are maximums, not targets: size/1 10, size/2 6, size/3 4, size/4 and size/5 just the lead. claim-companions.py re-checks them under the PRD lock before claiming, so the agent cannot exceed them. Companions follow the lead's committed and pushed transitions with the same branch and PR number, and return to pending if the lead is skipped or invalid. Only the bravebot profile has the block; brave-core is unchanged.

Test plan

  • /usr/bin/python3 -m pytest tests/test_cluster.py tests/test_scripts.py -q -k "not TestRunLocking and not TestReviewRequestQueue and not TestWaitGateStart" — 562 passed, on this branch rebased on origin/master
  • ruff check and ruff format on the changed Python files — clean
  • Not run: a full run.sh iteration with a real cluster
  • Not run: make check-reviewdog
  • Not run: a multi-issue PR body through scripts/check-pr-body.py
  • CI passes cleanly
Known gaps
  • The excluded suites (TestRunLocking, TestReviewRequestQueue, TestWaitGateStart) had 9 failures in the full run. 4 reproduce on an unmodified checkout and look like macOS problems. The other 5 did not fail there, and I have not shown they are unrelated to this change.
  • clustering.md was adapted by hand from the implement-issues skill and not diffed against it. Two lines are mine rather than the skill's: "when unsure whether two are related, they are", and "reproduce each issue on upstream/main". Remove them if they should not be there.

run.sh offers a pool of related pending issues alongside the lead issue, capped by the lead's size label (size/1: 10, size/2: 6, size/3: 4, size/4 and size/5: 1). The caps are maximums. claim-companions.py claims the chosen ones under the PRD lock, and a lead's committed and pushed transitions carry to its companions. Only the bravebot profile enables it; brave-core is unchanged.
@bbondy
bbondy merged commit 20e6a90 into master Nov 1, 2026
3 checks passed
@bbondy
bbondy deleted the cluster-related-bravebot-issues branch November 1, 2026 20:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants