60 lines
2.0 KiB
Bash
Executable File
60 lines
2.0 KiB
Bash
Executable File
#!/bin/bash
|
|
# Local Registry Validation Script
|
|
# Run this before commits to ensure registry integrity
|
|
|
|
echo "🔍 Local Registry Validation"
|
|
echo "============================"
|
|
|
|
# Set Python path for MCP servers
|
|
export PYTHONPATH="/Users/sovereign/work-core"
|
|
|
|
cd /Users/sovereign/work-core/cloudflare
|
|
|
|
# Generate fresh registry
|
|
echo "📝 Generating fresh capability registry..."
|
|
python3 generate_capability_registry_v2.py
|
|
|
|
# Check tool name parity
|
|
echo "🔧 Checking tool name parity..."
|
|
python3 ci_check_tool_names.py
|
|
|
|
# Check entrypoint sanity
|
|
echo "🚀 Checking entrypoint sanity..."
|
|
python3 ci_check_entrypoints.py
|
|
|
|
# Validate registry format
|
|
echo "📊 Validating registry format..."
|
|
python3 -c "
|
|
import json
|
|
with open('capability_registry_v2.json', 'r') as f:
|
|
registry = json.load(f)
|
|
|
|
# Required sections
|
|
required_sections = ['mcp_servers', 'terraform_resources', 'gitops_tools', 'security_framework', 'operational_tools']
|
|
for section in required_sections:
|
|
assert section in registry, f'Missing section: {section}'
|
|
|
|
# MCP server validation
|
|
for server_name, server_info in registry['mcp_servers'].items():
|
|
assert 'entrypoint' in server_info, f'Missing entrypoint for {server_name}'
|
|
assert 'tools' in server_info, f'Missing tools for {server_name}'
|
|
assert 'auth_env' in server_info, f'Missing auth_env for {server_name}'
|
|
assert 'side_effects' in server_info, f'Missing side_effects for {server_name}'
|
|
assert 'outputs' in server_info, f'Missing outputs for {server_name}'
|
|
|
|
print('✅ Registry format validation passed')
|
|
"
|
|
|
|
# Check for changes from original
|
|
echo "📈 Checking for registry changes..."
|
|
if git diff --quiet capability_registry_v2.json; then
|
|
echo "✅ Registry is stable - no changes detected"
|
|
else
|
|
echo "⚠️ Registry changed during validation"
|
|
git diff capability_registry_v2.json
|
|
echo "💡 Consider committing these changes"
|
|
fi
|
|
|
|
echo ""
|
|
echo "🎉 Registry validation completed successfully!"
|
|
echo "💡 Run this script before committing Cloudflare changes" |