{
  "schema_version": 1,
  "diagram_type": "dataflow",
  "meta": {
    "title": "AgentSquad Video Production Pipeline",
    "subtitle": "De la idea al video publicado en YouTube — 9 etapas, QA gates en cada transición · consolidado 2026-07-05 (12 capacidades implementadas)",
    "viewBox": [
      1080,
      800
    ]
  },
  "stages": [
    {
      "label": "Ideación & Research"
    },
    {
      "label": "Guion"
    },
    {
      "label": "Assets"
    },
    {
      "label": "Ensamblaje"
    },
    {
      "label": "Distribución"
    }
  ],
  "nodes": [
    {
      "id": "roberto",
      "type": "external",
      "label": "Roberto",
      "sublabel": "INTERVIEW Step 0",
      "stage": 0,
      "row": 0,
      "tag": "tema real"
    },
    {
      "id": "scout",
      "type": "backend",
      "label": "Scout",
      "sublabel": "Apify multi-plataforma",
      "stage": 0,
      "row": 2
    },
    {
      "id": "librarydb",
      "type": "database",
      "label": "library.db",
      "sublabel": "bge-m3 · CF Workers AI",
      "stage": 0,
      "row": 4,
      "tag": "49 winners"
    },
    {
      "id": "guion",
      "type": "backend",
      "label": "Guion REX",
      "sublabel": "13 estructuras + gates.py",
      "stage": 1,
      "row": 2,
      "tag": "LATAM neutro"
    },
    {
      "id": "vo",
      "type": "backend",
      "label": "VO ElevenLabs",
      "sublabel": "gen_efficient.py",
      "stage": 2,
      "row": 0,
      "tag": "voqa >=0.97"
    },
    {
      "id": "avatar",
      "type": "backend",
      "label": "Avatar router",
      "sublabel": "HeyGen / MuAPI / Higgsfield",
      "stage": 2,
      "row": 2,
      "tag": "avatar_qa.py"
    },
    {
      "id": "broll",
      "type": "cloud",
      "label": "B-rolls AI",
      "sublabel": "Sora 2 / Seedance",
      "stage": 2,
      "row": 4
    },
    {
      "id": "compose",
      "type": "backend",
      "label": "Composición",
      "sublabel": "compose.py · FFmpeg",
      "stage": 3,
      "row": 1,
      "tag": "-14 LUFS"
    },
    {
      "id": "pack",
      "type": "backend",
      "label": "Packaging",
      "sublabel": "Pikzels + JuntaYT",
      "stage": 3,
      "row": 3,
      "tag": "titulo <=60c"
    },
    {
      "id": "publish",
      "type": "backend",
      "label": "publish.py",
      "sublabel": "multi-canal · spec.json",
      "stage": 4,
      "row": 0,
      "tag": "idempotente"
    },
    {
      "id": "youtube",
      "type": "external",
      "label": "YouTube",
      "sublabel": "@AgentsSquad-c6p",
      "stage": 4,
      "row": 2
    },
    {
      "id": "metrics",
      "type": "backend",
      "label": "Métricas",
      "sublabel": "monthly.py + YT Brain",
      "stage": 4,
      "row": 4,
      "tag": "CTR Studio"
    }
  ],
  "flows": [
    {
      "from": "roberto",
      "to": "scout",
      "label": "tema grounded",
      "classification": "experiencia real",
      "variant": "emphasis",
      "fromSide": "bottom",
      "toSide": "top",
      "route": "straight",
      "labelAt": [
        100,
        260
      ]
    },
    {
      "from": "scout",
      "to": "librarydb",
      "label": "winners filtrados",
      "classification": "views/edad",
      "variant": "default",
      "fromSide": "bottom",
      "toSide": "top",
      "route": "straight",
      "labelAt": [
        100,
        490
      ]
    },
    {
      "from": "librarydb",
      "to": "guion",
      "label": "briefing patterns",
      "classification": "top-5 semántico",
      "variant": "emphasis",
      "fromSide": "right",
      "toSide": "left",
      "via": [
        [
          210,
          613
        ],
        [
          210,
          385
        ]
      ]
    },
    {
      "from": "guion",
      "to": "vo",
      "label": "guion validado",
      "classification": "gates.py OK",
      "variant": "emphasis",
      "fromSide": "top",
      "toSide": "left",
      "via": [
        [
          315,
          157
        ]
      ]
    },
    {
      "from": "guion",
      "to": "broll",
      "label": "prompts b-roll",
      "classification": "1-by-1, cost gate",
      "variant": "dashed",
      "fromSide": "bottom",
      "toSide": "left",
      "via": [
        [
          315,
          613
        ]
      ]
    },
    {
      "from": "vo",
      "to": "avatar",
      "label": "VO aprobado",
      "classification": "QA >=0.97",
      "variant": "emphasis",
      "fromSide": "bottom",
      "toSide": "top",
      "route": "straight",
      "labelAt": [
        530,
        260
      ]
    },
    {
      "from": "avatar",
      "to": "compose",
      "label": "clips avatar QA",
      "classification": "sin deformidades",
      "variant": "emphasis",
      "fromSide": "right",
      "toSide": "left",
      "via": [
        [
          640,
          385
        ],
        [
          640,
          271
        ]
      ]
    },
    {
      "from": "broll",
      "to": "compose",
      "label": "b-rolls fullscreen",
      "classification": "premium style",
      "variant": "dashed",
      "fromSide": "right",
      "toSide": "bottom",
      "via": [
        [
          672,
          613
        ],
        [
          672,
          385
        ],
        [
          745,
          385
        ]
      ],
      "labelAt": [
        630,
        550
      ]
    },
    {
      "from": "compose",
      "to": "pack",
      "label": "master MP4",
      "classification": "+faststart",
      "variant": "emphasis",
      "fromSide": "bottom",
      "toSide": "top",
      "route": "straight",
      "labelAt": [
        745,
        380
      ]
    },
    {
      "from": "pack",
      "to": "publish",
      "label": "thumb + título",
      "classification": "gate JuntaYT",
      "variant": "security",
      "fromSide": "right",
      "toSide": "left",
      "via": [
        [
          853,
          499
        ],
        [
          853,
          157
        ]
      ],
      "labelAt": [
        853,
        300
      ]
    },
    {
      "from": "publish",
      "to": "youtube",
      "label": "video_id",
      "classification": "por canal",
      "variant": "emphasis",
      "fromSide": "bottom",
      "toSide": "top",
      "route": "straight",
      "labelAt": [
        960,
        260
      ]
    },
    {
      "from": "youtube",
      "to": "metrics",
      "label": "CTR / AVD",
      "classification": "loop mensual",
      "variant": "dashed",
      "fromSide": "bottom",
      "toSide": "top",
      "route": "straight",
      "labelAt": [
        960,
        490
      ]
    }
  ],
  "cards": [
    {
      "dot": "rose",
      "title": "QA gates (bloquean avance)",
      "items": [
        "VO: similitud faster-whisper >= 0.97 antes de avanzar",
        "Avatar: avatar_qa.py en CADA render (deformidades)",
        "Título: JuntaYT automática — se ejecuta su mejor recomendación, <= 60c",
        "Video final: verificado con screenshots antes de entregar"
      ]
    },
    {
      "dot": "cyan",
      "title": "Reglas duras de contenido",
      "items": [
        "Español LATAM neutro, sin voseo; 'inteligencia artificial' en VO",
        "NUNCA nombrar cantidad de agentes ni tenure",
        "Safe-zones vertical: texto en x<936 / y<1632",
        "Audio: loudnorm -14 LUFS, normalización por clip"
      ]
    },
    {
      "dot": "emerald",
      "title": "Loop de aprendizaje",
      "items": [
        "Métricas mensuales alimentan la siguiente ideación",
        "CTR solo de YouTube Studio (API no lo expone)",
        "YouTube Brain guarda aprendizajes por video"
      ]
    },
    {
      "dot": "orange",
      "title": "Consolidado 2026-07-05",
      "items": [
        "Embeddings gratuitos: Cloudflare Workers AI bge-m3 (multilingüe ES/EN)",
        "Publicación multi-canal: agentsquad · ai4m · latam, con thumbnail y playlist",
        "Entrega estándar scriptada: lib/cfstream.py → Cloudflare Stream (E2E)",
        "Métricas LATAM fuera de alcance por decisión (código listo si se retoma)"
      ]
    }
  ]
}