huskies: merge 738_refactor_delete_fs_shadow_code_from_lifecycle_rs_and_the_work_directory_watcher
This commit is contained in:
@@ -54,7 +54,7 @@ pub(crate) async fn tool_rebuild_and_restart(ctx: &AppContext) -> Result<String,
|
||||
/// Forwards the permission request through the shared channel to the active
|
||||
/// WebSocket session, which presents a dialog to the user. Blocks until the
|
||||
/// user approves or denies (with a 5-minute timeout).
|
||||
pub(crate) fn tool_move_story(args: &Value, ctx: &AppContext) -> Result<String, String> {
|
||||
pub(crate) fn tool_move_story(args: &Value, _ctx: &AppContext) -> Result<String, String> {
|
||||
let story_id = args
|
||||
.get("story_id")
|
||||
.and_then(|v| v.as_str())
|
||||
@@ -64,9 +64,7 @@ pub(crate) fn tool_move_story(args: &Value, ctx: &AppContext) -> Result<String,
|
||||
.and_then(|v| v.as_str())
|
||||
.ok_or("Missing required argument: target_stage")?;
|
||||
|
||||
let project_root = ctx.services.agents.get_project_root(&ctx.state)?;
|
||||
|
||||
let (from_stage, to_stage) = move_story_to_stage(&project_root, story_id, target_stage)?;
|
||||
let (from_stage, to_stage) = move_story_to_stage(story_id, target_stage)?;
|
||||
|
||||
serde_json::to_string_pretty(&json!({
|
||||
"story_id": story_id,
|
||||
|
||||
@@ -450,7 +450,7 @@ mod tests {
|
||||
let content = "---\nname: Test\n---\n";
|
||||
fs::write(backlog.join("5_story_test.md"), content).unwrap();
|
||||
crate::db::ensure_content_store();
|
||||
crate::db::write_content("5_story_test", content);
|
||||
crate::db::write_item_with_content("5_story_test", "1_backlog", content);
|
||||
|
||||
let ctx = test_ctx(root);
|
||||
let result = super::super::tool_move_story(
|
||||
@@ -477,7 +477,7 @@ mod tests {
|
||||
let content = "---\nname: Back\n---\n";
|
||||
fs::write(current.join("6_story_back.md"), content).unwrap();
|
||||
crate::db::ensure_content_store();
|
||||
crate::db::write_content("6_story_back", content);
|
||||
crate::db::write_item_with_content("6_story_back", "2_current", content);
|
||||
|
||||
let ctx = test_ctx(root);
|
||||
let result = super::super::tool_move_story(
|
||||
@@ -504,7 +504,7 @@ mod tests {
|
||||
let content = "---\nname: Idem\n---\n";
|
||||
fs::write(current.join("9907_story_idem.md"), content).unwrap();
|
||||
crate::db::ensure_content_store();
|
||||
crate::db::write_content("9907_story_idem", content);
|
||||
crate::db::write_item_with_content("9907_story_idem", "2_current", content);
|
||||
|
||||
let ctx = test_ctx(root);
|
||||
let result = super::super::tool_move_story(
|
||||
|
||||
@@ -145,7 +145,7 @@ pub(super) async fn tool_move_story_to_merge(
|
||||
let project_root = ctx.services.agents.get_project_root(&ctx.state)?;
|
||||
|
||||
// Move story from work/2_current/ to work/4_merge/
|
||||
move_story_to_merge(&project_root, story_id)?;
|
||||
move_story_to_merge(story_id)?;
|
||||
|
||||
// Start the mergemaster agent on the story worktree
|
||||
let info = ctx
|
||||
|
||||
@@ -24,7 +24,7 @@ pub(super) async fn tool_request_qa(args: &Value, ctx: &AppContext) -> Result<St
|
||||
let project_root = ctx.services.agents.get_project_root(&ctx.state)?;
|
||||
|
||||
// Move story from work/2_current/ to work/3_qa/
|
||||
move_story_to_qa(&project_root, story_id)?;
|
||||
move_story_to_qa(story_id)?;
|
||||
|
||||
// Start the QA agent on the story worktree
|
||||
let info = ctx
|
||||
@@ -75,7 +75,7 @@ pub(super) async fn tool_approve_qa(args: &Value, ctx: &AppContext) -> Result<St
|
||||
.map_err(|e| format!("Merge task panicked: {e}"))?
|
||||
.map_err(|e| e.to_string())?;
|
||||
|
||||
move_story_to_done(&project_root, story_id)?;
|
||||
move_story_to_done(story_id)?;
|
||||
|
||||
let pool = std::sync::Arc::clone(&ctx.services.agents);
|
||||
pool.remove_agents_for_story(story_id);
|
||||
@@ -99,7 +99,7 @@ pub(super) async fn tool_approve_qa(args: &Value, ctx: &AppContext) -> Result<St
|
||||
.map_err(|e| format!("Serialization error: {e}"))
|
||||
} else {
|
||||
// Non-spike items go through the normal merge pipeline.
|
||||
move_story_to_merge(&project_root, story_id)?;
|
||||
move_story_to_merge(story_id)?;
|
||||
|
||||
// Start the mergemaster agent
|
||||
let info = ctx
|
||||
@@ -134,7 +134,7 @@ pub(super) async fn tool_reject_qa(args: &Value, ctx: &AppContext) -> Result<Str
|
||||
let project_root = ctx.services.agents.get_project_root(&ctx.state)?;
|
||||
|
||||
// Move story from work/3_qa/ back to work/2_current/ with rejection notes
|
||||
reject_story_from_qa(&project_root, story_id, notes)?;
|
||||
reject_story_from_qa(story_id, notes)?;
|
||||
|
||||
// Restart the coder agent with rejection context
|
||||
let story_path = project_root
|
||||
|
||||
@@ -97,8 +97,7 @@ pub(crate) fn tool_close_bug(args: &Value, ctx: &AppContext) -> Result<String, S
|
||||
.and_then(|v| v.as_str())
|
||||
.ok_or("Missing required argument: bug_id")?;
|
||||
|
||||
let root = ctx.services.agents.get_project_root(&ctx.state)?;
|
||||
close_bug_to_archive(&root, bug_id)?;
|
||||
close_bug_to_archive(bug_id)?;
|
||||
ctx.services.agents.remove_agents_for_story(bug_id);
|
||||
|
||||
Ok(format!(
|
||||
@@ -439,7 +438,7 @@ mod tests {
|
||||
let content = "# Bug 9901: Crash\n";
|
||||
std::fs::write(&bug_file, content).unwrap();
|
||||
crate::db::ensure_content_store();
|
||||
crate::db::write_content("9901_bug_crash", content);
|
||||
crate::db::write_item_with_content("9901_bug_crash", "1_backlog", content);
|
||||
// Stage the file so it's tracked
|
||||
std::process::Command::new("git")
|
||||
.args(["add", "."])
|
||||
|
||||
@@ -225,7 +225,7 @@ pub(crate) fn tool_accept_story(args: &Value, ctx: &AppContext) -> Result<String
|
||||
));
|
||||
}
|
||||
|
||||
move_story_to_done(&project_root, story_id)?;
|
||||
move_story_to_done(story_id)?;
|
||||
ctx.services.agents.remove_agents_for_story(story_id);
|
||||
|
||||
Ok(format!(
|
||||
@@ -869,7 +869,7 @@ mod tests {
|
||||
let content = "---\nname: No Branch\n---\n";
|
||||
std::fs::write(current_dir.join("51_story_no_branch.md"), content).unwrap();
|
||||
crate::db::ensure_content_store();
|
||||
crate::db::write_content("51_story_no_branch", content);
|
||||
crate::db::write_item_with_content("51_story_no_branch", "2_current", content);
|
||||
|
||||
let ctx = test_ctx(tmp.path());
|
||||
let result = tool_accept_story(&json!({"story_id": "51_story_no_branch"}), &ctx);
|
||||
|
||||
Reference in New Issue
Block a user