huskies: create 476_refactor_split_agents_pool_lifecycle_rs_into_submodules
This commit is contained in:
-25
@@ -1,25 +0,0 @@
|
|||||||
---
|
|
||||||
name: "Deduplicate lifecycle.rs move functions into a shared parameterised helper"
|
|
||||||
---
|
|
||||||
|
|
||||||
# Refactor 475: Deduplicate lifecycle.rs move functions into a shared parameterised helper
|
|
||||||
|
|
||||||
## Current State
|
|
||||||
|
|
||||||
- TBD
|
|
||||||
|
|
||||||
## Desired State
|
|
||||||
|
|
||||||
The move_story_to_current, move_story_to_done, move_story_to_merge, move_story_to_qa, and reject_story_from_qa functions share the same pattern: build paths, check idempotency, find source file in one or more stages, rename, clear front matter fields, log. Extract a shared `move_story()` helper parameterised by source stages, target stage, and fields to clear. The named functions become thin wrappers. The existing `move_story_to_stage` function should also use this shared helper. 27 existing tests provide a safety net.
|
|
||||||
|
|
||||||
## Acceptance Criteria
|
|
||||||
|
|
||||||
- [ ] Single shared move_story helper function parameterised by source stages, target stage, and fields to clear
|
|
||||||
- [ ] All existing named move functions (move_story_to_current, move_story_to_done, move_story_to_merge, move_story_to_qa, reject_story_from_qa) become thin wrappers
|
|
||||||
- [ ] move_story_to_stage also delegates to the shared helper
|
|
||||||
- [ ] All 27 existing tests pass unchanged
|
|
||||||
- [ ] Net reduction of at least 150 lines from lifecycle.rs
|
|
||||||
|
|
||||||
## Out of Scope
|
|
||||||
|
|
||||||
- TBD
|
|
||||||
+25
@@ -0,0 +1,25 @@
|
|||||||
|
---
|
||||||
|
name: "Split agents/pool/lifecycle.rs into submodules"
|
||||||
|
---
|
||||||
|
|
||||||
|
# Refactor 476: Split agents/pool/lifecycle.rs into submodules
|
||||||
|
|
||||||
|
## Current State
|
||||||
|
|
||||||
|
- TBD
|
||||||
|
|
||||||
|
## Desired State
|
||||||
|
|
||||||
|
pool/lifecycle.rs is 1812 lines with 4 public functions (start_agent, stop_agent, wait_for_agent, remove_agents_for_story) plus 29 tests. start_agent is by far the largest — it handles agent selection, worktree creation, process spawning, and completion callbacks. Split into submodules: start.rs (agent start + selection logic), stop.rs (stop + cleanup), wait.rs (wait_for_agent), with tests co-located in each module.
|
||||||
|
|
||||||
|
## Acceptance Criteria
|
||||||
|
|
||||||
|
- [ ] pool/lifecycle.rs split into submodules (e.g. start.rs, stop.rs, wait.rs)
|
||||||
|
- [ ] Each submodule contains its related tests
|
||||||
|
- [ ] All 29 existing tests pass unchanged
|
||||||
|
- [ ] Public API unchanged — re-export from pool/mod.rs if needed
|
||||||
|
- [ ] No functional changes, purely structural
|
||||||
|
|
||||||
|
## Out of Scope
|
||||||
|
|
||||||
|
- TBD
|
||||||
Reference in New Issue
Block a user