Document the implementation approach, progress, and component integration for the OrchestrationLoop feature. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2.1 KiB
2.1 KiB
Issue #150: [COORD-010] Build orchestration loop
Objective
Build the main orchestration loop that coordinates issue queue processing, agent assignment, and quality verification. This is the core coordinator that ties all components together.
Approach
The orchestration loop must:
- Read issue queue (priority sorted)
- Estimate context for next issue (via parser or metadata)
- Assign cheapest capable agent (50% rule)
- Monitor agent context during execution
- On completion claim, delegate to Quality Layer
- Handle rejection (inject continuation) or approval (move to next issue)
Components to Integrate
src/queue.py- QueueManager for issue queuesrc/parser.py- Context estimation from issue bodysrc/agent_assignment.py- Agent selection (50% rule)src/validation.py- 50% rule validationsrc/quality_orchestrator.py- Quality gate verificationsrc/forced_continuation.py- Continuation promptssrc/context_monitor.py- Context monitoring
Implementation Plan
-
TDD RED Phase: Write comprehensive tests for:
- OrchestrationLoop class with full integration
- Queue processing with priority sorting
- Agent assignment integration
- Quality gate verification
- Rejection handling with forced continuation
- Approval and completion flow
- Context monitoring during execution
-
TDD GREEN Phase: Implement OrchestrationLoop in coordinator.py
- Add new OrchestrationLoop class (or enhance Coordinator)
- Integrate all components
- Add proper error handling
-
TDD REFACTOR Phase: Clean up and optimize
Progress
- Write tests for orchestration loop (RED) - 33 tests written
- Implement orchestration loop (GREEN) - OrchestrationLoop class implemented
- Refactor and clean up (REFACTOR) - Code cleaned up
- Run quality gates (build, lint, test, coverage) - All passing
- Commit changes
Testing
Target: 85% minimum coverage for all new code
Notes
- The existing Coordinator class has basic queue processing
- Need to enhance it with Quality Layer integration
- ForcedContinuationService handles rejection prompts
- QualityOrchestrator runs quality gates in parallel