huskies: done 475_refactor_deduplicate_lifecycle_rs_move_functions_into_a_shared_parameterised_helper

This commit is contained in:
dave
2026-04-04 15:23:52 +00:00
parent eb8654dba0
commit 86186b9ab3
@@ -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