auto-sync: 2026-06-03 08:50:01
This commit is contained in:
@@ -0,0 +1,44 @@
|
||||
# Dev Report: ORCH-4 — единый stage-engine (M-3)
|
||||
Дата: 2026-06-03
|
||||
Статус: IN PROGRESS
|
||||
|
||||
## Задача
|
||||
Слить две разошедшиеся реализации `_try_advance_stage` (launcher sync ~174 строки + plane async) в один движок `src/stage_engine.py:advance_stage(...)`. launcher и plane → тонкие обёртки. Исправить баг выбора агента, сохранить всю rollback/retry-логику и check_review_approved.
|
||||
|
||||
## Анализ бага выбора агента (КРИТИЧНО)
|
||||
`stages.py` STAGE_TRANSITIONS: каждый `agent` = "agent to launch when advancing FROM this stage" (подтверждено docstring `get_agent_for_stage`).
|
||||
- `analysis: {next: architecture, agent: architect}` — при уходе ИЗ analysis запускается **architect**.
|
||||
- `development: {next: review, agent: reviewer}` — при уходе ИЗ development запускается **reviewer**.
|
||||
|
||||
Значит при переходе current→next правильный агент = `get_agent_for_stage(current_stage)`.
|
||||
|
||||
**Вердикт:**
|
||||
- `plane._try_advance_stage` — ПРАВИЛЬНО: `get_agent_for_stage(current_stage)`.
|
||||
- `launcher._try_advance_stage` (стр.741) — **БАГ**: `get_agent_for_stage(next_stage)`.
|
||||
Пример: analyst finishes в analysis, advance→architecture, launcher брал `get_agent_for_stage("architecture")="developer"` — запускал developer ВМЕСТО architect (пропуск стадии).
|
||||
- Подтверждение: `src/webhooks/gitea.py` (вне scope, не трогаю) ТОЖЕ использует `get_agent_for_stage(current_stage)` в 3 местах — корректная семантика.
|
||||
|
||||
**Фикс:** унифицировано на `get_agent_for_stage(current_stage)`.
|
||||
|
||||
## Сделано
|
||||
- [x] Прочитан весь код: stages.py, launcher.py, plane.py, gitea.py, db.py, qg/checks.py, тесты
|
||||
- [x] Разобран баг выбора агента, вердикт зафиксирован
|
||||
- [x] Создана ветка feature/ORCH-4-stage-engine из свежего main
|
||||
- [ ] Создан src/stage_engine.py с advance_stage(...)
|
||||
- [ ] launcher → тонкая обёртка
|
||||
- [ ] plane → тонкая обёртка (через asyncio.to_thread)
|
||||
- [ ] tests/test_stage_engine.py
|
||||
- [ ] прогон тестов в контейнере (baseline 118)
|
||||
- [ ] деплой + health/queue
|
||||
- [ ] push + PR (проверка remote!)
|
||||
|
||||
## QG-сигнатуры (диспетчеризация)
|
||||
- check_ci_green, check_tests_local → (repo, branch)
|
||||
- check_review_approved → (repo, pr_number) [спец: поиск PR по ветке]
|
||||
- остальные (check_analysis_approved/complete, check_architecture_done, check_tests_passed, check_reviewer_verdict) → (repo, work_item_id, branch)
|
||||
|
||||
## Изменённые файлы
|
||||
- (в процессе)
|
||||
|
||||
## Результат
|
||||
(в процессе)
|
||||
Reference in New Issue
Block a user