diff --git a/docs/superpowers/plans/2026-05-09-agentforge.md b/docs/superpowers/plans/2026-05-09-agentforge.md index 2c5e67c..c435feb 100644 --- a/docs/superpowers/plans/2026-05-09-agentforge.md +++ b/docs/superpowers/plans/2026-05-09-agentforge.md @@ -31,7 +31,7 @@ - Create: `dashboard/requirements.txt` - Create directorios: `core/src/agentforge_core/{api,domain,registry,llm,guardrails,runtime,observability}`, `dashboard/src/agentforge_dashboard/{pages,components}`, `agents/incident_analyzer/{versions,examples}`, `policies/default/versions`, `data/`, `tests/{unit,integration,fixtures}` -- [ ] **Step 1: Crear estructura de directorios y `__init__.py`** +- [x] **Step 1: Crear estructura de directorios y `__init__.py`** ```bash cd /home/juan/Work/agentforge @@ -51,7 +51,7 @@ touch dashboard/src/agentforge_dashboard/components/__init__.py touch tests/__init__.py tests/unit/__init__.py tests/integration/__init__.py ``` -- [ ] **Step 2: Crear `pyproject.toml`** +- [x] **Step 2: Crear `pyproject.toml`** ```toml [build-system] @@ -98,7 +98,7 @@ markers = [ ] ``` -- [ ] **Step 3: Crear `core/requirements.txt`** +- [x] **Step 3: Crear `core/requirements.txt`** ``` fastapi>=0.115,<0.120 @@ -117,7 +117,7 @@ PyYAML>=6.0,<7.0 nemoguardrails>=0.10,<0.12 ``` -- [ ] **Step 4: Crear `dashboard/requirements.txt`** +- [x] **Step 4: Crear `dashboard/requirements.txt`** ``` streamlit>=1.38,<2.0 @@ -126,7 +126,7 @@ pydantic>=2.7,<3.0 PyYAML>=6.0,<7.0 ``` -- [ ] **Step 5: Crear `.env.example`** +- [x] **Step 5: Crear `.env.example`** ``` # Proveedor LLM activo. Valores: mock | azure | openai @@ -158,7 +158,7 @@ DATA_DIR=./data AGENTFORGE_CORE_URL=http://core:8000 ``` -- [ ] **Step 6: Crear `Makefile`** +- [x] **Step 6: Crear `Makefile`** ```makefile .PHONY: help install lint format test smoke up down logs clean @@ -203,7 +203,7 @@ clean: rm -rf .pytest_cache .mypy_cache .ruff_cache __pycache__ data/*.sqlite data/*.jsonl ``` -- [ ] **Step 7: Verificar instalación local mínima** +- [x] **Step 7: Verificar instalación local mínima** ```bash cd /home/juan/Work/agentforge @@ -215,7 +215,7 @@ ruff check core/src Expected: `All checks passed!` (no hay código aún; debe pasar). -- [ ] **Step 8: Commit** +- [x] **Step 8: Commit** ```bash git add -A @@ -230,7 +230,7 @@ git commit -m "chore: scaffolding inicial del repo (pyproject, requirements, Mak - Create: `core/src/agentforge_core/domain/agent.py` - Create: `tests/unit/test_domain_agent.py` -- [ ] **Step 1: Escribir test fallido** +- [x] **Step 1: Escribir test fallido** Create `tests/unit/test_domain_agent.py`: ```python @@ -305,14 +305,14 @@ def test_agent_definition_rechaza_state_invalido() -> None: ) ``` -- [ ] **Step 2: Verificar que falla** +- [x] **Step 2: Verificar que falla** ```bash pytest tests/unit/test_domain_agent.py -v ``` Expected: 5 ERRORS — `ModuleNotFoundError: No module named 'agentforge_core.domain.agent'`. -- [ ] **Step 3: Implementar `agent.py`** +- [x] **Step 3: Implementar `agent.py`** Create `core/src/agentforge_core/domain/agent.py`: ```python @@ -360,14 +360,14 @@ class AgentDefinition(BaseModel): updated_at: datetime ``` -- [ ] **Step 4: Verificar que pasan** +- [x] **Step 4: Verificar que pasan** ```bash pytest tests/unit/test_domain_agent.py -v ``` Expected: 5 PASSED. -- [ ] **Step 5: Commit** +- [x] **Step 5: Commit** ```bash git add core/src/agentforge_core/domain/agent.py tests/unit/test_domain_agent.py @@ -386,7 +386,7 @@ git commit -m "feat(domain): añade modelo AgentDefinition + LLMConfig + AgentVe - Create: `tests/unit/test_domain_guardrail.py` - Create: `tests/unit/test_domain_policy.py` -- [ ] **Step 1: Test para `guardrail.py`** +- [x] **Step 1: Test para `guardrail.py`** Create `tests/unit/test_domain_guardrail.py`: ```python @@ -426,7 +426,7 @@ def test_guardrail_violation_rechaza_severity_invalido() -> None: ) ``` -- [ ] **Step 2: Test para `policy.py`** +- [x] **Step 2: Test para `policy.py`** Create `tests/unit/test_domain_policy.py`: ```python @@ -445,7 +445,7 @@ def test_policy_definition_default_fail_closed() -> None: assert p.on_validator_error == "fail_closed" ``` -- [ ] **Step 3: Test para `execution.py`** +- [x] **Step 3: Test para `execution.py`** Create `tests/unit/test_domain_execution.py`: ```python @@ -515,14 +515,14 @@ def test_agent_execution_summary_no_incluye_decision_path() -> None: assert "decision_path" not in s.model_dump() ``` -- [ ] **Step 4: Verificar fallos** +- [x] **Step 4: Verificar fallos** ```bash pytest tests/unit/test_domain_guardrail.py tests/unit/test_domain_policy.py tests/unit/test_domain_execution.py -v ``` Expected: ERRORS por imports. -- [ ] **Step 5: Implementar `guardrail.py`** +- [x] **Step 5: Implementar `guardrail.py`** ```python """Modelos de dominio de guardrails.""" @@ -547,7 +547,7 @@ class GuardrailViolation(BaseModel): blocked: bool ``` -- [ ] **Step 6: Implementar `policy.py`** +- [x] **Step 6: Implementar `policy.py`** ```python """Modelos de políticas de guardrails.""" @@ -585,7 +585,7 @@ class PolicyDefinition(BaseModel): on_validator_error: Literal["fail_open", "fail_closed"] = "fail_closed" ``` -- [ ] **Step 7: Implementar `execution.py`** +- [x] **Step 7: Implementar `execution.py`** ```python """Modelos de ejecución del agente: estado, traza, acciones propuestas.""" @@ -659,14 +659,14 @@ class AgentExecutionSummary(BaseModel): n_proposed_actions: int ``` -- [ ] **Step 8: Verificar que pasan** +- [x] **Step 8: Verificar que pasan** ```bash pytest tests/unit/test_domain_guardrail.py tests/unit/test_domain_policy.py tests/unit/test_domain_execution.py -v ``` Expected: todos PASSED. -- [ ] **Step 9: Commit** +- [x] **Step 9: Commit** ```bash git add core/src/agentforge_core/domain/ tests/unit/test_domain_*.py @@ -681,7 +681,7 @@ git commit -m "feat(domain): añade modelos GuardrailViolation, PolicyDefinition - Create: `core/src/agentforge_core/config.py` - Create: `tests/unit/test_config.py` -- [ ] **Step 1: Test fallido** +- [x] **Step 1: Test fallido** Create `tests/unit/test_config.py`: ```python @@ -707,14 +707,14 @@ def test_settings_data_dir_se_resuelve() -> None: assert s.data_dir == Path("/tmp/agentforge-test") ``` -- [ ] **Step 2: Verificar fallo** +- [x] **Step 2: Verificar fallo** ```bash pytest tests/unit/test_config.py -v ``` Expected: ERROR import. -- [ ] **Step 3: Implementar** +- [x] **Step 3: Implementar** ```python """Configuración global del core. Se carga desde variables de entorno (.env).""" @@ -768,13 +768,13 @@ def get_settings() -> Settings: return Settings() ``` -- [ ] **Step 4: Verificar PASSED** +- [x] **Step 4: Verificar PASSED** ```bash pytest tests/unit/test_config.py -v ``` -- [ ] **Step 5: Commit** +- [x] **Step 5: Commit** ```bash git add core/src/agentforge_core/config.py tests/unit/test_config.py @@ -789,7 +789,7 @@ git commit -m "feat(config): añade Settings con Pydantic Settings y .env loadin - Create: `core/src/agentforge_core/observability/logging.py` - Create: `tests/unit/test_logging.py` -- [ ] **Step 1: Test** +- [x] **Step 1: Test** ```python """Tests de logging estructurado.""" @@ -823,7 +823,7 @@ def test_bind_trace_id_aparece_en_logs(capsys) -> None: # type: ignore[no-untyp assert parsed["trace_id"] == "trace-abc-123" ``` -- [ ] **Step 2: Implementar** +- [x] **Step 2: Implementar** ```python """Configuración de logging estructurado JSON con propagación de trace_id.""" @@ -870,7 +870,7 @@ def clear_trace_id() -> None: clear_contextvars() ``` -- [ ] **Step 3: Verificar y commit** +- [x] **Step 3: Verificar y commit** ```bash pytest tests/unit/test_logging.py -v