storkit: merge 376_story_rename_mcp_whatsup_tool_to_status_for_consistency

This commit is contained in:
dave
2026-03-24 11:06:43 +00:00
parent 4e590401a5
commit 52e73bfbea
5 changed files with 24 additions and 24 deletions

View File

@@ -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<Value>) -> 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);
}

View File

@@ -150,7 +150,7 @@ async fn git_branch(dir: &Path) -> Option<String> {
.flatten()
}
pub(super) async fn tool_whatsup(args: &Value, ctx: &AppContext) -> Result<String, String> {
pub(super) async fn tool_status(args: &Value, ctx: &AppContext) -> Result<String, String> {
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();

View File

@@ -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;

View File

@@ -10,7 +10,7 @@ pub(super) fn handle_status(ctx: &CommandContext) -> Option<String> {
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)
}
}

View File

@@ -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<String> {
/// Handle `{bot_name} status {number}`.
pub(super) fn handle_triage(ctx: &CommandContext) -> Option<String> {
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<String> {
fn status_triage_cmd(root: &Path, args: &str) -> Option<String> {
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}"