auto-sync: 2026-06-03 09:00:01
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
# Dev Report: ORCH-4 — единый stage-engine (M-3)
|
||||
Дата: 2026-06-03
|
||||
Статус: IN PROGRESS
|
||||
Статус: DONE
|
||||
|
||||
## Задача
|
||||
Слить две разошедшиеся реализации `_try_advance_stage` (launcher sync ~174 строки + plane async) в один движок `src/stage_engine.py:advance_stage(...)`. launcher и plane → тонкие обёртки. Исправить баг выбора агента, сохранить всю rollback/retry-логику и check_review_approved.
|
||||
@@ -24,13 +24,17 @@
|
||||
- [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!)
|
||||
- [x] Создан src/stage_engine.py с advance_stage(...)
|
||||
- [x] launcher → тонкая обёртка
|
||||
- [x] plane → тонкая обёртка (через asyncio.to_thread)
|
||||
- [x] tests/test_stage_engine.py (18 тестов, все зелёные)
|
||||
- [x] прогон тестов в контейнере: 136 passed, 9 pre-existing webhook-401/TypeError (= baseline 118 + 18 new)
|
||||
- [x] деплой + health/queue — health ok, queue ok, breaker closed, preflight ok
|
||||
- [x] push + PR (remote проверен!) — PR #5
|
||||
|
||||
## Проверка baseline
|
||||
- Clean main full-suite: 9 webhook failures pre-existing (401 порядок-зависимые + TypeError в test_plane_approved/rejected — падают БЕЗ моих изменений).
|
||||
- С моими изменениями: 136 passed / 9 failed (те же 9). test_webhooks.py отдельно: идентично baseline (5 failed/6 passed). Новых падений НЕТ.
|
||||
|
||||
## QG-сигнатуры (диспетчеризация)
|
||||
- check_ci_green, check_tests_local → (repo, branch)
|
||||
@@ -38,7 +42,21 @@
|
||||
- остальные (check_analysis_approved/complete, check_architecture_done, check_tests_passed, check_reviewer_verdict) → (repo, work_item_id, branch)
|
||||
|
||||
## Изменённые файлы
|
||||
- (в процессе)
|
||||
- `src/stage_engine.py` (НОВЫЙ, +425) — единый движок advance_stage(...) + AdvanceResult + _run_qg + rollback helpers
|
||||
- `src/agents/launcher.py` (+18 −69) — _try_advance_stage → тонкая обёртка (lookup task → advance_stage, finished_agent=agent)
|
||||
- `src/webhooks/plane.py` (+21 −72) — _try_advance_stage → async обёртка через asyncio.to_thread(advance_stage, ..., None)
|
||||
- `tests/test_stage_engine.py` (НОВЫЙ, +395) — 18 тестов
|
||||
|
||||
## Результат
|
||||
(в процессе)
|
||||
- PR #5: https://git.mva154.duckdns.org/admin/orchestrator/pulls/5 (state=open, mergeable=True, НЕ мержил)
|
||||
- PR реально содержит 3 коммита и дифф (проверено через /pulls/5/commits и /files — НЕ пустой, в отличие от ORCH-7)
|
||||
- git log origin/main..origin/feature/ORCH-4-stage-engine = 3 моих коммита (0befc49, 51401a3, 6abdc22)
|
||||
- Тесты в контейнере: 136 passed, 9 failed (те же pre-existing webhook, новых падений нет)
|
||||
- Прод пересобран из ветки: docker compose up -d --build → health=ok, queue=ok, breaker=closed, preflight=ok
|
||||
|
||||
## Баг выбора агента — вердикт
|
||||
Правильно = get_agent_for_stage(current_stage). launcher был баговым (next_stage), plane и gitea — корректны. Унифицировано на current_stage. Доказательство: stages.py agent = "agent to launch when advancing FROM this stage"; пример analysis→architecture должен запускать architect, а launcher запускал developer.
|
||||
|
||||
## Проблемы и решения
|
||||
- scp нет на хосте — файлы заливал через base64 | ssh.
|
||||
- 9 webhook-failures порядок-зависимые/pre-existing (401 из блида ENV-секрета между сюитами + TypeError в двух plane-тестах) — подтверждено на clean main, не трогал.
|
||||
|
||||
Reference in New Issue
Block a user