Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
6406605
checkpoint(ia360): snapshot motor+freetext-agent+booking antes de fix…
SoyAlek Jun 3, 2026
0f34a0f
fix(ia360): arranque en frio robusto + G-G hot-lead handoff + action=…
SoyAlek Jun 3, 2026
cfde731
revert(ia360): quitar handoff G-G duplicado en flow100m (syncIa360Dea…
SoyAlek Jun 3, 2026
42fcdd5
fix(ia360): wantsList gate (list_bookings alcanzable en Reunion agend…
SoyAlek Jun 4, 2026
7312b38
Implement persona-first vCard sequence selector
SoyAlek Jun 5, 2026
c0d4ea6
Add persona-first WhatsApp owner guardrails
SoyAlek Jun 5, 2026
75d82f2
Add QA persona hint guard
SoyAlek Jun 5, 2026
f12325b
Add IA360 memory store
SoyAlek Jun 6, 2026
9eebf4a
checkpoint(ia360): scheduler recordatorios + gap #1/#5 webhook + add-…
SoyAlek Jun 9, 2026
d10dea5
checkpoint(ia360): Revenue OS P5 webhook handler (estado vivo en prod…
SoyAlek Jun 9, 2026
0dfcf54
feat(ia360): canary reversible Brain v2 en webhook.js (allowlist owne…
SoyAlek Jun 9, 2026
5c8fac5
fix(ia360): canary Brain v2 timeout 30s->90s (gpt-5 responder es lent…
SoyAlek Jun 9, 2026
cea0953
feat(ia360): validador pre-Meta de templates (bloquea #132000/#132012…
SoyAlek Jun 9, 2026
f816042
feat(ia360): approve-send último metro P0 — tarjeta de aprobación pos…
SoyAlek Jun 9, 2026
b1e8ebb
fix(ia360): approve-send — wildcard * en allowlist (aprobación del ow…
SoyAlek Jun 9, 2026
2f68797
feat(ia360): expediente del contacto al agente — callIa360Agent inclu…
SoyAlek Jun 9, 2026
1660367
fix(ia360): expediente del agente sube de 8 a 12 facts (el menu carga…
SoyAlek Jun 9, 2026
0cd223e
feat(ia360): bandeja de ideas del owner — comando idea:, tarjeta de r…
SoyAlek Jun 10, 2026
f4b56b2
checkpoint(ia360): estado vivo pre-consola — guardrail UX Quiero mapa…
SoyAlek Jun 10, 2026
58927c0
feat(ia360): comando del owner "qué sabes de <nombre|número>" — exped…
SoyAlek Jun 10, 2026
b7f995f
feat(ia360): openers v2 persona-first con interactive (botones/lista)…
SoyAlek Jun 10, 2026
f94fe26
feat(ia360): G-C — ruteo real seq_*, anti-loop 100M, CTAs únicos y de…
SoyAlek Jun 10, 2026
9b6b537
feat(ia360): G-D — selector de secuencias RECOMENDADO (ranker rule-ba…
SoyAlek Jun 10, 2026
2e8ec6b
test(ia360): harness QA por pipeline — starters reales, metadata vera…
SoyAlek Jun 10, 2026
f4f34fb
feat(ia360): G-WIN quick-win mapa de cartera (P7 Champions, persona c…
SoyAlek Jun 11, 2026
fbe4e38
feat(ia360): G-COLD — cold send para las 24 secuencias persona-first
SoyAlek Jun 11, 2026
30084f1
fix(ia360): no-silencio P0 cliente activo/beta — dry-run de memoria y…
SoyAlek Jun 11, 2026
a4581dd
feat(ia360): G-LIVE no-silencio producción — respuesta real del agent…
SoyAlek Jun 11, 2026
38fe3e8
feat(ia360): G-BRAIN — conversación con memoria y cierre + dedupe ató…
SoyAlek Jun 11, 2026
2af49a4
feat(ia360): G-RAG — puente seguro AlekContenido <-> RAG (tabla puent…
SoyAlek Jun 12, 2026
8618979
feat(ia360): G6 — botones de opener (Si,cuentame/Ahora no) ya no muer…
SoyAlek Jun 15, 2026
756aea1
feat(ia360): G5 — circuit breaker + alerta de pago (131042) en el web…
SoyAlek Jun 15, 2026
5dd1a1b
merge G6 opener buttons
SoyAlek Jun 15, 2026
82faf70
merge G5 payment circuit breaker
SoyAlek Jun 15, 2026
aaa7a2a
feat(ia360): G8 P0 — deals de aliado/referido BNI van a su pipeline (…
SoyAlek Jun 16, 2026
1bb6a0e
feat(ia360): G9 — comando del owner para teclear la INTRO del referid…
SoyAlek Jun 16, 2026
d187c71
merge G8 aliado pipeline routing
SoyAlek Jun 16, 2026
bf9f4f3
merge G9 quien_intro
SoyAlek Jun 16, 2026
7bd4533
docs: runbook operativo IA360 para agentes en el VPS (claude/codex) +…
SoyAlek Jun 16, 2026
73e111c
docs: runbook + prompt orquestador tmux para agentes del VPS
SoyAlek Jun 16, 2026
adf7c5f
feat(ia360): G10 P2 — stages Fit identificado/Diagnostico compartido …
SoyAlek Jun 16, 2026
d8f68ee
fix(ia360): G10 — el deal Fit identificado va al contacto partner, no…
SoyAlek Jun 16, 2026
9e0256f
docs(runbook): G10 desplegado + P1/P2 estado actualizado (P1 verifica…
SoyAlek Jun 16, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .cleanup-backup-20260610/bot_events_backup.csv

Large diffs are not rendered by default.

18 changes: 18 additions & 0 deletions .cleanup-backup-20260610/bot_facts_backup.csv

Large diffs are not rendered by default.

178 changes: 178 additions & 0 deletions .cleanup-backup-20260610/deal5_backup.csv

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions .cleanup-backup-20260610/owner_contact_backup.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
id,wa_number,contact_number,name,created_at,updated_at,tags,custom_fields,assigned_user_id,profile_name
2,5213321594582,5213322638033,Alejandro Orozco Flores,2026-06-01 19:41:55.147517+00,2026-06-10 20:08:08.377111+00,"[""campana-ia360"", ""cancelada-aprobada"", ""decisor:decisor_final"", ""detalle-solicitado"", ""diagnostico-enviado"", ""diagnostico-ia360"", ""dolor-captura-manual"", ""dolor-seguimiento-ventas"", ""dolor:ventas"", ""ejemplo-solicitado"", ""explorando"", ""hot-lead"", ""ia360-vcard"", ""intencion-detectada"", ""interes-erp-integraciones"", ""interes-gobierno-ia"", ""interes-og4-diagnostico"", ""llamada-solicitada"", ""mapa-30-60-90-solicitado"", ""mecanismo-agentic-followup"", ""mecanismo-erp-bi"", ""mecanismo-whatsapp-crm"", ""no-prioritario"", ""nutricion-suave"", ""oferta:Premium"", ""oferta:Starter"", ""owner-intake"", ""owner-pipe-guardar"", ""owner-pipe-pendiente"", ""owner-pipe-persona_beta"", ""pipeline:revenue-os"", ""pre-call-ia360"", ""preferencia:contactar_mas_adelante"", ""preferencia:interes_especifico"", ""problema-reconocido"", ""prospecting-100m"", ""requiere-alek"", ""respondio-diagnostico"", ""reunion-confirmada"", ""reunion-solicitada"", ""revenue-os-calificado"", ""revenue-os-diseno-propuesto"", ""revenue-os-handoff-agenda"", ""revenue-os-interesado"", ""staged"", ""texto-libre-ia"", ""urgencia:esta_semana"", ""urgencia:este_mes"", ""zoom-creado""]","{""email"": null, ""stage"": ""Capturado / Por rutear"", ""staged"": true, ""espo_id"": ""6a222ddec21f79bf7"", ""ia360_rol"": ""CDO"", ""area_dolor"": ""Gobierno IA"", ""ia360_fuga"": ""doble_captura"", ""captured_at"": ""2026-06-05T22:37:53.960Z"", ""captured_by"": ""owner-whatsapp"", ""ia360_dolor"": ""ventas"", ""vcard_wa_id"": ""5213322638033"", ""owner_action"": ""solo_guardar"", ""referido_por"": ""5213322638033"", ""campana_ia360"": ""IA360 100M WhatsApp prospecting"", ""fuente_origen"": ""whatsapp-template-100m"", ""ia360_empresa"": ""Geek Studio"", ""ia360_sistema"": ""otro"", ""intake_source"": ""b29-vcard-whatsapp"", ""area_operacion"": ""operación cliente"", ""ia360_bookings"": [{""start"": ""2026-06-12T19:00:00.000Z"", ""zoom_id"": 86520922242, ""event_id"": ""q2ka0gakk9g34b8mrbt5vrgamo""}, {""start"": ""2026-06-10T22:00:00.000Z"", ""zoom_id"": 81685035029, ""event_id"": ""uv950935pdc9540mm58h2t9bg4""}], ""ia360_objetivo"": ""Tesitng"", ""ia360_sistemas"": ""Todos"", ""ia360_urgencia"": ""este_mes"", ""dolor_principal"": ""Trabajo manual / doble captura en ERP"", ""ia360_resultado"": ""Automatizar la prospección de empresarios de alto nivel"", ""owner_action_at"": ""2026-06-05T22:42:30.872Z"", ""vcard_phone_raw"": ""+52 1 33 2263 8033"", ""proximo_followup"": ""Alek debe proponer llamada y objetivo"", ""ia360_preferencia"": ""contactar_mas_adelante"", ""pipeline_sugerido"": ""guardar"", ""source_message_id"": ""wamid.HBgNNTIxMzMyMjYzODAzMxUCABIYFDNFQjA0MTQ5NUE3QURCMzRENTlGAA=="", ""ultimo_cta_enviado"": ""apply_call_terminal"", ""ia360_booking_start"": ""2026-06-10T22:00:00.000Z"", ""ia360_revenue_canal"": ""excel"", ""ia360_revenue_dolor"": ""Hoy se confian a la memoria y un Excel, se nos pierden como 20 leads al mes"", ""ia360_revenue_state"": ""nutricion"", ""servicio_recomendado"": ""Diagnóstico IA360"", ""ia360_booking_zoom_id"": 81685035029, ""ia360_oferta_sugerida"": ""Starter"", ""ia360_revenue_volumen"": ""20 leads"", ""ia360_booking_event_id"": ""uv950935pdc9540mm58h2t9bg4"", ""ia360_ultima_respuesta"": ""Llamada"", ""ia360_revenue_started_at"": ""2026-06-09T00:29:41.004Z"", ""ia360_revenue_calificacion_raw"": ""Hoy se confian a la memoria y un Excel, se nos pierden como 20 leads al mes"", ""ia360_owner_number_vcard_blocked_at"": ""2026-06-06T00:27:49.778Z"", ""ia360_owner_number_vcard_blocked_name"": ""QA Owner Number Block"", ""ia360_owner_number_vcard_blocked_reason"": ""shared_contact_phone_matches_owner"", ""ia360_owner_number_vcard_blocked_source_message_id"": ""wamid.qa.ownerblock.1780705669702""}",,Alek
4 changes: 4 additions & 0 deletions .cleanup-backup-20260610/owner_meeting_links_backup.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
token,event_id,contact_number,kind,start_utc,end_utc,summary,zoom_join_url,created_at,expires_at,reminder_1d_sent_at,reminder_sameday_am_sent_at,reminder_1h_sent_at,reminder_starting_sent_at
KEQE-kCbWjJ2ajvNUGZm5F8c,q2ka0gakk9g34b8mrbt5vrgamo,5213322638033,cal,2026-06-12 19:00:00+00,2026-06-12 20:00:00+00,Reunion con Alek (TransformIA),https://us06web.zoom.us/j/86520922242?pwd=aHDg0eR32lEfoNGCBPOPXPxIIwJQOQ.1,2026-06-09 00:31:37.000899+00,2026-06-14 07:00:00+00,,,,
n0AzZqbgc9GkyFFqliXVgRML,uv950935pdc9540mm58h2t9bg4,5213322638033,cal,2026-06-10 22:00:00+00,2026-06-10 23:00:00+00,Reunion con Alek (TransformIA),https://us06web.zoom.us/j/81685035029?pwd=aeH4oq9elzeIf8L0OAhLsxtzmrIu9F.1,2026-06-09 19:32:08.325384+00,2026-06-12 10:00:00+00,2026-06-09 19:35:32.932568+00,2026-06-10 14:00:11.42997+00,,
jWSlWnqG1kXTpWvNsNf926ln,r11rv3ajrbkjt1pmei6781ep30,5213322638033,cal,2026-06-11 16:00:00+00,2026-06-11 17:00:00+00,Reunion con Alek (TransformIA),https://us06web.zoom.us/j/87042400174?pwd=bVdlext7aPvuVumcjMhnSaHbmS7Xex.1,2026-06-08 21:49:37.177451+00,2026-06-13 04:00:00+00,2026-06-10 15:03:23.135121+00,,,
6 changes: 6 additions & 0 deletions .forgechat-credentials
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
ForgeChat POC credentials
URL local: http://127.0.0.1:4017
Admin email: admin@forgechat.local
Admin password: y3YNoh5lEQHVcPoD/5kk3XBP
Meta webhook verify token: 7419999ee702323c2d73e917826df514
Created: 2026-06-01T16:43:27+00:00
2 changes: 2 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# ForgeChat — el codigo y el runbook estan en ./backend
Lee backend/AGENTS.md (runbook operativo IA360) antes de trabajar. El backend se despliega desde aqui: docker compose build forgecrm-backend && docker compose up -d forgecrm-backend
2 changes: 2 additions & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# ForgeChat — el codigo y el runbook estan en ./backend
Lee backend/AGENTS.md (runbook operativo IA360) antes de trabajar. El backend se despliega desde aqui: docker compose build forgecrm-backend && docker compose up -d forgecrm-backend
69 changes: 69 additions & 0 deletions DEPLOYMENT-WA-GEEKSTUDIO.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
# ForgeChat POC — wa.geekstudio.dev

Fecha: 2026-06-01

## URL pública

- https://wa.geekstudio.dev

## Ruta de despliegue

- Repo/compose: `/home/alek/stack/forgechat-poc`
- Caddy global: `/home/alek/stack/caddy/Caddyfile`
- Cloudflare Tunnel config: `/etc/cloudflared/config.yml`

## Servicios

Docker Compose en `/home/alek/stack/forgechat-poc`:

- `forgecrm-db` — PostgreSQL 15
- `redis` / container `forgecrm-redis` — Redis
- `forgecrm-backend` — Node backend en puerto interno `3011`
- `forgecrm-frontend` — Nginx frontend, publicado localmente en `127.0.0.1:4017`

Ingress:

- Cloudflare DNS/tunnel: `wa.geekstudio.dev`
- cloudflared ingress: `wa.geekstudio.dev` → `http://localhost:8094`
- Caddy local listener `:8094` → `127.0.0.1:4017`
- ForgeChat frontend `/api/*` proxy interno → backend `forgecrm-backend:3011`

## Configuración ajustada

- `backend/.env`: `CORS_ORIGIN=https://wa.geekstudio.dev`
- `backend/.env`: `NODE_ENV=production`

Credenciales admin locales guardadas en:

- `/home/alek/stack/forgechat-poc/.forgechat-credentials`

No exponer ese archivo en chats ni commits.

## Verificación ejecutada

- `https://wa.geekstudio.dev/` respondió `HTTP/2 200` vía Cloudflare/Caddy.
- HTML público contiene: `ForgeChat — Inbox & CRM for WhatsApp Business`.
- Login admin por API respondió `HTTP 200`.
- `/api/auth/me` con cookie respondió `HTTP 200`.
- Sesión admin expone páginas visibles:
- `home`
- `chats`
- `contacts`
- `pipelines`
- `bulk-message`
- `template-builder`
- `chatbot-builder`
- `media-library`
- `admin-settings:whatsapp-accounts`
- `admin-settings:users`

## Pendiente para Meta WhatsApp Cloud API real

1. Crear/configurar Meta App y WhatsApp Business Account.
2. Configurar callback público:
- `https://wa.geekstudio.dev/api/webhook/whatsapp`
3. Usar el verify token configurado en `META_WEBHOOK_VERIFY_TOKEN`.
4. Cargar/guardar `META_ACCESS_TOKEN` y datos de cuenta/número desde la UI o env según flujo de ForgeChat.
5. Probar handshake webhook de Meta.
6. Probar envío/recepción real con número de prueba antes de producción.
7. Evaluar licencia Sustainable Use License antes de adopción productiva/comercial amplia.
84 changes: 84 additions & 0 deletions ORQUESTADOR-tmux-prompt.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
# Prompt — Orquestador tmux (automator) para IA360 / ForgeChat

Pega esto a un claude o codex corriendo EN el VPS (`~/stack/forgechat-poc/backend`).
Es el cerebro orquestador; los ejecutores son agentes headless que tú lanzas en tmux.

---

Eres el **ORQUESTADOR**. NO implementas tú: descompones el objetivo en *goals* verificables,
lanzas un **ejecutor headless por goal en su propia sesión tmux**, y **auditas en el disco real**
lo que cada ejecutor reporta como hecho (no confías en su transcript). Tu superpoder es tmux:
úsalo como automator para correr varios ejecutores en paralelo y vigilarlos sin bloquearte.

## Entorno (ya estás dentro del VPS Linux)
- Shell por defecto = **fish**. Para todo script/`$()`/`&&` usa `bash -lc '...'`.
- Backend (código): `~/stack/forgechat-poc/backend` (git, rama `main`, remoto Forgemind-git/ForgeChat — push da 403, ignóralo, commitea local).
- Deploy: `~/stack/forgechat-poc` → `docker compose build forgecrm-backend && docker compose up -d forgecrm-backend`.
- Código **BAKEADO**: editar disco NO afecta producción hasta build+up. Es tu red de seguridad.
- DB: contenedor `forgecrm-db` (Postgres), `DATABASE_URL` en `backend/.env`, esquema `coexistence.*`.
- Cerebro: n8n (`n8n.geekstudio.dev`), Brain v2 workflow `b74vYWxP5YT8dQ2H`.
- Owner WhatsApp `5213322638033`; bot `5213321594582`; **sandbox = prefijo `52199900*`**.
- **Runbook operativo completo: `~/stack/forgechat-poc/backend/AGENTS.md`. Léelo antes de nada.**

## Reglas duras (rómpelas y vales verga)
1. **NUNCA asumas que funciona. Testea con DATOS**: corre los tests tú mismo y verifica el efecto en la DB / en el WhatsApp del owner. Reportar "debería funcionar" está prohibido.
2. **CERO egress a números reales** sin OK explícito de Alek. Pruebas solo con sandbox `52199900*` o el owner.
3. **No reinicies el backend** (build+up) sin avisar a Alek. El deploy es un gate humano.
4. El orquestador **audita en disco**, no en el transcript del ejecutor: corre el check, lee el diff, confirma que el container no se reinició.
5. Español correcto (acentos, ñ). Sin emojis en scripts.
6. Un goal nunca es vago. Siempre: **end-state medible + check concreto + constraints + cota de turnos ("para tras N turnos")**.

## Mecánica tmux (tu automator)
Lanzar un ejecutor headless para un goal (read-only o con cambios en rama):
```bash
# 1) escribe el goal a archivo (evita el infierno de comillas)
cat > /tmp/<id>-goal.txt <<'GOAL'
/goal <end-state + DONE CUANDO + CONTEXTO por rutas + CONSTRAINTS duros + REPORTA>
GOAL
# 2) launcher en bash (el pane de tmux es fish; fuerza bash)
cat > /tmp/run-<id>.sh <<'RUN'
#!/bin/bash
cd ~/stack/forgechat-poc/backend
claude --dangerously-skip-permissions -p "$(cat /tmp/<id>-goal.txt)" 2>&1 | tee ~/<id>.log
echo "DONE_<id>"
RUN
chmod +x /tmp/run-<id>.sh
tmux new-session -d -s <id> "bash /tmp/run-<id>.sh"
```
Monitorear sin bloquearte (sondea, no asumas):
```bash
tmux capture-pane -t <id> -p | tail -20 # ver progreso
grep -c "DONE_<id>" ~/<id>.log # terminó?
pgrep -f "claude --dangerously" | head # sigue vivo?
```
Recoger y limpiar: cuando todos terminen, `tmux kill-session -t <id>`.

**Paralelización:** lanza en sesiones tmux distintas los goals **independientes** (no tocan el mismo
archivo ni dependen entre sí) y vigílalos a la vez. Los goals **dependientes** (mismo archivo, o uno
necesita el output del otro) van en secuencia. Si dos goals tocan `webhook.js`, ejecútalos en serie
o en ramas separadas y resuelve el merge tú (conflictos de `require` → conserva ambos bloques).

## Ciclo de cada goal
1. **Descompón**: end-state, check, constraints, cota. Saca la lógica a un módulo puro testeable.
2. **Lanza** el ejecutor en tmux (arriba). El ejecutor: rama `gN-nombre` desde `main`, implementa, `node --check`, escribe test REAL en `test/` (sin deps externas — npm no corre), corre el test, commitea en la rama. **Sin deploy.**
3. **Audita en disco** (tú, el orquestador): `node --check`, `node --test test/<archivo>.test.js` corrido por ti, `git diff main...gN --stat`, confirma `docker ps` (container no reiniciado), revisa la calidad (no solo que pase tests: que los símbolos runtime existan, que la lógica sea coherente).
4. **Veredicto**: APROBADO → merge a main; RECHAZADO → re-lanza el ejecutor con feedback concreto del disco (self-healing).
5. **Integra**: merge a main, corre TODOS los tests, **deploy** (build+up, avisa a Alek), verifica arranque (`[ForgeChat] Backend running on port 3011`).
6. **Prueba en vivo con datos**: envía/teclea desde el owner o inyecta sandbox, y **verifica el efecto en la DB**. Si no lo ves en datos, no está hecho.

## Estado actual y objetivo
Desplegado en `main`: G6 (botones opener), G5 (circuit breaker pago 131042), G8 (deals aliado→pipeline 6),
G9 (comando `intro <contacto>: <quien>`). Pendientes (ver AGENTS.md §backlog):
- **P1**: test vivo de `quien_intro` (owner teclea `intro 5210000002102: <quien>` → verificar en `coexistence.contacts`).
- **P2**: etapas **Blueprint** y **Propuesta** del journey de aliado BNI (templates nuevos en Meta + secuencias; stages pipeline 6 `Fit identificado` pos0 y `Diagnóstico compartido` pos3 sin callsite).
- **DEFERRED**: latencia del cerebro Brain v2 (timeout 30s lo corta) — async sin timeout.
- **Push 403** del backend a GitHub (permiso de AlekZen en Forgemind-git/ForgeChat).

Objetivo de negocio que manda: **que el pipeline VENDA con lógica** y mande templates de forma lógica
(para el owner y para contactos/clientes), respetando los customer journeys definidos
(`05-Agentes/auditorias/2026-06-15-pipeline-aliado-bni-vs-journey.md` y `03-Recursos/Customer journeys - TransformIA.md`).

## Arranque
1. Lee `AGENTS.md` y el doc del journey de aliado.
2. Propón a Alek el plan de goals (tabla: goal · end-state · check · paralelizable sí/no) y **espera su OK**.
3. Ejecuta el ciclo, auditando en disco cada `done`, probando en vivo con datos. Reporta corto y honesto: qué quedó probado con datos y qué falta.
Loading