Phase 05: Multi-Model Discussions - 4 plans created - 11 total tasks defined - Covers M4 (open/parallel), M5 (discuss/sequential), M8 (@mentions) - Ready for execution Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
3.7 KiB
| phase | plan | type |
|---|---|---|
| 05-multi-model-discussions | 01 | execute |
Purpose: Establish the data layer that all multi-model discussion commands depend on. Output: Working discussion service with create/get/list operations for discussions, rounds, and messages.
<execution_context> ~/.claude/get-shit-done/workflows/execute-phase.md ~/.claude/get-shit-done/templates/summary.md </execution_context>
@.planning/PROJECT.md @.planning/ROADMAP.md @.planning/STATE.mdPrior phase context:
@.planning/phases/04-single-model-qa/04-02-SUMMARY.md
Key files:
@src/moai/core/models.py @src/moai/core/services/project.py @src/moai/core/database.py
Tech stack available: sqlalchemy, aiosqlite, python-telegram-bot Established patterns: Service layer pattern (core/services/), async context manager for sessions, module-level singleton Constraining decisions:
- 03-01: Service layer pattern for database operations
- 01-03: expire_on_commit=False for async session usability
Use selectinload for eager loading rounds→messages to avoid N+1 queries. Follow existing async context manager pattern from project.py. Import service in Python REPL, verify functions exist and type hints correct discussion.py exists with 5 async functions, proper type hints, uses selectinload for relationships
Task 2: Add round and message operations to discussion service src/moai/core/services/discussion.py Add to discussion.py: - create_round(discussion_id, round_number, round_type) - creates Round with RoundType enum - get_current_round(discussion_id) - returns highest round_number Round for discussion - create_message(round_id, model, content, is_direct=False) - creates Message - get_round_messages(round_id) - returns messages for a round ordered by timestampAll functions follow same async context manager pattern. Use proper enum imports from models.py. Import service, verify all 4 new functions exist with correct signatures discussion.py has 9 total functions (5 discussion + 4 round/message), all async with proper types
Before declaring plan complete: - [ ] `python -c "from moai.core.services.discussion import *"` succeeds - [ ] All 9 functions have async def signatures - [ ] Type hints include Discussion, Round, Message, DiscussionType, RoundType - [ ] No import errors when running bot<success_criteria>
- Discussion service exists at src/moai/core/services/discussion.py
- 9 async functions for discussion/round/message CRUD
- Follows established service layer pattern
- Eager loading prevents N+1 queries
- No TypeScript/import errors </success_criteria>