opencode-config/docs/decisions/017-pr-42-orchestration-switch.md
Sergey 67174b4879
refactor(pipeline): make pipeline-status sole orchestrator + slim docs (#42)
* refactor(pipeline): add subagent_type and template to NEXT actions

NEXT_ACTIONS now explicitly specifies subagent_type + template per phase (except MERGE which calls merge_pr tool). ISSUE/IMPLEMENT -> general/A, DOCS -> docs-reviewer/B, REVIEW -> reviewer/C, MEMORY -> memory-syncer/E. Existing tests updated to new format, 25 new tests added.

* refactor(docs): slim AGENTS.md and run-pipeline skill

AGENTS.md 71 -> 31 lines: remove Commits/Pull Requests sections (formats in tools), shorten Development Workflow/Pipeline to 1-2 lines. run-pipeline SKILL.md 164 -> 155 lines: remove Phase 0 Bootstrap (duplicated phases, now in pipeline-status NEXT_ACTIONS). Keep protocol, templates, restrictions.

* chore(skills): remove commit skill (format in tool validator)

commit/SKILL.md deleted (format validated by commit.ts tool, PR#38). References updated: configure-opencode SKILL.md (2 places), add-skill SKILL.md (1 place + tree structure). project-map README: remove commit/SKILL.md from tree, add configure-opencode.

* docs(handoff): add ADR-017 and handoff for orchestration switch

PR number in handoff frontmatter is <PR-NUMBER> placeholder, will be set after gh pr create.

* docs(handoff): set PR number

Set PR number 42 in handoff frontmatter, rename handoff/ADR files from pr-41 to pr-42 (pipeline-status matches pr-{pr_number}-*.md in diff).

* docs: update project map + handoff + ADR

---------

Co-authored-by: opencode-agent <agent@slaid098.dev>
2026-07-24 15:40:20 +03:00

4.2 KiB
Raw Permalink Blame History

ADR-017: pipeline-status sole orchestrator + slim docs

Статус

Accepted (2026-07-24)

Контекст

PR #38 (build) добавил 3 детерминированных tool'а (commit, create_pr, create_issue) с валидацией форматов. PR #40 (lock) заблокировал прямые bash-вызовы мутаций через global deny rules + role-based tool access. Но промпты и оркестрация всё ещё ссылались на старые паттерны: pipeline-status.py NEXT_ACTIONS описывал действие текстом без указания subagent_type/template, run-pipeline skill дублировал 7 фаз в Phase 0: Bootstrap, AGENTS.md дублировал правила форматов commits/PRs (уже в tools), commit skill дублировал правила коммитов (уже в commit.ts).

Нужно: сделать pipeline-status.py единственным source of truth для оркестрации (NEXT action явно указывает subagent_type + template), убрать дублирование в AGENTS.md/run-pipeline skill, удалить commit skill (формат в commit.ts).

Решение

  1. pipeline-status.py NEXT_ACTIONS — каждая фаза явно указывает subagent_type + template (кроме MERGE — merge_pr tool): ISSUE/IMPLEMENT → subagent_type=general, template=A; DOCS → subagent_type=docs-reviewer, template=B; REVIEW → subagent_type=reviewer, template=C; MERGE → call merge_pr tool with pr_number=N; MEMORY → subagent_type=memory-syncer, template=E. REVIEW_NEXT_REQUEST_CHANGESdispatch subagent (subagent_type=general). Формат NEXT: строки сохранён (pipeline-driver парсит без изменений).

  2. AGENTS.md slim (71 → 31 строк) — убраны ## Commits и ## Pull Requests (форматы в tools). ## Development Workflow и ## Pipeline сокращены до 1-2 строк (ссылки на /run-pipeline + pipeline_status/merge_pr tools). Оставлены: Orchestrator Model, Read Path, Code Style, Language.

  3. run-pipeline SKILL.md slim (164 → 155 строк) — убран Phase 0: Bootstrap (дублировал фазы). Оставлены: ПРОТОКОЛ, ЗАПРЕЩЕНО, Остановы, Prompt templates A-F, API Restrictions, Rules.

  4. commit skill удалён — формат зашит в commit.ts валидаторе (PR#38). Ссылки в configure-opencode/SKILL.md и add-skill/SKILL.md обновлены на commit tool.

Альтернативы

  • Оставить NEXT_ACTIONS описательным текстом — отклонено: run-pipeline skill должен парсить NEXT action и диспетчизировать subagent'ов. Без явного subagent_type/template skill должен был гадать или хардкодить маппинг фаза→subagent. Явное указание = single source of truth, deterministic.
  • Не сокращать AGENTS.md/run-pipeline — отклонено: дублирование правил форматов (AGENTS.md commits/PRs vs tools) и фаз (run-pipeline Phase 0 vs pipeline-status NEXT_ACTIONS) нарушает DRY и pure-orchestrator model. Tools уже валидируют форматы — текстовые правила в AGENTS.md не enforced.
  • Оставить commit skill как pointer на tool — отклонено: commit.ts уже содержит все правила валидации (regex, English, ≤72, staged check). Skill с текстом правил = дублирование. Если правила изменятся — нужно править 2 места. Удаление skill устраняет дублирование.
  • Добавить отдельный tool для dispatch subagent — отклонено: opencode уже имеет task subagent dispatch mechanism. NEXT action строка достаточно для run-pipeline skill чтобы вызвать task с правильным subagent_type и template. Новый tool = избыточность.