storkit: done 392_refactor_extract_shared_transport_utilities_from_matrix_module_into_chat_submodule

This commit is contained in:
dave
2026-03-25 14:46:06 +00:00
parent 077288e7b7
commit f05c6a42b0
@@ -0,0 +1,27 @@
---
name: "Extract shared transport utilities from matrix module into chat submodule"
agent: "coder-opus"
---
# Refactor 392: Extract shared transport utilities from matrix module into chat submodule
## Current State
- TBD
## Desired State
Several functions currently living in the matrix transport module are used by all transports (WhatsApp, Slack, Matrix). These should be pulled up into a shared location under the chat module. Candidates include: strip_prefix_ci, strip_bot_mention, try_handle_command, drain_complete_paragraphs, markdown_to_whatsapp (pattern could generalize), chunk_for_whatsapp, and the command dispatch infrastructure. A chat::util or chat::text submodule would be a natural home for string utilities like strip_prefix_ci. The command dispatch (try_handle_command, CommandDispatch, BotCommand registry) could live in chat::commands.
## Acceptance Criteria
- [ ] Shared string utilities (strip_prefix_ci, strip_bot_mention, drain_complete_paragraphs) moved to a chat::util or chat::text submodule
- [ ] Command dispatch infrastructure (try_handle_command, CommandDispatch, BotCommand, command registry) moved to chat::commands
- [ ] Per-transport formatting functions (markdown_to_whatsapp, markdown_to_slack) remain in their respective transport modules
- [ ] All transports import from the new shared location instead of reaching into matrix::
- [ ] No functional changes — purely structural refactor
- [ ] All existing tests pass and move with their code
## Out of Scope
- TBD