Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
4a03555
Initialize SDLC contract for issue #732
Feb 17, 2026
d5f0680
Add analysis for issue #732: parallel phase-level dispatch
Feb 17, 2026
ea015d2
Add agent-design review verdict for issue #732 refine phase
Feb 17, 2026
27e0436
Add refine review verdict for issue #732
Feb 17, 2026
2908a63
Persist statefiles after refine phase
Feb 17, 2026
4b9b37f
Add architect analysis for Tier 3 phase-level dispatch (#732)
Feb 17, 2026
f314464
Fix orchestrator crash on host paths in egg-state dirs (#806)
james-in-a-box[bot] Feb 17, 2026
82dd92f
WIP: auto-commit uncommitted work (architect) [issue-732]
Feb 17, 2026
e8a08a4
Add task planner implementation plan for Tier 3 phase-level dispatch …
Feb 17, 2026
2e2eb6a
Add risk assessment for Tier 3 phase-level dispatch (#732)
Feb 17, 2026
f170b8e
Add plan review verdict for #732
Feb 17, 2026
08667d8
Persist statefiles after plan phase
Feb 17, 2026
8c024ab
Add Phase/AgentExecution model extensions for Tier 3 dispatch
Feb 17, 2026
9a15eef
Add 3-tier complexity assessment to refine phase
Feb 17, 2026
2cf4260
Add composite execution tracking and phase dependency graph
Feb 17, 2026
f4c152a
Add Tier 3 sequential phase cycling for implement phase
Feb 17, 2026
953a133
Add conditional integrator write access for Tier 3
Feb 17, 2026
89763aa
Add per-phase worktrees and parallel dispatch for Tier 3
Feb 17, 2026
d037a79
Add tests for Tier 3 dispatch and fix can_agent_run bug
Feb 17, 2026
63648ec
Update documentation for Tier 3 phase-level dispatch
Feb 17, 2026
4bd93c1
Add tests for Tier 3 parallel dispatch feature
Feb 17, 2026
8eb5ce7
Fix Tier 3 test task ID format and lint issues
Feb 17, 2026
4a6aa64
Fix lint errors, formatting, and broken test references
Feb 17, 2026
a79b3c1
Add code review verdict for #732 implement phase
Feb 17, 2026
eca444a
Add contract review verdict for #732 implement phase
Feb 17, 2026
b6b9de6
Persist statefiles after implement phase
Feb 17, 2026
c246d59
Merge remote-tracking branch 'origin/main' into egg/issue-732
Feb 17, 2026
4c954b7
Address review feedback for Tier 3 phase-level dispatch
egg-reviewer[bot] Feb 17, 2026
4ac6cac
Fix double reviewer execution and parallel cancellation in Tier 3
egg-reviewer[bot] Feb 17, 2026
e4b79b8
Fix ReviewVerdict type mismatches and add test coverage
egg-reviewer[bot] Feb 17, 2026
ad6a588
Fix thread-safety race in cancel_event parallel test
egg-reviewer[bot] Feb 17, 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
7 changes: 7 additions & 0 deletions .egg-state/agent-outputs/732-implement-code-review.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"reviewer": "code",
"verdict": "needs_revision",
"summary": "The Tier 3 phase-level dispatch implementation is well-structured overall, with good test coverage (142 new tests passing), clean separation of concerns, and correct cycle detection/topological sort algorithms. However, the parallel execution path has critical correctness bugs that must be fixed before merging.",
"feedback": "## Critical Issues\n\n### 1. Review verdict file race condition in parallel execution (pipelines.py:2611-2617)\n\nAll parallel phases write to and read from the **same** verdict file path (e.g., `732-implement-code-review.json`). The `_verdict_path_for_type()` function does not incorporate `phase_id`, so when phases run in parallel:\n\n- Phase A's reviewer writes `732-implement-code-review.json` with `{\"verdict\": \"approved\"}`\n- Phase B's reviewer overwrites the same file with `{\"verdict\": \"needs_revision\"}`\n- Phase A reads Phase B's verdict (or gets corrupted partial JSON)\n\n**Fix:** Include the plan phase ID in the verdict file path when running in Tier 3 mode. For example: `732-implement-phase-1-code-review.json`. Pass `phase_id` through `_build_review_prompt()` into the verdict path template, and through `_read_review_verdict()` when reading back.\n\n### 2. Per-phase worktrees not wired into the pipeline (pipelines.py:2427-2649)\n\n`create_phase_worktree()` and `cleanup_phase_worktrees()` were implemented in `gateway/worktree_manager.py` but are never called from `_run_tier3_implement()`. All parallel phase cycles spawn containers against the **same** `worktree_repo_path`. When phases execute in parallel, multiple coder/tester containers will write to the same filesystem concurrently, causing:\n\n- Git conflicts (multiple agents committing to the same branch simultaneously)\n- File corruption (concurrent writes to the same source files)\n- Non-deterministic test results\n\n**Fix:** For parallel waves, call `create_phase_worktree()` to create isolated worktrees per phase, pass the phase-specific worktree path to `_spawn_and_wait()`, and call `cleanup_phase_worktrees()` after integration. For sequential execution, the single worktree is fine.\n\n### 3. Early return from parallel wave doesn't cancel remaining futures (pipelines.py:2675-2676)\n\nWhen one phase fails during parallel execution, `return 1, \"\\n\".join(all_logs)` exits the `with ThreadPoolExecutor(...)` block. The context manager's `__exit__` calls `shutdown(wait=True)`, blocking until all remaining phases complete. This wastes compute resources and delays error reporting. Additionally, the remaining futures' logs are never collected.\n\n**Fix:** Use `pool.shutdown(wait=True, cancel_futures=True)` (Python 3.9+) or manually cancel pending futures before returning. Alternatively, track a failure flag and let remaining futures finish but skip their work.\n\n## Medium Issues\n\n### 4. `_read_last_review_feedback` is not phase-aware (pipelines.py:2449-2455)\n\nIn the retry loop, `_read_last_review_feedback()` reads the verdict file without the phase ID, so in Tier 3 mode it will read whatever was last written to the shared verdict path. This is the same root cause as issue #1 but affects the retry/revision feedback path.\n\n### 5. Test results show 22 test failures (implement-results.json)\n\nThe `implement-results.json` shows `\"all_passed\": false` with 22 failures in `tests/scripts/test_checks.py`. While the implementation claims these are pre-existing, having failing tests in the CI artifact is a concern. The review should verify these are genuinely pre-existing and not caused by the new changes.\n\n### 6. `complexity_tier` not reset on HITL revision (pipelines.py:4538-4567)\n\nWhen the refine phase is re-run after HITL feedback, `pipeline.short_circuit` is explicitly reset to `False` before re-checking, but `pipeline.complexity_tier` is not reset. If a HITL revision changes the analysis to remove the high-complexity signal, `enable_parallel_phases` (set on line 4548) is never cleared back to `False`, and `complexity_tier` is always overwritten but `enable_parallel_phases` persists.\n\n**Fix:** Reset `pipeline.config.enable_parallel_phases = False` before re-detecting the complexity tier, similar to how `pipeline.short_circuit = False` is reset.\n\n### 7. Documenter agent missing from Tier 3 per-phase cycle (pipelines.py:2427-2649)\n\nThe standard multi-agent implement flow runs coder -> tester -> documenter -> integrator -> reviewer. The Tier 3 `_run_single_phase_cycle` only runs coder -> tester -> reviewer, skipping the documenter entirely. If documentation changes are expected per phase, they won't happen.\n\n## Minor Issues\n\n### 8. `import bisect` inside a loop (dependency_graph.py:480)\n\n`import bisect` is placed inside the `while queue` loop body of `topological_sort()`. While Python caches imports, this is unconventional and should be moved to the top of the file or function.\n\n### 9. `import yaml` inside function body (pipelines.py:1201)\n\n`yaml` is imported inside `_check_high_complexity_signal()` rather than at module level. This is a minor style inconsistency.\n\n### 10. Test references to non-existent enum values (test_dag_visualizer.py)\n\nThe test fixes replace `AgentRole.CHECKER` and `AgentRole.REVIEWER_UNIFIED` with `AgentRole.REFINER` and `AgentRole.REVIEWER_CONTRACT`/`REVIEWER_CODE`. This appears to be fixing pre-existing broken references, which is fine, but it's mixed in with the Tier 3 feature commits, making the diff harder to review.",
"timestamp": "2026-02-17T12:00:00Z"
}
7 changes: 7 additions & 0 deletions .egg-state/agent-outputs/732-implement-contract-review.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"reviewer": "contract",
"verdict": "needs_revision",
"summary": "Implementation is substantially complete (33 of 34 tasks verified), but task-5-3 is incomplete: the integrator prompt is not differentiated by complexity tier, so Tier 3 integrators receive generic read-only instructions despite having write access to source files.",
"feedback": "## Contract Verification Results\n\n### Phase 1: Contract schema and model extensions — ALL 5 TASKS PASS\n- task-1-1: Phase.dependencies field exists in models.py with list[str] type and empty default\n- task-1-2: AgentExecutionModel.phase_id field exists with str|None type and None default\n- task-1-3: contract.schema.json updated with both new fields including pattern validation\n- task-1-4: to_contract_phase() in plan_parser.py propagates and normalizes dependencies\n- task-1-5: Pipeline.complexity_tier field added with ComplexityTier enum (LOW/MID/HIGH)\n\n### Phase 2: 3-tier complexity assessment — ALL 3 TASKS PASS\n- task-2-1: Refine prompt includes complexity tier instructions with YAML metadata format for all three tiers\n- task-2-2: _check_high_complexity_signal() parses YAML metadata, returns (tier, parallel_phases) tuple\n- task-2-3: pipeline.complexity_tier set during refine-to-plan transition in pipelines.py:4538-4568\n\n### Phase 3: Composite execution tracking — ALL 4 TASKS PASS\n- task-3-1: OrchestrationState has phase_executions dict with (phase_id, role) composite keys\n- task-3-2: can_agent_run() and get_runnable_agents() accept optional phase_id parameter\n- task-3-3: Orchestrator.get_next_dispatch() uses phase_id for phase-aware agent filtering\n- task-3-4: PhaseDependencyGraph class with wave computation, topological sort, and cycle detection\n\n### Phase 4: Sequential phase cycling — ALL 5 TASKS PASS\n- task-4-1: _run_tier3_implement() loops through phases in dependency order with coder->tester->reviewer cycle\n- task-4-2: _build_phase_scoped_prompt() filters tasks and files_affected to current phase only\n- task-4-3: Per-phase cycling implemented in _run_tier3_implement inner function (multi_agent.py unchanged but not needed)\n- task-4-4: Retry logic with max_retries, reviewer rejection triggers coder retry within phase\n- task-4-5: Phase scoping enforced via state initialization and phase-scoped prompts (dispatch.py unchanged but not needed)\n\n### Phase 5: Integrator write access — 2 of 3 TASKS PASS, 1 FAILS\n- task-5-1: PASS — get_role_definition() returns expanded write access for Tier 3 integrator\n- task-5-2: PASS — Gateway agent_restrictions.py has INTEGRATOR_TIER3_PATTERNS; phase_filter.py accepts complexity_tier\n- task-5-3: FAIL — _build_agent_prompt() does not accept complexity_tier parameter (line 1925). The integrator prompt (lines 2047-2060) is identical for all tiers. The call site at line 2693 does not pass complexity_tier. Acceptance criterion requires 'Integrator prompt in Tier 3 includes merge/fix/test instructions' but no Tier 3-specific instructions exist.\n\n### Phase 6: Per-phase worktrees and parallel dispatch — ALL 5 TASKS PASS\n- task-6-1: create_phase_worktree() in worktree_manager.py creates phase-specific worktrees\n- task-6-2: cleanup_phase_worktrees() handles post-integration cleanup with auto-discovery\n- task-6-3: _run_tier3_implement() uses ThreadPoolExecutor for parallel wave execution when enabled\n- task-6-4: enable_parallel_phases config flag added to PipelineConfig (default False)\n- task-6-5: Integrator invoked after all phases with complexity_tier awareness\n\n### Phase 7: Tests — ALL 8 TASKS PASS\n- task-7-1: test_phase_dependency_graph.py — 18 tests passing\n- task-7-2: test_composite_execution.py — 19 tests passing\n- task-7-3: test_tier3_dispatch.py — 5 model tests passing, 12 integration tests skipped (env limitation)\n- task-7-4: test_tier3_execute.py — 14 integration tests exist but skip due to docker import limitation\n- task-7-5: test_plan_parser_dependencies.py — 7 tests passing\n- task-7-6: test_phase_filter_tier3.py — 16 tests passing; test_integrator_tier3.py — 27 tests passing\n- task-7-7: test_phase_worktree.py — 10 tests passing\n- task-7-8: test_short_circuit.py — 29 passing; test_dispatch.py — 8 passing\n\n### Required Fix for task-5-3\n1. Add complexity_tier parameter to _build_agent_prompt() (pipelines.py:1925)\n2. Add Tier 3-specific integrator instructions: inform integrator it has write access, instruct it to fix integration issues, include merge/conflict resolution guidance\n3. Pass complexity_tier=pipeline.complexity_tier.value at the integrator call site (line 2693)\n\n### Test Summary\n- 97 tests passed, 26 skipped (environment limitations), 0 failed",
"timestamp": "2026-02-17T08:15:00Z"
}
Loading