From 86186b9ab32ab633f76fb72a1ffec2c73fafb381 Mon Sep 17 00:00:00 2001 From: dave Date: Sat, 4 Apr 2026 15:23:52 +0000 Subject: [PATCH] huskies: done 475_refactor_deduplicate_lifecycle_rs_move_functions_into_a_shared_parameterised_helper --- ...ions_into_a_shared_parameterised_helper.md | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 .huskies/work/5_done/475_refactor_deduplicate_lifecycle_rs_move_functions_into_a_shared_parameterised_helper.md diff --git a/.huskies/work/5_done/475_refactor_deduplicate_lifecycle_rs_move_functions_into_a_shared_parameterised_helper.md b/.huskies/work/5_done/475_refactor_deduplicate_lifecycle_rs_move_functions_into_a_shared_parameterised_helper.md new file mode 100644 index 00000000..c17c5357 --- /dev/null +++ b/.huskies/work/5_done/475_refactor_deduplicate_lifecycle_rs_move_functions_into_a_shared_parameterised_helper.md @@ -0,0 +1,25 @@ +--- +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