Skip to content

[issue-3393][slice-4/6] Slice-PR routing to slice.repo + lazy... - #3429

Merged
jwbron merged 4 commits into
mainfrom
egg/issue-3393/slice-4
Jul 2, 2026
Merged

[issue-3393][slice-4/6] Slice-PR routing to slice.repo + lazy...#3429
jwbron merged 4 commits into
mainfrom
egg/issue-3393/slice-4

Conversation

@james-in-a-box

@james-in-a-box james-in-a-box Bot commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Route each slice's PR to slice.repo and give every participating repo its own work branch + context PR (lazy-per-repo, operator ruling #1). Repos with ≥1 slice get an egg/<id>/work branch and a context PR; submitted repos with no slices get neither. Slice-PR and context-PR descriptions cross-reference sibling PRs in the pipeline.

Base PR: #3418

What's in this PR

Commits (4):

.egg-state/agent-outputs/coder/brc-memory-issue-3393.md |    71 +
 .egg-state/brc-history/3393-implement-slice-4.json      | 12859 ++++++++++++++++++++++++++++++++++
 .egg-state/brc-history/3393-implement-slice-4.md        | 11486 ++++++++++++++++++++++++++++++
 orchestrator/gateway_client/_pr.py                      |    78 +
 orchestrator/routes/pipelines.py                        |   410 +-
 orchestrator/tests/test_pipelines.py                    |   302 +-
 6 files changed, 25201 insertions(+), 5 deletions(-)

This slice

Slice-PR routing to slice.repo + lazy per-repo work branch & context PR

Files affected:

  • orchestrator/gateway_client/_pr.py
  • orchestrator/routes/pipelines.py
  • orchestrator/tests/test_pipelines.py
Tasks (3) + acceptance criteria
  • task-4-1: Route slice-PR creation to the slice's repo. create_slice_pr (orchestrator/gateway_client/_pr.py:139-164) is already repo-parameterized; change the caller(s) in orchestrator/routes/pipelines.py to pass slice.repo (falling back to the pipeline primary when a slice's repo is absent, per the slice-1 migration default) instead of the pipeline singleton. Render sibling cross-references into the slice-PR body: list the other pipeline PRs (repo + number) and, for a dependent slice, note the upstream slice's PR it is ordered behind.
    • Acceptance criteria: - Each slice's PR is opened in slice.repo; absent ⇒ primary. - The slice-PR body cross-references sibling pipeline PRs (repo + number) and names the upstream PR for dependent slices. - No behavioral change for N=1 (single repo) pipelines.
  • task-4-2: Make the context-PR opener lazy-per-repo. In orchestrator/routes/pipelines.py _open_context_pr_at_implement_start (~11001-11250), which today opens one context PR on egg/<id>/work → main in the single repo: iterate the set of repos that own ≥1 slice, and for each open its own egg/<id>/work branch (same naming, per repo) and its own context PR; skip submitted repos with no slices. A single-slice repo still gets the standard context PR (uniformity beats special-casing). Cross-reference sibling context PRs in each body. Keep the N=1 path byte-equivalent to today.
    • Acceptance criteria: - Every repo with ≥1 slice gets its own egg/<id>/work branch and context PR; a slice-less submitted repo gets neither. - A single-slice repo gets the standard context PR. - Context-PR bodies cross-reference sibling context PRs. - N=1 behavior is unchanged.
  • task-4-3: Add tests in orchestrator/tests: a slice's PR is created in slice.repo (and falls back to primary when absent); the slice-PR and context-PR bodies render sibling cross-references; the lazy-per-repo rule holds (repo with ≥1 slice ⇒ work branch + context PR; slice-less repo ⇒ neither; single-slice repo ⇒ standard context PR); N=1 opens exactly one work branch + context PR as today.
    • Acceptance criteria: - Tests assert slice-PR repo routing (+ primary fallback), sibling cross-references, and the lazy-per-repo work-branch/context-PR rule. - N=1 regression asserted (one work branch + one context PR). - make test (narrowed) and make test-all green.

Stack

egg and others added 4 commits July 2, 2026 05:58
…k-4-3)

Add tester coverage for slice-4's slice-PR routing to slice.repo and the
lazy-per-repo work-branch/context-PR rule.

- Always-green rule tests on the slice-1 model API (resolve_slice_repo /
  primary_repo): each slice PR routes to its own repo (absent => primary);
  a repo participates (work branch + context PR) iff it owns >=1 slice,
  slice-less submitted repos excluded; N=1 => exactly one participating repo.
- Skip-guarded integration tests on the coder-owned seams (the
  _repos_with_slices opener helper and repo-qualified cross-repo sibling
  references in the context-PR body), activating at convergence.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…xt PR

task-4-1: create_slice_pr gains sibling_pr_refs/upstream_pr_ref (cross-repo
only); slice caller routes repo=resolve_slice_repo(slice) and passes
cross-repo coordination refs. N=1 byte-equivalent (refs empty -> section
omitted; slice_repo == primary).

task-4-2: _open_context_pr_at_implement_start now lazy-per-repo — new
_maybe_open_secondary_context_prs (guard len(repos)>1, never raises) opens
a per-repo egg/<id>/work context PR for every repo owning >=1 slice, cross-
referencing sibling context PRs; slice-less repos skipped. Primary path and
N=1 unchanged. Secondary create soft-fails / adopts via lookup_open_pr until
secondary-repo worktree/branch creation is wired (deferred by slice-3).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Satisfy make lint-python (ruff format) on the slice-4 coverage added in
52ed962; test-only reformatting, no behavioral change. 21 passed /
2 skipped unchanged.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@jwbron
jwbron changed the base branch from egg/issue-3393/slice-3 to main July 2, 2026 20:58
@jwbron
jwbron merged commit f7f661d into main Jul 2, 2026
25 of 30 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant