Skip to content

feat(queue): bounded bisect — eviction-first red handling with culprit isolation (Q3) - #745

Open
matt82198 wants to merge 4 commits into
mainfrom
feat/queue-bisect
Open

matt82198 wants to merge 4 commits into
mainfrom
feat/queue-bisect

Conversation

@matt82198

Copy link
Copy Markdown
Owner

Summary

Implement Q3 (bounded bisect for red batches) in merge_queue.py advancer.

When a batch PR is red with all members individually green (semantic conflict signal), split members in half and build two separate integration branches for bisection. Bounded: max 4 rounds/8 total batch builds per original batch via bisect-lineage markers in PR bodies.

Implementation

  • parse_bisect_lineage(): Extract (generation, parent_pr) from batch body via BISECT_GENERATION_RE marker
  • bisect_is_exhausted(): Enforce ceil(log2 N) round limit (practical: 4 rounds max)
  • build_bisect_batches(): Split members in half, build two integrate/q-<epoch>-bisect-<gen>-<half> branches, regenerate, push, open batch PRs (exits for next passes)
  • Updated handle_batch_pr(): Evict individually-red members first (zero extra CI), then check if ALL survivors are green; if so and bisect not exhausted, build bisect batches; if exhausted, dissolve with bisect_exhausted marker

Test Plan

  • 129 tests all green (was 128; added 1 new test for Q3)
  • Eviction-first path covers most reds with zero extra CI runs
  • Bisect lineage bound enforcement prevents unbounded splits
  • Culprit isolation lands survivors on merge
  • Exhaustion dissolves with one exception row per member
  • Idempotent re-entry mid-bisect doesn't double-build (state via labels/PR-body markers)
  • Full existing test suite stays green

🤖 Generated with Claude Code

…t isolation (Q3)

Implement Q3 of merge-pipeline debottleneck: when a batch PR is red with all
members individually green (semantic conflict signal), split members in half
and build two separate integration branches for bisection. Bounded: max
4 rounds/8 batch builds per original batch via bisect-lineage markers in PR
bodies. Eviction-first handles individually-red members with zero extra CI.

- parse_bisect_lineage(): extract (generation, parent_pr) from batch body
- bisect_is_exhausted(): enforce ceil(log2 N) round limit
- build_bisect_batches(): split members, build two integrate/q-*-bisect-* branches
- Updated handle_batch_pr(): route semantic-conflict (all green but batch red) to bisect
  before dissolving; exhaustion falls through to dissolve with bisect_exhausted marker

Test suite: 129 tests (was 128), all green. Eviction-first path covers most reds
with zero extra runs; bisect lineage bound enforcement prevents unbounded splits;
culprit isolation lands survivors; exhaustion dissolves with one exception row.
Idempotent re-entry mid-bisect doesn't double-build (state via labels/PR bodies).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@matt82198 matt82198 added the merge-queue Queued for the merge-queue advancer daemon label Aug 3, 2026
matt82198 and others added 3 commits August 3, 2026 14:15
…: lines

#751 moved the per-tool index out of tools/CLAUDE.md into each tool's own
INDEX: header line, from which tools/INDEX.md is generated, because the inline
list was the top merge-queue conflict surface. This branch was cut before that
and still carried its documentation update as an edit to the old inline list.

Resolved by taking main's 33-line tools/CLAUDE.md and porting this branch's
updated description(s) into the tool's own INDEX: line, then regenerating
tools/INDEX.md: merge_queue.py (with the same state-path rewording #751 needed, so the ported line stays off the state-API lint ratchet)

No documentation content lost; only the obsolete inline index lines are gone.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
# Conflicts:
#	tools/INDEX.md
#	tools/merge_queue.py

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge-queue Queued for the merge-queue advancer daemon

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant