#130 · Extract breakout-room handlers from command-handler.ts (3rd capability split)
Last checked with GitLab: . Status comes from GitLab using a 2-minute cache. Merge events clear affected cached statuses. An already-open page does not update itself. Refresh page.
An MR completes this bounty when it is merged into main with Closes #130 and GitLab closes the issue. A mention or an updated timestamp is not completion. Awarded points appear in Activity.
cp .dev.vars.example .dev.vars && pnpm dev, after rebasing on main) and fully test your change before opening the MR.
Description
Background
\apps/signal-bot/src/src/bot/command-handler.ts\ is 32,122 lines (was 33,239). Two capabilities have been extracted following the pattern documented in \apps/signal-bot/CLAUDE.md\ § "Capability extraction pattern":
- v5.13.9: \
commands/games/dice.ts\(12 handlers, 791 lines) - v5.13.10: \
commands/games/rps.ts\(4 handlers, 411 lines)
Breakouts is the next obvious target. It's the largest remaining single capability cluster — entangled with broadcast, decision/objective annotations, task management, and the question/answer system.
Scope challenges
A clean breakouts extraction needs to decide:
- Where to draw the boundary. \
handleBreakout\dispatches to \handleQuestionBreakout\and \handleShareQuestion\(Q&A commands, not breakouts) and \handleBroadcastBreakout\(400 lines on its own). Possible splits:
- Narrow: just \
handleBreakout\, \handleEndBreakout\, \handleBreakouts\, \handleBreakoutExtend\(~310 lines, leaves the entangled dispatchers calling back into \this.X\through deps) - Wide: include \
handleBroadcastBreakout\+ \handleBreakoutAnnotation\(~1500 lines, cleaner but bigger PR) - Co-located: also pull \
handleObjective\, \handleListObjectives\, \handleTaskStatusChange\, \handleTaskPriority\, \handleTaskAssign\since they share state with breakouts via \breakoutManager\(~2200 lines, completes the cluster)
The wide or co-located split is structurally cleaner but the narrow one ships faster. Recommend wide with the question-handler callbacks kept on the parent via deps (same pattern as dice's \handleCommandError\).
- \
BreakoutDeps\interface is similar to RPS (\bot, dbClient, breakoutManager, getRoomSettings\) plus \announcementHandler\and bound callbacks for \handleQuestionBreakout\/ \handleShareQuestion\if narrow scope.
Acceptance
- New file \
apps/signal-bot/src/src/bot/commands/groups/breakouts.ts\(or similar — see existing \commands/admin/\, \commands/games/\for conventions) - The chosen scope's handlers exported as \
async function handleX(args, context, BreakoutDeps): Promise<CommandResponse>\ - command-handler.ts switch cases route through \
breakouts.handleX(args, context, this.breakoutDeps())\ - \
pnpm turbo typecheck\green - \
cd apps/signal-bot/src && npx tsc --noEmit\— only the 11 pre-existing errors remain - command-handler.ts line count drops by the scope's size
Bounty: L
Architecturally the most-coupled extraction. Estimate 1-2 days depending on chosen scope.
Getting Started (added for pickup-readiness)
Path note: code + the "Capability extraction pattern" doc are now under
selfhost/messaging-apps/signal-messenger/(notapps/signal-bot/).
Verify note: the "only the 11 pre-existing errors remain" check above is stale — those 11
were resolved in #133. Per current CLAUDE.md, a bare checkout's npx tsc --noEmit instead shows
~40 Cannot find module '@irregularchat/shared-utils' errors (the vendor symlink is populated at
deploy time). Compare the error *count* to a pre-change baseline rather than expecting "11".
- Pattern + exemplars:
src/src/bot/commands/games/dice.ts,commands/games/rps.ts; - Recommended scope: wide (per Scope challenges), Q&A dispatcher callbacks kept on the parent via deps.
- Verify:
pnpm turbo typecheck;cd selfhost/messaging-apps/signal-messenger/src && npx tsc --noEmit
doc at selfhost/messaging-apps/signal-messenger/CLAUDE.md § "Capability extraction pattern".
(baseline-compare per the note); confirm command-handler.ts line count drops and breakout commands behave identically.
Prepared for pickup by 🤖 GearSmith's Goal-Tender (Claude).
Relevant files
No relevant files linked yet.
Hints
No hints yet.
Activity
No points have been awarded for this bounty yet.
Comments
Sign in to join the discussion.
No comments yet. Be the first to weigh in.