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:
@@ -1729,7 +1729,7 @@ stage = "coder"
|
||||
|
||||
#[tokio::test]
|
||||
async fn archiving_story_removes_agent_entries_from_pool() {
|
||||
use crate::agents::lifecycle::move_story_to_archived;
|
||||
use crate::agents::lifecycle::move_story_to_done;
|
||||
use std::fs;
|
||||
|
||||
let tmp = tempfile::tempdir().unwrap();
|
||||
@@ -1746,7 +1746,7 @@ stage = "coder"
|
||||
|
||||
assert_eq!(pool.list_agents().unwrap().len(), 3);
|
||||
|
||||
move_story_to_archived(root, "60_story_cleanup").unwrap();
|
||||
move_story_to_done(root, "60_story_cleanup").unwrap();
|
||||
pool.remove_agents_for_story("60_story_cleanup");
|
||||
|
||||
let remaining = pool.list_agents().unwrap();
|
||||
|
||||
@@ -308,7 +308,7 @@ impl AgentPool {
|
||||
"[pipeline] Post-merge tests passed for '{story_id}'. Moving to done."
|
||||
);
|
||||
if let Err(e) =
|
||||
crate::agents::lifecycle::move_story_to_archived(&project_root, story_id)
|
||||
crate::agents::lifecycle::move_story_to_done(&project_root, story_id)
|
||||
{
|
||||
slog_error!("[pipeline] Failed to move '{story_id}' to done: {e}");
|
||||
}
|
||||
|
||||
@@ -104,7 +104,7 @@ impl AgentPool {
|
||||
}
|
||||
|
||||
let story_archived =
|
||||
crate::agents::lifecycle::move_story_to_archived(project_root, story_id).is_ok();
|
||||
crate::agents::lifecycle::move_story_to_done(project_root, story_id).is_ok();
|
||||
if story_archived {
|
||||
self.remove_agents_for_story(story_id);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user