{
  "_part": 2,
  "_note": "Categories C, D, E — merge with part 1 under MASTER_SLAVE_TEST_CONVERSATIONS",

  "CATEGORY_C_DEPENDENCY": [

    {
      "conversation_id": "C-001",
      "category": "DEPENDENCY",
      "priority": "P0",
      "title": "Campaign requested but no template exists — template first",
      "purpose": "Verify master checks template dependency before routing to Campaign Helper.",
      "preconditions": ["Onboarding done", "No approved template exists"],
      "initial_session_state": {
        "active_child_agent": null,
        "pending_task_queue": [],
        "completed_task_list": ["onboarding"],
        "dependency_status": { "approved_template_exists": false }
      },
      "user_goal": "Send a campaign but user has no template.",
      "expected_master_behavior_summary": "Master detects campaign intent but notes no approved template. Routes to Template Helper with note that campaign is pending template approval.",
      "expected_final_outcome": "Template created and approved → Campaign Helper starts with template context.",
      "conversation_steps": [
        {
          "turn_number": 1,
          "speaker": "user",
          "active_agent_expected": "master",
          "user_message": "I want to send a broadcast campaign to all my customers.",
          "expected_intent": "start_campaign_flow",
          "expected_target_agent": "Template Helper",
          "expected_master_action": "RESOLVE_DEPENDENCY_FIRST",
          "expected_state_update": { "active_child_agent": "Template Helper", "child_agent_status_map.Template Helper": "ACTIVE" },
          "expected_queue_update": "pending_task_queue = ['campaign_creation: pending template']",
          "expected_handoff": "HANDOFF_TO_TEMPLATE_CREATION_HELPER",
          "expected_return_to_master": null,
          "validation_note": "Master detects no approved template. Must redirect to template creation BEFORE campaign. Must NOT route directly to Campaign Helper when no template exists."
        },
        {
          "turn_number": 2,
          "speaker": "master",
          "active_agent_expected": "master",
          "agent_message": "To send a campaign, you'll need an approved WhatsApp template first. Let me help you create one — then we'll set up the campaign.",
          "expected_intent": null,
          "expected_target_agent": "Template Helper",
          "expected_master_action": "RESOLVE_DEPENDENCY_FIRST",
          "expected_state_update": null,
          "expected_queue_update": "no change",
          "expected_handoff": "HANDOFF_TO_TEMPLATE_CREATION_HELPER",
          "expected_return_to_master": null,
          "validation_note": "Master must explain WHY it's routing to template first."
        }
      ]
    },

    {
      "conversation_id": "C-002",
      "category": "DEPENDENCY",
      "priority": "P0",
      "title": "Campaign requested but onboarding not done",
      "purpose": "Verify master detects onboarding-not-done and routes to Onboarding Helper before campaign.",
      "preconditions": ["No onboarding", "No template"],
      "initial_session_state": {
        "active_child_agent": null,
        "pending_task_queue": [],
        "completed_task_list": [],
        "dependency_status": { "onboarding_complete": false, "approved_template_exists": false }
      },
      "user_goal": "Send campaign but hasn't even set up WABA.",
      "expected_master_behavior_summary": "Master detects P=110 dependency block (no onboarding). Routes to Onboarding Helper first. Campaign queued after onboarding and template.",
      "expected_final_outcome": "Onboarding → Template → Campaign in order.",
      "conversation_steps": [
        {
          "turn_number": 1,
          "speaker": "user",
          "active_agent_expected": "master",
          "user_message": "I haven't done onboarding yet but I want to set up a campaign. Where do I start?",
          "expected_intent": "cross_flow_dependency_query",
          "expected_target_agent": "Onboarding Helper",
          "expected_master_action": "RESOLVE_DEPENDENCY_FIRST",
          "expected_state_update": { "active_child_agent": "Onboarding Helper", "child_agent_status_map.Onboarding Helper": "ACTIVE" },
          "expected_queue_update": "pending_task_queue = ['template_creation', 'campaign_creation']",
          "expected_handoff": "HANDOFF_TO_ONBOARDING_HELPER",
          "expected_return_to_master": null,
          "validation_note": "P=110 fires ('haven't done onboarding yet'). Onboarding is prerequisite. Master must explain full dependency chain."
        },
        {
          "turn_number": 2,
          "speaker": "master",
          "active_agent_expected": "master",
          "agent_message": "To send campaigns, you need: 1) WhatsApp API onboarding, 2) An approved template, 3) Campaign setup. Let's start with onboarding.",
          "expected_intent": null,
          "expected_target_agent": "Onboarding Helper",
          "expected_master_action": "ROUTE_TO_ONBOARDING",
          "expected_state_update": null,
          "expected_queue_update": "no change",
          "expected_handoff": "HANDOFF_TO_ONBOARDING_HELPER",
          "expected_return_to_master": null,
          "validation_note": "Master must communicate full dependency chain clearly."
        }
      ]
    },

    {
      "conversation_id": "C-003",
      "category": "DEPENDENCY",
      "priority": "P0",
      "title": "Chatbot with template-response node — no template exists",
      "purpose": "Verify that asking for a chatbot with a template message node triggers template creation first.",
      "preconditions": ["Onboarding done", "No template"],
      "initial_session_state": {
        "active_child_agent": null,
        "pending_task_queue": [],
        "completed_task_list": ["onboarding"],
        "dependency_status": { "approved_template_exists": false }
      },
      "user_goal": "Build chatbot that replies with a template message.",
      "expected_master_behavior_summary": "Master detects template dependency for chatbot. Routes to Template Helper first. Chatbot queued.",
      "expected_final_outcome": "Template created → Chatbot Helper starts with template dependency resolved.",
      "conversation_steps": [
        {
          "turn_number": 1,
          "speaker": "user",
          "active_agent_expected": "master",
          "user_message": "I want to build a chatbot that automatically sends a welcome template when customers say 'hello'.",
          "expected_intent": "start_chatbot_flow",
          "expected_target_agent": "Template Helper",
          "expected_master_action": "RESOLVE_DEPENDENCY_FIRST",
          "expected_state_update": { "active_child_agent": "Template Helper", "child_agent_status_map.Template Helper": "ACTIVE" },
          "expected_queue_update": "pending_task_queue = ['chatbot_creation: keyword=hello, response=welcome_template']",
          "expected_handoff": "HANDOFF_TO_TEMPLATE_CREATION_HELPER",
          "expected_return_to_master": null,
          "validation_note": "Chatbot uses 'welcome template' response node — template must exist first. Master detects this dependency."
        }
      ]
    },

    {
      "conversation_id": "C-004",
      "category": "DEPENDENCY",
      "priority": "P0",
      "title": "Campaign requested — template already exists → proceed directly",
      "purpose": "Verify that when template is already approved, campaign routes directly without template detour.",
      "preconditions": ["Onboarding done", "Approved template exists"],
      "initial_session_state": {
        "active_child_agent": null,
        "pending_task_queue": [],
        "completed_task_list": ["onboarding", "template_creation"],
        "dependency_status": { "approved_template_exists": true }
      },
      "user_goal": "Send a campaign using an already-approved template.",
      "expected_master_behavior_summary": "Dependency check passes (template exists). Master routes directly to Campaign Helper. No detour to Template.",
      "expected_final_outcome": "Campaign Helper starts immediately.",
      "conversation_steps": [
        {
          "turn_number": 1,
          "speaker": "user",
          "active_agent_expected": "master",
          "user_message": "I already have an approved template. I want to create a campaign now.",
          "expected_intent": "start_campaign_flow",
          "expected_target_agent": "Campaign Helper",
          "expected_master_action": "ROUTE_TO_CAMPAIGN",
          "expected_state_update": { "active_child_agent": "Campaign Helper", "child_agent_status_map.Campaign Helper": "ACTIVE" },
          "expected_queue_update": "no change",
          "expected_handoff": "HANDOFF_TO_CAMPAIGN_HELPER",
          "expected_return_to_master": null,
          "validation_note": "Template dependency already satisfied. MUST route directly to Campaign. Must NOT re-create template."
        }
      ]
    },

    {
      "conversation_id": "C-005",
      "category": "DEPENDENCY",
      "priority": "P1",
      "title": "Chatbot without template dependency — direct route",
      "purpose": "Verify that a chatbot without template-response node has no template dependency — routes directly.",
      "preconditions": ["Onboarding done", "No template exists"],
      "initial_session_state": { "active_child_agent": null, "pending_task_queue": [], "completed_task_list": ["onboarding"] },
      "user_goal": "Build a simple FAQ chatbot using text and quick reply responses only.",
      "expected_master_behavior_summary": "No template dependency detected (chatbot uses only text/quick-reply). Routes directly to Chatbot Helper.",
      "expected_final_outcome": "Chatbot Helper starts without template detour.",
      "conversation_steps": [
        {
          "turn_number": 1,
          "speaker": "user",
          "active_agent_expected": "master",
          "user_message": "I want to create a simple chatbot with quick reply buttons for FAQ — no templates needed.",
          "expected_intent": "start_chatbot_flow",
          "expected_target_agent": "Chatbot Helper",
          "expected_master_action": "ROUTE_TO_CHATBOT",
          "expected_state_update": { "active_child_agent": "Chatbot Helper", "child_agent_status_map.Chatbot Helper": "ACTIVE" },
          "expected_queue_update": "no change",
          "expected_handoff": "HANDOFF_TO_CHATBOT_HELPER",
          "expected_return_to_master": null,
          "validation_note": "User explicitly says 'no templates needed'. No dependency. Must route directly to chatbot."
        }
      ]
    },

    {
      "conversation_id": "C-006",
      "category": "DEPENDENCY",
      "priority": "P0",
      "title": "All three dependencies missing — correct cascade order",
      "purpose": "When user asks for campaign but has nothing set up, verify correct cascade: onboarding → template → campaign.",
      "preconditions": ["No onboarding", "No template", "No campaign"],
      "initial_session_state": {
        "active_child_agent": null,
        "pending_task_queue": [],
        "completed_task_list": [],
        "dependency_status": { "onboarding_complete": false, "approved_template_exists": false }
      },
      "user_goal": "Run a WhatsApp campaign but has nothing ready.",
      "expected_master_behavior_summary": "Master identifies full cascade of dependencies. Routes onboarding first. Queues template and campaign. Each auto-resumes after prior completes.",
      "expected_final_outcome": "Onboarding → Template → Campaign in order.",
      "conversation_steps": [
        {
          "turn_number": 1,
          "speaker": "user",
          "active_agent_expected": "master",
          "user_message": "I want to run a WhatsApp marketing campaign for my product launch.",
          "expected_intent": "start_campaign_flow",
          "expected_target_agent": "Onboarding Helper",
          "expected_master_action": "RESOLVE_DEPENDENCY_FIRST",
          "expected_state_update": { "active_child_agent": "Onboarding Helper" },
          "expected_queue_update": "pending_task_queue = ['template_creation', 'campaign_creation: product launch']",
          "expected_handoff": "HANDOFF_TO_ONBOARDING_HELPER",
          "expected_return_to_master": null,
          "validation_note": "Master detects both dependencies missing. Should explain 3-step process to user."
        }
      ]
    },

    {
      "conversation_id": "C-007",
      "category": "DEPENDENCY",
      "priority": "P1",
      "title": "Onboarding done, template rejected — campaign still blocked",
      "purpose": "Verify campaign remains blocked when template is rejected (not approved).",
      "preconditions": ["Onboarding done", "Template submitted but rejected"],
      "initial_session_state": {
        "active_child_agent": null,
        "pending_task_queue": [],
        "completed_task_list": ["onboarding"],
        "blocked_task_list": ["template: rejected"],
        "dependency_status": { "onboarding_complete": true, "approved_template_exists": false }
      },
      "user_goal": "Start campaign despite template being rejected.",
      "expected_master_behavior_summary": "Template rejection detected. Campaign cannot proceed. Master routes to Template Helper to fix rejection first.",
      "expected_final_outcome": "Template Helper resolves rejection → Campaign unblocks.",
      "conversation_steps": [
        {
          "turn_number": 1,
          "speaker": "user",
          "active_agent_expected": "master",
          "user_message": "My template was rejected but I want to start my campaign anyway.",
          "expected_intent": "start_campaign_flow",
          "expected_target_agent": "Template Helper",
          "expected_master_action": "RESOLVE_DEPENDENCY_FIRST",
          "expected_state_update": { "active_child_agent": "Template Helper" },
          "expected_queue_update": "pending_task_queue = ['campaign_creation']",
          "expected_handoff": "HANDOFF_TO_TEMPLATE_CREATION_HELPER",
          "expected_return_to_master": null,
          "validation_note": "Master MUST NOT route to campaign when template is rejected. Dependency not satisfied."
        },
        {
          "turn_number": 2,
          "speaker": "master",
          "active_agent_expected": "master",
          "agent_message": "Campaigns require an approved template. Let me help you fix the rejection and resubmit — then we'll proceed with the campaign.",
          "expected_intent": null,
          "expected_target_agent": "Template Helper",
          "expected_master_action": "RESOLVE_DEPENDENCY_FIRST",
          "expected_state_update": null,
          "expected_queue_update": "no change",
          "expected_handoff": "HANDOFF_TO_TEMPLATE_CREATION_HELPER",
          "expected_return_to_master": null,
          "validation_note": "Master must explain dependency and the fix path."
        }
      ]
    },

    {
      "conversation_id": "C-008",
      "category": "DEPENDENCY",
      "priority": "P1",
      "title": "Template pending approval — campaign must wait",
      "purpose": "Verify campaign is held when template is submitted but not yet approved.",
      "preconditions": ["Onboarding done", "Template submitted, pending Meta approval"],
      "initial_session_state": {
        "active_child_agent": null,
        "pending_task_queue": [],
        "completed_task_list": ["onboarding"],
        "dependency_status": { "approved_template_exists": false, "template_pending_approval": true }
      },
      "user_goal": "Start campaign while template is awaiting approval.",
      "expected_master_behavior_summary": "Template pending — not yet approved. Master informs user campaign cannot start yet. Routes to Template Helper to check status.",
      "expected_final_outcome": "Master informs about pending state. Campaign queued for when template approves.",
      "conversation_steps": [
        {
          "turn_number": 1,
          "speaker": "user",
          "active_agent_expected": "master",
          "user_message": "My template is under review. Can I start the campaign setup now?",
          "expected_intent": "start_campaign_flow",
          "expected_target_agent": "Template Helper",
          "expected_master_action": "RESOLVE_DEPENDENCY_FIRST",
          "expected_state_update": { "active_child_agent": "Template Helper" },
          "expected_queue_update": "pending_task_queue = ['campaign_creation: waiting for template approval']",
          "expected_handoff": "HANDOFF_TO_TEMPLATE_CREATION_HELPER",
          "expected_return_to_master": null,
          "validation_note": "Template pending ≠ template approved. Campaign must wait. Master routes to Template Helper to check/expedite status."
        }
      ]
    },

    {
      "conversation_id": "C-009",
      "category": "DEPENDENCY",
      "priority": "P1",
      "title": "Chatbot requested while onboarding incomplete",
      "purpose": "Verify chatbot creation is blocked/queued when onboarding is not done.",
      "preconditions": ["Onboarding not complete"],
      "initial_session_state": {
        "active_child_agent": null,
        "pending_task_queue": [],
        "completed_task_list": [],
        "dependency_status": { "onboarding_complete": false }
      },
      "user_goal": "Create chatbot but WABA not activated.",
      "expected_master_behavior_summary": "P=110 block fires. Onboarding must happen before chatbot. Master routes onboarding first, queues chatbot.",
      "expected_final_outcome": "Onboarding completes → Chatbot Helper starts.",
      "conversation_steps": [
        {
          "turn_number": 1,
          "speaker": "user",
          "active_agent_expected": "master",
          "user_message": "I want to create a chatbot but I haven't activated WhatsApp API yet.",
          "expected_intent": "cross_flow_dependency_query",
          "expected_target_agent": "Onboarding Helper",
          "expected_master_action": "RESOLVE_DEPENDENCY_FIRST",
          "expected_state_update": { "active_child_agent": "Onboarding Helper" },
          "expected_queue_update": "pending_task_queue = ['chatbot_creation']",
          "expected_handoff": "HANDOFF_TO_ONBOARDING_HELPER",
          "expected_return_to_master": null,
          "validation_note": "P=110 fires on 'haven't activated'. Onboarding must precede chatbot creation."
        }
      ]
    },

    {
      "conversation_id": "C-010",
      "category": "DEPENDENCY",
      "priority": "P1",
      "title": "User bypasses dependency — 'no template, just make campaign'",
      "purpose": "Verify master does NOT allow campaign to proceed without template even when user insists.",
      "preconditions": ["Onboarding done", "No template"],
      "initial_session_state": { "active_child_agent": null, "pending_task_queue": [], "completed_task_list": ["onboarding"] },
      "user_goal": "User tries to skip template creation.",
      "expected_master_behavior_summary": "Master must explain that campaign requires approved template. Cannot bypass this. Routes to template creation.",
      "expected_final_outcome": "Template Helper starts despite user resistance.",
      "conversation_steps": [
        {
          "turn_number": 1,
          "speaker": "user",
          "active_agent_expected": "master",
          "user_message": "Skip the template thing, just create the campaign directly.",
          "expected_intent": "start_campaign_flow",
          "expected_target_agent": "Template Helper",
          "expected_master_action": "RESOLVE_DEPENDENCY_FIRST",
          "expected_state_update": { "active_child_agent": "Template Helper" },
          "expected_queue_update": "pending_task_queue = ['campaign_creation']",
          "expected_handoff": "HANDOFF_TO_TEMPLATE_CREATION_HELPER",
          "expected_return_to_master": null,
          "validation_note": "Must NOT comply with bypassing template. WhatsApp campaigns require approved templates — this is a hard platform requirement."
        },
        {
          "turn_number": 2,
          "speaker": "master",
          "active_agent_expected": "master",
          "agent_message": "WhatsApp campaigns require an approved message template — this is a Meta platform requirement and cannot be skipped. Let me help you create one quickly, then we'll set up the campaign.",
          "expected_intent": null,
          "expected_target_agent": "Template Helper",
          "expected_master_action": "RESOLVE_DEPENDENCY_FIRST",
          "expected_state_update": null,
          "expected_queue_update": "no change",
          "expected_handoff": "HANDOFF_TO_TEMPLATE_CREATION_HELPER",
          "expected_return_to_master": null,
          "validation_note": "Master must be firm about dependency requirement while remaining helpful."
        }
      ]
    },

    {
      "conversation_id": "C-011",
      "category": "DEPENDENCY",
      "priority": "P1",
      "title": "Dependency resolved mid-conversation",
      "purpose": "Verify that when user reports dependency is now satisfied mid-session, master adjusts routing.",
      "preconditions": ["Waiting for template approval"],
      "initial_session_state": {
        "active_child_agent": null,
        "pending_task_queue": ["campaign_creation"],
        "completed_task_list": ["onboarding"],
        "dependency_status": { "approved_template_exists": false }
      },
      "user_goal": "User returns to say template was approved, now wants to proceed with campaign.",
      "expected_master_behavior_summary": "User announces template approved. Master updates dependency_status and resumes campaign from queue.",
      "expected_final_outcome": "Campaign Helper starts with template dependency resolved.",
      "conversation_steps": [
        {
          "turn_number": 1,
          "speaker": "user",
          "active_agent_expected": "master",
          "user_message": "My template just got approved. Can we proceed with the campaign now?",
          "expected_intent": "continue_campaign_flow",
          "expected_target_agent": "Campaign Helper",
          "expected_master_action": "RESUME_PREVIOUS_TASK",
          "expected_state_update": { "active_child_agent": "Campaign Helper", "dependency_status.approved_template_exists": true },
          "expected_queue_update": "pending_task_queue cleared",
          "expected_handoff": "HANDOFF_TO_CAMPAIGN_HELPER",
          "expected_return_to_master": null,
          "validation_note": "User announces dependency resolved. Master must resume queued campaign immediately."
        }
      ]
    },

    {
      "conversation_id": "C-012",
      "category": "DEPENDENCY",
      "priority": "P1",
      "title": "Already completed all dependencies — direct campaign",
      "purpose": "Verify that when user states all prerequisites done, campaign routes directly.",
      "preconditions": ["All dependencies satisfied"],
      "initial_session_state": {
        "active_child_agent": null,
        "pending_task_queue": [],
        "completed_task_list": ["onboarding", "template_creation"],
        "dependency_status": { "onboarding_complete": true, "approved_template_exists": true }
      },
      "user_goal": "Start campaign with everything ready.",
      "expected_master_behavior_summary": "All dependencies met. Direct route to Campaign Helper.",
      "expected_final_outcome": "Campaign Helper starts immediately.",
      "conversation_steps": [
        {
          "turn_number": 1,
          "speaker": "user",
          "active_agent_expected": "master",
          "user_message": "I already finished setup and have an approved template. Now I want to send a campaign.",
          "expected_intent": "start_campaign_flow",
          "expected_target_agent": "Campaign Helper",
          "expected_master_action": "ROUTE_TO_CAMPAIGN",
          "expected_state_update": { "active_child_agent": "Campaign Helper" },
          "expected_queue_update": "no change",
          "expected_handoff": "HANDOFF_TO_CAMPAIGN_HELPER",
          "expected_return_to_master": null,
          "validation_note": "User explicitly states everything is ready. Must NOT detour to onboarding or template."
        }
      ]
    },

    {
      "conversation_id": "C-013",
      "category": "DEPENDENCY",
      "priority": "P1",
      "title": "Partial dependency — onboarding done, template missing, chatbot simple",
      "purpose": "Simple chatbot (no template node) after onboarding done — no dependency block.",
      "preconditions": ["Onboarding done", "No template"],
      "initial_session_state": {
        "active_child_agent": null,
        "pending_task_queue": [],
        "completed_task_list": ["onboarding"],
        "dependency_status": { "onboarding_complete": true, "approved_template_exists": false }
      },
      "user_goal": "Create a text-reply chatbot after onboarding.",
      "expected_master_behavior_summary": "Onboarding done. Simple chatbot has no template dependency. Routes directly to Chatbot Helper.",
      "expected_final_outcome": "Chatbot Helper starts immediately.",
      "conversation_steps": [
        {
          "turn_number": 1,
          "speaker": "user",
          "active_agent_expected": "master",
          "user_message": "Onboarding is done. Now I want to create a basic auto-reply chatbot with text messages.",
          "expected_intent": "start_chatbot_flow",
          "expected_target_agent": "Chatbot Helper",
          "expected_master_action": "ROUTE_TO_CHATBOT",
          "expected_state_update": { "active_child_agent": "Chatbot Helper" },
          "expected_queue_update": "no change",
          "expected_handoff": "HANDOFF_TO_CHATBOT_HELPER",
          "expected_return_to_master": null,
          "validation_note": "Simple text-reply chatbot has no template dependency. Must NOT block on template."
        }
      ]
    },

    {
      "conversation_id": "C-014",
      "category": "DEPENDENCY",
      "priority": "P2",
      "title": "User asks about dependency chain explicitly",
      "purpose": "Verify master explains dependency order when user asks 'what do I need to do first?'",
      "preconditions": ["No session"],
      "initial_session_state": { "active_child_agent": null, "pending_task_queue": [], "completed_task_list": [] },
      "user_goal": "Understand what order to do things in.",
      "expected_master_behavior_summary": "Master explains dependency chain: onboarding → template → campaign. Routes to onboarding as starting point.",
      "expected_final_outcome": "User understands and proceeds with onboarding.",
      "conversation_steps": [
        {
          "turn_number": 1,
          "speaker": "user",
          "active_agent_expected": "master",
          "user_message": "I want to send WhatsApp campaigns eventually. What should I set up first?",
          "expected_intent": "help_choose_flow",
          "expected_target_agent": "Onboarding Helper",
          "expected_master_action": "ROUTE_TO_ONBOARDING",
          "expected_state_update": { "active_child_agent": "Onboarding Helper" },
          "expected_queue_update": "no change",
          "expected_handoff": "HANDOFF_TO_ONBOARDING_HELPER",
          "expected_return_to_master": null,
          "validation_note": "Master must explain order: onboarding first. Should NOT ask clarification — clear request for guidance."
        },
        {
          "turn_number": 2,
          "speaker": "master",
          "active_agent_expected": "master",
          "agent_message": "To send campaigns, you need to: 1) Set up WhatsApp API (onboarding), 2) Create and get an approved template, 3) Then create your campaign. Let's start with onboarding.",
          "expected_intent": null,
          "expected_target_agent": "Onboarding Helper",
          "expected_master_action": "ROUTE_TO_ONBOARDING",
          "expected_state_update": null,
          "expected_queue_update": "no change",
          "expected_handoff": "HANDOFF_TO_ONBOARDING_HELPER",
          "expected_return_to_master": null,
          "validation_note": null
        }
      ]
    },

    {
      "conversation_id": "C-015",
      "category": "DEPENDENCY",
      "priority": "P2",
      "title": "Template for chatbot created mid-session — chatbot resumes",
      "purpose": "Verify chatbot resumes correctly after template is created mid-session to satisfy its dependency.",
      "preconditions": ["Chatbot creation paused waiting for template"],
      "initial_session_state": {
        "active_child_agent": null,
        "pending_task_queue": ["chatbot_creation: needs_welcome_template"],
        "completed_task_list": ["onboarding"],
        "child_agent_status_map": { "Template Helper": "COMPLETED", "Chatbot Helper": "WAITING" },
        "dependency_status": { "approved_template_exists": true }
      },
      "user_goal": "Continue chatbot creation after template was just approved.",
      "expected_master_behavior_summary": "Template dependency now resolved. Master resumes queued chatbot creation with template context.",
      "expected_final_outcome": "Chatbot Helper starts with template name passed as context.",
      "conversation_steps": [
        {
          "turn_number": 1,
          "speaker": "user",
          "active_agent_expected": "master",
          "user_message": "Great, template is approved. Now let's continue building the chatbot.",
          "expected_intent": "continue_chatbot_flow",
          "expected_target_agent": "Chatbot Helper",
          "expected_master_action": "RESUME_PREVIOUS_TASK",
          "expected_state_update": { "active_child_agent": "Chatbot Helper", "dependency_status.approved_template_exists": true },
          "expected_queue_update": "pending_task_queue cleared",
          "expected_handoff": "HANDOFF_TO_CHATBOT_HELPER",
          "expected_return_to_master": null,
          "validation_note": "Master must pass the just-created template name as context to Chatbot Helper."
        }
      ]
    }
  ],

  "CATEGORY_D_CONTEXT_CONTINUITY": [

    {
      "conversation_id": "D-001",
      "category": "CONTEXT_CONTINUITY",
      "priority": "P0",
      "title": "Short 'yes' reply continues with active onboarding agent",
      "purpose": "Verify that a single 'yes' reply routes to the active child (Onboarding Helper) not master.",
      "preconditions": ["Onboarding Helper is active sticky agent"],
      "initial_session_state": {
        "active_child_agent": "Onboarding Helper",
        "child_agent_status_map": { "Onboarding Helper": "ACTIVE" },
        "expected_next_action": "confirm_documents_ready"
      },
      "user_goal": "Confirm documents are ready.",
      "expected_master_behavior_summary": "P=85 activeChild context rule fires for 'yes'. Routes to Onboarding Helper.",
      "expected_final_outcome": "Onboarding Helper receives confirmation and proceeds.",
      "conversation_steps": [
        {
          "turn_number": 1,
          "speaker": "child_agent",
          "active_agent_expected": "Onboarding Helper",
          "agent_message": "Do you have a business registration document ready? (GST, incorporation certificate, MSME, trade license)",
          "expected_intent": null,
          "expected_target_agent": "Onboarding Helper",
          "expected_master_action": null,
          "expected_state_update": { "expected_next_action": "confirm_documents_ready" },
          "expected_queue_update": "no change",
          "expected_handoff": null,
          "expected_return_to_master": null,
          "validation_note": null
        },
        {
          "turn_number": 2,
          "speaker": "user",
          "active_agent_expected": "Onboarding Helper",
          "user_message": "yes",
          "expected_intent": "provide_business_document_status",
          "expected_target_agent": "Onboarding Helper",
          "expected_master_action": null,
          "expected_state_update": null,
          "expected_queue_update": "no change",
          "expected_handoff": null,
          "expected_return_to_master": null,
          "validation_note": "P=85 context rule fires. 'yes' with active_child = Onboarding Helper → stays in Onboarding Helper. Must NOT trigger master clarification."
        }
      ]
    },

    {
      "conversation_id": "D-002",
      "category": "CONTEXT_CONTINUITY",
      "priority": "P0",
      "title": "'manual' reply inside onboarding method selection",
      "purpose": "Verify that 'manual' reply stays in Onboarding Helper when method selection is expected.",
      "preconditions": ["Onboarding Helper active, awaiting method selection"],
      "initial_session_state": {
        "active_child_agent": "Onboarding Helper",
        "child_agent_status_map": { "Onboarding Helper": "ACTIVE" },
        "expected_next_action": "select_onboarding_method"
      },
      "user_goal": "Choose manual onboarding method.",
      "expected_master_behavior_summary": "P=85 activeChild rule fires: 'manual' keyword + active_child=Onboarding → stays in Onboarding Helper.",
      "expected_final_outcome": "Onboarding Helper receives 'manual' and shows manual steps.",
      "conversation_steps": [
        {
          "turn_number": 1,
          "speaker": "child_agent",
          "active_agent_expected": "Onboarding Helper",
          "agent_message": "Which onboarding method do you prefer — auto (Facebook login / Embedded Signup) or manual (Facebook Developer App)?",
          "expected_intent": null,
          "expected_target_agent": "Onboarding Helper",
          "expected_master_action": null,
          "expected_state_update": { "expected_next_action": "select_onboarding_method" },
          "expected_queue_update": "no change",
          "expected_handoff": null,
          "expected_return_to_master": null,
          "validation_note": null
        },
        {
          "turn_number": 2,
          "speaker": "user",
          "active_agent_expected": "Onboarding Helper",
          "user_message": "manual",
          "expected_intent": "choose_manual_onboarding",
          "expected_target_agent": "Onboarding Helper",
          "expected_master_action": null,
          "expected_state_update": { "expected_next_action": "collect_app_id" },
          "expected_queue_update": "no change",
          "expected_handoff": null,
          "expected_return_to_master": null,
          "validation_note": "CRITICAL: 'manual' must stay in Onboarding Helper via P=85 rule. Must NOT trigger new routing to wrong child."
        }
      ]
    },

    {
      "conversation_id": "D-003",
      "category": "CONTEXT_CONTINUITY",
      "priority": "P0",
      "title": "Numeric App ID reply inside manual onboarding context",
      "purpose": "Verify that a long numeric reply is routed to Onboarding Helper when App ID is expected.",
      "preconditions": ["Onboarding Helper active, awaiting App ID in manual onboarding"],
      "initial_session_state": {
        "active_child_agent": "Onboarding Helper",
        "child_agent_status_map": { "Onboarding Helper": "ACTIVE" },
        "expected_next_action": "collect_app_id"
      },
      "user_goal": "Provide Facebook App ID.",
      "expected_master_behavior_summary": "P=85 activeChild rule with 'app id' keyword fires. Numeric reply routed to Onboarding Helper.",
      "expected_final_outcome": "Onboarding Helper receives App ID.",
      "conversation_steps": [
        {
          "turn_number": 1,
          "speaker": "child_agent",
          "active_agent_expected": "Onboarding Helper",
          "agent_message": "Please share your Facebook Developer App ID from App Settings → Basic.",
          "expected_intent": null,
          "expected_target_agent": "Onboarding Helper",
          "expected_master_action": null,
          "expected_state_update": { "expected_next_action": "collect_app_id" },
          "expected_queue_update": "no change",
          "expected_handoff": null,
          "expected_return_to_master": null,
          "validation_note": null
        },
        {
          "turn_number": 2,
          "speaker": "user",
          "active_agent_expected": "Onboarding Helper",
          "user_message": "1234567890123456",
          "expected_intent": "provide_app_id",
          "expected_target_agent": "Onboarding Helper",
          "expected_master_action": null,
          "expected_state_update": null,
          "expected_queue_update": "no change",
          "expected_handoff": null,
          "expected_return_to_master": null,
          "validation_note": "16-digit number is App ID. Must stay in Onboarding Helper. Must NOT be confused with campaign audience count or chatbot trigger."
        }
      ]
    },

    {
      "conversation_id": "D-004",
      "category": "CONTEXT_CONTINUITY",
      "priority": "P0",
      "title": "URL reply inside onboarding website step",
      "purpose": "Verify URL reply routes to Onboarding Helper when website step is active.",
      "preconditions": ["Onboarding Helper active, awaiting website URL"],
      "initial_session_state": {
        "active_child_agent": "Onboarding Helper",
        "child_agent_status_map": { "Onboarding Helper": "ACTIVE" },
        "expected_next_action": "collect_website_url"
      },
      "user_goal": "Provide business website URL.",
      "expected_master_behavior_summary": "P=85 activeChild rule fires. URL reply stays in Onboarding Helper.",
      "expected_final_outcome": "Onboarding Helper captures website URL.",
      "conversation_steps": [
        {
          "turn_number": 1,
          "speaker": "user",
          "active_agent_expected": "Onboarding Helper",
          "user_message": "https://www.technovasolutions.in",
          "expected_intent": "provide_website",
          "expected_target_agent": "Onboarding Helper",
          "expected_master_action": null,
          "expected_state_update": { "expected_next_action": "collect_facebook_status" },
          "expected_queue_update": "no change",
          "expected_handoff": null,
          "expected_return_to_master": null,
          "validation_note": "URL with active Onboarding Helper must stay in Onboarding. Must NOT be confused with template URL button or chatbot CTA URL."
        }
      ]
    },

    {
      "conversation_id": "D-005",
      "category": "CONTEXT_CONTINUITY",
      "priority": "P0",
      "title": "'marketing' reply inside template category selection",
      "purpose": "Verify 'marketing' reply routes to Template Helper when category selection is active.",
      "preconditions": ["Template Helper active, awaiting category"],
      "initial_session_state": {
        "active_child_agent": "Template Helper",
        "child_agent_status_map": { "Template Helper": "ACTIVE" },
        "expected_next_action": "select_template_category"
      },
      "user_goal": "Select marketing template category.",
      "expected_master_behavior_summary": "P=85 activeChild rule fires: 'marketing' + active_child=Template → stays in Template Helper.",
      "expected_final_outcome": "Template Helper captures category selection.",
      "conversation_steps": [
        {
          "turn_number": 1,
          "speaker": "child_agent",
          "active_agent_expected": "Template Helper",
          "agent_message": "What category is this template? (marketing / utility / authentication / service)",
          "expected_intent": null,
          "expected_target_agent": "Template Helper",
          "expected_master_action": null,
          "expected_state_update": { "expected_next_action": "select_template_category" },
          "expected_queue_update": "no change",
          "expected_handoff": null,
          "expected_return_to_master": null,
          "validation_note": null
        },
        {
          "turn_number": 2,
          "speaker": "user",
          "active_agent_expected": "Template Helper",
          "user_message": "marketing",
          "expected_intent": "provide_template_category",
          "expected_target_agent": "Template Helper",
          "expected_master_action": null,
          "expected_state_update": { "expected_next_action": "select_template_language" },
          "expected_queue_update": "no change",
          "expected_handoff": null,
          "expected_return_to_master": null,
          "validation_note": "P=85 rule fires: 'marketing' with Template Helper active → stays. Must NOT route to Campaign Helper despite 'marketing' word."
        }
      ]
    },

    {
      "conversation_id": "D-006",
      "category": "CONTEXT_CONTINUITY",
      "priority": "P0",
      "title": "'publish it' reply inside chatbot flow",
      "purpose": "Verify 'publish it' routes to Chatbot Helper when chatbot is being built.",
      "preconditions": ["Chatbot Helper active, chatbot flow complete"],
      "initial_session_state": {
        "active_child_agent": "Chatbot Helper",
        "child_agent_status_map": { "Chatbot Helper": "ACTIVE" },
        "expected_next_action": "publish_chatbot"
      },
      "user_goal": "Publish chatbot after completing flow design.",
      "expected_master_behavior_summary": "P=75 conflict rule + P=85 activeChild rule: 'publish' inside Chatbot Helper → stays in Chatbot Helper.",
      "expected_final_outcome": "Chatbot Helper publishes the chatbot.",
      "conversation_steps": [
        {
          "turn_number": 1,
          "speaker": "child_agent",
          "active_agent_expected": "Chatbot Helper",
          "agent_message": "Your chatbot flow is ready. Would you like to publish it now to make it live?",
          "expected_intent": null,
          "expected_target_agent": "Chatbot Helper",
          "expected_master_action": null,
          "expected_state_update": { "expected_next_action": "publish_chatbot" },
          "expected_queue_update": "no change",
          "expected_handoff": null,
          "expected_return_to_master": null,
          "validation_note": null
        },
        {
          "turn_number": 2,
          "speaker": "user",
          "active_agent_expected": "Chatbot Helper",
          "user_message": "publish it",
          "expected_intent": "chatbot_publish_query",
          "expected_target_agent": "Chatbot Helper",
          "expected_master_action": null,
          "expected_state_update": { "child_agent_status_map.Chatbot Helper": "COMPLETED" },
          "expected_queue_update": "no change",
          "expected_handoff": null,
          "expected_return_to_master": null,
          "validation_note": "P=75 conflict rule fires: 'publish' inside Chatbot Helper context → stays. Must NOT trigger new routing."
        }
      ]
    },

    {
      "conversation_id": "D-007",
      "category": "CONTEXT_CONTINUITY",
      "priority": "P0",
      "title": "'send now' inside active campaign setup",
      "purpose": "Verify 'send now' routes to Campaign Helper when schedule selection is pending.",
      "preconditions": ["Campaign Helper active, awaiting send time"],
      "initial_session_state": {
        "active_child_agent": "Campaign Helper",
        "child_agent_status_map": { "Campaign Helper": "ACTIVE" },
        "expected_next_action": "select_send_time"
      },
      "user_goal": "Choose to send campaign immediately.",
      "expected_master_behavior_summary": "P=85 activeChild rule: 'send now' + active_child=Campaign → stays in Campaign Helper.",
      "expected_final_outcome": "Campaign Helper processes immediate send.",
      "conversation_steps": [
        {
          "turn_number": 1,
          "speaker": "child_agent",
          "active_agent_expected": "Campaign Helper",
          "agent_message": "When would you like to send this campaign? (send now / schedule for later)",
          "expected_intent": null,
          "expected_target_agent": "Campaign Helper",
          "expected_master_action": null,
          "expected_state_update": null,
          "expected_queue_update": "no change",
          "expected_handoff": null,
          "expected_return_to_master": null,
          "validation_note": null
        },
        {
          "turn_number": 2,
          "speaker": "user",
          "active_agent_expected": "Campaign Helper",
          "user_message": "send now",
          "expected_intent": "confirm_send_now",
          "expected_target_agent": "Campaign Helper",
          "expected_master_action": null,
          "expected_state_update": null,
          "expected_queue_update": "no change",
          "expected_handoff": null,
          "expected_return_to_master": null,
          "validation_note": "'send now' with Campaign Helper active → P=85 rule fires. Must NOT route elsewhere."
        }
      ]
    },

    {
      "conversation_id": "D-008",
      "category": "CONTEXT_CONTINUITY",
      "priority": "P0",
      "title": "Time reply 'tomorrow 5pm' inside campaign schedule context",
      "purpose": "Verify that a time reply stays in Campaign Helper when scheduling is expected.",
      "preconditions": ["Campaign Helper active, schedule step pending"],
      "initial_session_state": {
        "active_child_agent": "Campaign Helper",
        "child_agent_status_map": { "Campaign Helper": "ACTIVE" },
        "expected_next_action": "collect_schedule_time"
      },
      "user_goal": "Schedule campaign for tomorrow at 5pm.",
      "expected_master_behavior_summary": "P=85 activeChild rule: 'tomorrow' keyword + active_child=Campaign → stays in Campaign Helper.",
      "expected_final_outcome": "Campaign Helper captures schedule.",
      "conversation_steps": [
        {
          "turn_number": 2,
          "speaker": "user",
          "active_agent_expected": "Campaign Helper",
          "user_message": "tomorrow 5pm",
          "expected_intent": "select_schedule_time",
          "expected_target_agent": "Campaign Helper",
          "expected_master_action": null,
          "expected_state_update": null,
          "expected_queue_update": "no change",
          "expected_handoff": null,
          "expected_return_to_master": null,
          "validation_note": "'tomorrow' + active Campaign → P=85 fires. Must NOT route to Onboarding (has 'tomorrow' in some training phrases)."
        }
      ]
    },

    {
      "conversation_id": "D-009",
      "category": "CONTEXT_CONTINUITY",
      "priority": "P0",
      "title": "Keyword 'ORDER' inside chatbot trigger context",
      "purpose": "Verify that 'keyword is ORDER' routes to Chatbot Helper when trigger setup is active.",
      "preconditions": ["Chatbot Helper active, awaiting trigger keyword"],
      "initial_session_state": {
        "active_child_agent": "Chatbot Helper",
        "child_agent_status_map": { "Chatbot Helper": "ACTIVE" },
        "expected_next_action": "set_trigger_keyword"
      },
      "user_goal": "Set ORDER as chatbot trigger keyword.",
      "expected_master_behavior_summary": "P=78 conflict rule + P=85 activeChild: 'keyword' + active_child=Chatbot → stays in Chatbot Helper.",
      "expected_final_outcome": "Chatbot Helper sets trigger keyword.",
      "conversation_steps": [
        {
          "turn_number": 2,
          "speaker": "user",
          "active_agent_expected": "Chatbot Helper",
          "user_message": "keyword is ORDER",
          "expected_intent": "set_chatbot_trigger",
          "expected_target_agent": "Chatbot Helper",
          "expected_master_action": null,
          "expected_state_update": null,
          "expected_queue_update": "no change",
          "expected_handoff": null,
          "expected_return_to_master": null,
          "validation_note": "P=78 conflict rule: 'keyword' inside Chatbot Helper context → stays. 'ORDER' is trigger value, not a routing keyword."
        }
      ]
    },

    {
      "conversation_id": "D-010",
      "category": "CONTEXT_CONTINUITY",
      "priority": "P0",
      "title": "'submit' inside template review context",
      "purpose": "Verify 'submit' routes to Template Helper when template review is pending.",
      "preconditions": ["Template Helper active, review step pending"],
      "initial_session_state": {
        "active_child_agent": "Template Helper",
        "child_agent_status_map": { "Template Helper": "ACTIVE" },
        "expected_next_action": "submit_template"
      },
      "user_goal": "Submit template for Meta review.",
      "expected_master_behavior_summary": "P=85 activeChild rule: 'submit' + active_child=Template → stays in Template Helper.",
      "expected_final_outcome": "Template Helper submits for approval.",
      "conversation_steps": [
        {
          "turn_number": 2,
          "speaker": "user",
          "active_agent_expected": "Template Helper",
          "user_message": "submit",
          "expected_intent": "submit_template",
          "expected_target_agent": "Template Helper",
          "expected_master_action": null,
          "expected_state_update": { "child_agent_status_map.Template Helper": "WAITING" },
          "expected_queue_update": "no change",
          "expected_handoff": null,
          "expected_return_to_master": null,
          "validation_note": "'submit' with Template Helper active stays in Template Helper. Must NOT trigger master routing."
        }
      ]
    },

    {
      "conversation_id": "D-011",
      "category": "CONTEXT_CONTINUITY",
      "priority": "P1",
      "title": "'done' reply after onboarding step",
      "purpose": "Verify 'done' stays in Onboarding Helper when step confirmation is expected.",
      "preconditions": ["Onboarding Helper active, step in progress"],
      "initial_session_state": {
        "active_child_agent": "Onboarding Helper",
        "child_agent_status_map": { "Onboarding Helper": "ACTIVE" },
        "expected_next_action": "confirm_step_completion"
      },
      "user_goal": "Confirm auto onboarding step 2 is complete.",
      "expected_master_behavior_summary": "P=85 activeChild rule: 'done' + active_child=Onboarding → stays in Onboarding Helper.",
      "expected_final_outcome": "Onboarding Helper proceeds to next step.",
      "conversation_steps": [
        {
          "turn_number": 2,
          "speaker": "user",
          "active_agent_expected": "Onboarding Helper",
          "user_message": "done",
          "expected_intent": "confirm_step_done",
          "expected_target_agent": "Onboarding Helper",
          "expected_master_action": null,
          "expected_state_update": null,
          "expected_queue_update": "no change",
          "expected_handoff": null,
          "expected_return_to_master": null,
          "validation_note": "'done' with Onboarding active → stays. Must NOT fire as 'onboarding_completed' which would return to master prematurely."
        }
      ]
    },

    {
      "conversation_id": "D-012",
      "category": "CONTEXT_CONTINUITY",
      "priority": "P1",
      "title": "'upload csv' inside campaign audience step",
      "purpose": "Verify audience upload instruction stays in Campaign Helper.",
      "preconditions": ["Campaign Helper active, audience step pending"],
      "initial_session_state": {
        "active_child_agent": "Campaign Helper",
        "child_agent_status_map": { "Campaign Helper": "ACTIVE" },
        "expected_next_action": "select_audience"
      },
      "user_goal": "Upload a CSV contact list for campaign.",
      "expected_master_behavior_summary": "P=85 activeChild rule: 'upload csv' + Campaign active → stays in Campaign Helper.",
      "expected_final_outcome": "Campaign Helper handles audience upload.",
      "conversation_steps": [
        {
          "turn_number": 2,
          "speaker": "user",
          "active_agent_expected": "Campaign Helper",
          "user_message": "upload csv",
          "expected_intent": "select_contact_import",
          "expected_target_agent": "Campaign Helper",
          "expected_master_action": null,
          "expected_state_update": null,
          "expected_queue_update": "no change",
          "expected_handoff": null,
          "expected_return_to_master": null,
          "validation_note": "'upload csv' with Campaign active stays in Campaign Helper. Must NOT trigger new routing."
        }
      ]
    },

    {
      "conversation_id": "D-013",
      "category": "CONTEXT_CONTINUITY",
      "priority": "P1",
      "title": "'continue' reply with active child agent",
      "purpose": "Verify 'continue' stays in the currently active child.",
      "preconditions": ["Template Helper active"],
      "initial_session_state": {
        "active_child_agent": "Template Helper",
        "child_agent_status_map": { "Template Helper": "ACTIVE" }
      },
      "user_goal": "Continue template creation flow.",
      "expected_master_behavior_summary": "P=85 activeChild rule: 'continue' with Template Helper active → stays in Template Helper.",
      "expected_final_outcome": "Template Helper continues from where it was.",
      "conversation_steps": [
        {
          "turn_number": 2,
          "speaker": "user",
          "active_agent_expected": "Template Helper",
          "user_message": "continue",
          "expected_intent": "continue_template_flow",
          "expected_target_agent": "Template Helper",
          "expected_master_action": null,
          "expected_state_update": null,
          "expected_queue_update": "no change",
          "expected_handoff": null,
          "expected_return_to_master": null,
          "validation_note": "Generic 'continue' with active child must stay with that child. Must NOT trigger master routing."
        }
      ]
    },

    {
      "conversation_id": "D-014",
      "category": "CONTEXT_CONTINUITY",
      "priority": "P1",
      "title": "Quick reply button selection inside chatbot builder",
      "purpose": "Verify 'quick reply' inside chatbot builder stays in Chatbot Helper.",
      "preconditions": ["Chatbot Helper active, awaiting response type"],
      "initial_session_state": {
        "active_child_agent": "Chatbot Helper",
        "child_agent_status_map": { "Chatbot Helper": "ACTIVE" },
        "expected_next_action": "select_response_type"
      },
      "user_goal": "Select quick reply response node type.",
      "expected_master_behavior_summary": "P=85 activeChild rule: 'quick reply' + Chatbot active → stays in Chatbot Helper.",
      "expected_final_outcome": "Chatbot Helper adds quick reply node.",
      "conversation_steps": [
        {
          "turn_number": 2,
          "speaker": "user",
          "active_agent_expected": "Chatbot Helper",
          "user_message": "add quick reply",
          "expected_intent": "add_quick_reply_node",
          "expected_target_agent": "Chatbot Helper",
          "expected_master_action": null,
          "expected_state_update": null,
          "expected_queue_update": "no change",
          "expected_handoff": null,
          "expected_return_to_master": null,
          "validation_note": "'quick reply' with Chatbot active → stays. Must NOT route to Template Helper despite 'quick reply' being a template component too."
        }
      ]
    },

    {
      "conversation_id": "D-015",
      "category": "CONTEXT_CONTINUITY",
      "priority": "P2",
      "title": "GST reply inside onboarding document step",
      "purpose": "Verify 'GST' reply routes to Onboarding Helper when document collection is active.",
      "preconditions": ["Onboarding Helper active, awaiting document type"],
      "initial_session_state": {
        "active_child_agent": "Onboarding Helper",
        "child_agent_status_map": { "Onboarding Helper": "ACTIVE" },
        "expected_next_action": "collect_document_type"
      },
      "user_goal": "Specify GST as the business document.",
      "expected_master_behavior_summary": "P=85 activeChild rule: 'gst' + Onboarding active → stays in Onboarding Helper.",
      "expected_final_outcome": "Onboarding Helper captures document type.",
      "conversation_steps": [
        {
          "turn_number": 2,
          "speaker": "user",
          "active_agent_expected": "Onboarding Helper",
          "user_message": "GST hai",
          "expected_intent": "provide_business_document_status",
          "expected_target_agent": "Onboarding Helper",
          "expected_master_action": null,
          "expected_state_update": null,
          "expected_queue_update": "no change",
          "expected_handoff": null,
          "expected_return_to_master": null,
          "validation_note": "'GST hai' (Hindi/English mix) with Onboarding active → stays. GST is document confirmation."
        }
      ]
    }
  ],

  "CATEGORY_E_SWITCHING_AND_RETURN": [

    {
      "conversation_id": "E-001",
      "category": "SWITCHING_AND_RETURN",
      "priority": "P0",
      "title": "Switch from onboarding to template — user explicit",
      "purpose": "Verify that explicit switch mid-onboarding pauses onboarding and routes to template.",
      "preconditions": ["Onboarding Helper active mid-flow"],
      "initial_session_state": {
        "active_child_agent": "Onboarding Helper",
        "pending_task_queue": [],
        "completed_task_list": [],
        "child_agent_status_map": { "Onboarding Helper": "ACTIVE" }
      },
      "user_goal": "Switch away from onboarding to work on template.",
      "expected_master_behavior_summary": "Master detects 'leave this, do template first' switch signal at P=105. Pauses onboarding. Routes to Template Helper. Saves onboarding state.",
      "expected_final_outcome": "Onboarding paused → Template Helper starts.",
      "conversation_steps": [
        {
          "turn_number": 1,
          "speaker": "child_agent",
          "active_agent_expected": "Onboarding Helper",
          "agent_message": "Please share the phone number you want to register for WhatsApp API.",
          "expected_intent": null,
          "expected_target_agent": "Onboarding Helper",
          "expected_master_action": null,
          "expected_state_update": null,
          "expected_queue_update": "no change",
          "expected_handoff": null,
          "expected_return_to_master": null,
          "validation_note": null
        },
        {
          "turn_number": 2,
          "speaker": "user",
          "active_agent_expected": "master",
          "user_message": "Leave this for now, I need to create a template first.",
          "expected_intent": "switch_agent_request",
          "expected_target_agent": "Template Helper",
          "expected_master_action": "PRESERVE_CONTEXT_AND_SWITCH",
          "expected_state_update": {
            "active_child_agent": "Template Helper",
            "child_agent_status_map.Onboarding Helper": "PAUSED",
            "child_agent_status_map.Template Helper": "ACTIVE",
            "switch_history": ["onboarding -> template"]
          },
          "expected_queue_update": "pending_task_queue = ['resume_onboarding']",
          "expected_handoff": "HANDOFF_TO_TEMPLATE_CREATION_HELPER",
          "expected_return_to_master": null,
          "validation_note": "P=105 fires on 'create a template first'. Master must save onboarding state. Must NOT lose onboarding progress."
        },
        {
          "turn_number": 3,
          "speaker": "master",
          "active_agent_expected": "master",
          "agent_message": "Switching to template creation. I've saved your onboarding progress — we can resume it afterwards.",
          "expected_intent": null,
          "expected_target_agent": "Template Helper",
          "expected_master_action": "PRESERVE_CONTEXT_AND_SWITCH",
          "expected_state_update": null,
          "expected_queue_update": "no change",
          "expected_handoff": "HANDOFF_TO_TEMPLATE_CREATION_HELPER",
          "expected_return_to_master": null,
          "validation_note": "Master must confirm what is saved and what is next."
        }
      ]
    },

    {
      "conversation_id": "E-002",
      "category": "SWITCHING_AND_RETURN",
      "priority": "P0",
      "title": "Switch from template to campaign mid-flow",
      "purpose": "Verify mid-template switch to campaign: template paused, campaign starts.",
      "preconditions": ["Template Helper active mid-flow"],
      "initial_session_state": {
        "active_child_agent": "Template Helper",
        "child_agent_status_map": { "Template Helper": "ACTIVE" }
      },
      "user_goal": "Jump to campaign work while template is in progress.",
      "expected_master_behavior_summary": "P=105 explicit switch fires. Template paused. Campaign starts. Template queued for resume.",
      "expected_final_outcome": "Template paused → Campaign Helper starts.",
      "conversation_steps": [
        {
          "turn_number": 1,
          "speaker": "user",
          "active_agent_expected": "master",
          "user_message": "Go to campaign setup, I'll finish the template later.",
          "expected_intent": "switch_agent_request",
          "expected_target_agent": "Campaign Helper",
          "expected_master_action": "PRESERVE_CONTEXT_AND_SWITCH",
          "expected_state_update": {
            "active_child_agent": "Campaign Helper",
            "child_agent_status_map.Template Helper": "PAUSED",
            "child_agent_status_map.Campaign Helper": "ACTIVE"
          },
          "expected_queue_update": "pending_task_queue = ['resume_template']",
          "expected_handoff": "HANDOFF_TO_CAMPAIGN_HELPER",
          "expected_return_to_master": null,
          "validation_note": "P=105 fires on 'go to campaign setup'. Template must be paused, not lost."
        }
      ]
    },

    {
      "conversation_id": "E-003",
      "category": "SWITCHING_AND_RETURN",
      "priority": "P0",
      "title": "Return to master after child completes — resume queued task",
      "purpose": "Verify master auto-resumes next queued task when active child completes.",
      "preconditions": ["Template Helper active, Campaign is queued"],
      "initial_session_state": {
        "active_child_agent": "Template Helper",
        "pending_task_queue": ["campaign_creation"],
        "completed_task_list": ["onboarding"],
        "child_agent_status_map": { "Template Helper": "ACTIVE", "Campaign Helper": "WAITING" }
      },
      "user_goal": "Complete template then auto-proceed to campaign.",
      "expected_master_behavior_summary": "Template completes → master detects completion → resumes campaign from queue automatically.",
      "expected_final_outcome": "Campaign Helper starts without user having to request it.",
      "conversation_steps": [
        {
          "turn_number": 1,
          "speaker": "user",
          "active_agent_expected": "Template Helper",
          "user_message": "[Template submitted for approval]",
          "expected_intent": "submit_template",
          "expected_target_agent": "Template Helper",
          "expected_master_action": "RETURN_CONTROL_TO_MASTER",
          "expected_state_update": { "child_agent_status_map.Template Helper": "COMPLETED", "completed_task_list": ["onboarding", "template_creation"] },
          "expected_queue_update": "dequeue campaign_creation",
          "expected_handoff": null,
          "expected_return_to_master": "RETURN_CONTROL_TO_MASTER",
          "validation_note": null
        },
        {
          "turn_number": 2,
          "speaker": "master",
          "active_agent_expected": "master",
          "agent_message": "Template submitted for review. Now let's continue with your campaign setup.",
          "expected_intent": null,
          "expected_target_agent": "Campaign Helper",
          "expected_master_action": "RESUME_PREVIOUS_TASK",
          "expected_state_update": { "active_child_agent": "Campaign Helper", "child_agent_status_map.Campaign Helper": "ACTIVE" },
          "expected_queue_update": "pending_task_queue = []",
          "expected_handoff": "HANDOFF_TO_CAMPAIGN_HELPER",
          "expected_return_to_master": null,
          "validation_note": "CRITICAL: Master MUST auto-resume queued campaign. Must NOT ask 'what would you like to do next?'"
        }
      ]
    },

    {
      "conversation_id": "E-004",
      "category": "SWITCHING_AND_RETURN",
      "priority": "P0",
      "title": "Child blocks — returns to master — master asks clarification",
      "purpose": "Verify that when a child gets blocked, it returns to master, which then decides next step.",
      "preconditions": ["Onboarding Helper active, encounters OTP failure"],
      "initial_session_state": {
        "active_child_agent": "Onboarding Helper",
        "pending_task_queue": ["template_creation"],
        "child_agent_status_map": { "Onboarding Helper": "ACTIVE" }
      },
      "user_goal": "OTP not received — onboarding blocked.",
      "expected_master_behavior_summary": "Onboarding child returns blocked state. Master detects block. Keeps onboarding as BLOCKED. Asks user if they want to wait or continue with something else.",
      "expected_final_outcome": "Master informs user of block, offers to continue with queued template task.",
      "conversation_steps": [
        {
          "turn_number": 1,
          "speaker": "child_agent",
          "active_agent_expected": "Onboarding Helper",
          "agent_message": "I've tried OTP verification but it seems your number may still be active on WhatsApp. Please delete WhatsApp from your phone first, then try again.",
          "expected_intent": null,
          "expected_target_agent": "Onboarding Helper",
          "expected_master_action": null,
          "expected_state_update": { "child_agent_status_map.Onboarding Helper": "BLOCKED" },
          "expected_queue_update": "no change",
          "expected_handoff": null,
          "expected_return_to_master": "RETURN_CONTROL_TO_MASTER",
          "validation_note": null
        },
        {
          "turn_number": 2,
          "speaker": "master",
          "active_agent_expected": "master",
          "agent_message": "Onboarding is temporarily blocked — waiting for you to remove WhatsApp from your phone. While you do that, would you like to start creating your template?",
          "expected_intent": null,
          "expected_target_agent": null,
          "expected_master_action": "RETURN_CONTROL_TO_MASTER",
          "expected_state_update": {
            "active_child_agent": null,
            "child_agent_status_map.Onboarding Helper": "BLOCKED",
            "blocked_task_list": ["onboarding: waiting for number migration"]
          },
          "expected_queue_update": "no change",
          "expected_handoff": null,
          "expected_return_to_master": null,
          "validation_note": "Master must offer productive next step while blocking task resolves."
        }
      ]
    },

    {
      "conversation_id": "E-005",
      "category": "SWITCHING_AND_RETURN",
      "priority": "P0",
      "title": "'not this, go back' — user aborts current flow",
      "purpose": "Verify 'not this, go back' correctly returns control to master or prior agent.",
      "preconditions": ["Template Helper active"],
      "initial_session_state": {
        "active_child_agent": "Template Helper",
        "child_agent_status_map": { "Template Helper": "ACTIVE" },
        "switch_history": ["onboarding -> template"]
      },
      "user_goal": "Abort template and return to onboarding.",
      "expected_master_behavior_summary": "User sends abort signal. Master pauses template, restores onboarding as active.",
      "expected_final_outcome": "Template paused → Onboarding Helper resumes.",
      "conversation_steps": [
        {
          "turn_number": 1,
          "speaker": "user",
          "active_agent_expected": "master",
          "user_message": "not this, go back",
          "expected_intent": "return_to_previous_agent",
          "expected_target_agent": "Onboarding Helper",
          "expected_master_action": "PRESERVE_CONTEXT_AND_SWITCH",
          "expected_state_update": {
            "active_child_agent": "Onboarding Helper",
            "child_agent_status_map.Template Helper": "PAUSED",
            "child_agent_status_map.Onboarding Helper": "ACTIVE"
          },
          "expected_queue_update": "no change",
          "expected_handoff": "HANDOFF_TO_ONBOARDING_HELPER",
          "expected_return_to_master": null,
          "validation_note": "'not this, go back' is a return signal. Master must check switch_history for where to go back to."
        }
      ]
    },

    {
      "conversation_id": "E-006",
      "category": "SWITCHING_AND_RETURN",
      "priority": "P0",
      "title": "No queued tasks after child completes — master asks what is next",
      "purpose": "Verify master asks a single focused question when no pending task exists after child completes.",
      "preconditions": ["Template Helper completes, no tasks queued"],
      "initial_session_state": {
        "active_child_agent": "Template Helper",
        "pending_task_queue": [],
        "completed_task_list": ["onboarding"],
        "child_agent_status_map": { "Template Helper": "ACTIVE" }
      },
      "user_goal": "Template done, no prior plan for next step.",
      "expected_master_behavior_summary": "Template completes. No pending queue. Master asks one question about next step.",
      "expected_final_outcome": "Master presents options or asks what user wants to do with the template.",
      "conversation_steps": [
        {
          "turn_number": 1,
          "speaker": "user",
          "active_agent_expected": "Template Helper",
          "user_message": "[Template submitted]",
          "expected_intent": "submit_template",
          "expected_target_agent": "Template Helper",
          "expected_master_action": "RETURN_CONTROL_TO_MASTER",
          "expected_state_update": { "child_agent_status_map.Template Helper": "COMPLETED" },
          "expected_queue_update": "no change",
          "expected_handoff": null,
          "expected_return_to_master": "RETURN_CONTROL_TO_MASTER",
          "validation_note": null
        },
        {
          "turn_number": 2,
          "speaker": "master",
          "active_agent_expected": "master",
          "agent_message": "Template submitted for Meta review. What would you like to do next — set up a campaign, build a chatbot, or check something else?",
          "expected_intent": null,
          "expected_target_agent": null,
          "expected_master_action": "ASK_MINIMAL_CLARIFICATION",
          "expected_state_update": { "active_child_agent": null },
          "expected_queue_update": "no change",
          "expected_handoff": null,
          "expected_return_to_master": null,
          "validation_note": "Master asks one concise question. Must NOT give long generic menu. Must reference what was just done."
        }
      ]
    },

    {
      "conversation_id": "E-007",
      "category": "SWITCHING_AND_RETURN",
      "priority": "P1",
      "title": "All four agents — switch history maintained",
      "purpose": "Verify switch_history tracks correctly across 3+ switches.",
      "preconditions": ["No prior session"],
      "initial_session_state": { "active_child_agent": null, "switch_history": [] },
      "user_goal": "Flow across all 4 agents with explicit switches.",
      "expected_master_behavior_summary": "Switch history is updated at each transition. Master can return to any prior agent on request.",
      "expected_final_outcome": "switch_history = ['onboarding', 'template', 'chatbot', 'campaign'] in order.",
      "conversation_steps": [
        {
          "turn_number": 1,
          "speaker": "user",
          "active_agent_expected": "master",
          "user_message": "Start with onboarding.",
          "expected_intent": "start_onboarding_flow",
          "expected_target_agent": "Onboarding Helper",
          "expected_master_action": "ROUTE_TO_ONBOARDING",
          "expected_state_update": { "switch_history": ["onboarding"] },
          "expected_queue_update": "no change",
          "expected_handoff": "HANDOFF_TO_ONBOARDING_HELPER",
          "expected_return_to_master": null,
          "validation_note": null
        },
        {
          "turn_number": 2,
          "speaker": "user",
          "active_agent_expected": "master",
          "user_message": "Switch to template now.",
          "expected_intent": "switch_agent_request",
          "expected_target_agent": "Template Helper",
          "expected_master_action": "PRESERVE_CONTEXT_AND_SWITCH",
          "expected_state_update": { "switch_history": ["onboarding", "template"] },
          "expected_queue_update": "pending_task_queue = ['resume_onboarding']",
          "expected_handoff": "HANDOFF_TO_TEMPLATE_CREATION_HELPER",
          "expected_return_to_master": null,
          "validation_note": null
        },
        {
          "turn_number": 3,
          "speaker": "user",
          "active_agent_expected": "master",
          "user_message": "Now go to chatbot.",
          "expected_intent": "switch_agent_request",
          "expected_target_agent": "Chatbot Helper",
          "expected_master_action": "PRESERVE_CONTEXT_AND_SWITCH",
          "expected_state_update": { "switch_history": ["onboarding", "template", "chatbot"] },
          "expected_queue_update": "pending_task_queue = ['resume_onboarding', 'resume_template']",
          "expected_handoff": "HANDOFF_TO_CHATBOT_HELPER",
          "expected_return_to_master": null,
          "validation_note": "Each switch must append to switch_history and preserve prior agent state."
        }
      ]
    },

    {
      "conversation_id": "E-008",
      "category": "SWITCHING_AND_RETURN",
      "priority": "P1",
      "title": "Return to previous agent by name",
      "purpose": "Verify 'go back to onboarding' returns to Onboarding Helper from any current child.",
      "preconditions": ["Template Helper active, onboarding was done before"],
      "initial_session_state": {
        "active_child_agent": "Template Helper",
        "child_agent_status_map": { "Onboarding Helper": "PAUSED", "Template Helper": "ACTIVE" },
        "switch_history": ["onboarding", "template"]
      },
      "user_goal": "Return to onboarding flow.",
      "expected_master_behavior_summary": "P=105 fires on 'go back to onboarding'. Template paused. Onboarding resumes.",
      "expected_final_outcome": "Onboarding Helper resumes from where it was paused.",
      "conversation_steps": [
        {
          "turn_number": 1,
          "speaker": "user",
          "active_agent_expected": "master",
          "user_message": "Go back to onboarding.",
          "expected_intent": "return_to_previous_agent",
          "expected_target_agent": "Onboarding Helper",
          "expected_master_action": "PRESERVE_CONTEXT_AND_SWITCH",
          "expected_state_update": {
            "active_child_agent": "Onboarding Helper",
            "child_agent_status_map.Template Helper": "PAUSED",
            "child_agent_status_map.Onboarding Helper": "ACTIVE"
          },
          "expected_queue_update": "no change",
          "expected_handoff": "HANDOFF_TO_ONBOARDING_HELPER",
          "expected_return_to_master": null,
          "validation_note": "P=105 fires on 'go back to onboarding'. Onboarding must resume from saved state."
        }
      ]
    },

    {
      "conversation_id": "E-009",
      "category": "SWITCHING_AND_RETURN",
      "priority": "P1",
      "title": "Chatbot blocks — master offers alternatives",
      "purpose": "Verify master offers alternatives when chatbot child gets blocked.",
      "preconditions": ["Chatbot Helper active, encounters publish error"],
      "initial_session_state": {
        "active_child_agent": "Chatbot Helper",
        "pending_task_queue": [],
        "child_agent_status_map": { "Chatbot Helper": "ACTIVE" }
      },
      "user_goal": "Chatbot publish fails — master must handle.",
      "expected_master_behavior_summary": "Chatbot returns BLOCKED. Master acknowledges block, offers to create template or campaign while chatbot issue is being resolved.",
      "expected_final_outcome": "Chatbot blocked noted. User redirected to another productive task.",
      "conversation_steps": [
        {
          "turn_number": 1,
          "speaker": "child_agent",
          "active_agent_expected": "Chatbot Helper",
          "agent_message": "There seems to be a configuration error preventing publish. Please check your trigger keywords for conflicts.",
          "expected_intent": null,
          "expected_target_agent": "Chatbot Helper",
          "expected_master_action": null,
          "expected_state_update": { "child_agent_status_map.Chatbot Helper": "BLOCKED" },
          "expected_queue_update": "no change",
          "expected_handoff": null,
          "expected_return_to_master": "RETURN_CONTROL_TO_MASTER",
          "validation_note": null
        },
        {
          "turn_number": 2,
          "speaker": "master",
          "active_agent_expected": "master",
          "agent_message": "The chatbot is blocked due to a trigger conflict. While you resolve that, would you like to work on a template or campaign instead?",
          "expected_intent": null,
          "expected_target_agent": null,
          "expected_master_action": "RETURN_CONTROL_TO_MASTER",
          "expected_state_update": { "blocked_task_list": ["chatbot: trigger conflict"] },
          "expected_queue_update": "no change",
          "expected_handoff": null,
          "expected_return_to_master": null,
          "validation_note": "Master must be productive — offer alternatives. Must NOT just say 'try again'."
        }
      ]
    },

    {
      "conversation_id": "E-010",
      "category": "SWITCHING_AND_RETURN",
      "priority": "P1",
      "title": "User forgets and restarts mid-session",
      "purpose": "Verify master detects restart attempt and offers to continue existing work.",
      "preconditions": ["Onboarding Helper paused mid-flow"],
      "initial_session_state": {
        "active_child_agent": null,
        "child_agent_status_map": { "Onboarding Helper": "PAUSED" },
        "switch_history": ["onboarding"]
      },
      "user_goal": "User sends greeting as if starting fresh.",
      "expected_master_behavior_summary": "User sends 'hi'. Master detects existing paused session. Offers to resume instead of starting over.",
      "expected_final_outcome": "User chooses to resume. Onboarding Helper resumes.",
      "conversation_steps": [
        {
          "turn_number": 1,
          "speaker": "user",
          "active_agent_expected": "master",
          "user_message": "hi",
          "expected_intent": "Default Welcome Intent",
          "expected_target_agent": null,
          "expected_master_action": "RETURN_CONTROL_TO_MASTER",
          "expected_state_update": null,
          "expected_queue_update": "no change",
          "expected_handoff": null,
          "expected_return_to_master": null,
          "validation_note": "Master detects paused session exists. Must offer to resume instead of treating as new user."
        },
        {
          "turn_number": 2,
          "speaker": "master",
          "active_agent_expected": "master",
          "agent_message": "Welcome back! You have an onboarding process in progress. Would you like to continue from where you left off?",
          "expected_intent": null,
          "expected_target_agent": null,
          "expected_master_action": "ASK_MINIMAL_CLARIFICATION",
          "expected_state_update": null,
          "expected_queue_update": "no change",
          "expected_handoff": null,
          "expected_return_to_master": null,
          "validation_note": "Must NOT start fresh onboarding. Must offer resume."
        },
        {
          "turn_number": 3,
          "speaker": "user",
          "active_agent_expected": "master",
          "user_message": "yes continue",
          "expected_intent": "continue_onboarding_flow",
          "expected_target_agent": "Onboarding Helper",
          "expected_master_action": "RESUME_PREVIOUS_TASK",
          "expected_state_update": { "active_child_agent": "Onboarding Helper", "child_agent_status_map.Onboarding Helper": "ACTIVE" },
          "expected_queue_update": "no change",
          "expected_handoff": "HANDOFF_TO_ONBOARDING_HELPER",
          "expected_return_to_master": null,
          "validation_note": null
        }
      ]
    },

    {
      "conversation_id": "E-011",
      "category": "SWITCHING_AND_RETURN",
      "priority": "P1",
      "title": "Campaign completes — master offers next step",
      "purpose": "Verify that after campaign completion, master makes a relevant next-step suggestion.",
      "preconditions": ["Campaign Helper active, all steps done"],
      "initial_session_state": {
        "active_child_agent": "Campaign Helper",
        "pending_task_queue": [],
        "completed_task_list": ["onboarding", "template_creation"],
        "child_agent_status_map": { "Campaign Helper": "ACTIVE" }
      },
      "user_goal": "Campaign sent — session ends or master offers next action.",
      "expected_master_behavior_summary": "Campaign completes. No queue. Master makes contextual next-step offer.",
      "expected_final_outcome": "Master suggests building a chatbot or reviewing analytics.",
      "conversation_steps": [
        {
          "turn_number": 1,
          "speaker": "user",
          "active_agent_expected": "Campaign Helper",
          "user_message": "[Campaign launched successfully]",
          "expected_intent": "campaign_launched",
          "expected_target_agent": "Campaign Helper",
          "expected_master_action": "RETURN_CONTROL_TO_MASTER",
          "expected_state_update": { "child_agent_status_map.Campaign Helper": "COMPLETED", "completed_task_list": ["onboarding", "template_creation", "campaign_created"] },
          "expected_queue_update": "no change",
          "expected_handoff": null,
          "expected_return_to_master": "RETURN_CONTROL_TO_MASTER",
          "validation_note": null
        },
        {
          "turn_number": 2,
          "speaker": "master",
          "active_agent_expected": "master",
          "agent_message": "Campaign is live! Would you like to set up an automated chatbot to handle replies, or would you like to check the campaign analytics?",
          "expected_intent": null,
          "expected_target_agent": null,
          "expected_master_action": "ASK_MINIMAL_CLARIFICATION",
          "expected_state_update": { "active_child_agent": null },
          "expected_queue_update": "no change",
          "expected_handoff": null,
          "expected_return_to_master": null,
          "validation_note": "Contextually relevant next-step offer. References what was just done."
        }
      ]
    },

    {
      "conversation_id": "E-012",
      "category": "SWITCHING_AND_RETURN",
      "priority": "P1",
      "title": "Switch with pending slots — master preserves filled slots",
      "purpose": "Verify that when user switches mid-slot-filling, already filled slots are preserved.",
      "preconditions": ["Template Helper active, partially filled template form"],
      "initial_session_state": {
        "active_child_agent": "Template Helper",
        "child_agent_status_map": { "Template Helper": "ACTIVE" },
        "current_workflow_stage": "template.collect_body_text",
        "user_goal_summary": "creating marketing template in English"
      },
      "user_goal": "Switch to campaign while template is partially filled.",
      "expected_master_behavior_summary": "User switches. Master preserves template state (category=marketing, language=English). Routes to Campaign. On return, Template Helper resumes from body_text step.",
      "expected_final_outcome": "Template state preserved across switch. Resumes correctly.",
      "conversation_steps": [
        {
          "turn_number": 1,
          "speaker": "user",
          "active_agent_expected": "master",
          "user_message": "Hold on, let me check something in campaign first.",
          "expected_intent": "switch_agent_request",
          "expected_target_agent": "Campaign Helper",
          "expected_master_action": "PRESERVE_CONTEXT_AND_SWITCH",
          "expected_state_update": {
            "active_child_agent": "Campaign Helper",
            "child_agent_status_map.Template Helper": "PAUSED",
            "child_agent_status_map.Campaign Helper": "ACTIVE"
          },
          "expected_queue_update": "pending_task_queue = ['resume_template: from body_text step']",
          "expected_handoff": "HANDOFF_TO_CAMPAIGN_HELPER",
          "expected_return_to_master": null,
          "validation_note": "Template's partial state (category, language already filled) MUST be preserved."
        }
      ]
    },

    {
      "conversation_id": "E-013",
      "category": "SWITCHING_AND_RETURN",
      "priority": "P2",
      "title": "Multiple rapid switches — state integrity check",
      "purpose": "Verify state integrity is maintained across 4 rapid agent switches.",
      "preconditions": ["No prior session"],
      "initial_session_state": { "active_child_agent": null, "switch_history": [], "pending_task_queue": [] },
      "user_goal": "User rapidly switches between agents.",
      "expected_master_behavior_summary": "Each switch correctly pauses prior, activates new. switch_history grows. Pending queue grows.",
      "expected_final_outcome": "State integrity maintained: 4 items in switch_history, all paused correctly.",
      "conversation_steps": [
        {
          "turn_number": 1, "speaker": "user", "active_agent_expected": "master",
          "user_message": "Start onboarding.",
          "expected_target_agent": "Onboarding Helper", "expected_master_action": "ROUTE_TO_ONBOARDING",
          "expected_state_update": { "switch_history": ["onboarding"] }, "expected_queue_update": "no change",
          "expected_handoff": "HANDOFF_TO_ONBOARDING_HELPER", "expected_return_to_master": null, "validation_note": null,
          "expected_intent": "start_onboarding_flow"
        },
        {
          "turn_number": 2, "speaker": "user", "active_agent_expected": "master",
          "user_message": "Actually, switch to template.",
          "expected_target_agent": "Template Helper", "expected_master_action": "PRESERVE_CONTEXT_AND_SWITCH",
          "expected_state_update": { "child_agent_status_map.Onboarding Helper": "PAUSED", "switch_history": ["onboarding","template"] },
          "expected_queue_update": "pending_task_queue = ['resume_onboarding']",
          "expected_handoff": "HANDOFF_TO_TEMPLATE_CREATION_HELPER", "expected_return_to_master": null,
          "validation_note": "State must show Onboarding=PAUSED, Template=ACTIVE.",
          "expected_intent": "switch_agent_request"
        },
        {
          "turn_number": 3, "speaker": "user", "active_agent_expected": "master",
          "user_message": "No wait, chatbot.",
          "expected_target_agent": "Chatbot Helper", "expected_master_action": "PRESERVE_CONTEXT_AND_SWITCH",
          "expected_state_update": { "child_agent_status_map.Template Helper": "PAUSED", "switch_history": ["onboarding","template","chatbot"] },
          "expected_queue_update": "pending_task_queue = ['resume_onboarding','resume_template']",
          "expected_handoff": "HANDOFF_TO_CHATBOT_HELPER", "expected_return_to_master": null,
          "validation_note": "Onboarding=PAUSED, Template=PAUSED, Chatbot=ACTIVE.",
          "expected_intent": "switch_agent_request"
        }
      ]
    },

    {
      "conversation_id": "E-014",
      "category": "SWITCHING_AND_RETURN",
      "priority": "P1",
      "title": "Child returns because out-of-scope request",
      "purpose": "Verify child returns to master when user asks something out of its scope.",
      "preconditions": ["Campaign Helper active"],
      "initial_session_state": {
        "active_child_agent": "Campaign Helper",
        "child_agent_status_map": { "Campaign Helper": "ACTIVE" }
      },
      "user_goal": "User asks about chatbot while in campaign flow.",
      "expected_master_behavior_summary": "User asks about chatbot inside campaign flow. Campaign Helper detects out-of-scope. Returns to master. Master routes to Chatbot Helper.",
      "expected_final_outcome": "Campaign paused → Chatbot Helper handles the chatbot query.",
      "conversation_steps": [
        {
          "turn_number": 1,
          "speaker": "user",
          "active_agent_expected": "master",
          "user_message": "By the way, how do I set a keyword trigger for my chatbot?",
          "expected_intent": "chatbot_trigger_query",
          "expected_target_agent": "Chatbot Helper",
          "expected_master_action": "PRESERVE_CONTEXT_AND_SWITCH",
          "expected_state_update": {
            "active_child_agent": "Chatbot Helper",
            "child_agent_status_map.Campaign Helper": "PAUSED",
            "child_agent_status_map.Chatbot Helper": "ACTIVE"
          },
          "expected_queue_update": "pending_task_queue = ['resume_campaign']",
          "expected_handoff": "HANDOFF_TO_CHATBOT_HELPER",
          "expected_return_to_master": null,
          "validation_note": "P=88 chatbot keyword fires. Campaign paused. Must preserve campaign state."
        }
      ]
    },

    {
      "conversation_id": "E-015",
      "category": "SWITCHING_AND_RETURN",
      "priority": "P2",
      "title": "Session summary after all tasks complete",
      "purpose": "Verify master gives a completion summary when all 4 agents have completed their tasks.",
      "preconditions": ["All 4 agents have completed their tasks"],
      "initial_session_state": {
        "active_child_agent": null,
        "pending_task_queue": [],
        "completed_task_list": ["onboarding", "template_creation", "campaign_creation", "chatbot_creation"],
        "child_agent_status_map": { "Onboarding Helper": "COMPLETED", "Template Helper": "COMPLETED", "Campaign Helper": "COMPLETED", "Chatbot Helper": "COMPLETED" }
      },
      "user_goal": "All tasks done — master summarizes.",
      "expected_master_behavior_summary": "All tasks complete. Master gives concise session summary.",
      "expected_final_outcome": "Master summarizes what was done and offers what to do next.",
      "conversation_steps": [
        {
          "turn_number": 1,
          "speaker": "user",
          "active_agent_expected": "master",
          "user_message": "I think everything is done. What did we accomplish today?",
          "expected_intent": "faq_redirect",
          "expected_target_agent": null,
          "expected_master_action": "ASK_MINIMAL_CLARIFICATION",
          "expected_state_update": null,
          "expected_queue_update": "no change",
          "expected_handoff": null,
          "expected_return_to_master": null,
          "validation_note": "Master reads completed_task_list and gives accurate session summary."
        },
        {
          "turn_number": 2,
          "speaker": "master",
          "active_agent_expected": "master",
          "agent_message": "Here's what we completed today: ✅ WhatsApp API onboarding ✅ Template created and submitted ✅ Campaign launched ✅ Chatbot published. You're all set! Would you like to monitor campaign performance or make any changes?",
          "expected_intent": null,
          "expected_target_agent": null,
          "expected_master_action": null,
          "expected_state_update": null,
          "expected_queue_update": "no change",
          "expected_handoff": null,
          "expected_return_to_master": null,
          "validation_note": "Summary must be accurate and reference actual completed tasks."
        }
      ]
    }
  ]
}
