huskies: merge 553_story_accept_spike_state_machine_transition_skips_merge_and_goes_directly_to_done

This commit is contained in:
dave
2026-04-13 12:50:25 +00:00
parent 12497eb4f1
commit 5806156af3
3 changed files with 138 additions and 105 deletions
+5 -4
View File
@@ -7,7 +7,7 @@ use crate::slog;
type ContentTransform = Option<Box<dyn Fn(&str) -> String>>;
pub(super) fn item_type_from_id(item_id: &str) -> &'static str {
pub(crate) fn item_type_from_id(item_id: &str) -> &'static str {
// New format: {digits}_{type}_{slug}
let after_num = item_id.trim_start_matches(|c: char| c.is_ascii_digit());
if after_num.starts_with("_bug_") {
@@ -155,14 +155,15 @@ pub fn feature_branch_has_unmerged_changes(project_root: &Path, story_id: &str)
}
}
/// Move a story from `work/2_current/` or `work/4_merge/` to `work/5_done/`.
/// Move a story from `work/2_current/`, `work/3_qa/`, or `work/4_merge/` to `work/5_done/`.
///
/// Idempotent if already in `5_done/` or `6_archived/`. Errors if not found in `2_current/` or `4_merge/`.
/// Idempotent if already in `5_done/` or `6_archived/`. Errors if not found in any earlier stage.
/// Spikes may transition directly from `3_qa/` to `5_done/`, skipping the merge stage.
pub fn move_story_to_done(project_root: &Path, story_id: &str) -> Result<(), String> {
move_item(
project_root,
story_id,
&["2_current", "4_merge"],
&["2_current", "3_qa", "4_merge"],
"5_done",
&["6_archived"],
false,