storkit: create 413_refactor_split_slack_rs_into_focused_modules

This commit is contained in:
dave
2026-03-27 14:59:06 +00:00
parent fca46c3806
commit b4eeb499e9
2 changed files with 29 additions and 36 deletions
@@ -1,36 +0,0 @@
---
name: "WhatsApp and Slack missing assign command handler"
---
# Bug 404: WhatsApp and Slack missing assign command handler
## Description
The assign 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_assign_command` and `handle_assign` already exist in `server/src/chat/transport/matrix/assign.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::assign::extract_assign_command` to detect the command, then `crate::chat::transport::matrix::assign::handle_assign` to execute it
- The fallback handler in `chat/commands/mod.rs` (`handle_assign_fallback` — note: the registry entry for `assign` currently calls `assign::handle_assign` synchronously; verify this doesn't conflict) stays as-is for `help` listing
- The fallback in `chat/commands/assign.rs` may need to return `None` instead of a real response once the async path handles it
## How to Reproduce
1. Configure bot with transport = "whatsapp" or "slack"\n2. Send "assign <story_id> <agent>" to the bot\n3. Check server logs
## Actual Result
Command falls through to LLM instead of assigning the agent.
## Expected Result
The bot assigns the specified agent to the story and replies with confirmation.
## Acceptance Criteria
- [ ] WhatsApp transport handles assign command: assigns agent and replies with confirmation
- [ ] Slack transport handles assign command: assigns agent and replies with confirmation
@@ -0,0 +1,29 @@
---
name: "Split slack.rs into focused modules"
---
# Refactor 413: Split slack.rs into focused modules
## Current State
- TBD
## Desired State
Refactor the monolithic server/src/chat/transport/slack.rs (1902 lines) into a slack/ directory with focused modules, mirroring the whatsapp/ module structure from story 409.
## Acceptance Criteria
- [ ] slack.rs is replaced by a slack/ directory with mod.rs re-exporting all public types
- [ ] meta.rs contains SlackTransport struct, ChatTransport trait impl, and Slack API request/response types
- [ ] commands.rs contains incoming message dispatch, permission logic, and slash command handling
- [ ] format.rs contains markdown_to_slack() conversion
- [ ] history.rs contains load_slack_history(), save_slack_history(), and SlackHistoryDump
- [ ] verify.rs contains verify_slack_signature(), sha256(), and constant_time_eq()
- [ ] mod.rs contains Slack event types, webhook handlers, and SlackWebhookContext
- [ ] All existing tests are preserved and pass in their respective modules
- [ ] No public API changes — all existing imports from other crates continue to work
## Out of Scope
- TBD