Commit Graph

333 Commits

Author SHA1 Message Date
egutierrez c6eae2fcae docs: actualizar skills y CLAUDE.md con pipeline formalizado
- /create-agent SKILL.md: pipeline 8 pasos del script, pasos 8-12 post
- /create-bot SKILL.md: pipeline con health check y self-introduce
- CLAUDE.md: seccion breve de pipeline de 12 pasos con env var clave

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-09 22:46:29 +00:00
egutierrez 9cad643c23 docs: documentar pipeline formalizado de 12 pasos en rules y system prompt
Actualiza create_agent.md con el pipeline completo (12 pasos) al inicio
de la guia, referenciando los scripts de cada paso.

Actualiza system prompt de father-bot con:
- Pipeline de 12 pasos explicito con "nunca saltar pasos"
- Health check (paso 11) via health-check.sh antes de confirmar
- Self-introduce (paso 12) via notify-developer.sh
- Paso de reporte incluye confirmacion de health check y notify
- Manejo de errores para health check y notify

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-09 22:43:49 +00:00
egutierrez 40710b924d feat: agregar display name, health check y mejorar notificacion — issue 0044
Pipeline de creacion formalizado con 3 mejoras:

1. Display name automatico (paso 7): create-full.sh ahora configura
   el display name en Matrix via PUT al profile API con el token
   del bot recien creado. Evita que los bots aparezcan como @id:server.

2. Health check post-arranque: nuevo script health-check.sh que busca
   en los logs del launcher mensajes de arranque exitoso ("e2ee ready",
   "runner started", etc.) con timeout configurable (default 30s).

3. Notificacion enriquecida: notify-developer.sh ahora incluye
   descripcion del agente (leida de config.yaml), tools habilitadas,
   formato markdown con estructura clara, y reintentos con backoff
   (hasta 3 intentos) si el envio de DM falla.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-09 22:38:41 +00:00
egutierrez ca2c5c5275 merge: quick/pipeline-issue — issue 0044 pipeline de creacion formalizado 2026-04-09 22:27:51 +00:00
egutierrez f225d76eff docs: crear issue 0044 — formalizar pipeline de creacion de agentes
Pipeline de 12 pasos obligatorios:
scaffold → build → register → verify E2EE → [convert robot] →
auto-avatar → display name → personalize → rebuild → start →
health check → self-introduce (el bot habla a devs)

Nuevos pasos: display name automatico, health check post-arranque,
y mejora del mensaje de bienvenida. Garantiza consistencia entre
creacion manual (dev-scripts) y via father-bot.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-09 22:27:46 +00:00
egutierrez 944aec89d3 merge: quick/father-bot-e2e-and-security — E2E interactivo + fix admin ACL
- Agregar @egutierrez al grupo admins (fix ACL father-bot)
- Test E2E interactivo: father-bot crea robot via Matrix (validado 3.8min)
2026-04-09 22:23:35 +00:00
egutierrez 452ee63527 test: E2E interactivo — father-bot crea un robot via Matrix
Test de integracion real que:
1. Crea DM con father-bot via Matrix SDK
2. Pide crear un robot simple (e2e-father-test)
3. Espera respuesta de father-bot (timeout 9min, claude-code)
4. Verifica: config.yaml (type: robot), agent.go, compilacion, blank import
5. Cleanup automatico: borra agente, import y env vars

Validado: father-bot creo el robot en ~3min con reporte estructurado.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-09 22:23:28 +00:00
egutierrez 390d110b3d fix: agregar @egutierrez a grupo admins en user-groups.yaml
El usuario principal del servidor no estaba en el grupo admins,
causando que father-bot (y cualquier agente con ACL restrictivo)
denegara el acceso. Solo @admin estaba listado.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-09 22:23:21 +00:00
egutierrez 7ccc4f5aa4 merge: issue/0037-father-bot — father-bot, agente del sistema que crea otros agentes
Primer agente privilegiado en agents/_specials/. Usa claude-code provider
con acceso completo al repo para crear agentes y robots via Matrix.

Cambios principales:
- father-bot: agent.go, config.yaml (claude-code, E2EE, audit, sanitize),
  system prompt con guia de creacion completa y seguridad anti-injection
- Launcher: descubre configs en _specials/ con validacion de tipo
- Seguridad: grupo privileged (admin-only), reestructura de all → general
  para evitar ACL union con everyone
- dev-scripts: _common.sh escanea _specials/ en config_path_for y list_agents_raw
- Issue 0043 creado para guardrails de seguridad futuros
- Tests: ACL privileged vs general, isSpecialConfig, 11 E2E tests
2026-04-09 22:08:29 +00:00
egutierrez 39ba7bdab0 docs: crear y cerrar issue 0037 — father-bot (agente creador)
Implementado como father-bot en agents/_specials/father-bot/.
Mover issue a completed/ y actualizar README.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-09 22:07:57 +00:00
egutierrez bee1f47b65 test: E2E para father-bot — validacion estructural completa
11 tests que verifican:
- agent.go puro (sin imports I/O, registra Rules con ActionKindLLM)
- config.yaml: claude-code provider, bypassPermissions, E2EE, sanitize, audit
- system prompt: guia de creacion, decision tree, convenciones, seguridad
- launcher: import de _specials/father-bot, discovery de _specials/
- security: father-bot en grupo privileged, solo admins en permissions.yaml,
  NO en grupo general (evita ACL union)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-09 22:07:28 +00:00
egutierrez a6100b5154 test: tests para privileged ACL y isSpecialConfig
- TestResolveACL_PrivilegedVsGeneral: verifica que father-bot solo
  es accesible por admins y que agentes generales son accesibles
  por todos. Reproduce la config real de produccion.
- TestIsSpecialConfig_*: 3 tests para la funcion que detecta
  configs de SpecialConfig ya cargados (orchestrator) y los salta
  en el loop de discovery normal del launcher.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-09 22:05:41 +00:00
egutierrez db1a93c3fe feat: ACL admin-only para father-bot via grupo privileged
Reestructura los grupos de seguridad para soportar agentes privilegiados:

- Nuevo grupo 'privileged' con father-bot (solo admins)
- Reemplaza grupo 'all' (wildcard) con 'general' (lista explicita)
  para evitar que el ACL union otorgue permisos de everyone a father-bot
- Documenta en YAML que el ACL es acumulativo y por que privileged
  y general deben ser mutuamente excluyentes

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-09 22:05:32 +00:00
egutierrez be88c6ce7e feat: father-bot — agente del sistema que crea otros agentes via Matrix
Primer agente privilegiado en agents/_specials/. Usa provider claude-code
con acceso completo al repositorio para ejecutar el pipeline de creacion
de agentes de forma autonoma (scaffold, build, register, verify, restart).

Archivos:
- agent.go: reglas puras (DM/mention → LLM)
- config.yaml: claude-code provider, bypassPermissions, E2EE, audit
- prompts/system.md: guia completa de creacion con decision tree,
  convencion de IDs, validaciones y seccion anti-injection

Config: claude-code con working_dir al repo, allowed_tools restringido,
model sonnet, timeout 10m, add_dirs con templates y referencias.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-09 22:05:23 +00:00
egutierrez 2f3f30c86b feat: launcher descubre agentes en _specials/ con validacion de tipo
El launcher ahora escanea agents/_specials/*/config.yaml ademas de
agents/*/config.yaml para descubrir agentes del sistema con identidad
Matrix (ej: father-bot). Los SpecialConfig ya cargados (orchestrator)
se detectan y saltan via isSpecialConfig() para evitar errores de
validacion.

Tambien actualiza dev-scripts/_common.sh para que config_path_for()
y list_agents_raw() incluyan _specials/ en la busqueda.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-09 22:05:13 +00:00
egutierrez cd22c1c861 docs: crear issue 0043 — guardrails de seguridad para father-bot
Issue futuro para implementar capas adicionales de seguridad:
- Developer allowlist via .env (deny-by-default)
- Path scoping para el subprocess claude-code
- Rate limiting de operaciones de creacion
- Audit trail extendido
- Validacion de configs de agentes creados

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-09 22:05:04 +00:00
egutierrez d5339f3f7b merge: issue/0042-auto-avatar-providers — auto-avatar con proveedores gratuitos
Refactoriza profile.go separando UploadMedia/SetAvatarURL, añade sistema
de generacion automatica de avatares (DiceBear, RoboHash, Multiavatar)
con pkg/avatar (puro) + shell/avatar (impuro), nuevo comando
agentctl auto-avatar, e integracion en create-full.sh.
2026-04-09 21:40:55 +00:00
egutierrez fb67ec17a6 docs: crear y cerrar issue 0042 — auto-avatar con proveedores gratuitos
Documenta el diseño completo: proveedores (DiceBear, RoboHash, Multiavatar),
arquitectura pure/impure, integracion CLI y pipeline.
Todas las tareas completadas.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-09 21:40:08 +00:00
egutierrez 890a44b0ca feat: integrar auto-avatar en pipeline de creacion de agentes
create-full.sh ahora genera y aplica un avatar automatico tras registrar
el agente en Matrix. Usa agentctl auto-avatar internamente.
Si falla (sin internet, proveedor caido), continua sin bloquear el pipeline.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-09 21:39:59 +00:00
egutierrez 4f7c96dcc8 test: tests unitarios para pkg/avatar y shell/avatar
- pkg/avatar: 13 tests cubriendo todos los proveedores, estilos, sets,
  edge cases (size=0, unknown provider, chars especiales, determinismo)
- shell/avatar: 6 tests con httptest server local (download OK, JPEG,
  HTTP 404, context cancelled, extensiones por content-type)

No requiere acceso a internet — shell/avatar usa httptest.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-09 21:38:22 +00:00
egutierrez cef681ec87 feat: auto-avatar con proveedores gratuitos (DiceBear, RoboHash, Multiavatar)
Nuevo sistema de generacion automatica de avatares:

- pkg/avatar/ — tipos puros y URL builders para proveedores gratuitos:
  DiceBear (bottts, pixel-art, etc.), RoboHash (robots, monsters),
  Multiavatar (multicultural). Sin I/O.
- shell/avatar/ — fetcher impuro: descarga imagen por HTTP a temp file.
- agentctl auto-avatar <id> — genera, descarga, sube y activa avatar
  con un solo comando. Soporta --provider, --style, --set, --dry-run.

Respeta pure core / impure shell. El seed del avatar es el agent ID,
asi cada bot obtiene una imagen unica y determinista.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-09 21:37:21 +00:00
egutierrez cc8c5a6645 feat: añadir subcomandos upload-media y set-avatar-url en agentctl
Expone las funciones separadas de profile.go como CLI:
- agentctl upload-media <id> <path> — sube sin activar avatar
- agentctl set-avatar-url <id> <mxc://...> — activa un mxc ya subido

Complementa la refactorizacion de shell/matrix/profile.go.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-09 21:37:13 +00:00
egutierrez 730e415dc1 refactor: separar SetAvatar en UploadMedia + SetAvatarURL
SetAvatar hacia dos cosas: subir la imagen y establecerla como avatar.
Ahora son tres funciones separadas:
- UploadMedia: solo sube, devuelve mxc:// URI
- SetAvatarURL: solo establece avatar con un mxc:// URI existente
- SetAvatar: convenience wrapper que llama a ambas

Permite subir imagenes sin activar el avatar, o reusar imagenes ya subidas.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-09 21:37:06 +00:00
egutierrez 3efde2b9bc merge: issue/0000-rename-specials-underscore — convención _ para dirs del sistema
Renombra agents/specials → agents/_specials y documenta la convención
de que directorios con prefijo _ en agents/ son del sistema.
2026-04-09 21:24:21 +00:00
egutierrez c1d118f269 refactor: renombrar agents/specials → agents/_specials
Establece la convención de que directorios con prefijo _ en agents/
son del sistema (templates, specials), no agentes desplegables.

Cambios:
- Renombrar agents/specials/ → agents/_specials/
- Actualizar path en cmd/launcher/main.go (startOrchestrator)
- Documentar convención _ en CLAUDE.md

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-09 21:24:06 +00:00
egutierrez d0ebaa5317 merge: issue/0000-refactor-devagents — mover runtime a devagents/ + issues 0036-0041
agents/ ahora solo contiene carpetas de agentes.
El runtime (Agent, Robot, Runner, registry, handler) vive en devagents/.
Tambien se crean 6 nuevos issues: streaming, creator-bot, widgets,
recordatorios, voz, videollamadas.
2026-04-09 21:19:52 +00:00
egutierrez bd0c8c0dd3 refactor: mover runtime Go de agents/ a devagents/
agents/ ahora solo contiene carpetas de agentes (config, reglas, prompts).
El runtime (Agent, Robot, Runner, registry, handler, commands, llm, memory)
vive en devagents/ como package devagents.

Cambios:
- git mv agents/*.go → devagents/*.go
- package agents → package devagents en todos los archivos movidos
- Actualizar imports en agents/*/agent.go, cmd/launcher/, dev-scripts/
- Actualizar docs: CLAUDE.md, rules/, docs/e2ee.md, issues pendientes

Build y tests pasan sin errores.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-09 21:19:25 +00:00
egutierrez 52d5632d89 docs: crear issues 0036-0041 — nuevas features del sistema
Issues planificados:
- 0036: Claude Code streaming de progreso en Matrix
- 0037: Agente que crea otros agentes/bots via Matrix
- 0038: Webapps y dashboards embebidos en Element via widgets
- 0039: Recordatorios dinámicos y crons que invocan agentes
- 0040: Soporte para mensajes de voz (audio → STT)
- 0041: Videollamadas con agentes via LiveKit

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-09 21:19:09 +00:00
egutierrez 9ec0c16038 merge: issue/0032-e2e-create-agent-skill — agente pirata espacial + E2E tests
Agente test-personality (GPT-4o, personalidad de pirata espacial) creado
con pipeline completo. 11 E2E tests (5 funcionales + 6 pipeline) pasando.
2026-04-09 20:53:57 +00:00
egutierrez 46de98cb73 docs: cerrar issue 0032 y actualizar CLAUDE.md
- Añadir test-personality a tabla de agentes
- Añadir nuevos specs E2E a la lista de tests
- Mover issue a completed, actualizar README

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-09 20:53:50 +00:00
egutierrez aea0f74d4a test: E2E tests para agente test-personality y pipeline de creacion
Tests funcionales (test-personality.spec.ts):
- Saludo con personalidad pirata espacial (keywords flexibles)
- Personalidad consistente en respuestas serias (fotosintesis + pirata)
- !help y !ping funcionan (assertions estrictas)
- Sin errores E2EE

Tests de pipeline (create-agent-pipeline.spec.ts):
- Valida agent.go con Rules() y ActionKindLLM
- Config sin type: robot (es agent por defecto)
- System prompt con personalidad + seccion de seguridad
- LLM configurado (openai/gpt-4o)
- Encryption habilitada, import en launcher

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-09 20:52:34 +00:00
egutierrez 1089d0e765 feat: crear agente test-personality (pirata espacial) para E2E tests
Agente con LLM (GPT-4o) y personalidad de pirata espacial exagerada.
System prompt diseñado para generar keywords detectables en tests:
"arrr", "cosmonauta", "estelar", "marea", "nave", emojis pirata/cohete.

Archivos:
- agents/test-personality/agent.go — regla llm-all (DM + mencion → LLM)
- agents/test-personality/config.yaml — GPT-4o, E2EE habilitado
- agents/test-personality/prompts/system.md — Capitan Nebulosa
- cmd/launcher/main.go — blank import añadido

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-09 20:49:57 +00:00
egutierrez 34bf54f559 merge: issue/0034-e2e-create-bot-skill — robot de prueba + E2E tests + scripts de automatización
Robot test-bot creado con pipeline completo (scaffold → register → verify → E2E).
Scripts mejorados: create-full.sh --type robot, convert-to-robot.sh, notify-developer.sh.
14 E2E tests (7 funcionales + 7 pipeline) todos pasando.
Fix: config loader ya no exige llm.provider para robots.
2026-04-09 20:45:39 +00:00
egutierrez 43c70e904b docs: cerrar issue 0034 y actualizar CLAUDE.md
- Añadir test-bot a tabla de agentes en CLAUDE.md
- Añadir nuevos specs E2E a la lista de tests
- Mover issue a completed, actualizar README

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-09 20:45:17 +00:00
egutierrez f3581721b1 test: E2E tests para robot test-bot y pipeline de creacion
Tests funcionales (test-bot.spec.ts):
- help lista built-in + custom commands sin prefijo !
- ping funciona sin prefijo y con ! (retrocompatible)
- echo repite texto exacto (assertion estricta)
- dice devuelve numero 1-6
- comando desconocido muestra error descriptivo
- sin errores E2EE en el timeline

Tests de pipeline (create-bot-pipeline.spec.ts):
- Valida estructura: agent.go, config.yaml, commands.go
- Verifica type: robot, command_prefix vacio, encryption habilitada
- Confirma ausencia de prompts/system.md
- Verifica import en launcher

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-09 20:43:24 +00:00
egutierrez 9e6d831ea9 docs: actualizar skills /create-bot y /create-agent con nuevos scripts
- /create-bot: usa create-full.sh --type robot (pipeline de 6 pasos)
- /create-agent: documenta --type robot y notificacion a developers
- Referencia actualizada: agents/test-bot/ como ejemplo de robot

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-09 20:36:45 +00:00
egutierrez 7edbbad6b3 feat: scripts para automatizar creacion de robots y notificar developers
Nuevos scripts:
- convert-to-robot.sh: convierte scaffold de agente a robot (config
  minimo, agent.go con nil Rules, sin prompts, command_prefix vacio)
- notify-developer.sh: envia DM a los developers (DEVELOPER_MATRIX_USERS)
  al crear un bot o agente, presentandose con nombre y tipo

Mejorado:
- create-full.sh: acepta --type robot para pipeline completo de robots
  (scaffold → build → register → verify → convert → notify)
- .env.example: añade DEVELOPER_MATRIX_USERS para lista de developers

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-09 20:35:44 +00:00
egutierrez 184d7ca0ae fix: permitir robots sin llm.primary.provider + command_prefix vacio
- internal/config/loader.go: skip validacion de LLM provider cuando
  agent.type es "robot" — los robots no usan LLM
- agents/test-bot/config.yaml: usar command_prefix: "" para que acepte
  comandos sin prefijo ! (feature del issue 0033)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-09 20:33:43 +00:00
egutierrez 235c5ff827 feat: implementar comandos custom !echo y !dice para test-bot
- !echo <texto>: repite el texto recibido (util para assertions exactas)
- !dice / !dado: lanza un dado aleatorio (1-6)
- Registro en cmd/launcher/main.go via testbot.Commands()

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-09 20:25:41 +00:00
egutierrez 899108e3f8 feat: crear robot test-bot para validar pipeline de creacion
Robot command-only (type: robot) sin LLM. Scaffold via create-full.sh,
registrado en Matrix con E2EE verificado. Config minimo basado en
template_robot con encryption habilitada.

Archivos:
- agents/test-bot/agent.go — Rules() retorna nil (robot)
- agents/test-bot/config.yaml — tipo robot, sin LLM
- cmd/launcher/main.go — blank import añadido

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-09 20:24:35 +00:00
egutierrez be00c0da6e docs: actualizar README de issues — marcar 0029, 0033, 0035 como completados
Tambien resuelve conflicto de test helper newTestAgent entre
runtime_test.go (issue 0029) y commands_metrics_test.go (issue 0035)
renombrando el segundo a newMetricsTestAgent.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-09 20:22:36 +00:00
egutierrez 056dd3c73a docs: cerrar issue 0035
Mueve el issue a dev/issues/completed/ tras implementar todas las tareas:
audit trail con AuditWriter y comando !metrics.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-09 20:22:36 +00:00
egutierrez 05668e398f feat: anadir comando !metrics para metricas agregadas del dia actual
Implementa el comando built-in !metrics que lee los JSONL logs del dia
actual usando shell/logger/query.go y calcula agregados en memoria:

- Mensajes recibidos (handling event)
- Comandos ejecutados (command_received)
- Llamadas LLM (count, tokens totales, latencia media)
- Llamadas a tools (count, errores)
- Errores totales (nivel ERROR)
- Total de entradas de log

El comando se registra como built-in disponible para todos los agentes.
Recibe logDir via Option pattern (WithLogDir) para no romper la firma
de agents.New(). El launcher pasa logDir al crear cada agente.

Formatea la salida como tabla markdown para Matrix.
Incluye tests unitarios con logs JSONL sinteticos.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-09 20:22:36 +00:00
egutierrez fb96a79feb feat: implementar audit trail con AuditWriter y emision de eventos
Crea shell/audit/ con Writer que escribe eventos de auditoria a archivo
JSONL y opcionalmente a un room Matrix. Integra la emision de eventos
en los puntos clave del runtime:

- message_received: al recibir cualquier evento Matrix (handler.go)
- command_exec: al ejecutar un comando (handler.go)
- tool_exec: al ejecutar una tool (tools/registry.go via AuditFunc callback)
- llm_request / llm_error: al llamar al LLM (llm.go)

El Writer se inicializa en agents/runtime.go si security.audit.enabled=true.
Usa patron de inyeccion de dependencias (MatrixSender como funcion,
AuditFunc como callback) para evitar acoplamiento entre packages.

Incluye tests completos para el Writer: escritura JSONL, filtrado por
Include, modo solo-file, modo solo-room, auto-set de timestamp.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-09 20:22:36 +00:00
egutierrez 892fe0cb19 docs: cerrar issue 0033
Mover issue 0033-bot-commands-no-prefix a completed/.
Todas las tareas implementadas y tests pasando.
2026-04-09 20:22:36 +00:00
egutierrez dc1193f463 docs: documentar opcion de comandos sin prefijo en create_command.md
Agregar seccion "Comandos sin prefijo (robots)" que explica como configurar
command_prefix: "" para robots que no requieren el prefijo ! en sus comandos.
2026-04-09 20:22:36 +00:00
egutierrez 9a3c09ecf6 test: tests para comandos sin prefijo
Tests del parser (pkg/message/parse_test.go):
- Con prefijo !: comando estandar, con args, sin prefijo no detecta, lowercase
- Sin prefijo: comando bare, con args, ! retrocompatible, primer token, lowercase
- Casos borde: mensaje vacio, solo espacios, solo "!"
- Retrocompatibilidad: "!help" con prefix="" produce mismo resultado que con "!"
- Deteccion de menciones independiente del modo de prefijo

Tests del robot (agents/robot_test.go):
- !help muestra comandos sin ! cuando command_prefix es ""
- Comandos custom en modo sin prefijo
- Mismo conjunto de built-ins en ambos modos
- newTestRobot ahora configura command_prefix: "!" explicitamente
2026-04-09 20:22:36 +00:00
egutierrez 421ab5c773 feat: permitir comandos de robots sin prefijo !
Cuando command_prefix es "" en el config, el parser trata el primer token
del mensaje como nombre de comando sin requerir el prefijo !. Si el token
empieza con !, se le quita igualmente para retrocompatibilidad.

Cambios:
- pkg/message/parse.go: modo sin prefijo en Parse() (puro, sin side effects)
- agents/robot.go: mensaje "comando desconocido" y !help adaptados al prefijo
- agents/handler.go: mensaje "comando desconocido" adaptado al prefijo
- internal/config/schema.go: documentar command_prefix: "" en FiltersCfg
- agents/_template_robot/config.yaml: ejemplo comentado de command_prefix: ""

El comportamiento con command_prefix: "!" no cambia (retrocompatible).
2026-04-09 20:22:36 +00:00
egutierrez 945710034c docs: cerrar issue 0029
Mover issue 0029-core-tests a completed/ tras implementar todos los
tests del runtime y config loader.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-09 20:22:36 +00:00
egutierrez 75b84fdc8d test: añadir tests para handleEvent, runLLM y tool-use loop
Tests de command routing: builtin help/ping, comando desconocido,
RegisterCommand, alias, ACL deniega comando.

Tests de reglas + LLM: DM sin reglas cae a LLM, DM sin LLM ignora,
regla matchea ejecuta accion, ActionKindReply estatico, ActionKindLLM
invoca CompleteFunc, mencion sin reglas cae a LLM, mensaje sin match
ni mencion se ignora, LLM action sin LLM configurado.

Tests de tool-use loop: tool call ejecuta y retorna, tool call falla
pasa error al LLM, max iterations se respeta, RBAC deniega tool call,
error de LLM se propaga.

Infraestructura: mockCompleteFunc con respuestas configurables,
spyMatrixSender que graba mensajes, newTestAgent minimal.

Cobertura: handleEvent 86%, executeActions 79%, runLLM 85%

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-09 20:22:36 +00:00