#!/usr/bin/env python3
"""
Validate that all agent user testing scenarios are properly structured
"""

import os
from pathlib import Path

def validate_scenarios():
    """Validate all scenario directories"""
    
    base_dir = Path("agent-user-testing")
    
    print("🔍 Validating Agent User Testing Scenarios")
    print("=" * 50)
    
    expected_scenarios = [
        "01-mechanical-engineering",
        "02-childcare-regulations", 
        "03-plant-logistics",
        "04-financial-compliance",
        "05-medical-research",
        "06-real-estate-development",
        "07-agriculture-sustainability",
        "08-education-technology",
        "09-construction-safety",
        "10-nonprofit-fundraising",
        "11-cybersecurity-compliance",
        "12-retail-ecommerce",
        "13-hospitality-operations",
        "14-software-development",
        "15-environmental-consulting"
    ]
    
    all_valid = True
    
    for scenario in expected_scenarios:
        scenario_dir = base_dir / scenario
        
        print(f"\n📁 Checking {scenario}:")
        
        # Check if directory exists
        if not scenario_dir.exists():
            print(f"  ❌ Directory missing")
            all_valid = False
            continue
        
        # Check for required files
        instructions_file = scenario_dir / "INSTRUCTIONS.md"
        results_file = scenario_dir / "RESULTS.md"
        
        if instructions_file.exists():
            print(f"  ✅ INSTRUCTIONS.md present")
            
            # Quick content validation
            content = instructions_file.read_text()
            if "FSS-Mini-RAG" in content and "Step 1: Setup" in content:
                print(f"  ✅ Instructions contain required elements")
            else:
                print(f"  ⚠️  Instructions missing key elements")
                all_valid = False
        else:
            print(f"  ❌ INSTRUCTIONS.md missing")
            all_valid = False
        
        if results_file.exists():
            print(f"  ✅ RESULTS.md present")
        else:
            print(f"  ❌ RESULTS.md missing")
            all_valid = False
    
    print(f"\n{'=' * 50}")
    
    if all_valid:
        print(f"✅ ALL SCENARIOS VALID ({len(expected_scenarios)} scenarios)")
        print(f"🚀 Ready for agent deployment!")
        print(f"\nNext steps:")
        print(f"1. Choose scenarios for testing priority")
        print(f"2. Assign appropriate agent types")
        print(f"3. Deploy agents with scenario instructions")
        print(f"4. Monitor results and gather feedback")
    else:
        print(f"⚠️  SOME SCENARIOS NEED ATTENTION")
        print(f"🔧 Fix issues before deployment")
    
    return all_valid

if __name__ == "__main__":
    validate_scenarios()