<?xml version="1.0" encoding="UTF-8"?>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1200 820" width="1200" height="820" font-family="Helvetica, Arial, sans-serif">
  <defs>
    <linearGradient id="ctrlGrad" x1="0%" y1="0%" x2="0%" y2="100%">
      <stop offset="0%" style="stop-color:#FFEBEE"/>
      <stop offset="100%" style="stop-color:#FFCDD2"/>
    </linearGradient>
    <linearGradient id="mcpGrad" x1="0%" y1="0%" x2="0%" y2="100%">
      <stop offset="0%" style="stop-color:#E8EAF6"/>
      <stop offset="100%" style="stop-color:#9FA8DA"/>
    </linearGradient>
    <linearGradient id="taskGrad" x1="0%" y1="0%" x2="0%" y2="100%">
      <stop offset="0%" style="stop-color:#FFF3E0"/>
      <stop offset="100%" style="stop-color:#FFB74D"/>
    </linearGradient>
    <linearGradient id="taskActive" x1="0%" y1="0%" x2="0%" y2="100%">
      <stop offset="0%" style="stop-color:#FFF59D"/>
      <stop offset="100%" style="stop-color:#FBC02D"/>
    </linearGradient>
    <linearGradient id="taskIdle" x1="0%" y1="0%" x2="0%" y2="100%">
      <stop offset="0%" style="stop-color:#F5F5F5"/>
      <stop offset="100%" style="stop-color:#E0E0E0"/>
    </linearGradient>
    <filter id="shadow" x="-4%" y="-4%" width="110%" height="115%">
      <feDropShadow dx="2" dy="2" stdDeviation="2.5" flood-color="#000" flood-opacity="0.18"/>
    </filter>
    <marker id="arr-c" markerWidth="9" markerHeight="7" refX="8" refY="3.5" orient="auto" markerUnits="strokeWidth">
      <polygon points="0 0,9 3.5,0 7" fill="#C62828"/>
    </marker>
    <marker id="arr-c-r" markerWidth="9" markerHeight="7" refX="1" refY="3.5" orient="auto" markerUnits="strokeWidth">
      <polygon points="9 0,0 3.5,9 7" fill="#C62828"/>
    </marker>
    <marker id="arr-m" markerWidth="9" markerHeight="7" refX="8" refY="3.5" orient="auto" markerUnits="strokeWidth">
      <polygon points="0 0,9 3.5,0 7" fill="#283593"/>
    </marker>
    <marker id="arr-m-r" markerWidth="9" markerHeight="7" refX="1" refY="3.5" orient="auto" markerUnits="strokeWidth">
      <polygon points="9 0,0 3.5,9 7" fill="#283593"/>
    </marker>
  </defs>

  <rect width="1200" height="820" fill="#FAFAFA" rx="6"/>

  <!-- TITLE -->
  <text x="600" y="32" text-anchor="middle" font-size="20" font-weight="bold" fill="#1A237E">From Serial Hand-Off to Swarm</text>
  <text x="600" y="54" text-anchor="middle" font-size="13" fill="#666" font-style="italic">The pattern AOPM replaces &#x2014; and the pattern it enables</text>

  <!-- ===== LEFT: SERIAL CONTROLLER (PRE-MCP) ===== -->
  <g>
    <rect x="30" y="80" width="560" height="710" rx="10" fill="#FFFAFA" stroke="#C62828" stroke-width="2" stroke-dasharray="4 0"/>
    <text x="310" y="108" text-anchor="middle" font-size="16" font-weight="bold" fill="#B71C1C">Pre-MCP: Serialized Controller Pattern</text>
    <text x="310" y="128" text-anchor="middle" font-size="12" fill="#C62828" font-style="italic">Each task returns guidance &#x2192; controller picks the next task &#x2192; one task runs at a time</text>

    <!-- Ad-hoc subprocess outline -->
    <rect x="60" y="150" width="500" height="370" rx="14" fill="none" stroke="#9E9E9E" stroke-width="1.5" stroke-dasharray="6 4"/>
    <text x="310" y="170" text-anchor="middle" font-size="12" fill="#616161" font-style="italic">BPMN Ad-Hoc Sub-Process</text>

    <!-- Controller -->
    <ellipse cx="310" cy="240" rx="120" ry="46" fill="url(#ctrlGrad)" stroke="#C62828" stroke-width="2.5" filter="url(#shadow)"/>
    <text x="310" y="234" text-anchor="middle" font-size="14" font-weight="bold" fill="#B71C1C">Controller</text>
    <text x="310" y="252" text-anchor="middle" font-size="11" fill="#B71C1C" font-style="italic">rule / human / AI orchestrator</text>

    <!-- Task pool: 5 tasks, only T2 active -->
    <g>
      <rect x="80" y="350" width="80" height="60" rx="10" fill="url(#taskIdle)" stroke="#9E9E9E" stroke-width="1.4"/>
      <text x="120" y="378" text-anchor="middle" font-size="12" font-weight="bold" fill="#616161">T1</text>
      <text x="120" y="395" text-anchor="middle" font-size="9" fill="#9E9E9E">done</text>

      <rect x="180" y="350" width="80" height="60" rx="10" fill="url(#taskActive)" stroke="#F57C00" stroke-width="2" filter="url(#shadow)"/>
      <text x="220" y="378" text-anchor="middle" font-size="12" font-weight="bold" fill="#E65100">T2</text>
      <text x="220" y="395" text-anchor="middle" font-size="9" fill="#BF360C">running</text>

      <rect x="280" y="350" width="80" height="60" rx="10" fill="url(#taskIdle)" stroke="#9E9E9E" stroke-width="1.4"/>
      <text x="320" y="378" text-anchor="middle" font-size="12" font-weight="bold" fill="#616161">T3</text>
      <text x="320" y="395" text-anchor="middle" font-size="9" fill="#9E9E9E">idle</text>

      <rect x="380" y="350" width="80" height="60" rx="10" fill="url(#taskIdle)" stroke="#9E9E9E" stroke-width="1.4"/>
      <text x="420" y="378" text-anchor="middle" font-size="12" font-weight="bold" fill="#616161">T4</text>
      <text x="420" y="395" text-anchor="middle" font-size="9" fill="#9E9E9E">idle</text>

      <rect x="480" y="350" width="80" height="60" rx="10" fill="url(#taskIdle)" stroke="#9E9E9E" stroke-width="1.4"/>
      <text x="520" y="378" text-anchor="middle" font-size="12" font-weight="bold" fill="#616161">T5</text>
      <text x="520" y="395" text-anchor="middle" font-size="9" fill="#9E9E9E">idle</text>
    </g>

    <!-- Arrows: every task goes ONLY through controller -->
    <line x1="120" y1="350" x2="270" y2="285" stroke="#C62828" stroke-width="1.5" stroke-dasharray="3 3" opacity="0.5"/>
    <line x1="220" y1="350" x2="290" y2="285" stroke="#C62828" stroke-width="2.5" marker-start="url(#arr-c-r)" marker-end="url(#arr-c)"/>
    <line x1="320" y1="350" x2="320" y2="285" stroke="#C62828" stroke-width="1.5" stroke-dasharray="3 3" opacity="0.5"/>
    <line x1="420" y1="350" x2="350" y2="285" stroke="#C62828" stroke-width="1.5" stroke-dasharray="3 3" opacity="0.5"/>
    <line x1="520" y1="350" x2="370" y2="285" stroke="#C62828" stroke-width="1.5" stroke-dasharray="3 3" opacity="0.5"/>

    <!-- Timeline -->
    <text x="310" y="552" text-anchor="middle" font-size="12" font-weight="bold" fill="#37474F">Execution Timeline</text>
    <line x1="80" y1="575" x2="540" y2="575" stroke="#37474F" stroke-width="1.5"/>
    <text x="80" y="595" font-size="10" fill="#37474F">t&#x2080;</text>
    <text x="540" y="595" font-size="10" fill="#37474F">t&#x2099;</text>

    <rect x="85" y="563" width="80" height="14" fill="#FBC02D" stroke="#F57C00"/>
    <text x="125" y="574" text-anchor="middle" font-size="9" fill="#5D4037">T1</text>
    <rect x="170" y="563" width="80" height="14" fill="#FBC02D" stroke="#F57C00"/>
    <text x="210" y="574" text-anchor="middle" font-size="9" fill="#5D4037">T2</text>
    <rect x="255" y="563" width="80" height="14" fill="#FBC02D" stroke="#F57C00"/>
    <text x="295" y="574" text-anchor="middle" font-size="9" fill="#5D4037">T3</text>
    <rect x="340" y="563" width="80" height="14" fill="#FBC02D" stroke="#F57C00"/>
    <text x="380" y="574" text-anchor="middle" font-size="9" fill="#5D4037">T4</text>
    <rect x="425" y="563" width="80" height="14" fill="#FBC02D" stroke="#F57C00"/>
    <text x="465" y="574" text-anchor="middle" font-size="9" fill="#5D4037">T5</text>

    <text x="310" y="618" text-anchor="middle" font-size="11" fill="#B71C1C" font-style="italic">strict serialization &#x2014; the controller is the only path</text>

    <!-- Cost callouts -->
    <text x="310" y="650" text-anchor="middle" font-size="12" font-weight="bold" fill="#B71C1C">Costs</text>
    <text font-size="11" fill="#B71C1C">
      <tspan x="60" y="672">&#x2715; Capabilities bleed up into the controller</tspan>
      <tspan x="60" dy="16">&#x2715; Controller must understand every domain it orchestrates</tspan>
      <tspan x="60" dy="16">&#x2715; Parallelism is faked or absent</tspan>
    </text>
  </g>

  <!-- ===== RIGHT: MCP SWARM ===== -->
  <g>
    <rect x="610" y="80" width="560" height="710" rx="10" fill="#F1F8E9" stroke="#2E7D32" stroke-width="2"/>
    <text x="890" y="108" text-anchor="middle" font-size="16" font-weight="bold" fill="#1B5E20">AOPM with MCP: Swarming Tasks</text>
    <text x="890" y="128" text-anchor="middle" font-size="12" fill="#2E7D32" font-style="italic">Tasks consult runtime + peers directly &#x2192; no controller bottleneck &#x2192; concurrent execution</text>

    <!-- Ad-hoc subprocess outline -->
    <rect x="640" y="150" width="500" height="370" rx="14" fill="none" stroke="#9E9E9E" stroke-width="1.5" stroke-dasharray="6 4"/>
    <text x="890" y="170" text-anchor="middle" font-size="12" fill="#616161" font-style="italic">BPMN Ad-Hoc Sub-Process</text>

    <!-- MCP Gateway in center -->
    <ellipse cx="890" cy="335" rx="110" ry="46" fill="url(#mcpGrad)" stroke="#283593" stroke-width="2.5" filter="url(#shadow)"/>
    <text x="890" y="328" text-anchor="middle" font-size="14" font-weight="bold" fill="#1A237E">MCP Gateway</text>
    <text x="890" y="346" text-anchor="middle" font-size="10" fill="#1A237E" font-style="italic">runtime &#x2022; history &#x2022; peer state</text>

    <!-- 5 tasks all active -->
    <g>
      <rect x="660" y="200" width="90" height="56" rx="10" fill="url(#taskActive)" stroke="#F57C00" stroke-width="2" filter="url(#shadow)"/>
      <text x="705" y="225" text-anchor="middle" font-size="12" font-weight="bold" fill="#E65100">T1</text>
      <text x="705" y="241" text-anchor="middle" font-size="9" fill="#BF360C">running</text>

      <rect x="1030" y="200" width="90" height="56" rx="10" fill="url(#taskActive)" stroke="#F57C00" stroke-width="2" filter="url(#shadow)"/>
      <text x="1075" y="225" text-anchor="middle" font-size="12" font-weight="bold" fill="#E65100">T2</text>
      <text x="1075" y="241" text-anchor="middle" font-size="9" fill="#BF360C">running</text>

      <rect x="660" y="420" width="90" height="56" rx="10" fill="url(#taskActive)" stroke="#F57C00" stroke-width="2" filter="url(#shadow)"/>
      <text x="705" y="445" text-anchor="middle" font-size="12" font-weight="bold" fill="#E65100">T3</text>
      <text x="705" y="461" text-anchor="middle" font-size="9" fill="#BF360C">running</text>

      <rect x="1030" y="420" width="90" height="56" rx="10" fill="url(#taskActive)" stroke="#F57C00" stroke-width="2" filter="url(#shadow)"/>
      <text x="1075" y="445" text-anchor="middle" font-size="12" font-weight="bold" fill="#E65100">T4</text>
      <text x="1075" y="461" text-anchor="middle" font-size="9" fill="#BF360C">running</text>

      <rect x="845" y="185" width="90" height="56" rx="10" fill="url(#taskActive)" stroke="#F57C00" stroke-width="2" filter="url(#shadow)"/>
      <text x="890" y="210" text-anchor="middle" font-size="12" font-weight="bold" fill="#E65100">T5</text>
      <text x="890" y="226" text-anchor="middle" font-size="9" fill="#BF360C">running</text>
    </g>

    <!-- Bidirectional arrows from each task to MCP -->
    <line x1="750" y1="232" x2="785" y2="320" stroke="#283593" stroke-width="2" marker-start="url(#arr-m-r)" marker-end="url(#arr-m)"/>
    <line x1="1030" y1="232" x2="995" y2="320" stroke="#283593" stroke-width="2" marker-start="url(#arr-m-r)" marker-end="url(#arr-m)"/>
    <line x1="750" y1="442" x2="785" y2="358" stroke="#283593" stroke-width="2" marker-start="url(#arr-m-r)" marker-end="url(#arr-m)"/>
    <line x1="1030" y1="442" x2="995" y2="358" stroke="#283593" stroke-width="2" marker-start="url(#arr-m-r)" marker-end="url(#arr-m)"/>
    <line x1="890" y1="241" x2="890" y2="290" stroke="#283593" stroke-width="2" marker-start="url(#arr-m-r)" marker-end="url(#arr-m)"/>

    <!-- Peer-to-peer dashed arrows -->
    <path d="M 750 220 Q 890 180 1030 220" fill="none" stroke="#2E7D32" stroke-width="1.4" stroke-dasharray="4 4" opacity="0.7"/>
    <path d="M 750 460 Q 890 500 1030 460" fill="none" stroke="#2E7D32" stroke-width="1.4" stroke-dasharray="4 4" opacity="0.7"/>
    <path d="M 705 256 Q 660 340 705 420" fill="none" stroke="#2E7D32" stroke-width="1.4" stroke-dasharray="4 4" opacity="0.7"/>
    <path d="M 1075 256 Q 1120 340 1075 420" fill="none" stroke="#2E7D32" stroke-width="1.4" stroke-dasharray="4 4" opacity="0.7"/>

    <text x="890" y="500" text-anchor="middle" font-size="10" fill="#2E7D32" font-style="italic">peer reads via MCP &#x2014; no point-to-point wiring</text>

    <!-- Timeline -->
    <text x="890" y="552" text-anchor="middle" font-size="12" font-weight="bold" fill="#37474F">Execution Timeline</text>
    <line x1="660" y1="642" x2="1120" y2="642" stroke="#37474F" stroke-width="1.5"/>
    <text x="660" y="660" font-size="10" fill="#37474F">t&#x2080;</text>
    <text x="1120" y="660" font-size="10" fill="#37474F">t&#x2099;</text>

    <rect x="665" y="625" width="190" height="14" fill="#FBC02D" stroke="#F57C00"/>
    <text x="760" y="636" text-anchor="middle" font-size="9" fill="#5D4037">T1</text>
    <rect x="700" y="610" width="220" height="14" fill="#FBC02D" stroke="#F57C00"/>
    <text x="810" y="621" text-anchor="middle" font-size="9" fill="#5D4037">T2 (concurrent)</text>
    <rect x="760" y="595" width="180" height="14" fill="#FBC02D" stroke="#F57C00"/>
    <text x="850" y="606" text-anchor="middle" font-size="9" fill="#5D4037">T3 (concurrent)</text>
    <rect x="850" y="580" width="180" height="14" fill="#FBC02D" stroke="#F57C00"/>
    <text x="940" y="591" text-anchor="middle" font-size="9" fill="#5D4037">T4 (concurrent)</text>
    <rect x="900" y="565" width="180" height="14" fill="#FBC02D" stroke="#F57C00"/>
    <text x="990" y="576" text-anchor="middle" font-size="9" fill="#5D4037">T5 (concurrent)</text>

    <text x="890" y="683" text-anchor="middle" font-size="11" fill="#1B5E20" font-style="italic">overlapping execution &#x2014; coordination is ambient, not centralized</text>

    <!-- Benefit callouts -->
    <text x="890" y="712" text-anchor="middle" font-size="12" font-weight="bold" fill="#1B5E20">Benefits</text>
    <text font-size="11" fill="#1B5E20">
      <tspan x="640" y="732">&#x2713; Capability stays encapsulated in each task</tspan>
      <tspan x="640" dy="16">&#x2713; Controller is no longer the polymath bottleneck</tspan>
      <tspan x="640" dy="16">&#x2713; True concurrency, with real-time peer awareness</tspan>
    </text>
  </g>
</svg>
