fix(426): verify cherry-pick landed on master before marking story done

After the cherry-pick step in run_squash_merge, verify:
1. project_root is on the base branch (not a merge-queue branch)
2. HEAD commit has actual code changes (not an empty/story-only diff)

If either check fails, return success=false so the story stays in merge
stage for retry instead of being phantom-advanced to done.

Also rename move_story_to_archived → move_story_to_done.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
dave
2026-03-28 12:37:03 +00:00
parent 5035b84de5
commit 953fce2ca6
7 changed files with 79 additions and 14 deletions
+3 -3
View File
@@ -1,5 +1,5 @@
use crate::agents::{
close_bug_to_archive, feature_branch_has_unmerged_changes, move_story_to_archived,
close_bug_to_archive, feature_branch_has_unmerged_changes, move_story_to_done,
};
use crate::http::context::AppContext;
use crate::http::workflow::{
@@ -246,7 +246,7 @@ pub(super) fn tool_accept_story(args: &Value, ctx: &AppContext) -> Result<String
));
}
move_story_to_archived(&project_root, story_id)?;
move_story_to_done(&project_root, story_id)?;
ctx.agents.remove_agents_for_story(story_id);
Ok(format!(
@@ -1331,7 +1331,7 @@ mod tests {
.output()
.unwrap();
// Create story file in current/ so move_story_to_archived would work.
// Create story file in current/ so move_story_to_done would work.
let current_dir = tmp.path().join(".storkit/work/2_current");
std::fs::create_dir_all(&current_dir).unwrap();
std::fs::write(