From 204a99c2e7afadd0f340222d0bc2c208f1fc1ab1 Mon Sep 17 00:00:00 2001 From: dave Date: Fri, 27 Mar 2026 14:35:06 +0000 Subject: [PATCH] storkit: create 412_story_recheck_bot_command_to_re_run_gates_without_restarting_agent --- ...nd_slack_missing_rmtree_command_handler.md | 37 ---------- ..._split_whatsapp_rs_into_focused_modules.md | 67 ------------------- ...o_re_run_gates_without_restarting_agent.md | 1 + 3 files changed, 1 insertion(+), 104 deletions(-) delete mode 100644 .storkit/work/1_backlog/403_bug_whatsapp_and_slack_missing_rmtree_command_handler.md delete mode 100644 .storkit/work/1_backlog/409_refactor_split_whatsapp_rs_into_focused_modules.md diff --git a/.storkit/work/1_backlog/403_bug_whatsapp_and_slack_missing_rmtree_command_handler.md b/.storkit/work/1_backlog/403_bug_whatsapp_and_slack_missing_rmtree_command_handler.md deleted file mode 100644 index ab7d6a9e..00000000 --- a/.storkit/work/1_backlog/403_bug_whatsapp_and_slack_missing_rmtree_command_handler.md +++ /dev/null @@ -1,37 +0,0 @@ ---- -name: "WhatsApp and Slack missing rmtree command handler" -retry_count: 0 -blocked: false ---- - -# Bug 403: WhatsApp and Slack missing rmtree command handler - -## Description - -The rmtree command has a fallback handler in chat/commands/mod.rs that returns None. Only Matrix has pre-dispatch handling for this command. On WhatsApp and Slack, the command falls through to the LLM path. - -## Implementation Note - -Follow the **rebuild pattern** established in story 402. - -- `extract_rmtree_command` and `handle_rmtree` already exist in `server/src/chat/transport/matrix/rmtree.rs` -- Add an async intercept in `server/src/chat/transport/whatsapp.rs` (see rebuild intercept ~line 1107) and `server/src/chat/transport/slack.rs` (see rebuild intercept ~line 845) -- Call `crate::chat::transport::matrix::rmtree::extract_rmtree_command` to detect the command, then `crate::chat::transport::matrix::rmtree::handle_rmtree` to execute it -- The fallback handler in `chat/commands/mod.rs` (`handle_rmtree_fallback`) stays as-is — it exists only so `help` lists the command - -## How to Reproduce - -1. Configure bot with transport = "whatsapp" or "slack"\n2. Send "rmtree " to the bot\n3. Check server logs - -## Actual Result - -Command falls through to LLM instead of removing the worktree. - -## Expected Result - -The bot removes the worktree for the specified story and replies with confirmation. - -## Acceptance Criteria - -- [ ] WhatsApp transport handles rmtree command: removes worktree and replies with confirmation -- [ ] Slack transport handles rmtree command: removes worktree and replies with confirmation diff --git a/.storkit/work/1_backlog/409_refactor_split_whatsapp_rs_into_focused_modules.md b/.storkit/work/1_backlog/409_refactor_split_whatsapp_rs_into_focused_modules.md deleted file mode 100644 index c4b38607..00000000 --- a/.storkit/work/1_backlog/409_refactor_split_whatsapp_rs_into_focused_modules.md +++ /dev/null @@ -1,67 +0,0 @@ ---- -name: "Split whatsapp.rs into focused modules" ---- - -# Refactor 409: Split whatsapp.rs into focused modules - -## Current State - -- TBD - -## Desired State - -whatsapp.rs is 2000+ lines making it expensive for agents to navigate and edit. Split into focused modules under chat/transport/whatsapp/. - -## Acceptance Criteria - -- [x] mod.rs contains webhook handlers, WebhookContext, and re-exports -- [x] meta.rs contains WhatsAppTransport, ChatTransport impl, and Graph API structs/calls -- [x] twilio.rs contains TwilioWhatsAppTransport, ChatTransport impl, and Twilio structs/calls -- [x] history.rs contains WhatsAppConversationHistory, load/save_whatsapp_history, and MessagingWindowTracker -- [x] commands.rs contains handle_incoming_message, handle_llm_message, and all async command dispatch -- [x] format.rs contains markdown_to_whatsapp and chunk_for_whatsapp -- [x] All existing tests pass -- [x] No behaviour changes — pure structural refactor - -## Out of Scope - -- TBD - -## Test Results - - - -### Unit Tests (28 passed, 0 failed) - -- ✅ whatsapp::format::tests::chunk_short_message_returns_single_chunk -- ✅ whatsapp::format::tests::chunk_exactly_at_limit_returns_single_chunk -- ✅ whatsapp::format::tests::chunk_splits_on_paragraph_boundary -- ✅ whatsapp::format::tests::chunk_splits_on_line_boundary_when_no_paragraph_break -- ✅ whatsapp::format::tests::chunk_hard_splits_continuous_text -- ✅ whatsapp::format::tests::chunk_empty_string_returns_single_empty -- ✅ whatsapp::format::tests::md_to_wa_converts_headers_to_bold -- ✅ whatsapp::format::tests::md_to_wa_converts_bold -- ✅ whatsapp::format::tests::md_to_wa_converts_bold_italic -- ✅ whatsapp::format::tests::md_to_wa_converts_strikethrough -- ✅ whatsapp::format::tests::md_to_wa_converts_links -- ✅ whatsapp::format::tests::md_to_wa_removes_horizontal_rules -- ✅ whatsapp::format::tests::md_to_wa_preserves_inline_code -- ✅ whatsapp::format::tests::md_to_wa_preserves_code_blocks -- ✅ whatsapp::format::tests::md_to_wa_mixed_message -- ✅ whatsapp::format::tests::md_to_wa_passthrough_plain_text -- ✅ whatsapp::history::tests::messaging_window_tracker_basics -- ✅ whatsapp::history::tests::messaging_window_tracker_expiry -- ✅ whatsapp::history::tests::messaging_window_tracker_reset -- ✅ whatsapp::history::tests::load_empty_history -- ✅ whatsapp::history::tests::save_and_load_history -- ✅ whatsapp::twilio::tests::parse_twilio_form_valid -- ✅ whatsapp::twilio::tests::parse_twilio_form_missing_body -- ✅ whatsapp::twilio::tests::parse_twilio_form_missing_from -- ✅ whatsapp::commands::tests::parse_command_help -- ✅ whatsapp::commands::tests::parse_command_status -- ✅ whatsapp::commands::tests::parse_command_unknown -- ✅ whatsapp::mod::tests::webhook_context_basics - -### Integration Tests (0 passed, 0 failed) - -*No integration tests recorded.* diff --git a/.storkit/work/1_backlog/412_story_recheck_bot_command_to_re_run_gates_without_restarting_agent.md b/.storkit/work/1_backlog/412_story_recheck_bot_command_to_re_run_gates_without_restarting_agent.md index bd484dbc..2c05b89c 100644 --- a/.storkit/work/1_backlog/412_story_recheck_bot_command_to_re_run_gates_without_restarting_agent.md +++ b/.storkit/work/1_backlog/412_story_recheck_bot_command_to_re_run_gates_without_restarting_agent.md @@ -17,6 +17,7 @@ As a user, I want to send `recheck ` to the bot so that it re-runs accep - [ ] If no worktree exists for the story, returns a clear error - [ ] Does not spawn a new agent or increment retry_count - [ ] Works from all transports (Matrix, WhatsApp, Slack) +- [ ] Works from web UI slash commands (if slash command dispatch is wired up) ## Out of Scope