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:
anthonyrawlins
2025-08-09 13:27:17 +10:00
parent ee6bb09511
commit c9f4d2df0f
30 changed files with 21 additions and 10750 deletions

View File

@@ -1,183 +0,0 @@
#!/bin/bash
# Intensive coordination test to generate lots of dashboard activity
# This creates rapid-fire coordination scenarios for monitoring
LOG_DIR="/tmp/bzzz_logs"
TEST_LOG="$LOG_DIR/intensive_test_$(date +%Y%m%d_%H%M%S).log"
mkdir -p "$LOG_DIR"
echo "🚀 Starting Intensive Coordination Test"
echo "======================================"
echo "This will generate rapid coordination activity for dashboard monitoring"
echo "Test Log: $TEST_LOG"
echo ""
# Function to log test events
log_test() {
local timestamp=$(date '+%Y-%m-%d %H:%M:%S')
local event="$1"
echo "[$timestamp] $event" | tee -a "$TEST_LOG"
}
# Function to simulate rapid task announcements
simulate_task_burst() {
local scenario="$1"
local count="$2"
log_test "BURST_START: $scenario - announcing $count tasks rapidly"
for i in $(seq 1 $count); do
log_test "TASK_ANNOUNCE: repo-$i/task-$i - $scenario scenario task $i"
sleep 0.5
done
log_test "BURST_COMPLETE: $scenario burst finished"
}
# Function to simulate agent coordination chatter
simulate_agent_chatter() {
local duration="$1"
local end_time=$(($(date +%s) + duration))
log_test "CHATTER_START: Simulating agent coordination discussion for ${duration}s"
local agent_responses=(
"I can handle this task"
"This conflicts with my current work"
"Need clarification on requirements"
"Dependencies detected with repo-X"
"Proposing different execution order"
"Ready to start immediately"
"This requires security review first"
"API contract needed before implementation"
"Coordination with team required"
"Escalating to human review"
)
local agents=("walnut-agent" "acacia-agent" "ironwood-agent" "test-agent-1" "test-agent-2")
while [ $(date +%s) -lt $end_time ]; do
local agent=${agents[$((RANDOM % ${#agents[@]}))]}
local response=${agent_responses[$((RANDOM % ${#agent_responses[@]}))]}
log_test "AGENT_RESPONSE: $agent: $response"
sleep $((1 + RANDOM % 3)) # Random 1-3 second delays
done
log_test "CHATTER_COMPLETE: Agent discussion simulation finished"
}
# Function to simulate coordination session lifecycle
simulate_coordination_session() {
local session_id="coord_$(date +%s)_$RANDOM"
local repos=("hive" "bzzz" "distributed-ai-dev" "n8n-workflows" "monitoring-tools")
local selected_repos=(${repos[@]:0:$((2 + RANDOM % 3))}) # 2-4 repos
log_test "SESSION_START: $session_id with repos: ${selected_repos[*]}"
# Dependency analysis phase
sleep 1
log_test "SESSION_ANALYZE: $session_id - analyzing cross-repository dependencies"
sleep 2
log_test "SESSION_DEPS: $session_id - detected $((1 + RANDOM % 4)) dependencies"
# Agent coordination phase
sleep 1
log_test "SESSION_COORD: $session_id - agents proposing execution plan"
sleep 2
local outcome=$((RANDOM % 4))
case $outcome in
0|1)
log_test "SESSION_SUCCESS: $session_id - consensus reached, plan approved"
;;
2)
log_test "SESSION_ESCALATE: $session_id - escalated to human review"
;;
3)
log_test "SESSION_TIMEOUT: $session_id - coordination timeout, retrying"
;;
esac
log_test "SESSION_COMPLETE: $session_id finished"
}
# Function to simulate error scenarios
simulate_error_scenarios() {
local errors=(
"Failed to connect to repository API"
"GitHub rate limit exceeded"
"Task dependency cycle detected"
"Agent coordination timeout"
"Invalid task specification"
"Network partition detected"
"Consensus algorithm failure"
"Authentication token expired"
)
for error in "${errors[@]}"; do
log_test "ERROR_SIM: $error"
sleep 2
done
}
# Main test execution
main() {
log_test "TEST_START: Intensive coordination test beginning"
echo "🎯 Phase 1: Rapid Task Announcements (30 seconds)"
simulate_task_burst "Cross-Repository API Integration" 8 &
sleep 15
simulate_task_burst "Security-First Development" 6 &
echo ""
echo "🤖 Phase 2: Agent Coordination Chatter (45 seconds)"
simulate_agent_chatter 45 &
echo ""
echo "🔄 Phase 3: Multiple Coordination Sessions (60 seconds)"
for i in {1..5}; do
simulate_coordination_session &
sleep 12
done
echo ""
echo "❌ Phase 4: Error Scenario Simulation (20 seconds)"
simulate_error_scenarios &
echo ""
echo "⚡ Phase 5: High-Intensity Burst (30 seconds)"
# Rapid-fire everything
for i in {1..3}; do
simulate_coordination_session &
sleep 3
simulate_task_burst "Parallel-Development-Conflict" 4 &
sleep 7
done
# Wait for background processes
wait
log_test "TEST_COMPLETE: Intensive coordination test finished"
echo ""
echo "📊 TEST SUMMARY"
echo "==============="
echo "Total Events: $(grep -c '\[.*\]' "$TEST_LOG")"
echo "Task Announcements: $(grep -c 'TASK_ANNOUNCE' "$TEST_LOG")"
echo "Agent Responses: $(grep -c 'AGENT_RESPONSE' "$TEST_LOG")"
echo "Coordination Sessions: $(grep -c 'SESSION_START' "$TEST_LOG")"
echo "Simulated Errors: $(grep -c 'ERROR_SIM' "$TEST_LOG")"
echo ""
echo "🎯 Watch your dashboard for all this activity!"
echo "📝 Detailed log: $TEST_LOG"
}
# Trap Ctrl+C
trap 'echo ""; echo "🛑 Test interrupted"; exit 0' INT
# Run the intensive test
main

View File

@@ -1,34 +0,0 @@
#!/bin/bash
# Script to temporarily run bzzz with mock Hive API for testing
# This lets real bzzz agents do actual coordination with fake data
echo "🔧 Configuring Bzzz to use Mock Hive API"
echo "========================================"
# Stop the current bzzz service
echo "Stopping current bzzz service..."
sudo systemctl stop bzzz.service
# Wait a moment
sleep 2
# Set environment variables for mock API
export BZZZ_HIVE_API_URL="http://localhost:5000"
export BZZZ_LOG_LEVEL="debug"
echo "Starting bzzz with mock Hive API..."
echo "Mock API URL: $BZZZ_HIVE_API_URL"
echo ""
echo "🎯 The real bzzz agents will now:"
echo " - Discover fake projects and tasks from mock API"
echo " - Do actual P2P coordination on real dependencies"
echo " - Perform real antennae meta-discussion"
echo " - Execute real coordination algorithms"
echo ""
echo "Watch your dashboard to see REAL coordination activity!"
echo ""
# Run bzzz directly with mock API configuration
cd /home/tony/AI/projects/Bzzz
/usr/local/bin/bzzz

View File

@@ -1,200 +0,0 @@
#!/bin/bash
# Test script to monitor HMMM coordination activity
# This script monitors the existing bzzz service logs for coordination patterns
LOG_DIR="/tmp/bzzz_logs"
MONITOR_LOG="$LOG_DIR/hmmm_monitor_$(date +%Y%m%d_%H%M%S).log"
# Create log directory
mkdir -p "$LOG_DIR"
echo "🔬 Starting Bzzz HMMM Monitoring Test"
echo "========================================"
echo "Monitor Log: $MONITOR_LOG"
echo ""
# Function to log monitoring events
log_event() {
local timestamp=$(date '+%Y-%m-%d %H:%M:%S')
local event_type="$1"
local details="$2"
echo "[$timestamp] $event_type: $details" | tee -a "$MONITOR_LOG"
}
# Function to analyze bzzz logs for coordination patterns
analyze_coordination_patterns() {
echo "📊 Analyzing coordination patterns in bzzz logs..."
# Count availability broadcasts (baseline activity)
local availability_count=$(journalctl -u bzzz.service --since "5 minutes ago" | grep "availability_broadcast" | wc -l)
log_event "BASELINE" "Availability broadcasts in last 5 minutes: $availability_count"
# Look for peer connections
local peer_connections=$(journalctl -u bzzz.service --since "5 minutes ago" | grep "Connected Peers" | tail -1)
if [[ -n "$peer_connections" ]]; then
log_event "P2P_STATUS" "$peer_connections"
fi
# Look for task-related activity
local task_activity=$(journalctl -u bzzz.service --since "5 minutes ago" | grep -i "task\|github\|repository" | wc -l)
log_event "TASK_ACTIVITY" "Task-related log entries: $task_activity"
# Look for coordination messages (HMMM activity)
local coordination_msgs=$(journalctl -u bzzz.service --since "5 minutes ago" | grep -i "hmmm\|coordination\|meta" | wc -l)
log_event "COORDINATION" "Coordination-related messages: $coordination_msgs"
# Check for error patterns
local errors=$(journalctl -u bzzz.service --since "5 minutes ago" | grep -i "error\|failed" | wc -l)
if [[ $errors -gt 0 ]]; then
log_event "ERRORS" "Error messages detected: $errors"
fi
}
# Function to simulate coordination scenarios by watching for patterns
simulate_coordination_scenarios() {
echo "🎭 Setting up coordination scenario simulation..."
# Scenario 1: API Contract Coordination
log_event "SCENARIO_START" "API Contract Coordination - Multiple repos need shared API"
# Log simulated task announcements
log_event "TASK_ANNOUNCE" "bzzz#23 - Define coordination API contract (Priority: 1, Blocks: hive#15, distributed-ai-dev#8)"
log_event "TASK_ANNOUNCE" "hive#15 - Add WebSocket support (Priority: 2, Depends: bzzz#23)"
log_event "TASK_ANNOUNCE" "distributed-ai-dev#8 - Bzzz integration (Priority: 3, Depends: bzzz#23, hive#16)"
sleep 2
# Log simulated agent responses
log_event "AGENT_RESPONSE" "Agent walnut-node: I can handle the API contract definition"
log_event "AGENT_RESPONSE" "Agent acacia-node: WebSocket implementation ready after API contract"
log_event "AGENT_RESPONSE" "Agent ironwood-node: Integration work depends on both API and auth"
sleep 2
# Log coordination decision
log_event "COORDINATION" "Meta-coordinator analysis: API contract blocks 2 other tasks"
log_event "COORDINATION" "Consensus reached: Execute bzzz#23 -> hive#15 -> distributed-ai-dev#8"
log_event "SCENARIO_COMPLETE" "API Contract Coordination scenario completed"
echo ""
}
# Function to monitor real bzzz service activity
monitor_live_activity() {
local duration=$1
echo "🔍 Monitoring live bzzz activity for $duration seconds..."
# Monitor bzzz logs in real time
timeout "$duration" journalctl -u bzzz.service -f --since "1 minute ago" | while read -r line; do
local timestamp=$(date '+%H:%M:%S')
# Check for different types of activity
if [[ "$line" =~ "availability_broadcast" ]]; then
log_event "AVAILABILITY" "Agent availability update detected"
elif [[ "$line" =~ "Connected Peers" ]]; then
local peer_count=$(echo "$line" | grep -o "Connected Peers: [0-9]*" | grep -o "[0-9]*")
log_event "P2P_UPDATE" "Peer count: $peer_count"
elif [[ "$line" =~ "Failed to get active repositories" ]]; then
log_event "API_ERROR" "Hive API connection issue (expected due to overlay network)"
elif [[ "$line" =~ "bzzz" ]] && [[ "$line" =~ "task" ]]; then
log_event "TASK_DETECTED" "Task-related activity in logs"
fi
done
}
# Function to generate test metrics
generate_test_metrics() {
echo "📈 Generating test coordination metrics..."
local start_time=$(date +%s)
local total_sessions=3
local completed_sessions=2
local escalated_sessions=0
local failed_sessions=1
local total_messages=12
local task_announcements=6
local dependencies_detected=3
# Create metrics JSON
cat > "$LOG_DIR/test_metrics.json" << EOF
{
"test_run_start": "$start_time",
"monitoring_duration": "300s",
"total_coordination_sessions": $total_sessions,
"completed_sessions": $completed_sessions,
"escalated_sessions": $escalated_sessions,
"failed_sessions": $failed_sessions,
"total_messages": $total_messages,
"task_announcements": $task_announcements,
"dependencies_detected": $dependencies_detected,
"agent_participations": {
"walnut-node": 4,
"acacia-node": 3,
"ironwood-node": 5
},
"scenarios_tested": [
"API Contract Coordination",
"Security-First Development",
"Parallel Development Conflict"
],
"success_rate": 66.7,
"notes": "Test run with simulated coordination scenarios"
}
EOF
log_event "METRICS" "Test metrics saved to $LOG_DIR/test_metrics.json"
}
# Main test execution
main() {
echo "Starting HMMM coordination monitoring test..."
echo ""
# Initial analysis of current activity
analyze_coordination_patterns
echo ""
# Run simulated coordination scenarios
simulate_coordination_scenarios
echo ""
# Monitor live activity for 2 minutes
monitor_live_activity 120 &
MONITOR_PID=$!
# Wait for monitoring to complete
sleep 3
# Run additional analysis
analyze_coordination_patterns
echo ""
# Generate test metrics
generate_test_metrics
echo ""
# Wait for live monitoring to finish
wait $MONITOR_PID 2>/dev/null || true
echo "📊 HMMM MONITORING TEST COMPLETE"
echo "===================================="
echo "Results saved to: $LOG_DIR/"
echo "Monitor Log: $MONITOR_LOG"
echo "Metrics: $LOG_DIR/test_metrics.json"
echo ""
echo "Summary of detected activity:"
grep -c "AVAILABILITY" "$MONITOR_LOG" | xargs echo "- Availability updates:"
grep -c "COORDINATION" "$MONITOR_LOG" | xargs echo "- Coordination events:"
grep -c "TASK_" "$MONITOR_LOG" | xargs echo "- Task-related events:"
grep -c "AGENT_RESPONSE" "$MONITOR_LOG" | xargs echo "- Agent responses:"
echo ""
echo "To view detailed logs: tail -f $MONITOR_LOG"
}
# Trap Ctrl+C to clean up
trap 'echo ""; echo "🛑 Monitoring interrupted"; exit 0' INT
# Run the test
main

View File

@@ -1,118 +0,0 @@
#!/bin/bash
# Script to trigger coordination activity with mock API data
# This simulates task updates to cause real bzzz coordination
MOCK_API="http://localhost:5000"
echo "🎯 Triggering Mock Coordination Test"
echo "===================================="
echo "This will cause real bzzz agents to coordinate on fake tasks"
echo ""
# Function to simulate task claim attempts
simulate_task_claims() {
echo "📋 Simulating task claim attempts..."
# Try to claim tasks from different projects
for project_id in 1 2 3; do
for task_num in 15 23 8; do
echo "🎯 Agent attempting to claim project $project_id task $task_num"
curl -s -X POST "$MOCK_API/api/bzzz/projects/$project_id/claim" \
-H "Content-Type: application/json" \
-d "{\"task_number\": $task_num, \"agent_id\": \"test-agent-$project_id\"}" | jq .
sleep 2
done
done
}
# Function to simulate task status updates
simulate_task_updates() {
echo ""
echo "📊 Simulating task status updates..."
# Update task statuses to trigger coordination
curl -s -X PUT "$MOCK_API/api/bzzz/projects/1/status" \
-H "Content-Type: application/json" \
-d '{"task_number": 15, "status": "in_progress", "metadata": {"progress": 25}}' | jq .
sleep 3
curl -s -X PUT "$MOCK_API/api/bzzz/projects/2/status" \
-H "Content-Type: application/json" \
-d '{"task_number": 23, "status": "completed", "metadata": {"completion_time": "2025-01-14T12:00:00Z"}}' | jq .
sleep 3
curl -s -X PUT "$MOCK_API/api/bzzz/projects/3/status" \
-H "Content-Type: application/json" \
-d '{"task_number": 8, "status": "escalated", "metadata": {"reason": "dependency_conflict"}}' | jq .
}
# Function to add urgent tasks
add_urgent_tasks() {
echo ""
echo "🚨 Adding urgent tasks to trigger immediate coordination..."
# The mock API has background task generation, but we can trigger it manually
# by checking repositories multiple times rapidly
for i in {1..5}; do
echo "🔄 Repository refresh $i/5"
curl -s "$MOCK_API/api/bzzz/active-repos" > /dev/null
curl -s "$MOCK_API/api/bzzz/projects/1/tasks" > /dev/null
curl -s "$MOCK_API/api/bzzz/projects/2/tasks" > /dev/null
sleep 1
done
}
# Function to check bzzz response
check_bzzz_activity() {
echo ""
echo "📡 Checking recent bzzz activity..."
# Check last 30 seconds of bzzz logs for API calls
echo "Recent bzzz log entries:"
journalctl -u bzzz.service --since "30 seconds ago" -n 10 | grep -E "(API|repository|task|coordination)" || echo "No recent coordination activity"
}
# Main execution
main() {
echo "🔍 Testing mock API connectivity..."
curl -s "$MOCK_API/health" | jq .
echo ""
echo "📋 Current active repositories:"
curl -s "$MOCK_API/api/bzzz/active-repos" | jq .repositories[].name
echo ""
echo "🎯 Phase 1: Task Claims"
simulate_task_claims
echo ""
echo "📊 Phase 2: Status Updates"
simulate_task_updates
echo ""
echo "🚨 Phase 3: Urgent Tasks"
add_urgent_tasks
echo ""
echo "📡 Phase 4: Check Results"
check_bzzz_activity
echo ""
echo "✅ Mock coordination test complete!"
echo ""
echo "🎯 Watch your monitoring dashboard for:"
echo " - Task claim attempts"
echo " - Status update processing"
echo " - Coordination session activity"
echo " - Agent availability changes"
echo ""
echo "📝 Check mock API server output for request logs"
}
# Run the test
main