Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
79 commits
Select commit Hold shift + click to select a range
ef38910
Add agent-design review verdict for #1165 refine phase: needs_revisio…
Mar 16, 2026
e56296c
Update agent-design review for #1165 refine phase: needs_revision (dr…
Mar 16, 2026
697cbd1
Add refine review verdict for #1165 refine phase: needs_revision (dra…
Mar 16, 2026
1db93f4
Add refine analysis for #1165: remove conditional dispatch paths
Mar 16, 2026
d8d2607
Merge remote-tracking branch 'origin/main' into egg/issue-1165/work
Mar 16, 2026
3ccecb4
Update analysis: coordinator fully removed, drop stale decision
Mar 16, 2026
a59c1d4
Update agent-design review for #1165: approved with metadata concern
Mar 16, 2026
47bba99
Approve refine analysis for #1165: verified code refs, options, and d…
Mar 16, 2026
ad9ef80
Add agent-design review for issue #1165 refine phase
Mar 16, 2026
fb0d1e1
Add refine review for #1165: approved with minor line-number suggestions
Mar 16, 2026
69f6bb7
Initialize SDLC contract for issue #1165
Mar 16, 2026
e396eca
Review 1165 refine phase: agent-design approved
Mar 16, 2026
e4f8b95
Add refine review verdict for #1165: needs_revision (HITL decisions n…
Mar 16, 2026
251e7d6
Update refine analysis for #1165: fix line refs, register HITL decisions
Mar 16, 2026
f53319b
Update agent-design review for #1165: re-approved after v1 revision
Mar 16, 2026
6d6f69e
Update refine review for #1165: approved after HITL decisions registe…
Mar 16, 2026
a179c30
Add agent-design review for #1165: approved
Mar 16, 2026
c5442fc
Add refine review verdict for #1165 — approved
Mar 16, 2026
29005bd
Persist statefiles after refine phase
Mar 16, 2026
6982d1d
Plan review cycle 1 for #1165: needs_revision — plan draft still missing
Mar 16, 2026
7ea52b6
Add implementation plan for #1165: remove per-phase dispatch
Mar 16, 2026
28183c7
Add risk assessment for #1165: remove per-phase dispatch
Mar 16, 2026
e21244d
Add architect analysis for #1165: remove conditional dispatch paths
Mar 16, 2026
17ec384
Fix agent_roles.py path: orchestrator/ -> shared/egg_contracts/
Mar 16, 2026
aec6a5d
Add PhaseDependencyGraph/PhaseWave removal task (TASK-3-2b)
Mar 16, 2026
c66523f
Plan review for #1165: approved with noted gap (PhaseDependencyGraph …
Mar 16, 2026
16aec69
Plan review for #1165: needs_revision (wrong file path in TASK-2-3/2-…
Mar 16, 2026
5b35651
Plan review cycle 1 for #1165: needs_revision (blocking issue still u…
Mar 16, 2026
1276167
Fix file paths in TASK-2-3/2-4/2-5: orchestrator/orchestrator.py -> o…
Mar 16, 2026
3fc1099
Update risk assessment v2 for #1165: add RISK-8/RISK-9 from plan review
Mar 16, 2026
d89e5cc
Plan review for #1165: approved (revision 4 fixes file path issue)
Mar 16, 2026
cae838d
Update architect analysis for #1165: fix file paths, add INTEGRATOR e…
Mar 16, 2026
5da4257
Add plan review verdict for issue #1165 (cycle 2): approved
Mar 16, 2026
88394a8
Persist statefiles after plan phase
Mar 16, 2026
7fe040c
Phase 1: Prerequisite relocations and refactors
Mar 16, 2026
35278da
Remove stale references to integrator, complexity tiers, short-circui…
Mar 16, 2026
19f48b5
Add validation tests for #1165 removal of per-phase dispatch paths
Mar 16, 2026
45fa2aa
Phase 2: Core orchestrator removal
Mar 16, 2026
d2eb8f3
Phase 3: Remove INTEGRATOR role and complexity_tier from all modules
Mar 16, 2026
9719351
Phase 4: Remove dead code - PhaseDependencyGraph, MultiAgentConfig, T…
Mar 16, 2026
2df4015
Remove obsolete tests for deleted features (Tier 3, dispatch, short-c…
Mar 16, 2026
e890d79
Fix remaining test failures: remove INTEGRATOR refs and tier3 test files
Mar 16, 2026
5ed169a
Fix tests for removed integrator role, complexity_tier, and short-cir…
Mar 16, 2026
fc61cde
Fix remaining tests referencing removed INTEGRATOR role
Mar 16, 2026
3adfeb4
Remove tests for deleted _build_phase_scoped_prompt function
Mar 16, 2026
b1a9c83
Remove test_short_circuit_embeds_analysis test for removed short-circ…
Mar 16, 2026
96da2be
Fix indentation in test_pipeline_prompts.py
Mar 16, 2026
8695e77
Add plan review verdict for issue #1165 (cycle 2): approved
Mar 16, 2026
776e9c4
Persist statefiles after plan phase
Mar 16, 2026
29af9b9
Phase 1: Prerequisite relocations and refactors
Mar 16, 2026
58b90c9
Remove stale references to integrator, complexity tiers, short-circui…
Mar 16, 2026
d8f07d9
Add validation tests for #1165 removal of per-phase dispatch paths
Mar 16, 2026
02370ef
Phase 2: Core orchestrator removal
Mar 16, 2026
525c320
Phase 3: Remove INTEGRATOR role and complexity_tier from all modules
Mar 16, 2026
5e152d9
Phase 4: Remove dead code - PhaseDependencyGraph, MultiAgentConfig, T…
Mar 16, 2026
0b0876b
Remove obsolete tests for deleted features (Tier 3, dispatch, short-c…
Mar 16, 2026
d0315c9
Fix remaining test failures: remove INTEGRATOR refs and tier3 test files
Mar 16, 2026
017e34d
Fix tests for removed integrator role, complexity_tier, and short-cir…
Mar 16, 2026
25f68ab
Fix remaining tests referencing removed INTEGRATOR role
Mar 16, 2026
e5364cc
Remove tests for deleted _build_phase_scoped_prompt function
Mar 16, 2026
16e2fb8
Remove test_short_circuit_embeds_analysis test for removed short-circ…
Mar 16, 2026
529292f
Fix indentation in test_pipeline_prompts.py
Mar 16, 2026
7a6c09d
Merge remote-tracking branch 'origin/egg/issue-1165' into egg/issue-1…
Mar 16, 2026
b78dc7b
Fix checks: apply automated formatting fixes
Mar 16, 2026
432e1e3
Merge remote-tracking branch 'origin/egg/issue-1165' into egg/issue-1…
Mar 16, 2026
d89a28d
Fix checks: remove orphaned skip_plan reference in _run_pipeline
james-in-a-box[bot] Mar 16, 2026
207e854
Remove stale skip_plan reference from phase advancement
Mar 16, 2026
058e254
Merge remote-tracking branch 'origin/egg/issue-1165' into egg/issue-1…
Mar 16, 2026
d334100
Merge origin/main into egg/issue-1165: resolve conflicts in pipelines…
jwbron Mar 16, 2026
3b46dda
Fix multi_agent import in test_concurrent_integration.py
jwbron Mar 16, 2026
cb44b6a
Merge origin/main into egg/issue-1165: no conflicts
jwbron Mar 16, 2026
a9d653b
Increase feedback workflow timeout from 20 to 30 minutes
Mar 16, 2026
a18ef2b
Address review feedback: complete cleanup of removed concepts
Mar 16, 2026
16ccea0
Fix: remove unused review_feedback variable in pipelines.py
james-in-a-box[bot] Mar 16, 2026
9804c06
Fix checks: apply automated formatting fixes
Mar 16, 2026
19ae14b
Clean up stale references to removed concepts in docs and comments
james-in-a-box[bot] Mar 16, 2026
4f03d3c
Clean up remaining stale references from per-phase dispatch removal
egg-reviewer[bot] Mar 16, 2026
beaf58b
Remove backwards compat code and address review feedback from #1184
Mar 16, 2026
ab9abc0
Remove backwards compat code and address review feedback
Mar 16, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
451 changes: 451 additions & 0 deletions .egg-state/agent-outputs/1165-architect-output.json

Large diffs are not rendered by default.

241 changes: 241 additions & 0 deletions .egg-state/agent-outputs/1165-risk_analyst-output.json

Large diffs are not rendered by default.

621 changes: 621 additions & 0 deletions .egg-state/contracts/1165.json

Large diffs are not rendered by default.

133 changes: 133 additions & 0 deletions .egg-state/drafts/1165-analysis.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
# Analysis: Remove per-phase/task breakdown delegation from implement phase

> Issue: #1165 | Phase: refine

## Problem Statement

The implement phase has accumulated multiple conditional execution paths: Tier 3 phase-level dispatch, multi-agent wave execution, single-agent fallback, short-circuit mode, and complexity tiers. The decision tree in `orchestrator/routes/pipelines.py` (~line 6446) selects between these paths based on `multi_agent`, `complexity_tier`, and `concurrent_execution` flags.

This complexity is not justified by the results. The branching logic is hard to reason about, test, and maintain. Different execution paths produce inconsistent behavior.

The desired outcome: collapse all execution paths so that **every phase always runs concurrent BRC execution** — no conditional dispatch, no fallbacks. Also remove the integrator role, short-circuit mode, complexity tiers, and all associated plumbing.

## Current Behavior

The implement phase dispatch works as follows (pipelines.py:6446-6665):

1. **Coordinator mode**: Fully removed by PR #1169 (issue #1164, now CLOSED). No artifacts remain.
2. **Concurrent BRC** (`_run_concurrent_phase()`, line 4563): Spawns all agents simultaneously with consensus polling. **This is the keeper.**
3. **Tier 3 phase-level dispatch** (`_run_tier3_implement()`): For HIGH complexity, iterates plan phases in dependency order, spawning CODER → TESTER → DOCUMENTER → CHECKER → REVIEWER_CODE per phase, with an integrator pass at the end.
4. **Multi-agent wave execution** (`_run_multi_agent_phase()`): Wave-based execution using `MultiAgentExecutor` from `orchestrator/multi_agent.py`.
5. **Single-agent fallback**: Spawns a lone CODER agent.

Supporting infrastructure:
- **Short-circuit detection** (`_check_short_circuit_signal`, line 1656): Reads `short_circuit: true` from refine draft YAML to skip the plan phase.
- **Complexity tier detection** (`_check_high_complexity_signal`, line 1691): Reads `complexity_tier` and `parallel_phases` from refine draft YAML.
- **PhaseDependencyGraph** (`shared/egg_contracts/dependency_graph.py:382-539`): Models plan phase dependencies for Tier 3 wave computation.
- **PipelineDispatcher** (`orchestrator/dispatch.py`): Bridges orchestrator with egg_contracts dispatch logic for wave coordination. Used by `signals.py` (lines 339-345, 489-494) for completion/progress recording.
- **MultiAgentExecutor** (`orchestrator/multi_agent.py`): Wave-based parallel agent management. Also hosts `is_concurrent_execution()` (lines 653-673).

## Constraints

- **Dependency on #1164**: PR #1169 (Remove coordinator agent) is merged and fully landed. No cleanup needed.
- **No backward compatibility**: The issue explicitly states old `.egg-state/pipelines/*.json` files with removed fields will fail validation intentionally. Clean break.
- **signals.py refactoring required first**: `orchestrator/routes/signals.py` imports `create_dispatcher` and `map_agent_role_to_contract_role` from `dispatch.py` (line 35). These must be inlined using direct `egg_contracts.Orchestrator` calls before `dispatch.py` can be deleted.
- **`is_concurrent_execution()` relocation**: Must move from `multi_agent.py` to `concurrent_executor.py` before deleting `multi_agent.py`.
- **`max_parallel_agents` replacement**: Reviewer spawning (~line 6885) uses `min(len(reviewer_roles), max_parallel_agents)` — after removal, use `len(reviewer_roles)` directly as `max_workers`.
- **Scope**: ~5000-6000 lines removed across ~25-30 files. 9 test files deleted entirely, 6 test files updated.

## Options Considered

### Option A: Single large PR

**Approach**: Make all removals in one PR following the migration order in the issue.

**Pros**:
- Atomic change — no intermediate broken states
- Easier to review as a coherent whole
- Matches the "clean break" philosophy

**Cons**:
- Very large PR (~5000-6000 lines) is harder to review
- Higher risk of merge conflicts if other work lands concurrently
- Rollback is all-or-nothing

### Option B: Ordered sequence of smaller PRs

**Approach**: Split into 3-4 PRs following the dependency order: (1) signals.py refactor + relocate `is_concurrent_execution`, (2) remove execution paths + decision tree collapse, (3) remove integrator/short-circuit/complexity-tier/multi-agent-config, (4) docs + test cleanup.

**Pros**:
- Each PR is reviewable in isolation
- Lower risk per merge
- Can validate incrementally (tests pass at each step)

**Cons**:
- Intermediate states may have dead code temporarily
- More coordination overhead
- Slower to complete

### Option C: Two PRs — prep + removal

**Approach**: (1) Prep PR: relocate `is_concurrent_execution`, refactor `signals.py` to inline dispatcher calls. (2) Main PR: all removals, collapse decision tree, delete files, update docs.

**Pros**:
- Prep PR is small and safe — just refactoring, no behavior change
- Main PR is the actual removal — large but straightforward deletions
- Two review cycles, not four

**Cons**:
- Main PR is still very large

## Recommended Approach

**Option C: Two PRs** — this balances reviewability with execution speed. The prep PR unblocks the main removal by eliminating the `dispatch.py` and `multi_agent.py` dependencies. The main PR is then mostly deletions and simplifications, which are easy to review even at scale.

The migration order from the issue body is well-structured and should be followed as-is.

## Open Questions

All questions below are registered in the contract as decisions (decision-1 through decision-3) and feedback items (feedback-1).

### Decision 1: PR splitting strategy

> How should this be split into PRs?

- [ ] **Option A**: Single large PR (~5000-6000 lines, atomic change)
- [ ] **Option B**: 3-4 smaller PRs following dependency order
- [ ] **Option C**: Two PRs — prep refactor + main removal (recommended)
- [ ] Other (explain in reply)

### Decision 2: Open PR #1171

> What should happen to open PR #1171 (docs: add integrator to concurrent implement phase roles)?

This PR adds integrator documentation that #1165 will remove.

- [ ] Close #1171 — integrator is being removed anyway
- [ ] Merge #1171 first, then remove in this issue
- [ ] Ignore — this issue will supersede it
- [ ] Other (explain in reply)

### Decision 3: concurrent_execution config flags

> After removal, should `concurrent_execution` and `concurrent_phases` config flags also be removed (since BRC is now the only mode)?

The issue's "Keep" list says to keep these flags. But if BRC is always-on, they become dead config. From an agent-design perspective, keeping dead flags as "kill switches" risks reintroducing conditional dispatch — the exact complexity this issue removes. If a kill switch is ever needed, it could be implemented at the gateway/sandbox level rather than as orchestrator conditional logic.

- [ ] Yes, remove them — they are now always-on dead config
- [ ] No, keep them as kill switches for operational safety
- [ ] Other (explain in reply)

### Feedback Requested

1. **In-flight pipelines**: Are there any in-flight pipelines using Tier 3 or multi-agent wave execution that need to complete before this lands?

2. **Stale state handling**: The issue says no backward compatibility for old pipeline state. Should we add a one-time migration script to clean up old `.egg-state/pipelines/*.json` files, or is intentional failure on stale state acceptable?

---

*Authored-by: egg*

# metadata
complexity_tier: high
parallel_phases: true
Loading
Loading