Commit graph

72 commits

Author SHA1 Message Date
3e5e316d24 chore: complete v1.0 milestone
Archived:
- milestones/v1.0-ROADMAP.md
- milestones/v1.0-REQUIREMENTS.md
- milestones/v1.0-MILESTONE-AUDIT.md

Deleted (fresh for next milestone):
- ROADMAP.md

Updated:
- MILESTONES.md (new entry)
- PROJECT.md (requirements → Validated, decisions with outcomes)
- STATE.md (reset for next milestone)

v1.0 MVP shipped:
- 6 phases, 16 plans
- 2,732 lines Python
- All 9 requirements validated

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-17 02:03:13 +00:00
69574c8c6b docs(06-02): complete markdown export plan
Tasks completed: 2/2
- Create exporter module
- Create /export command handler

SUMMARY: .planning/phases/06-consensus-export/06-02-SUMMARY.md
2026-01-17 01:50:35 +00:00
e5108c6705 feat(06-02): add /export command handler
- export_command handles /export and /export project
- Sends markdown as Telegram document attachment
- Registered in handlers/__init__.py
- Updated HELP_TEXT with export options
2026-01-17 01:49:03 +00:00
152d6173d6 feat(06-02): create exporter module for markdown export
- export_discussion() formats discussion with rounds and messages
- export_project() creates full project export with header
- _format_consensus() helper for consensus section formatting
- Follows SPEC.md markdown format
2026-01-17 01:48:14 +00:00
edb4ab5593 docs(06-01): complete consensus generation plan
Tasks completed: 2/2
- Add consensus generation to orchestrator and service
- Create /consensus command handler

SUMMARY: .planning/phases/06-consensus-export/06-01-SUMMARY.md
2026-01-16 20:08:55 +00:00
ee9f8ca3a4 feat(06-01): create /consensus command handler
- Add consensus_command handler with typing indicator
- Add _format_consensus helper for Markdown output
- Register CommandHandler("consensus") in __init__.py
- Displays existing consensus or generates new one

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-16 20:06:52 +00:00
8242de5289 feat(06-01): add consensus generation to orchestrator and service
- Add CONSENSUS_PROMPT constant for AI consensus analysis
- Add generate_consensus() function that builds context and calls AI
- Add save_consensus() and get_consensus() to discussion service
- Import json module and Consensus model

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-16 20:03:46 +00:00
ddb0de0757 docs(06): create phase plans for consensus & export
Phase 06: Consensus & Export
- 2 plans created
- 4 total tasks defined
- Ready for execution

Plan 06-01: Consensus generation (M6)
Plan 06-02: Markdown export (M7)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-16 19:58:51 +00:00
bd1db003b7 docs(05-04): complete mention mode plan
Phase 5 complete - M4, M5, M8 milestones done:
- Open mode (parallel) for multi-model discussions
- Discuss mode (sequential rounds) with context
- @mention direct messages to specific models

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-16 19:51:00 +00:00
2a86d3903a feat(05-04): update /status to show active discussion info
Enhance status command to display:
- Selected project name and configured models
- Active discussion state (round progress, message count)
- Short discussion ID for reference
- Contextual hints for next actions

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-16 19:49:06 +00:00
3296874408 feat(05-04): implement @mention message handler
Add mention_handler for @claude, @gpt, @gemini direct messages:
- Parse model name from @mention prefix
- Get active discussion for context (if exists)
- Query model via query_model_direct with full context
- Persist response with is_direct=True flag
- Register MessageHandler with regex filter after CommandHandlers

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-16 19:48:39 +00:00
5934d21256 feat(05-04): add query_model_direct() for @mention support
Add direct model query function to orchestrator that:
- Takes single model, message, optional discussion context, and project name
- Builds context from discussion history when available
- Uses system prompt indicating this is a direct message
- Handles errors gracefully (returns error message string)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-16 19:47:38 +00:00
a59321cc3b docs(05-03): complete discuss mode plan
- Create 05-03-SUMMARY.md with sequential discussion implementation details
- Update STATE.md: Plan 3 of 4, add decisions for sequential execution pattern
- Update ROADMAP.md: Phase 5 progress 3/4

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-16 19:46:18 +00:00
3ae08e9317 feat(05-03): implement /next and /stop commands for round progression
Add /next to advance discussion with full context passed to models:
- Validates active discussion state
- Auto-completes when round limit reached
- Shows Round N/M progress indicator

Add /stop to end discussion early:
- Marks discussion as COMPLETED
- Clears session state
- Suggests /consensus for summarization

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-16 19:45:12 +00:00
104eceb246 feat(05-03): implement /discuss command handler with round limit
Add /discuss [rounds] command that:
- Requires active discussion from /open
- Stores discussion state in user_data for /next and /stop
- Runs sequential rounds via run_discussion_round
- Shows Round N/M progress indicator

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-16 19:44:06 +00:00
9133d4eebf feat(05-03): add build_context and run_discussion_round to orchestrator
Add sequential model execution for discuss mode:
- build_context() converts discussion history to OpenAI message format
- run_discussion_round() queries models sequentially, each seeing prior responses

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-16 19:43:05 +00:00
bed0fbcb3e docs(05-02): complete open mode plan
Tasks completed: 3/3
- Create orchestrator module with parallel query function
- Implement /open command handler with database persistence
- Update help text for discussion commands

SUMMARY: .planning/phases/05-multi-model-discussions/05-02-SUMMARY.md
2026-01-16 19:39:15 +00:00
7f461700d8 docs(05-02): update help text for discussion commands
Add @model mention syntax to help text under Discussion Commands section.
Documents all multi-model discussion commands for the full M4-M8 scope.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-16 19:37:34 +00:00
cef1898352 feat(05-02): implement /open command handler
Add /open command handler that queries all project models in parallel.
Creates Discussion and Round records, persists Message for each response.
Shows typing indicator and formats output with model names.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-16 19:37:08 +00:00
81b5bfff35 feat(05-02): create orchestrator with parallel model queries
Add orchestrator module with SYSTEM_PROMPT constant and query_models_parallel
function that uses asyncio.gather() to query all models simultaneously.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-16 19:36:13 +00:00
b2610cd90a docs(05-01): complete discussion service plan
Tasks completed: 2/2
- Create discussion service with CRUD operations
- Add round and message operations

SUMMARY: .planning/phases/05-multi-model-discussions/05-01-SUMMARY.md
2026-01-16 19:28:13 +00:00
baf02bb11f feat(05-01): add round and message operations to discussion service
Add create_round, get_current_round, create_message, and get_round_messages
functions. All async with proper type hints and eager loading.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-16 19:26:21 +00:00
3258c3a596 feat(05-01): create discussion service with CRUD operations
Add discussion.py service with create_discussion, get_discussion,
get_active_discussion, list_discussions, and complete_discussion.
Uses selectinload for eager loading of rounds, messages, and consensus.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-16 19:25:36 +00:00
5afd8b6213 docs(05): create phase plans for multi-model discussions
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>
2026-01-16 19:16:43 +00:00
71eec42baf docs(04-02): complete /ask handler plan
Create 04-02-SUMMARY.md documenting:
- /ask command handler implementation
- AI client integration in bot lifecycle
- Help text and status updates

Update STATE.md:
- Phase 4 complete, ready for Phase 5
- 10 total plans completed
- Add 04-02 decisions

Update ROADMAP.md:
- Mark Phase 4 as complete
- Update progress table (2/2 plans)

This completes M3 milestone (Single Model Q&A) and Phase 4.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-16 19:10:53 +00:00
7078379a9a feat(04-02): add /ask to help text and AI status
Update HELP_TEXT in commands.py with new Questions section showing
/ask <model> <question> command.

Update status_command to display AI router status (e.g., "AI Router:
requesty") or "not configured" if AI client isn't initialized.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-16 19:09:02 +00:00
32983c9301 feat(04-02): implement /ask command for single model queries
Create discussion.py with ask_command handler that:
- Validates model name against MODEL_MAP
- Shows usage when called without arguments
- Sends typing indicator while waiting for AI
- Returns formatted response with model name
- Includes optional project context if project is selected

Register CommandHandler("ask", ask_command) in handlers/__init__.py.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-16 19:08:28 +00:00
821b419271 feat(04-02): integrate AI client into bot lifecycle
Import init_ai_client and call it during post_init callback alongside
database initialization. Logs the configured AI router at startup.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-16 19:07:45 +00:00
f1a001f923 docs(04-01): complete AI client abstraction plan
- Add 04-01-SUMMARY.md with plan completion details
- Update STATE.md with Phase 4 progress and decisions
- Update ROADMAP.md with plan count and status

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-16 19:05:45 +00:00
e04ce4eeeb feat(04-01): create AI client abstraction layer
- Add AIClient class wrapping AsyncOpenAI for model routing
- Support Requesty and OpenRouter as backend routers
- Add MODEL_MAP with claude, gpt, gemini short names
- Add init_ai_client/get_ai_client module functions
- Include HTTP-Referer header support for OpenRouter

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-16 19:03:49 +00:00
3740691dac feat(04-01): add openai dependency and AI config
- Add openai package to dependencies in pyproject.toml
- Extend BotConfig with ai_router, ai_api_key, ai_referer attributes
- Load AI settings from environment with sensible defaults

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-16 19:02:59 +00:00
4ea13efe8f docs(04): create phase plans for single model Q&A
Phase 04: Single Model Q&A
- 2 plans created
- 5 total tasks defined
- Ready for execution

Plans:
- 04-01: AI client abstraction (openai dep, config, AIClient class)
- 04-02: /ask handler and bot integration (M3 milestone)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-16 19:00:50 +00:00
6ec3d069d8 docs(03-03): add summary and update state for phase completion
- Created 03-03-SUMMARY.md documenting M2 milestone completion
- Updated STATE.md: Phase 3 complete, 8 plans total
- Updated ROADMAP.md: Phase 3 marked complete
2026-01-16 18:57:37 +00:00
afab4f84e2 docs(03-03): complete project models/delete plan
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-16 18:55:52 +00:00
bb3eab7bb4 feat(03-03): implement /project models and /project delete handlers
- /project models [list] - show/set AI models for current project
- /project delete <id> - delete project by ID with confirmation
- Clear user selection if deleted project was selected

M2 milestone complete: full project CRUD via Telegram.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-16 18:55:30 +00:00
e2e10d9b2e feat(03-03): add update_models and delete_project to service
Add update_project_models(project_id, models) and delete_project(project_id)
functions to complete the project service CRUD operations.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-16 18:54:39 +00:00
8791398b02 docs(03-02): complete project select/info plan
Tasks completed: 2/2
- Add get_project_by_name to service
- Implement /project select and /project info handlers

SUMMARY: .planning/phases/03-project-crud/03-02-SUMMARY.md
2026-01-16 18:44:57 +00:00
9922c333cb feat(03-02): implement /project select and /project info handlers
Add project selection and info display:
- /project select <id|name> stores selection in user_data
- /project info displays selected project details
- get_selected_project helper retrieves current project

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-16 18:43:16 +00:00
70dd517e6a feat(03-02): add get_project_by_name to project service
Add case-insensitive project lookup by name using ilike query.
Supports /project select command finding projects by name.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-16 18:42:04 +00:00
4d8c66ee07 docs(03-01): complete project service & list/create plan
Tasks completed: 2/2
- Create project service module
- Implement /projects and /project new handlers

SUMMARY: .planning/phases/03-project-crud/03-01-SUMMARY.md

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-16 18:39:29 +00:00
3f3b5ce28f feat(03-01): implement /projects and /project new handlers
- /projects lists all projects with name, ID, models
- /project new "Name" creates project with confirmation
- Registered handlers in __init__.py

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-16 18:38:06 +00:00
718dcea7dc feat(03-01): create project service module
- list_projects() returns all projects ordered by created_at desc
- create_project() creates project with default models
- get_project() retrieves project by ID

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-16 18:37:21 +00:00
e3d72dab60 docs(03): create phase 3 plans for project CRUD
Phase 03: Project CRUD
- 3 plans created
- 6 total tasks defined
- Covers M2 milestone (full project management)

Plan breakdown:
- 03-01: Project service + /projects, /project new
- 03-02: /project select, /project info
- 03-03: /project models, /project delete

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-16 18:33:06 +00:00
dfdadc62f0 chore: add python-dotenv for .env loading 2026-01-16 18:27:22 +00:00
1908f5f61d chore: add .env.example template for bot configuration 2026-01-16 18:20:58 +00:00
15307d7c85 docs(02-02): complete help/status commands plan
Tasks completed: 3/3
- Create commands.py with /help and /start handlers
- Create status.py with /status handler
- Register handlers in __init__.py

M1 milestone complete: Bot responds to /help, /status
Phase 2 (Bot Core) complete

SUMMARY: .planning/phases/02-bot-core/02-02-SUMMARY.md
2026-01-16 18:19:23 +00:00
2a563efce0 feat(02-02): register handlers in __init__.py
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-16 18:17:05 +00:00
cb185e139c feat(02-02): create status.py with /status handler
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-16 18:16:49 +00:00
98b71829cc feat(02-02): create commands.py with /help and /start handlers
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-16 18:16:33 +00:00
712024eb10 docs(02-01): complete bot infrastructure plan
Tasks completed: 3/3
- Create bot configuration module
- Create bot main.py with Application setup
- Create handlers package structure

SUMMARY: .planning/phases/02-bot-core/02-01-SUMMARY.md
2026-01-16 15:38:34 +00:00