validate-profile-coverage.sh 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. #!/bin/bash
  2. # Check if all agents are in appropriate profiles
  3. set -e
  4. echo "🔍 Checking profile coverage..."
  5. echo ""
  6. # Get all agent IDs
  7. agents=$(cat registry.json | jq -r '.components.agents[].id')
  8. errors=0
  9. for agent in $agents; do
  10. # Get agent category
  11. category=$(cat registry.json | jq -r ".components.agents[] | select(.id == \"$agent\") | .category")
  12. # Check which profiles include this agent
  13. in_essential=$(cat registry.json | jq -r ".profiles.essential.components[] | select(. == \"agent:$agent\")" 2>/dev/null || echo "")
  14. in_developer=$(cat registry.json | jq -r ".profiles.developer.components[] | select(. == \"agent:$agent\")" 2>/dev/null || echo "")
  15. in_business=$(cat registry.json | jq -r ".profiles.business.components[] | select(. == \"agent:$agent\")" 2>/dev/null || echo "")
  16. in_full=$(cat registry.json | jq -r ".profiles.full.components[] | select(. == \"agent:$agent\")" 2>/dev/null || echo "")
  17. in_advanced=$(cat registry.json | jq -r ".profiles.advanced.components[] | select(. == \"agent:$agent\")" 2>/dev/null || echo "")
  18. # Validate based on category
  19. case $category in
  20. "development")
  21. if [[ -z "$in_developer" ]]; then
  22. echo "❌ $agent (development) missing from developer profile"
  23. errors=$((errors + 1))
  24. fi
  25. if [[ -z "$in_full" ]]; then
  26. echo "❌ $agent (development) missing from full profile"
  27. errors=$((errors + 1))
  28. fi
  29. if [[ -z "$in_advanced" ]]; then
  30. echo "❌ $agent (development) missing from advanced profile"
  31. errors=$((errors + 1))
  32. fi
  33. ;;
  34. "content"|"data")
  35. if [[ -z "$in_business" ]]; then
  36. echo "❌ $agent ($category) missing from business profile"
  37. errors=$((errors + 1))
  38. fi
  39. if [[ -z "$in_full" ]]; then
  40. echo "❌ $agent ($category) missing from full profile"
  41. errors=$((errors + 1))
  42. fi
  43. if [[ -z "$in_advanced" ]]; then
  44. echo "❌ $agent ($category) missing from advanced profile"
  45. errors=$((errors + 1))
  46. fi
  47. ;;
  48. "meta")
  49. if [[ -z "$in_advanced" ]]; then
  50. echo "❌ $agent (meta) missing from advanced profile"
  51. errors=$((errors + 1))
  52. fi
  53. ;;
  54. "essential"|"standard")
  55. if [[ -z "$in_full" ]]; then
  56. echo "❌ $agent ($category) missing from full profile"
  57. errors=$((errors + 1))
  58. fi
  59. if [[ -z "$in_advanced" ]]; then
  60. echo "❌ $agent ($category) missing from advanced profile"
  61. errors=$((errors + 1))
  62. fi
  63. ;;
  64. esac
  65. done
  66. echo ""
  67. if [[ $errors -eq 0 ]]; then
  68. echo "✅ Profile coverage check complete - no issues found"
  69. exit 0
  70. else
  71. echo "❌ Profile coverage check found $errors issue(s)"
  72. exit 1
  73. fi