Repository navigation
refactor: split the bot's Slack code into slack/, announcing/ and answering/ - #134
Merged
Merged
Conversation
ChristopherPHolder
enabled auto-merge (squash)
October 31, 2026 11:57
This was referenced Oct 31, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What and why
Closes #129.
Fourteen Slack-related modules sat flat in
apps/bot/src. Posting what the office did, answering people, and Slack's own API were only told apart in the docs. They're now three folders, each with anindex.tsthat is its interface:src/slack/: the adapter for Slack's Web API and Socket Mode, plus the bot's posts and history. Holds SlackClient, SlackSocket, SlackEvent, SlackMessage, BotPosts and SlackHistory.src/announcing/: announcements, reminders and banter. Holds SlackNotifier, HeadlineWriter, Banter, Reminder and the newAnnouncement.ts. Itsindex.tsgives Programbanter,remindersandSlackNotifier.src/answering/: answering in Slack. Holds Responder, ReplyDecider, CloudflareDecisionModel, ReplyWriter and the newReplyMessage.ts. Itsindex.tsexportsResponderLayer.SlackMessageheld three things, so it's split the same way the recording post was in #133:slack/SlackMessage.tskeeps the Block Kit pieces and escaping.announcing/Announcement.tsbuilds the announcement, reminder and banter messages, with their fixed phrasings.answering/ReplyMessage.tsbuilds the reply.Each
index.tsexports only what code outside its folder uses, and that code now imports through it. Tests mirror the folders and still test internals directly. Service keys follow the paths (bot/slack/SlackClientand so on).docs/architecture.mdgroups the module tables by folder.Behaviour doesn't change.
How I tested it
formatMessagetests moved totest/announcing/Announcement.test.ts.pnpm vp run cipasses, including the bundle build.Checklist
vp run cipasses