---
name: "Split pool/auto_assign.rs into submodules"
---

# Refactor 418: Split pool/auto_assign.rs into submodules

## Current State

- TBD

## Desired State

Refactor the monolithic server/src/agents/pool/auto_assign.rs (1813 lines) into focused submodules.

## Acceptance Criteria

- [ ] auto_assign.rs contains auto_assign_available_work and its unit tests
- [ ] reconcile.rs contains reconcile_on_startup and its unit tests
- [ ] watchdog.rs contains run_watchdog_once, spawn_watchdog, check_orphaned_agents and their unit tests
- [ ] scan.rs contains scan_stage_items, is_story_assigned_for_stage, count_active_agents_for_stage, find_free_agent_for_stage, is_agent_free and their unit tests
- [ ] story_checks.rs contains read_story_front_matter_agent, has_review_hold, is_story_blocked, has_merge_failure and their unit tests
- [ ] mod.rs wires the submodules and re-exports all public items
- [ ] Unit tests live in their respective module files
- [ ] No public API changes — all existing imports continue to work

## Out of Scope

- TBD
