feat: v2 plan — remove autogen/crewai, add tasks and wiki

- Remove autogen and crewai backends (focus on custom only)
- Simplify CLI: remove --backend flag
- Remove optional deps from pyproject.toml
- Add .tasks/ with 7 tasks for Phase 1 refactor
- Add .wiki/concepts/meeting-room-v2.md with architecture plan
- Update .wiki/index.md and .tasks/STATUS.md

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
2026-05-03 23:42:39 +03:00
parent 5ed79a2e95
commit 52e77bb50c
16 changed files with 289 additions and 157 deletions

View File

@@ -1,25 +1,59 @@
# Task Board
_Updated: 2026-05-03_
## 🔴 v2-p1-models — Pydantic модели данных (ProviderConfig, RoleConfig, Session и др.)
**Status:** active
**Where I stopped:** Задачи созданы, начинаем с моделей
**Next action:** Создать meeting_room/models.py с Pydantic v2 моделями
**Branch:** main
---
## 🟡 v2-p1-events — EventEmitter и типы событий
**Status:** ready
**Next action:** Создать meeting_room/events.py
---
## 🟡 v2-p1-api-client — Рефактор APIClient (класс вместо глобалов)
**Status:** ready
**Next action:** Рефакторить meeting_room/api_client.py
---
## 🟡 v2-p1-tools — Рефактор ToolRegistry (класс, Windows-совместимость)
**Status:** ready
**Next action:** Рефакторить meeting_room/tools.py
---
## 🟡 v2-p1-engine — DiscussionEngine (emit вместо print)
**Status:** ready
**Next action:** Создать meeting_room/engine.py, извлечь из backends/custom/run.py
---
## 🟡 v2-p1-config-cli — config.py + CLI рефактор + deprecation shim
**Status:** ready
**Next action:** Извлечь config.py из cli.py
---
## ⚪ v2-p1-deps — Обновить зависимости (pydantic, pytest, [web])
**Status:** ready
**Next action:** Обновить pyproject.toml и requirements.txt
---
<!--
Add one block per task, sorted by priority. Use the emoji status legend below.
Per-task deep context lives in .tasks/<task-slug>.md (created on demand by using-tasks).
Фаза 2 (Web-сервер) задачи будут добавлены после завершения Фазы 1
Фаза 3 (Интерактивность) задачи будут добавлены после Фазы 2
Фаза 4 (Артефакты) задачи будут добавлены после Фазы 3
Block format:
## 🔴 [task-slug] — short description
**Status:** active
**Where I stopped:** one sentence — the exact thought or action interrupted
**Next action:** one concrete step to resume immediately
**Blocker:** (only if blocked) what is preventing progress
**Branch:** git branch name
---
Status legend:
🔴 Active — only one at a time
🟡 Paused — in progress, resumable
⚪ Ready — defined, not started
🟢 Done — kept until merged
🔵 Blocked — waiting on external input
Статусы:
🔴 Active — только одна одновременно
🟡 Paused — в процессе, возобновима
⚪ Ready — определена, не начата
🟢 Done — до слияния
🔵 Blocked — ждёт внешнего
-->

View File

@@ -0,0 +1,25 @@
# v2-p1-api-client
## Goal
Рефактор api_client.py: класс APIClient вместо модульных глобалов, chat_stream() возвращает текст вместо печати, обратная совместимость через обёртки.
## Key files
- `meeting_room/api_client.py` — изменить
- `tests/test_api_client.py` — создать
## Decisions log
- 2026-05-03: Обратная совместимость через module-level функции-делегаты
## Open questions
- [ ]
## Completed steps
- [ ] Создать класс APIClient с __init__(providers: dict[str, ProviderConfig])
- [ ] Перенести chat() и chat_stream() как instance methods
- [ ] chat_stream() возвращает str, не печатает
- [ ] Добавить module-level init_providers(), chat(), chat_stream() как обёртки над default instance
- [ ] Написать тесты с mocked httpx
- [ ] Запустить тесты
## Notes
Критическое изменение: chat_stream() должен возвращать текст, а не печатать в stdout. Печать — ответственность вызывающего (CLI или WebSocket).

View File

@@ -0,0 +1,26 @@
# v2-p1-config-cli
## Goal
Извлечь config.py из cli.py, реорганизовать CLI как подписчик событий, добавить deprecation shim в backends/custom/.
## Key files
- `meeting_room/config.py` — создать (извлечь из cli.py)
- `meeting_room/cli.py` — изменить (тонкая обёртка, подписка на события)
- `meeting_room/backends/custom/run.py` — изменить (deprecation shim)
## Decisions log
- 2026-05-03: CLI не меняет пользовательский интерфейс — те же флаги, тот же вывод
## Open questions
- [ ]
## Completed steps
- [ ] Создать config.py: load_config(), find_workspace_config(), load_discussion_config()
- [ ] Рефакторить cli.py: создать DiscussionEngine, подписаться на события с ANSI-цветами
- [ ] Сохранить init_workspace, save_session, list_scenarios, list_roles в cli.py
- [ ] backends/custom/run.py → deprecation warning + legacy wrapper
- [ ] Написать integration test (CLI с mock API, тот же формат вывода)
- [ ] Запустить все тесты
## Notes
CLI должен работать идентично текущему. Это главное требование Фазы 1 — бесшовная совместимость.

25
.tasks/v2-p1-deps.md Normal file
View File

@@ -0,0 +1,25 @@
# v2-p1-deps
## Goal
Обновить зависимости: добавить pydantic, pytest, web-опциональные.
## Key files
- `pyproject.toml` — изменить
- `requirements.txt` — изменить
## Decisions log
- 2026-05-03: pydantic в основных зависимостях, fastapi/uvicorn — опционально
## Open questions
- [ ]
## Completed steps
- [ ] Добавить pydantic>=2.0 в dependencies
- [ ] Добавить [web] optional deps: fastapi, uvicorn, websockets
- [ ] Добавить [dev] optional deps: pytest, pytest-mock
- [ ] Обновить requirements.txt
- [ ] Запустить pip install -e ".[dev]" и проверить импорт
- [ ] Закоммитить
## Notes
FastAPI добавляется в Фазе 2, но опциональная группа [web] создаётся уже сейчас.

25
.tasks/v2-p1-engine.md Normal file
View File

@@ -0,0 +1,25 @@
# v2-p1-engine
## Goal
Извлечь DiscussionEngine из backends/custom/run.py. Заменить print() на events.emit(). Добавить inject_message() для Boss/CSO.
## Key files
- `meeting_room/engine.py` — создать
- `tests/test_engine.py` — создать
## Decisions log
- 2026-05-03: Движок emit'ит события, потребитель подписывается
## Open questions
- [ ]
## Completed steps
- [ ] Создать DiscussionEngine с __init__(config, api_client, tool_registry, event_emitter)
- [ ] Перенести _run_agent_turn() из backends/custom/run.py
- [ ] Заменить все print() на self.events.emit()
- [ ] Добавить inject_message(role_id, content) для Boss/CSO
- [ ] Написать тесты с mock APIClient и ToolRegistry
- [ ] Запустить тесты
## Notes
Движок полностью отделён от I/O. CLI подписывается на события и печатает, WebSocket подписывается и стримит.

24
.tasks/v2-p1-events.md Normal file
View File

@@ -0,0 +1,24 @@
# v2-p1-events
## Goal
Создать EventEmitter и типы событий для событийной архитектуры. Заменяет прямые print() вызовы в движке.
## Key files
- `meeting_room/events.py` — создать
- `tests/test_events.py` — создать
## Decisions log
- 2026-05-03: EventEmitter синхронный в Фазе 1, AsyncEventBridge в Фазе 2
## Open questions
- [ ]
## Completed steps
- [ ] Создать events.py с константами событий (DISCUSSION_START, ROUND_START, AGENT_TURN_START, AGENT_MESSAGE, TOOL_CALL, TOOL_RESULT, AGENT_ERROR, ROUND_END, DISCUSSION_END, BOSS_TURN)
- [ ] Создать Event dataclass с type, data, timestamp
- [ ] Создать EventEmitter с методами on(), off(), emit()
- [ ] Написать тесты: подписка, отписка, эмиссия, множественные обработчики
- [ ] Запустить тесты
## Notes
EventEmitter простой — dict of lists, без asyncio. Асинхронная версия появится в Фазе 2 (ws.py).

22
.tasks/v2-p1-models.md Normal file
View File

@@ -0,0 +1,22 @@
# v2-p1-models
## Goal
Создать Pydantic v2 модели данных для meeting-room: ProviderConfig, RoleConfig, ScenarioConfig, DiscussionConfig, Message, Session. Заменить сырые dict'ы на типизированные модели.
## Key files
- `meeting_room/models.py` — создать
- `tests/test_models.py` — создать
## Decisions log
- 2026-05-03: выбрали Pydantic v2 для валидации и сериализации
## Open questions
- [ ] Стоит ли использовать model_config для разрешения extra fields в config?
## Completed steps
- [ ] Создать models.py с ProviderConfig, RoleConfig, ScenarioConfig, DiscussionConfig, Message, ToolCallRecord, Session
- [ ] Написать тесты: валидация, дефолты, невалидные данные
- [ ] Запустить тесты, убедиться что проходят
## Notes
Модели должны быть совместимы с текущим форматом config.yaml — load_config() возвращает dict, который должен без проблем конвертироваться в DiscussionConfig через DiscussionConfig(**config).

26
.tasks/v2-p1-tools.md Normal file
View File

@@ -0,0 +1,26 @@
# v2-p1-tools
## Goal
Рефактор tools.py: класс ToolRegistry вместо модульных глобалов, замена find/grep на чистый Python, описания инструментов на английском.
## Key files
- `meeting_room/tools.py` — изменить
- `tests/test_tools.py` — создать
## Decisions log
- 2026-05-03: Чистый Python вместо shell-команд для Windows-совместимости
## Open questions
- [ ]
## Completed steps
- [ ] Создать класс ToolRegistry с __init__(workdir: str)
- [ ] Перенести get_tool_schemas() и execute_tool() как instance methods
- [ ] Заменить tool_list_files: subprocess.run(["find",...]) → os.walk() + fnmatch
- [ ] Заменить tool_search_in_files: subprocess.run(["grep",...]) → re.search() по файлам
- [ ] Перевести описания инструментов и ошибки на английский
- [ ] Написать тесты (особенно list_files и search_in_files на Windows)
- [ ] Запустить тесты
## Notes
Это критическое исправление — текущие find/grep не работают на Windows.