99 lines
4.2 KiB
Markdown
99 lines
4.2 KiB
Markdown
---
|
||
namespace: work
|
||
tags:
|
||
- architecture
|
||
- agent
|
||
- executor
|
||
- orchestrator
|
||
created: '2026-05-19'
|
||
updated: '2026-05-19'
|
||
type: concept
|
||
confidence: 0.85
|
||
sources:
|
||
- personal/projects/personal-os/executor-orchestrator-redesign.md
|
||
---
|
||
# Executor-as-Worker — Orchestrator Pattern
|
||
|
||
Архитектурный паттерн для запуска задач: Eagle как orchestrator спавнит Executor как отдельный worker-процесс с собственной Zulip-идентичностью.
|
||
|
||
## Проблема
|
||
|
||
Текущий режим (inline execution):
|
||
- Eagle берёт задачу прямо в разговорном треде
|
||
- Спрашивает разрешения у Alex в середине задачи — блокирует поток
|
||
- Тесная связность между conversational layer и execution layer
|
||
|
||
## Целевая архитектура
|
||
|
||
```
|
||
Alex → Eagle (orchestrator, Zulip topic)
|
||
↓ spawn
|
||
Executor (worker, отдельный Hermes-профиль)
|
||
↓ пишет в #executor
|
||
Eagle мониторит #executor (2-мин cron)
|
||
↓ auto-approve безопасные действия
|
||
↓ эскалирует неоднозначные → @mention Alex
|
||
```
|
||
|
||
## Протокол сообщений (Executor → Eagle)
|
||
|
||
```
|
||
[STATUS: investigation] Analysing bug GID 123456...
|
||
[REQUEST: create_worktree] Branch: fix/tab-preview-stuck
|
||
[REQUEST: run_tests] Scheme: macOS UI Tests CI
|
||
[STATUS: pr_open] Draft PR: https://github.com/...
|
||
[DONE: pr_ready] PR #1234 opened, CI green
|
||
[ESCALATE: scope_expansion] Found unrelated issue — should I fix it?
|
||
```
|
||
|
||
## Таблица auto-approve (Eagle)
|
||
|
||
| Тип сообщения | Действие |
|
||
|---|---|
|
||
| `[REQUEST: create_worktree]` | ✅ auto-approve |
|
||
| `[REQUEST: run_build]` | ✅ auto-approve |
|
||
| `[REQUEST: run_tests]` | ✅ auto-approve |
|
||
| `[REQUEST: open_draft_pr]` | ✅ auto-approve |
|
||
| `[REQUEST: push_branch]` | ✅ auto-approve |
|
||
| `[REQUEST: post_asana_comment]` | ⚠️ показать Alex, ждать |
|
||
| `[REQUEST: merge_pr]` | ❌ всегда эскалация |
|
||
| `[ESCALATE: *]` | ⚠️ всегда эскалация |
|
||
| `[ESCALATE: scope_expansion]` | ❌ deny + notify Alex |
|
||
|
||
## Реализация через Hermes Profiles
|
||
|
||
- **Механизм**: Hermes Profiles → `~/.hermes/profiles/executor/` с SOUL.md, отдельным Zulip bot token, отдельным gateway.
|
||
- **Команда**: `hermes profile create executor --clone`
|
||
- **Bot identity**: "Исполнитель" (не Eagle)
|
||
|
||
## Мониторинг Eagle
|
||
|
||
Eagle **не** запускает непрерывный процесс мониторинга. Вместо этого:
|
||
- Hermes cron каждые 2 мин → читает последние 20 сообщений из `#executor` по текущему `executor_run_id`
|
||
- Structured messages → O(1) парсинг без LLM
|
||
- Sliding window — не полный тред
|
||
|
||
## GTD-фреймворк оркестрации (идея, 2026-05-18)
|
||
|
||
> Eagle как orchestrator должен управлять очередью задач по GTD-принципам: capture all inputs → clarify → organize → execute. Это высвободит ручную координацию (~2-4ч/день).
|
||
|
||
## Шаги реализации
|
||
|
||
1. Определить message protocol (structured tags)
|
||
2. Добавить Zulip sender в executor worker prompts
|
||
3. Создать Eagle monitoring cron (2 мин, `#executor` stream)
|
||
4. Реализовать auto-approval logic в monitoring prompt
|
||
5. Добавить `@mention Alex` на эскалацию
|
||
6. Тест с dry-run executor run
|
||
|
||
## Open Questions
|
||
|
||
- Как Executor «спавнится» как отдельный bot? (Profile A vs отдельный gateway vs `hermes run -p executor-worker.md`)
|
||
- Concurrent runs: нужен `run_id` в каждом сообщении
|
||
|
||
## Связанные страницы
|
||
|
||
- [[personal-os-architecture]] — полная карта агентов и executor modes (v2 bash daemons)
|
||
- [[personal-os-agent-rules]] — правила поведения агентов
|
||
- [[concepts/agent-memory-architecture]] — memory model для агентов
|