Consolidated recommendations from md-database, md-discord, and md-league advisors into a sequenced roadmap: immediate PR backlog merge, near-term foundation work (test coverage, connection management, website CI/CD), medium-term architecture (service layer, monolith decomposition), and future major features (gameplay simulation, draft modernization). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
4.2 KiB
4.2 KiB
Major Domo — Roadmap
Last updated: 2026-03-24
Current State
Major Domo manages the SBA (Strat-o-Matic Baseball Association) fantasy baseball league through a Discord bot, FastAPI database API, and Vue.js website. The system handles team rosters, player transactions, trades, dice rolling, standings, schedules, and game results.
Bot: v2.29.9 — mature, full slash command coverage Database API: v2.7.0 — stable, PostgreSQL-backed Website: v2.1.1 — functional, covers core league info
Roadmap
Immediate — Merge PR Backlog
All three domain advisors flagged this independently as the top priority.
- Database security PRs: hardcoded webhook URL (#56), hardcoded DB password (#55), token leakage in logs (#45)
- Database connection fix: double-close bug (#42)
- Database bug/perf PRs: N+1 query fix (#51), dead code cleanup (#48), debug print removal (#53), unimplemented param removal (#57), pitching stats 500 fix (#67), sort validation (#68)
- Bot performance PRs: caching + league state (#120), N+1 in decision_service (#118), redundant trade view calls (#116), GET-after-POST elimination (#112)
- Prettify
/teamembed (issue #41) — oldest open issue, small, high visibility
Deploy sequence: database security → database fixes → bot performance PRs.
Near Term — Foundation
- Database API test coverage — zero automated router/endpoint tests today. Stand up TestClient fixture, cover critical paths (player CRUD, roster moves, standings, transactions, stats). Pattern exists in
tests/integration/test_stratplay_routes.py. - Centralize DB connection management — 180 manual
db.close()calls scattered across 28 files. Implement FastAPI middleware to handle connection lifecycle, then sweep manual calls. Builds on PR #42. - Website CI/CD pipeline — only component without Gitea Actions. Reuse
cal/gitea-actionspatterns (CalVer, docker-tags, discord-notify). Prerequisite for expanding website features. - Bot DI refactor +
@requires_teamfix (issues #34, #57) — circular import inutils/permissions.pyblocks 2 integration tests covering the transaction command path. Fix via DI parameter injection. - Migrate
StandingsServicetoBaseService— only service not using the base pattern, can't use Redis caching decorators. Replace in-memory workaround from PR #120.
Medium Term — Architecture
- Decompose
transaction_freeze.py(1,216 lines) — scheduling, freeze/thaw orchestration, contest resolution, notifications, and execution all in one file. Split into focused modules:freeze_orchestrator.py,transaction_executor.py,freeze_notifications.py. - Expand service layer beyond players/teams — 23 of 25 database routers embed business logic directly. Prioritize by traffic: transactions, battingstats, pitchingstats, standings.
- Break up
db_engine.py(2,738 lines) — every ORM model, CSV utilities, season filtering, roster logic, standings calculations in one file. Split intomodels/package with one file per domain. Do after service layer expansion so extracted logic has a clear home. - Website feature pages — API endpoints already exist for rosters, draft board/history, injury reports, and awards. Build Vue views + service files. Most valuable before next draft season.
Future — Major Features
- Gameplay simulation migration — the core Strat-o-Matic at-bat simulation from legacy bot v1. Scorebug/scorecard foundation exists in v2 but full simulation loop is incomplete. Highest-value feature for league engagement. Target: Season 13.
- Draft system modernization — automated draft room, timer-based picks, keeper integration. Currently handled externally.
- Player comparison command — low usage historically but requested
- Historical records and awards pages — website growth feature
Completed
- 2026-03-24: Umbrella repo reorganization — initialized
cal/major-domo-umbrella, archived legacy files, rewrote CLAUDE.md, created specialized PO agents (md-database, md-discord, md-league, md-ops)