From 87b56481238ec6279233f3a7e33c0c8840bf18d6 Mon Sep 17 00:00:00 2001 From: dave Date: Sun, 22 Mar 2026 22:37:56 +0000 Subject: [PATCH] storkit: merge 367_story_rename_bot_whatsup_command_to_status --- server/src/matrix/commands/mod.rs | 7 +------ server/src/matrix/commands/status.rs | 6 +++++- server/src/matrix/commands/whatsup.rs | 20 ++++++++++---------- 3 files changed, 16 insertions(+), 17 deletions(-) diff --git a/server/src/matrix/commands/mod.rs b/server/src/matrix/commands/mod.rs index 2d9f2b2..f1b0b69 100644 --- a/server/src/matrix/commands/mod.rs +++ b/server/src/matrix/commands/mod.rs @@ -89,7 +89,7 @@ pub fn commands() -> &'static [BotCommand] { }, BotCommand { name: "status", - description: "Show pipeline status and agent availability", + description: "Show pipeline status and agent availability; or `status ` for a story triage dump", handler: status::handle_status, }, BotCommand { @@ -127,11 +127,6 @@ pub fn commands() -> &'static [BotCommand] { description: "Show implementation summary for a merged story: `overview `", handler: overview::handle_overview, }, - BotCommand { - name: "whatsup", - description: "Show in-progress triage dump for a story: `whatsup `", - handler: whatsup::handle_whatsup, - }, BotCommand { name: "start", description: "Start a coder on a story: `start ` or `start opus`", diff --git a/server/src/matrix/commands/status.rs b/server/src/matrix/commands/status.rs index 52adf8b..89f535a 100644 --- a/server/src/matrix/commands/status.rs +++ b/server/src/matrix/commands/status.rs @@ -7,7 +7,11 @@ use std::collections::{HashMap, HashSet}; use super::CommandContext; pub(super) fn handle_status(ctx: &CommandContext) -> Option { - Some(build_pipeline_status(ctx.project_root, ctx.agents)) + if ctx.args.trim().is_empty() { + Some(build_pipeline_status(ctx.project_root, ctx.agents)) + } else { + super::whatsup::handle_whatsup(ctx) + } } /// Format a short display label for a work item. diff --git a/server/src/matrix/commands/whatsup.rs b/server/src/matrix/commands/whatsup.rs index d27a652..05f7f14 100644 --- a/server/src/matrix/commands/whatsup.rs +++ b/server/src/matrix/commands/whatsup.rs @@ -15,13 +15,13 @@ pub(super) fn handle_whatsup(ctx: &CommandContext) -> Option { let num_str = ctx.args.trim(); if num_str.is_empty() { return Some(format!( - "Usage: `{} whatsup `\n\nShows a triage dump for a story currently in progress.", + "Usage: `{} status `\n\nShows a triage dump for a story currently in progress.", ctx.bot_name )); } if !num_str.chars().all(|c| c.is_ascii_digit()) { return Some(format!( - "Invalid story number: `{num_str}`. Usage: `{} whatsup `", + "Invalid story number: `{num_str}`. Usage: `{} status `", ctx.bot_name )); } @@ -293,7 +293,7 @@ mod tests { ambient_rooms: &ambient_rooms, room_id: &room_id, }; - try_handle_command(&dispatch, &format!("@timmy whatsup {args}")) + try_handle_command(&dispatch, &format!("@timmy status {args}")) } fn write_story_file(root: &Path, stage: &str, filename: &str, content: &str) { @@ -305,13 +305,13 @@ mod tests { // -- registration ------------------------------------------------------- #[test] - fn whatsup_command_is_registered() { + fn whatsup_command_is_not_registered() { let found = super::super::commands().iter().any(|c| c.name == "whatsup"); - assert!(found, "whatsup command must be in the registry"); + assert!(!found, "whatsup command must not be in the registry (renamed to status)"); } #[test] - fn whatsup_command_appears_in_help() { + fn status_command_appears_in_help() { let result = super::super::tests::try_cmd_addressed( "Timmy", "@timmy:homeserver.local", @@ -319,8 +319,8 @@ mod tests { ); let output = result.unwrap(); assert!( - output.contains("whatsup"), - "help should list whatsup command: {output}" + output.contains("status"), + "help should list status command: {output}" ); } @@ -331,8 +331,8 @@ mod tests { let tmp = tempfile::TempDir::new().unwrap(); let output = whatsup_cmd(tmp.path(), "").unwrap(); assert!( - output.contains("Usage"), - "no args should show usage: {output}" + output.contains("Pipeline Status"), + "no args should show pipeline status: {output}" ); }