You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Dev Loop workflow module is one 400+ line module with 5 async methods, all sharing the same workflow class state. The interface surface — every method a caller or test must understand — nearly matches the implementation complexity. Testing one phase means instantiating the entire workflow and mocking every other method.
Extract a deep PhasePipeline module that exposes one interface: run(plan_phase, execute_phase, review_phase, notifier). Each phase becomes a standalone deep module with a small interface. The workflow class shrinks to dependency injection — it wires the pipeline but doesn't implement the loop.
Create these deep modules:
PhasePipeline — The orchestration loop: run(plan_phase, execute_phase, review_phase, notifier). Controls phase ordering, CI cycle, and notification.
CICycle — run(fix_attempts) -> CIChecksResult. Reusable CI fix cycle (also used by PRCommentWorkflow).
Notifier — notify(review_result). Wraps _post_github_comment and summary notification.
The workflow class (DevLoopWorkflow) becomes a thin adapter that injects these phases into the pipeline. The same pattern applies to PRCommentWorkflow — both can share the CICycle module.
Acceptance criteria
PhasePipeline module exists with run(plan, execute, review, notifier) interface
PlanPhase, ExecutePhase, ReviewPhase, ReviewFixPass, CICycle, Notifier each exist as standalone deep modules
DevLoopWorkflow shrinks to dependency injection — wires phases into pipeline, doesn't implement loop
CICycle is shared between DevLoopWorkflow and PRCommentWorkflow (or PRCommentWorkflow uses it)
Each phase can be tested independently — no need to instantiate the full workflow
All existing workflow behavior preserved — same phase ordering, same activity calls, same CI fix logic
Unit tests pass with no regression in workflow execution
Blocked by
None - can start immediately
Note: After shared.py is split (issue #150), the Phase, JobStatus, and CIChecksResult types used by these modules will come from their dedicated sub-modules.
Parent
#149
What to build
The Dev Loop workflow module is one 400+ line module with 5 async methods, all sharing the same workflow class state. The interface surface — every method a caller or test must understand — nearly matches the implementation complexity. Testing one phase means instantiating the entire workflow and mocking every other method.
Extract a deep PhasePipeline module that exposes one interface:
run(plan_phase, execute_phase, review_phase, notifier). Each phase becomes a standalone deep module with a small interface. The workflow class shrinks to dependency injection — it wires the pipeline but doesn't implement the loop.Create these deep modules:
run(plan_phase, execute_phase, review_phase, notifier). Controls phase ordering, CI cycle, and notification.execute(task_spec, by_repo, client) -> TaskSpec. Wraps the existing _plan_phase activity call.execute(task_spec, by_repo, client) -> TaskSpec. Wraps the existing _execute_phase activity call.execute(task_spec, by_repo, client) -> CIChecksResult. Wraps the existing _review_phase activity call.execute(revise_prompt, ...) -> CIChecksResult. The mid-review fix loop logic.run(fix_attempts) -> CIChecksResult. Reusable CI fix cycle (also used by PRCommentWorkflow).notify(review_result). Wraps _post_github_comment and summary notification.The workflow class (DevLoopWorkflow) becomes a thin adapter that injects these phases into the pipeline. The same pattern applies to PRCommentWorkflow — both can share the CICycle module.
Acceptance criteria
Blocked by
Note: After shared.py is split (issue #150), the Phase, JobStatus, and CIChecksResult types used by these modules will come from their dedicated sub-modules.