Clean up BZZZ development detritus and enhance .gitignore
Major cleanup of development artifacts and obsolete files: REMOVED: - archived/2025-07-17/ directory (11 outdated development files) - old-docs/ directory (10 obsolete documentation files) - Compiled binaries: bzzz-port3333, test/bzzz-chat-api - Development scripts: intensive_coordination_test.sh, start_bzzz_with_mock_api.sh, test_hmmm_monitoring.sh, trigger_mock_coordination.sh - Test artifacts: test/run_chat_api.sh, test/test_chat_api.py - Empty data/chat-api-logs/ directory ENHANCED: - Updated .gitignore with comprehensive patterns to prevent future artifact accumulation - Added patterns for compiled binaries, build artifacts, logs, temporary files - Included development-specific ignores for archived/, old-docs/, test artifacts PRESERVED: - All Phase 2B documentation in docs/ - Essential deployment scripts (install-service.sh, uninstall-service.sh, deploy-bzzz-cluster.sh) - Project status tracking (PROJECT_TODOS.md, README.md) - Core source code and production configurations Space saved: ~95MB of development detritus removed Project is now clean and production-ready with enhanced artifact prevention 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Binary file not shown.
@@ -1,47 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Bzzz Chat API Test Runner
|
||||
# This script builds and runs the chat API integration server
|
||||
|
||||
set -e
|
||||
|
||||
echo "🔧 Building Bzzz Chat API..."
|
||||
|
||||
# Go to Bzzz project root
|
||||
cd /home/tony/AI/projects/Bzzz
|
||||
|
||||
# Add gorilla/mux dependency if not present
|
||||
if ! grep -q "github.com/gorilla/mux" go.mod; then
|
||||
echo "📦 Adding gorilla/mux dependency..."
|
||||
go get github.com/gorilla/mux
|
||||
fi
|
||||
|
||||
# Build the chat API handler
|
||||
echo "🏗️ Building chat API handler..."
|
||||
go build -o test/bzzz-chat-api test/chat_api_handler.go
|
||||
|
||||
# Check if build succeeded
|
||||
if [ ! -f "test/bzzz-chat-api" ]; then
|
||||
echo "❌ Build failed!"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "✅ Build successful!"
|
||||
|
||||
# Create data directory for logs
|
||||
mkdir -p ./data/chat-api-logs
|
||||
|
||||
# Start the server
|
||||
echo "🚀 Starting Bzzz Chat API server on port 8080..."
|
||||
echo "📡 API Endpoints:"
|
||||
echo " POST http://localhost:8080/bzzz/api/execute-task"
|
||||
echo " GET http://localhost:8080/bzzz/api/health"
|
||||
echo ""
|
||||
echo "🔗 For N8N integration, use:"
|
||||
echo " http://localhost:8080/bzzz/api/execute-task"
|
||||
echo ""
|
||||
echo "Press Ctrl+C to stop the server"
|
||||
echo ""
|
||||
|
||||
# Run the server
|
||||
./test/bzzz-chat-api 8080
|
||||
@@ -1,197 +0,0 @@
|
||||
#!/usr/bin/env python3
|
||||
"""
|
||||
Test client for Bzzz Chat API integration
|
||||
This script simulates the N8N workflow calling the Bzzz API
|
||||
"""
|
||||
|
||||
import json
|
||||
import requests
|
||||
import time
|
||||
import sys
|
||||
|
||||
# API endpoint
|
||||
API_URL = "http://localhost:8080/bzzz/api"
|
||||
|
||||
def test_health_check():
|
||||
"""Test the health check endpoint"""
|
||||
print("🔍 Testing health check endpoint...")
|
||||
try:
|
||||
response = requests.get(f"{API_URL}/health", timeout=5)
|
||||
if response.status_code == 200:
|
||||
print("✅ Health check passed:", response.json())
|
||||
return True
|
||||
else:
|
||||
print(f"❌ Health check failed: {response.status_code}")
|
||||
return False
|
||||
except Exception as e:
|
||||
print(f"❌ Health check error: {e}")
|
||||
return False
|
||||
|
||||
def create_test_task():
|
||||
"""Create a simple test task"""
|
||||
return {
|
||||
"method": "execute_task_in_sandbox",
|
||||
"task": {
|
||||
"task_id": 9999,
|
||||
"number": 9999,
|
||||
"title": "Chat API Test Task",
|
||||
"description": "Create a simple Python hello world function and save it to hello.py",
|
||||
"repository": {
|
||||
"owner": "test",
|
||||
"repository": "chat-test"
|
||||
},
|
||||
"git_url": "", # No git repo for simple test
|
||||
"task_type": "development",
|
||||
"priority": "medium",
|
||||
"requirements": [],
|
||||
"deliverables": ["hello.py with hello_world() function"],
|
||||
"context": "This is a test task from the chat API integration"
|
||||
},
|
||||
"execution_options": {
|
||||
"sandbox_image": "registry.home.deepblack.cloud/tony/bzzz-sandbox:latest",
|
||||
"timeout": "300s",
|
||||
"max_iterations": 5,
|
||||
"return_full_log": True,
|
||||
"cleanup_on_complete": True
|
||||
},
|
||||
"callback": {
|
||||
"webhook_url": "http://localhost:8080/test-callback",
|
||||
"include_artifacts": True
|
||||
}
|
||||
}
|
||||
|
||||
def test_task_execution():
|
||||
"""Test task execution endpoint"""
|
||||
print("\n🚀 Testing task execution...")
|
||||
|
||||
task_request = create_test_task()
|
||||
|
||||
try:
|
||||
print("📤 Sending task request...")
|
||||
print(f"Task: {task_request['task']['description']}")
|
||||
|
||||
response = requests.post(
|
||||
f"{API_URL}/execute-task",
|
||||
json=task_request,
|
||||
headers={"Content-Type": "application/json"},
|
||||
timeout=30
|
||||
)
|
||||
|
||||
if response.status_code == 200:
|
||||
result = response.json()
|
||||
print("✅ Task accepted:", result)
|
||||
print(f" Task ID: {result.get('task_id')}")
|
||||
print(f" Status: {result.get('status')}")
|
||||
print(f" Message: {result.get('message')}")
|
||||
return True
|
||||
else:
|
||||
print(f"❌ Task execution failed: {response.status_code}")
|
||||
print(f" Response: {response.text}")
|
||||
return False
|
||||
|
||||
except Exception as e:
|
||||
print(f"❌ Task execution error: {e}")
|
||||
return False
|
||||
|
||||
def create_complex_task():
|
||||
"""Create a more complex test task"""
|
||||
return {
|
||||
"method": "execute_task_in_sandbox",
|
||||
"task": {
|
||||
"task_id": 9998,
|
||||
"number": 9998,
|
||||
"title": "Complex Chat API Test",
|
||||
"description": "Create a Python script that implements a simple calculator with add, subtract, multiply, and divide functions. Include basic error handling and save to calculator.py",
|
||||
"repository": {
|
||||
"owner": "test",
|
||||
"repository": "calculator-test"
|
||||
},
|
||||
"git_url": "",
|
||||
"task_type": "development",
|
||||
"priority": "high",
|
||||
"requirements": [
|
||||
"Python functions for basic math operations",
|
||||
"Error handling for division by zero",
|
||||
"Simple command-line interface"
|
||||
],
|
||||
"deliverables": ["calculator.py with Calculator class"],
|
||||
"context": "Complex test task to validate full execution pipeline"
|
||||
},
|
||||
"execution_options": {
|
||||
"sandbox_image": "registry.home.deepblack.cloud/tony/bzzz-sandbox:latest",
|
||||
"timeout": "600s",
|
||||
"max_iterations": 10,
|
||||
"return_full_log": True,
|
||||
"cleanup_on_complete": False # Keep sandbox for inspection
|
||||
},
|
||||
"callback": {
|
||||
"webhook_url": "http://localhost:8080/test-callback",
|
||||
"include_artifacts": True
|
||||
}
|
||||
}
|
||||
|
||||
def test_complex_execution():
|
||||
"""Test complex task execution"""
|
||||
print("\n🧠 Testing complex task execution...")
|
||||
|
||||
task_request = create_complex_task()
|
||||
|
||||
try:
|
||||
print("📤 Sending complex task request...")
|
||||
print(f"Task: {task_request['task']['description']}")
|
||||
|
||||
response = requests.post(
|
||||
f"{API_URL}/execute-task",
|
||||
json=task_request,
|
||||
headers={"Content-Type": "application/json"},
|
||||
timeout=30
|
||||
)
|
||||
|
||||
if response.status_code == 200:
|
||||
result = response.json()
|
||||
print("✅ Complex task accepted:", result)
|
||||
return True
|
||||
else:
|
||||
print(f"❌ Complex task failed: {response.status_code}")
|
||||
print(f" Response: {response.text}")
|
||||
return False
|
||||
|
||||
except Exception as e:
|
||||
print(f"❌ Complex task error: {e}")
|
||||
return False
|
||||
|
||||
def main():
|
||||
"""Run all tests"""
|
||||
print("🧪 Bzzz Chat API Test Suite")
|
||||
print("=" * 40)
|
||||
|
||||
# Test health check
|
||||
if not test_health_check():
|
||||
print("❌ Health check failed, is the server running?")
|
||||
print(" Start with: ./test/run_chat_api.sh")
|
||||
sys.exit(1)
|
||||
|
||||
# Test simple task execution
|
||||
if not test_task_execution():
|
||||
print("❌ Simple task execution failed")
|
||||
sys.exit(1)
|
||||
|
||||
# Test complex task execution
|
||||
if not test_complex_execution():
|
||||
print("❌ Complex task execution failed")
|
||||
sys.exit(1)
|
||||
|
||||
print("\n✅ All tests passed!")
|
||||
print("\n📋 Next steps:")
|
||||
print("1. Import the N8N workflow from chat-to-code-integration.json")
|
||||
print("2. Configure webhook URLs to point to your N8N instance")
|
||||
print("3. Test with actual chat interface")
|
||||
print("4. Monitor execution logs in ./data/chat-api-logs/")
|
||||
|
||||
print("\n💬 Example chat messages to try:")
|
||||
print(' "Create a simple hello world function in Python"')
|
||||
print(' "Task: Build a REST API endpoint\\nRepo: https://github.com/myorg/api.git\\nLanguage: Python"')
|
||||
print(' "Fix the memory leak in the session handler"')
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
Reference in New Issue
Block a user