From 52e73bfbea01259d9812b6ff097dea678501736c Mon Sep 17 00:00:00 2001 From: dave Date: Tue, 24 Mar 2026 11:06:43 +0000 Subject: [PATCH] storkit: merge 376_story_rename_mcp_whatsup_tool_to_status_for_consistency --- server/src/http/mcp/mod.rs | 8 +++--- .../mcp/{whatsup_tools.rs => status_tools.rs} | 10 +++---- server/src/matrix/commands/mod.rs | 2 +- server/src/matrix/commands/status.rs | 2 +- .../matrix/commands/{whatsup.rs => triage.rs} | 26 +++++++++---------- 5 files changed, 24 insertions(+), 24 deletions(-) rename server/src/http/mcp/{whatsup_tools.rs => status_tools.rs} (96%) rename server/src/matrix/commands/{whatsup.rs => triage.rs} (95%) diff --git a/server/src/http/mcp/mod.rs b/server/src/http/mcp/mod.rs index ddb9ed2..b8147b8 100644 --- a/server/src/http/mcp/mod.rs +++ b/server/src/http/mcp/mod.rs @@ -15,7 +15,7 @@ pub mod merge_tools; pub mod qa_tools; pub mod shell_tools; pub mod story_tools; -pub mod whatsup_tools; +pub mod status_tools; /// Returns true when the Accept header includes text/event-stream. fn wants_sse(req: &Request) -> bool { @@ -1124,7 +1124,7 @@ fn handle_tools_list(id: Option) -> JsonRpcResponse { } }, { - "name": "whatsup", + "name": "status", "description": "Get a full triage dump for an in-progress story: front matter, AC checklist, active worktree/branch, git diff --stat since master, last 5 commits, and last 20 lines of the most recent agent log. Returns a clear error if the story is not in work/2_current/.", "inputSchema": { "type": "object", @@ -1225,7 +1225,7 @@ async fn handle_tools_call( "git_commit" => git_tools::tool_git_commit(&args, ctx).await, "git_log" => git_tools::tool_git_log(&args, ctx).await, // Story triage - "whatsup" => whatsup_tools::tool_whatsup(&args, ctx).await, + "status" => status_tools::tool_status(&args, ctx).await, _ => Err(format!("Unknown tool: {tool_name}")), }; @@ -1341,7 +1341,7 @@ mod tests { assert!(names.contains(&"git_add")); assert!(names.contains(&"git_commit")); assert!(names.contains(&"git_log")); - assert!(names.contains(&"whatsup")); + assert!(names.contains(&"status")); assert_eq!(tools.len(), 49); } diff --git a/server/src/http/mcp/whatsup_tools.rs b/server/src/http/mcp/status_tools.rs similarity index 96% rename from server/src/http/mcp/whatsup_tools.rs rename to server/src/http/mcp/status_tools.rs index 5413603..7dc6b33 100644 --- a/server/src/http/mcp/whatsup_tools.rs +++ b/server/src/http/mcp/status_tools.rs @@ -150,7 +150,7 @@ async fn git_branch(dir: &Path) -> Option { .flatten() } -pub(super) async fn tool_whatsup(args: &Value, ctx: &AppContext) -> Result { +pub(super) async fn tool_status(args: &Value, ctx: &AppContext) -> Result { let story_id = args .get("story_id") .and_then(|v| v.as_str()) @@ -323,16 +323,16 @@ mod tests { } #[tokio::test] - async fn tool_whatsup_returns_error_for_missing_story() { + async fn tool_status_returns_error_for_missing_story() { let tmp = tempdir().unwrap(); let ctx = crate::http::context::AppContext::new_test(tmp.path().to_path_buf()); - let result = tool_whatsup(&json!({"story_id": "999_story_nonexistent"}), &ctx).await; + let result = tool_status(&json!({"story_id": "999_story_nonexistent"}), &ctx).await; assert!(result.is_err()); assert!(result.unwrap_err().contains("not found in work/2_current/")); } #[tokio::test] - async fn tool_whatsup_returns_story_data() { + async fn tool_status_returns_story_data() { let tmp = tempdir().unwrap(); let current_dir = tmp .path() @@ -345,7 +345,7 @@ mod tests { fs::write(current_dir.join("42_story_test.md"), story_content).unwrap(); let ctx = crate::http::context::AppContext::new_test(tmp.path().to_path_buf()); - let result = tool_whatsup(&json!({"story_id": "42_story_test"}), &ctx) + let result = tool_status(&json!({"story_id": "42_story_test"}), &ctx) .await .unwrap(); let parsed: serde_json::Value = serde_json::from_str(&result).unwrap(); diff --git a/server/src/matrix/commands/mod.rs b/server/src/matrix/commands/mod.rs index f1b0b69..8b582d2 100644 --- a/server/src/matrix/commands/mod.rs +++ b/server/src/matrix/commands/mod.rs @@ -14,7 +14,7 @@ mod move_story; mod overview; mod show; mod status; -mod whatsup; +mod triage; use crate::agents::AgentPool; use std::collections::HashSet; diff --git a/server/src/matrix/commands/status.rs b/server/src/matrix/commands/status.rs index e9617ce..f56dbb0 100644 --- a/server/src/matrix/commands/status.rs +++ b/server/src/matrix/commands/status.rs @@ -10,7 +10,7 @@ pub(super) fn handle_status(ctx: &CommandContext) -> Option { if ctx.args.trim().is_empty() { Some(build_pipeline_status(ctx.project_root, ctx.agents)) } else { - super::whatsup::handle_whatsup(ctx) + super::triage::handle_triage(ctx) } } diff --git a/server/src/matrix/commands/whatsup.rs b/server/src/matrix/commands/triage.rs similarity index 95% rename from server/src/matrix/commands/whatsup.rs rename to server/src/matrix/commands/triage.rs index 05f7f14..0371ea1 100644 --- a/server/src/matrix/commands/whatsup.rs +++ b/server/src/matrix/commands/triage.rs @@ -1,4 +1,4 @@ -//! Handler for the `whatsup` command. +//! Handler for the story triage dump subcommand of `status`. //! //! Produces a triage dump for a story that is currently in-progress //! (`work/2_current/`): metadata, acceptance criteria, worktree/branch state, @@ -10,8 +10,8 @@ use super::CommandContext; use std::path::{Path, PathBuf}; use std::process::Command; -/// Handle `{bot_name} whatsup {number}`. -pub(super) fn handle_whatsup(ctx: &CommandContext) -> Option { +/// Handle `{bot_name} status {number}`. +pub(super) fn handle_triage(ctx: &CommandContext) -> Option { let num_str = ctx.args.trim(); if num_str.is_empty() { return Some(format!( @@ -281,7 +281,7 @@ mod tests { use super::super::{CommandDispatch, try_handle_command}; - fn whatsup_cmd(root: &Path, args: &str) -> Option { + fn status_triage_cmd(root: &Path, args: &str) -> Option { let agents = Arc::new(AgentPool::new_test(3000)); let ambient_rooms = Arc::new(Mutex::new(HashSet::new())); let room_id = "!test:example.com".to_string(); @@ -329,7 +329,7 @@ mod tests { #[test] fn whatsup_no_args_returns_usage() { let tmp = tempfile::TempDir::new().unwrap(); - let output = whatsup_cmd(tmp.path(), "").unwrap(); + let output = status_triage_cmd(tmp.path(), "").unwrap(); assert!( output.contains("Pipeline Status"), "no args should show pipeline status: {output}" @@ -339,7 +339,7 @@ mod tests { #[test] fn whatsup_non_numeric_returns_error() { let tmp = tempfile::TempDir::new().unwrap(); - let output = whatsup_cmd(tmp.path(), "abc").unwrap(); + let output = status_triage_cmd(tmp.path(), "abc").unwrap(); assert!( output.contains("Invalid"), "non-numeric arg should return error: {output}" @@ -358,7 +358,7 @@ mod tests { "42_story_not_in_current.md", "---\nname: Not in current\n---\n", ); - let output = whatsup_cmd(tmp.path(), "42").unwrap(); + let output = status_triage_cmd(tmp.path(), "42").unwrap(); assert!( output.contains("42"), "message should include story number: {output}" @@ -380,7 +380,7 @@ mod tests { "99_story_my_feature.md", "---\nname: My Feature\n---\n\n## Acceptance Criteria\n\n- [ ] First thing\n- [x] Done thing\n", ); - let output = whatsup_cmd(tmp.path(), "99").unwrap(); + let output = status_triage_cmd(tmp.path(), "99").unwrap(); assert!(output.contains("99"), "should show story number: {output}"); assert!( output.contains("My Feature"), @@ -401,7 +401,7 @@ mod tests { "99_story_criteria_test.md", "---\nname: Criteria Test\n---\n\n- [ ] First thing\n- [x] Done thing\n- [ ] Second thing\n", ); - let output = whatsup_cmd(tmp.path(), "99").unwrap(); + let output = status_triage_cmd(tmp.path(), "99").unwrap(); assert!( output.contains("First thing"), "should show unchecked criterion: {output}" @@ -426,7 +426,7 @@ mod tests { "55_story_blocked_story.md", "---\nname: Blocked Story\nblocked: true\n---\n", ); - let output = whatsup_cmd(tmp.path(), "55").unwrap(); + let output = status_triage_cmd(tmp.path(), "55").unwrap(); assert!( output.contains("blocked"), "should show blocked field: {output}" @@ -442,7 +442,7 @@ mod tests { "55_story_agent_story.md", "---\nname: Agent Story\nagent: coder-1\n---\n", ); - let output = whatsup_cmd(tmp.path(), "55").unwrap(); + let output = status_triage_cmd(tmp.path(), "55").unwrap(); assert!( output.contains("coder-1"), "should show agent field: {output}" @@ -458,7 +458,7 @@ mod tests { "77_story_no_worktree.md", "---\nname: No Worktree\n---\n", ); - let output = whatsup_cmd(tmp.path(), "77").unwrap(); + let output = status_triage_cmd(tmp.path(), "77").unwrap(); // Branch name should still appear assert!( output.contains("feature/story-77"), @@ -475,7 +475,7 @@ mod tests { "77_story_no_log.md", "---\nname: No Log\n---\n", ); - let output = whatsup_cmd(tmp.path(), "77").unwrap(); + let output = status_triage_cmd(tmp.path(), "77").unwrap(); assert!( output.contains("no log") || output.contains("No log") || output.contains("*(no log found)*"), "should indicate no log exists: {output}"