From 18d2242815d76eafd5e3134e5fa1d4fe8d862537 Mon Sep 17 00:00:00 2001 From: dave Date: Sat, 4 Apr 2026 12:33:36 +0000 Subject: [PATCH] huskies: create 476_refactor_split_agents_pool_lifecycle_rs_into_submodules --- ...ions_into_a_shared_parameterised_helper.md | 25 ------------------- ...gents_pool_lifecycle_rs_into_submodules.md | 25 +++++++++++++++++++ 2 files changed, 25 insertions(+), 25 deletions(-) delete mode 100644 .huskies/work/1_backlog/475_refactor_deduplicate_lifecycle_rs_move_functions_into_a_shared_parameterised_helper.md create mode 100644 .huskies/work/1_backlog/476_refactor_split_agents_pool_lifecycle_rs_into_submodules.md diff --git a/.huskies/work/1_backlog/475_refactor_deduplicate_lifecycle_rs_move_functions_into_a_shared_parameterised_helper.md b/.huskies/work/1_backlog/475_refactor_deduplicate_lifecycle_rs_move_functions_into_a_shared_parameterised_helper.md deleted file mode 100644 index c17c5357..00000000 --- a/.huskies/work/1_backlog/475_refactor_deduplicate_lifecycle_rs_move_functions_into_a_shared_parameterised_helper.md +++ /dev/null @@ -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 diff --git a/.huskies/work/1_backlog/476_refactor_split_agents_pool_lifecycle_rs_into_submodules.md b/.huskies/work/1_backlog/476_refactor_split_agents_pool_lifecycle_rs_into_submodules.md new file mode 100644 index 00000000..0c35fe88 --- /dev/null +++ b/.huskies/work/1_backlog/476_refactor_split_agents_pool_lifecycle_rs_into_submodules.md @@ -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