Update emory, memory (+22 ~1)
This commit is contained in:
204
memory/kb/youtube/2026-03-21-multi-agent-team-polling.md
Normal file
204
memory/kb/youtube/2026-03-21-multi-agent-team-polling.md
Normal file
@@ -0,0 +1,204 @@
|
||||
# My Multi-Agent Team (NOT OpenClaw)
|
||||
|
||||
**URL:** https://youtu.be/Zhbx-dj0qHE
|
||||
**Durată:** 16:18
|
||||
**Data salvare:** 2026-03-21
|
||||
**Tags:** @work @scout @project #architecture #automation #agents #security
|
||||
|
||||
---
|
||||
|
||||
## 📋 TL;DR
|
||||
|
||||
Demonstrație sistem minimal de delegare automată către agenți AI (Claude Code/Codex) prin task manager (Linear/Jira). Spre deosebire de OpenClaw (push-based, webhook-uri publice expuse), folosește **polling architecture** - mai sigur, fără porturi expuse. Worker-ul urmărește ticket queue, preia task-uri, le execută autonom (git worktree + Claude Code + tests + code review) și deschide PR pentru review. Scalează de la 1 worker local la sute pe VPS-uri.
|
||||
|
||||
---
|
||||
|
||||
## 🎯 Puncte cheie
|
||||
|
||||
### 1. Polling vs Push Architecture
|
||||
- **Polling** (propus în video):
|
||||
- Mai sigur - fără porturi expuse, doar outbound requests
|
||||
- Worker întreabă periodic task manager dacă sunt ticket-uri noi
|
||||
- Latență acceptabilă (~60s) pentru task-uri de background
|
||||
- **Push** (OpenClaw):
|
||||
- Expune webhook-uri HTTP publice
|
||||
- Mai mare attack surface
|
||||
- Răspuns instant, dar risc securitate mai mare
|
||||
|
||||
### 2. Worker Background Autonom
|
||||
**Flux complet:**
|
||||
1. Poll task queue la interval (ex: 60s)
|
||||
2. Claim ticket (mută status în "In Progress")
|
||||
3. Creează git worktree nou
|
||||
4. Delegate către Claude Code/Codex
|
||||
5. Rulează tests
|
||||
6. Self-review cu CodeRabbit
|
||||
7. Deschide PR
|
||||
8. Mută ticket în "Review"
|
||||
|
||||
**Caracteristici:**
|
||||
- Full delegation - nu mai ești in-the-loop
|
||||
- Pentru task-uri mici: bug fixes, doc updates, refactoring
|
||||
- Rulează oriunde: local, VPS, cloud
|
||||
|
||||
### 3. Hooks Deterministe
|
||||
**Concept:** Guardrails deterministe în jurul agent-ului non-determinist
|
||||
|
||||
**Pre-hooks:**
|
||||
- Git checkout branch
|
||||
- Git pull
|
||||
- Setup environment
|
||||
|
||||
**Post-hooks:**
|
||||
- Run tests
|
||||
- Git push
|
||||
- Open PR (GitHub CLI)
|
||||
- Code review (CodeRabbit)
|
||||
|
||||
### 4. Code Review Automat
|
||||
**Tool:** CodeRabbit
|
||||
- Integrat cu Claude Code (CLI + GitHub)
|
||||
- Layer extra de quality assurance
|
||||
- Critic când nu mai ești tu in-the-loop
|
||||
|
||||
**Workflow intern agent:**
|
||||
```
|
||||
Write code → Run tests → Self-review (CodeRabbit) → Fix issues → Run tests again
|
||||
```
|
||||
|
||||
### 5. Scalabilitate
|
||||
- **1 worker local** → task-uri ocazionale
|
||||
- **N workers pe aceeași mașină** → task-uri paralele
|
||||
- **Workers pe VPS-uri multiple** → sute de task-uri simultan
|
||||
- **Task manager agnostic:** Linear (demo), Jira, Monday, Todoist
|
||||
- **Agent agnostic:** Claude Code, Codex, orice CLI agent
|
||||
|
||||
---
|
||||
|
||||
## 💬 Quote-uri Relevante
|
||||
|
||||
> "We're working as managers here. We're just delegating work to agents who are going to do the work for us."
|
||||
|
||||
> "With OpenClaw you're exposing a webhook... The architecture we're using here is a pull-based architecture. So we don't have to expose any ports."
|
||||
|
||||
> "These are deterministic guardrails around non-deterministic agents."
|
||||
|
||||
> "If you're working on smaller tasks like bug fixes or documentation updates, you generally don't need to be involved in the loop."
|
||||
|
||||
> "Tools like OpenClaw are exciting and interesting, but I believe the architecture is relatively insecure because it requires you exposing things on the public internet."
|
||||
|
||||
> "What's interesting here is the architecture, not necessarily the code."
|
||||
|
||||
---
|
||||
|
||||
## 💡 Insights & Idei
|
||||
|
||||
### ✅ Aplicabile pentru Echo/Marius
|
||||
|
||||
**1. Arhitectura polling e mai sigură decât push-based**
|
||||
- OpenClaw expune webhook-uri → risc prompt injection via internet
|
||||
- Polling = doar outbound requests, fără porturi expuse
|
||||
- Trade-off acceptabil: latență +60s vs securitate mult mai bună
|
||||
|
||||
**2. Task manager ca interfață de delegare**
|
||||
- Mai bun decât chat pentru tracking când ai N task-uri paralele
|
||||
- Vizibilitate clară: TODO → In Progress → Review → Done
|
||||
- Poate integra cu sistemul nostru: `memory/approved-tasks.md` → Linear/Jira light
|
||||
|
||||
**3. Hooks deterministe = siguranță**
|
||||
- Encapsulează agent-ul non-determinist între pași predictibili
|
||||
- Pre: setup environment, checkout branch
|
||||
- Post: tests, linting, security checks, PR
|
||||
|
||||
**4. Self-review loop critic pentru autonomie**
|
||||
- Agent scrie cod → testează → se auto-evaluează → corectează
|
||||
- Reduce iterații back-and-forth
|
||||
- CodeRabbit sau similar = must-have când nu ești in-the-loop
|
||||
|
||||
**5. Pattern interesant pentru Ralph workflow**
|
||||
- Ralph = similar dar mai complex (PRD → Stories → Implementation)
|
||||
- Ar putea beneficia de hooks deterministe și self-review loop
|
||||
- Polling model ar fi mai sigur decât push pentru integrări externe
|
||||
|
||||
### 🔴 Nu recomand (pentru contextul nostru)
|
||||
|
||||
**1. Full replacement OpenClaw cu polling system**
|
||||
- OpenClaw oferă mai mult decât doar webhook-uri (memory, cron, multi-channel)
|
||||
- Polling e bun pentru task queue, nu pentru conversații
|
||||
- Prefer: păstrăm OpenClaw, aplicăm principiile de securitate
|
||||
|
||||
**2. Linear/Jira ca task manager principal**
|
||||
- Overhead prea mare pentru workflow-ul nostru actual
|
||||
- `approved-tasks.md` + Discord notifications = suficient
|
||||
- Excepție: dacă Marius vrea tracking mai formal pentru proiecte mari
|
||||
|
||||
---
|
||||
|
||||
## 🛠️ Aplicabilitate Practică
|
||||
|
||||
### Scenariu 1: Ralph Workflow Improvement
|
||||
**Context:** Ralph generează proiecte autonom în `~/workspace/`
|
||||
|
||||
**Îmbunătățire posibilă:**
|
||||
```python
|
||||
# În tools/ralph_workflow.py
|
||||
def run_with_hooks(prd_json, project_dir):
|
||||
# Pre-hooks
|
||||
run_hook("git checkout -b feature/...")
|
||||
run_hook("setup_venv.sh")
|
||||
|
||||
# Agent execution
|
||||
run_ralph(prd_json)
|
||||
|
||||
# Post-hooks
|
||||
run_hook("pytest tests/")
|
||||
run_hook("ruff check .")
|
||||
run_hook("git push && gh pr create")
|
||||
```
|
||||
|
||||
**Beneficiu:** Siguranță mai mare, PR-uri automate, tests garantate
|
||||
|
||||
### Scenariu 2: Security Hooks pentru Echo
|
||||
**Context:** Echo rulează comenzi externe (email, calendar, git)
|
||||
|
||||
**Îmbunătățire posibilă:**
|
||||
```python
|
||||
# Pre-hook: verify command whitelist
|
||||
# Agent: execute task
|
||||
# Post-hook: audit log, security scan
|
||||
```
|
||||
|
||||
**Beneficiu:** Layer extra de siguranță pentru acțiuni sensibile
|
||||
|
||||
### Scenariu 3: Background Workers pentru ROA
|
||||
**Context:** Rapoarte ROA, procesare bonuri, ANAF monitor
|
||||
|
||||
**Polling model aplicabil:**
|
||||
- Worker monitorizează inbox/folder pentru noi fișiere
|
||||
- Preia, procesează autonom (parsare, validare, DB insert)
|
||||
- Notifică când e gata pentru review
|
||||
|
||||
**Beneficiu:** Marius doar delegă (trimite PDF), primește notificare când e procesat
|
||||
|
||||
---
|
||||
|
||||
## 🔗 Link-uri & Resurse
|
||||
|
||||
- **Video:** https://youtu.be/Zhbx-dj0qHE
|
||||
- **Code (mentioned):** Link in description (proof of concept)
|
||||
- **CodeRabbit:** https://coderabbit.ai (AI code review tool)
|
||||
|
||||
---
|
||||
|
||||
## 📝 Note Suplimentare
|
||||
|
||||
- Video e proof of concept, nu production-ready code
|
||||
- Autorul subliniază că arhitectura e mai importantă decât codul specific
|
||||
- OpenClaw e criticat pentru securitate, dar recunoscut ca "exciting and interesting"
|
||||
- Pattern-ul e scalabil: de la 1 worker la sute, de la local la cloud
|
||||
|
||||
---
|
||||
|
||||
**Status:** [ ] Review pentru integrare în workflow Echo/Ralph
|
||||
**Priority:** Medium - idei bune de securitate și autonomie
|
||||
**Next steps:** Discută cu Marius dacă vrea polling hooks în Ralph sau security hooks în Echo
|
||||
Reference in New Issue
Block a user