---
name: "Split pool.rs into pipeline, auto-assign, and agent management modules"
---

# Refactor 317: Split pool.rs into pipeline, auto-assign, and agent management modules

## Current State

- TBD

## Desired State

pool.rs is 5,852 lines and handles agent pool management, pipeline advancement, auto-assign logic, completion handling, and has massive test suites all in one file. Split into focused modules:
- pool.rs — core agent pool (start, stop, list, inject)
- pipeline.rs — run_pipeline_advance and stage transition logic
- auto_assign.rs — auto_assign_available_work and assignment logic
- Tests split into corresponding test modules

## Acceptance Criteria

- [ ] pool.rs reduced to core agent management (start, stop, list)
- [ ] Pipeline advancement logic extracted to agents/pipeline.rs
- [ ] Auto-assign logic extracted to agents/auto_assign.rs
- [ ] All existing tests pass without modification to test logic
- [ ] No public API changes — callers still access everything through AgentPool

## Out of Scope

- TBD
