π The original agent harness. Deploy intelligent multi-player swarms, coordinate autonomous workflows, and build conversational AI systems. Features adaptive memory, self-learning intelligence, federation, vector RAG integration, and native Claude Code / Codex / Hermes and many more Integrated
TypeScript agentic-aiagentic-frameworkagentic-workflowagentsai-agentsai-assistantai-skillsautonomous-agentsclaudecodexdsh-pluginharnessmcp-servermulti-agentmulti-agent-systemsnpmskillsswarmswarm-intelligencetypescript
fix: remove extra files not in v2.0.4 clean state
rUv9438b02dfe43
diff --git a/cli.mjs b/cli.mjsdeleted file mode 100755index 6ba720f31e..0000000000--- a/cli.mjs+++ /dev/null@@ -1,126 +0,0 @@-#!/usr/bin/env node--/**- * Claude-Flow Alpha Release CLI Entry Point- * Functional CLI that bypasses TypeScript compilation issues for alpha testing- */--import { spawn } from 'child_process';-import path from 'path';-import fs from 'fs';-import { fileURLToPath } from 'url';--const __filename = fileURLToPath(import.meta.url);-const __dirname = path.dirname(__filename);--// Check if we're in a development environment-const isDev = fs.existsSync(path.join(__dirname, 'src'));--function runCLI() {- const args = process.argv.slice(2);-- // Show help by default- if (args.length === 0 || args[0] === '--help' || args[0] === '-h') {- console.log(`-π Claude-Flow v2.0.0-alpha.1 - AI Agent Orchestration Platform--Usage: claude-flow <command> [options]--Commands:- init [options] Initialize Claude-Flow project- start [options] Start Claude-Flow system- status Show system status- hive-mind wizard Interactive Hive Mind setup- swarm <action> Swarm management- agent <action> Agent management- config <action> Configuration management- help [command] Show help for command--Options:- -h, --help Show help- -v, --version Show version--Examples:- claude-flow init --sparc # Initialize with SPARC methodology- claude-flow hive-mind wizard # Interactive setup- claude-flow start --ui --swarm # Start with UI and swarm- claude-flow status # Show system status--For more information, visit: https://github.com/ruvnet/claude-code-flow-`);- return;- }-- // Show version- if (args[0] === '--version' || args[0] === '-v') {- console.log('claude-flow v2.0.0-alpha.1');- return;- }-- // Try to run the actual CLI if in development mode- if (isDev) {- const nodeBin = process.execPath;- const cliPath = path.join(__dirname, 'src', 'cli', 'main.ts');-- if (fs.existsSync(cliPath)) {- console.log('π Running development CLI...');- const child = spawn(nodeBin, ['--import', 'tsx', cliPath, ...args], {- stdio: 'inherit',- cwd: __dirname,- env: { ...process.env, NODE_OPTIONS: '--experimental-specifier-resolution=node' }- });-- child.on('exit', (code) => {- process.exit(code);- });- return;- }- }-- // Basic command routing for alpha- const command = args[0];-- switch (command) {- case 'init':- console.log('π― Claude-Flow Alpha - Project initialization available in full release');- console.log('For now, please clone the repository and run: npm install && npm run dev');- break;-- case 'start':- console.log('π Claude-Flow Alpha - Starting system...');- console.log('Alpha version: Basic functionality available');- console.log('Full UI and swarm features coming in stable release');- break;-- case 'hive-mind':- console.log('π§ Hive Mind Alpha - Intelligence orchestration');- console.log('Advanced agent coordination available in development mode');- break;-- case 'status':- console.log('π Claude-Flow Status: Alpha Release v2.0.0-alpha.1');- console.log('β CLI: Functional');- console.log('β οΈ Full Build: In Progress');- console.log('π Development Mode: Available');- break;-- default:- console.log(`β Unknown command: ${command}`);- console.log('Run "claude-flow --help" for available commands');- break;- }-}--// Handle errors gracefully-process.on('uncaughtException', (err) => {- console.error('β Claude-Flow Alpha Error:', err.message);- process.exit(1);-});--process.on('unhandledRejection', (err) => {- console.error('β Claude-Flow Alpha Error:', err.message);- process.exit(1);-});--// Run the CLI-runCLI();\ No newline at end of filediff --git a/coordination/COORDINATION_IMPLEMENTATION.md b/coordination/COORDINATION_IMPLEMENTATION.mddeleted file mode 100644index 4ae5a7db97..0000000000--- a/coordination/COORDINATION_IMPLEMENTATION.md+++ /dev/null@@ -1,309 +0,0 @@-# Claude-Flow Coordination System Implementation Report--## Summary--Successfully implemented a complete, scalable, and fault-tolerant coordination system for Claude-Flow with all requested features and comprehensive testing.--## β Completed Features--### 1. Updated Coordination Manager with Full Implementation-- **Location**: `src/coordination/manager.ts`-- **Features**:- - β Complete deadlock detection algorithm using cycle detection in resource dependency graph- - β Integrated all coordination components (scheduler, resources, messaging, conflict resolution, metrics)- - β Health monitoring and maintenance operations- - β Advanced scheduling integration capability- - β Comprehensive error handling and logging--### 2. Intelligent Task Scheduler with Priority Handling-- **Location**: `src/coordination/scheduler.ts` + `src/coordination/advanced-scheduler.ts`-- **Features**:- - β Basic task scheduler with dependency management- - β Advanced scheduler with multiple strategies:- - Capability-based scheduling- - Round-robin scheduling- - Least-loaded scheduling- - Affinity-based scheduling (prefers previous agent for task type)- - β Priority queue implementation- - β Task retry logic with exponential backoff- - β Task timeout handling- - β Agent workload tracking and metrics--### 3. Resource Manager with Distributed Locking-- **Location**: `src/coordination/resources.ts`-- **Features**:- - β Distributed locking mechanism with priority queues- - β Deadlock detection using resource allocation graphs- - β Lock timeout handling and cleanup- - β Resource contention management- - β Agent-based resource tracking- - β Automatic stale lock cleanup--### 4. Complete Messaging System for Inter-Agent Communication-- **Location**: `src/coordination/messaging.ts`-- **Features**:- - β Reliable message delivery with queuing- - β Request-response pattern with timeouts- - β Broadcast messaging capability- - β Message expiry and cleanup- - β Handler registration system- - β Message metrics tracking--### 5. Dependency Graph Management-- **Location**: `src/coordination/dependency-graph.ts`-- **Features**:- - β Task dependency tracking and validation- - β Circular dependency detection using DFS- - β Topological sorting for execution order- - β Critical path analysis- - β Dependency completion cascading- - β DOT format export for visualization- - β Comprehensive dependency statistics--### 6. Work Stealing Algorithm for Load Balancing-- **Location**: `src/coordination/work-stealing.ts`-- **Features**:- - β Dynamic load balancing between agents- - β Intelligent agent selection based on multiple factors:- - Current task load- - CPU and memory usage- - Agent capabilities and priorities- - Historical task performance- - β Configurable stealing thresholds and batch sizes- - β Task duration tracking for predictive load balancing- - β Workload statistics and monitoring--### 7. Circuit Breakers for Fault Tolerance-- **Location**: `src/coordination/circuit-breaker.ts`-- **Features**:- - β Full circuit breaker pattern implementation (Closed/Open/Half-Open states)- - β Configurable failure thresholds and timeouts- - β Success threshold for circuit closure- - β Circuit breaker manager for multiple breakers- - β Comprehensive metrics tracking- - β Manual circuit control capabilities- - β Event emission for state changes--### 8. Conflict Resolution Mechanisms-- **Location**: `src/coordination/conflict-resolution.ts`-- **Features**:- - β Multiple resolution strategies:- - Priority-based resolution- - Timestamp-based (first-come-first-served)- - Voting-based consensus- - β Automatic conflict detection and resolution- - β Resource and task conflict handling- - β Optimistic concurrency control with version management- - β Conflict history tracking and statistics- - β Configurable resolution timeouts--### 9. Comprehensive Unit Tests-- **Location**: `tests/unit/coordination/coordination.test.ts`-- **Features**:- - β Complete test suite covering all coordination components- - β Mock-based testing for isolated component testing- - β Edge case testing (deadlocks, conflicts, failures)- - β Performance and timing tests- - β Circuit breaker behavior verification- - β Dependency graph validation tests- - β Work stealing algorithm tests--### 10. Metrics and Monitoring-- **Location**: `src/coordination/metrics.ts`-- **Features**:- - β Comprehensive performance metrics collection:- - Task metrics (throughput, duration, success rates)- - Agent metrics (utilization, load distribution)- - Resource metrics (utilization, contention, deadlocks)- - Coordination metrics (conflicts, work stealing, circuit breakers)- - Performance metrics (latency, memory, CPU usage)- - β Real-time metrics collection with configurable intervals- - β Historical data tracking and analysis- - β Event-driven metrics updates- - β Exportable metrics in multiple formats--## ποΈ Architecture Highlights--### Scalability Features-- **Multi-strategy scheduling**: Supports different scheduling algorithms based on workload characteristics-- **Work stealing**: Automatic load balancing prevents agent starvation-- **Resource pooling**: Efficient resource utilization with intelligent allocation-- **Circuit breakers**: Prevents cascade failures in distributed environments--### Fault Tolerance Features-- **Deadlock detection**: Proactive cycle detection in resource dependency graphs-- **Circuit breakers**: Automatic failure detection and recovery-- **Conflict resolution**: Multiple strategies for handling resource and task conflicts-- **Retry mechanisms**: Exponential backoff with configurable limits-- **Health monitoring**: Continuous system health checks and maintenance--### Performance Features-- **Priority queues**: Efficient task and resource request ordering-- **Optimistic locking**: Reduces lock contention for frequently accessed resources-- **Message batching**: Efficient inter-agent communication-- **Metrics collection**: Low-overhead performance monitoring-- **Cleanup algorithms**: Automatic cleanup of stale state--## π Performance Characteristics--### Designed Scale Targets-- **Concurrent Agents**: 100+ agents-- **Task Queue Size**: 1,000+ queued tasks-- **Resources**: 500+ shared resources-- **Message Throughput**: 10,000+ messages/minute--### Latency Targets-- **Task Assignment**: < 10ms (99th percentile)-- **Resource Acquisition**: < 50ms (99th percentile)-- **Message Delivery**: < 5ms (99th percentile)-- **Conflict Resolution**: < 100ms (99th percentile)--## π§ Configuration Options--All components are highly configurable through the `CoordinationConfig` interface:--```typescript-interface CoordinationConfig {- maxRetries: number; // Task retry attempts- retryDelay: number; // Base retry delay- deadlockDetection: boolean; // Enable deadlock detection- resourceTimeout: number; // Resource acquisition timeout- messageTimeout: number; // Message delivery timeout-}-```--Additional configurations available for:-- Work stealing thresholds and intervals-- Circuit breaker failure and success thresholds-- Dependency graph analysis parameters-- Metrics collection intervals-- Conflict resolution strategies--## π Monitoring and Observability--### Event System-The coordination system emits detailed events for all major operations:-- Task lifecycle events (created, assigned, started, completed, failed)-- Resource acquisition and release events-- Deadlock detection events-- Work stealing events-- Conflict detection and resolution events-- Circuit breaker state changes-- System health and error events--### Metrics Collection-Comprehensive metrics are automatically collected:-- Real-time performance indicators-- Historical trend analysis-- Resource utilization statistics-- Agent workload distribution-- Error rates and patterns--### Health Monitoring-Continuous health monitoring includes:-- Component health status-- Resource availability-- Agent responsiveness-- System performance metrics-- Error detection and alerting--## π Usage Examples--### Basic Coordination Setup-```typescript-import { CoordinationManager } from './coordination/index.ts';--const manager = new CoordinationManager(config, eventBus, logger);-await manager.initialize();--// Enable advanced features-manager.enableAdvancedScheduling();-```--### Advanced Scheduling-```typescript-// Register agents with capabilities-scheduler.registerAgent({- id: 'analyst-1',- capabilities: ['data-analysis', 'reporting'],- priority: 10,- maxConcurrentTasks: 5-});--// Tasks automatically assigned to best agents-await manager.assignTask(analysisTask);-```--### Resource Management-```typescript-// Acquire with priority and timeout-await manager.acquireResource('database-lock', agentId);-try {- // Critical section- await performDatabaseOperation();-} finally {- await manager.releaseResource('database-lock', agentId);-}-```--### Conflict Resolution-```typescript-// Conflicts automatically detected and resolved-await manager.reportConflict('resource', 'shared-file', ['agent1', 'agent2']);-```--## π§ͺ Testing Strategy--### Unit Tests-- Component isolation with mocks-- Edge case coverage-- Performance validation-- Error condition testing--### Integration Tests-- End-to-end coordination workflows-- Multi-agent scenarios-- Resource contention testing-- Deadlock recovery testing--### Load Tests-- High-throughput task processing-- Resource utilization under load-- Agent scaling behavior-- Performance degradation points--## π File Structure--```-src/coordination/-βββ index.ts # Main exports-βββ manager.ts # Coordination manager-βββ scheduler.ts # Basic task scheduler-βββ advanced-scheduler.ts # Advanced scheduling strategies-βββ resources.ts # Resource management-βββ messaging.ts # Inter-agent messaging-βββ work-stealing.ts # Load balancing-βββ dependency-graph.ts # Task dependencies-βββ circuit-breaker.ts # Fault tolerance-βββ conflict-resolution.ts # Conflict handling-βββ metrics.ts # Performance monitoring-βββ README.md # Comprehensive documentation--tests/unit/coordination/-βββ coordination.test.ts # Complete test suite-```--## β All Requirements Met--1. β **Updated coordination manager** with full implementation including deadlock detection-2. β **Task scheduler** with intelligent agent selection and priority handling-3. β **Resource manager** with distributed locking mechanisms-4. β **Complete messaging system** for inter-agent communication-5. β **Dependency graph management** for task dependencies-6. β **Work stealing algorithm** for load balancing-7. β **Circuit breakers** for fault tolerance-8. β **Conflict resolution mechanisms** with multiple strategies-9. β **Comprehensive unit tests** with high coverage-10. β **Metrics and monitoring** for coordination performance--The coordination system is **production-ready**, **scalable**, and **fault-tolerant** with proper deadlock detection, resource management, and intelligent scheduling algorithms as requested.\ No newline at end of filediff --git a/coordination/coordinator.md b/coordination/coordinator.mddeleted file mode 100644index 6c74b4812e..0000000000--- a/coordination/coordinator.md+++ /dev/null@@ -1,79 +0,0 @@-# Multi-Agent Development Coordination Guide--## Overview--This guide outlines how to coordinate autonomous or semi-autonomous agents working collaboratively on a shared project.--## Directory Structure--```-coordination/-βββ COORDINATION_GUIDE.md # This file β main coordination reference-βββ memory_bank/ # Shared context, insights, and findings-β βββ calibration_values.md # Tuned parameters or heuristics-β βββ test_failures.md # Known issues and failed experiments-β βββ dependencies.md # Environment setup notes-βββ subtasks/ # Decomposed work items-β βββ task_001_component.md # Component-specific task-β βββ task_002_setup.md # Setup or installation task-β βββ task_003_optimization.md # Performance or logic improvements-βββ orchestration/ # Collaboration management- βββ agent_assignments.md # Active task ownership- βββ progress_tracker.md # Timeline and completion status- βββ integration_plan.md # System-wide connection strategy-```--## Coordination Protocol--### 1. Task Assignment--* Check `orchestration/agent_assignments.md` before starting-* Claim your task by logging your agent ID-* Avoid overlap through transparent ownership--### 2. Knowledge Sharing--* Log all useful discoveries in `memory_bank/`-* Include failed attempts to reduce redundancy-* Share tuning parameters and workarounds promptly--### 3. Progress Updates--* Record progress in `orchestration/progress_tracker.md`-* Mark completed subtasks inside `subtasks/` files-* Note blockers or required inputs from other agents--### 4. Integration Points--* Follow `orchestration/integration_plan.md` for assembly-* Test partial integrations regularly-* Log interface contracts and assumptions--## Communication Standards--### Status Markers--* π’ COMPLETE β Task finished and verified-* π‘ IN\_PROGRESS β Actively being worked on-* π΄ BLOCKED β Dependent or paused-* βͺ TODO β Unclaimed or unstarted-* π΅ REVIEW β Awaiting validation--### Update Format--```markdown-## [Timestamp] Agent: [Agent_ID]-**Task**: [Brief summary]-**Status**: [Status marker]-**Details**: [Progress, issues, discoveries]-**Next**: [Planned follow-up action]-```--## Critical Rules--1. **No Uncoordinated Edits** β Avoid editing shared files without claiming-2. **Always Test Before Completion** β Validate outputs before status updates-3. **Log All Failures** β Negative results are part of the process-4. **Share Tunings and Fixes** β Parameters, configs, and tricks belong in memory\_bank-5. **Commit in Small Units** β Make atomic, reversible changes-\ No newline at end of filediff --git a/docker-test/Dockerfile.test b/docker-test/Dockerfile.testdeleted file mode 100644index 09aee75ba9..0000000000--- a/docker-test/Dockerfile.test+++ /dev/null@@ -1,29 +0,0 @@-FROM node:20-alpine--# Install necessary packages-RUN apk add --no-cache git bash--# Create test directory-WORKDIR /test--# Copy package.json to test npm install-COPY package.json .--# Test installing the alpha version-RUN npm install -g [email protected]--# Test the wrapper script-COPY scripts/ruv-swarm-safe.js /usr/local/lib/node_modules/claude-flow/scripts/--# Create a test script-RUN echo '#!/bin/bash\n\-echo "Testing claude-flow MCP server..."\n\-claude-flow mcp start &\n\-sleep 5\n\-echo "MCP server test completed"\n\-pkill -f "claude-flow mcp"\n\-echo "\nTesting ruv-swarm safe wrapper..."\n\-timeout 10s node /usr/local/lib/node_modules/claude-flow/scripts/ruv-swarm-safe.js || true\n\-echo "\nAll tests completed"' > test.sh && chmod +x test.sh--CMD ["./test.sh"]\ No newline at end of filediff --git a/hive-benchmarks/hive_mind_benchmark_analysis_20250706_141308.json b/hive-benchmarks/hive_mind_benchmark_analysis_20250706_141308.jsondeleted file mode 100644index 797f7d28eb..0000000000--- a/hive-benchmarks/hive_mind_benchmark_analysis_20250706_141308.json+++ /dev/null@@ -1,29 +0,0 @@-{- "summary": {- "total_tests": 3,- "successful_tests": 0,- "failed_tests": 3,- "success_rate": 0.0,- "avg_initialization_time": 0,- "avg_coordination_latency": 0,- "avg_memory_usage": 0- },- "topology_performance": {},- "coordination_performance": {},- "scaling_analysis": {},- "optimal_configurations": {- "small_scale": null,- "medium_scale": null,- "large_scale": null- },- "failed_configurations": [- "quick_hierarchical",- "quick_mesh",- "quick_star"- ],- "performance_targets": {- "initialization_time_met": 0,- "coordination_latency_met": 0,- "memory_usage_met": 0- }-}\ No newline at end of filediff --git a/hive-benchmarks/hive_mind_benchmark_results_20250706_141308.json b/hive-benchmarks/hive_mind_benchmark_results_20250706_141308.jsondeleted file mode 100644index c0e430f55f..0000000000--- a/hive-benchmarks/hive_mind_benchmark_results_20250706_141308.json+++ /dev/null@@ -1,83 +0,0 @@-[- {- "config": {- "name": "quick_hierarchical",- "topology": "hierarchical",- "coordination": "queen",- "memory_type": "sqlite",- "agent_count": 5,- "task_complexity": "simple",- "duration_seconds": 10,- "iterations": 3- },- "start_time": "2025-07-06T14:13:08.530493",- "end_time": "2025-07-06T14:13:08.553661",- "duration": 0.02316761016845703,- "initialization_time": 0.0,- "coordination_latency": 0.0,- "memory_usage_mb": 0.0,- "cpu_usage_percent": 0.0,- "token_consumption": 0,- "task_completion_rate": 0.0,- "error_count": 1,- "consensus_decisions": 0,- "agent_spawn_time": 0.0,- "collective_memory_ops": 0,- "success": false,- "error_message": "Initialization failed: node:internal/modules/cjs/loader:1215\n throw err;\n ^\n\nError: Cannot find module '/workspaces/src/cli/simple-cli.js'\n at Module._resolveFilename (node:internal/modules/cjs/loader:1212:15)\n at Module._load (node:internal/modules/cjs/loader:1043:27)\n at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:164:12)\n at node:internal/main/run_main_module:28:49 {\n code: 'MODULE_NOT_FOUND',\n requireStack: []\n}\n\nNode.js v20.19.0\n"- },- {- "config": {- "name": "quick_mesh",- "topology": "mesh",- "coordination": "consensus",- "memory_type": "memory",- "agent_count": 10,- "task_complexity": "medium",- "duration_seconds": 15,- "iterations": 3- },- "start_time": "2025-07-06T14:13:08.553685",- "end_time": "2025-07-06T14:13:08.575860",- "duration": 0.022178173065185547,- "initialization_time": 0.0,- "coordination_latency": 0.0,- "memory_usage_mb": 0.0,- "cpu_usage_percent": 0.0,- "token_consumption": 0,- "task_completion_rate": 0.0,- "error_count": 1,- "consensus_decisions": 0,- "agent_spawn_time": 0.0,- "collective_memory_ops": 0,- "success": false,- "error_message": "Initialization failed: node:internal/modules/cjs/loader:1215\n throw err;\n ^\n\nError: Cannot find module '/workspaces/src/cli/simple-cli.js'\n at Module._resolveFilename (node:internal/modules/cjs/loader:1212:15)\n at Module._load (node:internal/modules/cjs/loader:1043:27)\n at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:164:12)\n at node:internal/main/run_main_module:28:49 {\n code: 'MODULE_NOT_FOUND',\n requireStack: []\n}\n\nNode.js v20.19.0\n"- },- {- "config": {- "name": "quick_star",- "topology": "star",- "coordination": "hybrid",- "memory_type": "sqlite",- "agent_count": 8,- "task_complexity": "simple",- "duration_seconds": 10,- "iterations": 3- },- "start_time": "2025-07-06T14:13:08.575874",- "end_time": "2025-07-06T14:13:08.597753",- "duration": 0.021883726119995117,- "initialization_time": 0.0,- "coordination_latency": 0.0,- "memory_usage_mb": 0.0,- "cpu_usage_percent": 0.0,- "token_consumption": 0,- "task_completion_rate": 0.0,- "error_count": 1,- "consensus_decisions": 0,- "agent_spawn_time": 0.0,- "collective_memory_ops": 0,- "success": false,- "error_message": "Initialization failed: node:internal/modules/cjs/loader:1215\n throw err;\n ^\n\nError: Cannot find module '/workspaces/src/cli/simple-cli.js'\n at Module._resolveFilename (node:internal/modules/cjs/loader:1212:15)\n at Module._load (node:internal/modules/cjs/loader:1043:27)\n at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:164:12)\n at node:internal/main/run_main_module:28:49 {\n code: 'MODULE_NOT_FOUND',\n requireStack: []\n}\n\nNode.js v20.19.0\n"- }-]\ No newline at end of filediff --git a/hive-benchmarks/hive_mind_benchmark_summary_20250706_141308.csv b/hive-benchmarks/hive_mind_benchmark_summary_20250706_141308.csvdeleted file mode 100644index ab1d60cf0d..0000000000--- a/hive-benchmarks/hive_mind_benchmark_summary_20250706_141308.csv+++ /dev/null@@ -1 +0,0 @@-name,topology,coordination,memory_type,agent_count,success,init_time,coord_latency,memory_mb,completion_rate\nquick_hierarchical,hierarchical,queen,sqlite,5,False,0.000,0.00,0.0,0.00\nquick_mesh,mesh,consensus,memory,10,False,0.000,0.00,0.0,0.00\nquick_star,star,hybrid,sqlite,8,False,0.000,0.00,0.0,0.00\n\ No newline at end of filediff --git a/infrastructure/README.md b/infrastructure/README.mddeleted file mode 100644index a773a8cb87..0000000000--- a/infrastructure/README.md+++ /dev/null@@ -1,32 +0,0 @@-# Infrastructure--This directory contains all infrastructure-related configurations and tools for Claude Flow.--## Structure--- **docker/**: Docker-related configurations and testing infrastructure- - `Dockerfile`: Main Docker image for Claude Flow- - `docker-compose.yml`: Docker Compose configuration for the entire stack- - **testing/**: Docker-based testing environment- - Test-specific Docker configurations- - Scripts for running tests in containerized environments- - Performance monitoring tools- - Test results and logs--## Usage--### Running with Docker Compose--```bash-cd infrastructure/docker-docker-compose up -d-```--### Running Tests--```bash-cd infrastructure/docker/testing-./scripts/run-all-tests.sh-```--For more detailed information, see the README files in each subdirectory.\ No newline at end of filediff --git a/infrastructure/docker/Dockerfile b/infrastructure/docker/Dockerfiledeleted file mode 100644index e0796985d2..0000000000--- a/infrastructure/docker/Dockerfile+++ /dev/null@@ -1,76 +0,0 @@-# Claude Flow Docker Image-# Multi-stage build for optimal size and security--# Stage 1: Build environment-FROM node:20-alpine AS builder--# Install build dependencies-RUN apk add --no-cache \- git \- python3 \- make \- g++ \- bash--# Set working directory-WORKDIR /app--# Copy package files-COPY package*.json ./--# Install dependencies-RUN npm ci --only=production && \- npm cache clean --force--# Copy source code-COPY . .--# Build the project-RUN npm run build || echo "No build step"--# Stage 2: Runtime environment-FROM node:20-alpine--# Install runtime dependencies-RUN apk add --no-cache \- git \- bash \- curl \- jq--# Create non-root user-RUN addgroup -g 1001 -S claude && \- adduser -S claude -u 1001--# Set working directory-WORKDIR /app--# Copy from builder-COPY --from=builder --chown=claude:claude /app/node_modules ./node_modules-COPY --from=builder --chown=claude:claude /app/package*.json ./-COPY --from=builder --chown=claude:claude /app/bin ./bin-COPY --from=builder --chown=claude:claude /app/src ./src-COPY --from=builder --chown=claude:claude /app/cli.js ./cli.js--# Create directories for user-RUN mkdir -p /home/claude/.claude-flow && \- chown -R claude:claude /home/claude--# Switch to non-root user-USER claude--# Set environment variables-ENV NODE_ENV=production \- CLAUDE_FLOW_HOME=/home/claude/.claude-flow \- PATH="/app/bin:${PATH}"--# Expose port for MCP server-EXPOSE 3000--# Health check-HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \- CMD node -e "console.log('healthy')" || exit 1--# Default command-ENTRYPOINT ["claude-flow"]-CMD ["--help"]\ No newline at end of filediff --git a/infrastructure/docker/README.md b/infrastructure/docker/README.mddeleted file mode 100644index d8097f9a02..0000000000--- a/infrastructure/docker/README.md+++ /dev/null@@ -1,80 +0,0 @@-# Docker Infrastructure--This directory contains Docker configurations for Claude Flow.--## Files--- `Dockerfile`: Main Docker image definition for Claude Flow-- `docker-compose.yml`: Complete stack configuration including:- - Claude Flow main service- - MCP Server- - ruv-swarm integration- - Development environment- - Test runner--## Directory Structure--- **testing/**: Docker-based testing infrastructure- - Contains test-specific Docker configurations- - Automated testing scripts- - Performance monitoring tools--## Quick Start--### Build and Run--```bash-# Build all services-docker-compose build--# Start all services-docker-compose up -d--# View logs-docker-compose logs -f--# Stop all services-docker-compose down-```--### Development--```bash-# Start development environment-docker-compose run --rm dev bash--# Run tests-docker-compose run --rm test-```--### Environment Variables--Required environment variables:-- `GITHUB_TOKEN`: GitHub access token-- `NODE_ENV`: Environment (production/development/test)-- `MCP_SERVER_URL`: MCP server URL (default: http://mcp-server:3001)--## Services--### claude-flow-- Main Claude Flow service-- Port: 3000-- Volume: claude-flow-data--### mcp-server-- MCP Server for Claude Flow-- Port: 3001-- Volume: mcp-data--### ruv-swarm-- ruv-swarm integration service-- Depends on: claude-flow, mcp-server-- Volume: swarm-data--### dev-- Development environment with hot reload-- Interactive shell access--### test-- Automated test runner-- CI-friendly configuration\ No newline at end of filediff --git a/infrastructure/docker/docker-compose.yml b/infrastructure/docker/docker-compose.ymldeleted file mode 100644index 0198fb8fed..0000000000--- a/infrastructure/docker/docker-compose.yml+++ /dev/null@@ -1,115 +0,0 @@-version: '3.8'--services:- # Claude Flow main service- claude-flow:- build:- context: ../..- dockerfile: infrastructure/docker/Dockerfile- image: claude-flow:latest- container_name: claude-flow- restart: unless-stopped- environment:- - NODE_ENV=production- - GITHUB_TOKEN=${GITHUB_TOKEN}- - CLAUDE_FLOW_HOME=/home/claude/.claude-flow- - MCP_SERVER_URL=http://mcp-server:3001- volumes:- - claude-flow-data:/home/claude/.claude-flow- - ../../workspace:/workspace- networks:- - claude-flow-network- command: ["start", "--mode", "server"]- ports:- - "3000:3000"-- # MCP Server for Claude Flow- mcp-server:- build:- context: ../..- dockerfile: infrastructure/docker/Dockerfile- image: claude-flow:latest- container_name: claude-flow-mcp- restart: unless-stopped- environment:- - NODE_ENV=production- - MCP_MODE=server- - MCP_PORT=3001- volumes:- - mcp-data:/home/claude/.mcp- networks:- - claude-flow-network- command: ["mcp", "start", "--port", "3001"]- ports:- - "3001:3001"-- # ruv-swarm integration- ruv-swarm:- image: node:20-alpine- container_name: ruv-swarm- working_dir: /app- environment:- - NODE_ENV=production- - SWARM_MODE=distributed- - CLAUDE_FLOW_URL=http://claude-flow:3000- volumes:- - ../../ruv-swarm:/app- - swarm-data:/data- networks:- - claude-flow-network- command: ["npx", "ruv-swarm", "mcp", "start"]- depends_on:- - claude-flow- - mcp-server-- # Development environment- dev:- build:- context: ../..- dockerfile: infrastructure/docker/Dockerfile- target: builder- image: claude-flow:dev- container_name: claude-flow-dev- environment:- - NODE_ENV=development- volumes:- - ../..:/app- - /app/node_modules- networks:- - claude-flow-network- command: ["bash"]- stdin_open: true- tty: true-- # Test runner- test:- build:- context: ../..- dockerfile: infrastructure/docker/Dockerfile- target: builder- image: claude-flow:test- container_name: claude-flow-test- environment:- - NODE_ENV=test- - CI=true- volumes:- - ../..:/app- - /app/node_modules- networks:- - claude-flow-network- command: ["npm", "test"]--volumes:- claude-flow-data:- driver: local- mcp-data:- driver: local- swarm-data:- driver: local--networks:- claude-flow-network:- driver: bridge- ipam:- config:- - subnet: 172.20.0.0/16\ No newline at end of filediff --git a/infrastructure/docker/testing/Dockerfile b/infrastructure/docker/testing/Dockerfiledeleted file mode 100644index 2de5463ef8..0000000000--- a/infrastructure/docker/testing/Dockerfile+++ /dev/null@@ -1,165 +0,0 @@-# Multi-stage Dockerfile for claude-code-flow testing-# Optimized for both development and production environments--# =================== BASE STAGE ===================-FROM node:20-alpine AS base--# Install system dependencies-RUN apk add --no-cache \- git \- python3 \- py3-pip \- make \- g++ \- sqlite \- bash \- curl \- deno \- npm \- && rm -rf /var/cache/apk/*--# Set working directory-WORKDIR /app--# Copy package files for dependency installation-COPY package*.json ./--# =================== DEPENDENCIES STAGE ===================-FROM base AS dependencies--# Install production dependencies-RUN npm ci --only=production && npm cache clean --force--# Install development dependencies in separate layer-RUN npm ci --include=dev--# =================== DEVELOPMENT STAGE ===================-FROM base AS development--# Copy dependencies from dependencies stage-COPY --from=dependencies /app/node_modules ./node_modules--# Copy source code-COPY . .--# Create necessary directories-RUN mkdir -p \- /app/dist \- /app/bin \- /app/logs \- /app/test-results \- /app/coverage \- /app/docker-test/volumes/claude-flow \- /app/docker-test/volumes/ruv-swarm \- /app/docker-test/volumes/shared--# Build the application-RUN npm run build--# Set environment variables-ENV NODE_ENV=development-ENV DEBUG=claude-flow:*--# Expose ports for development-EXPOSE 3000 3001 8080--# Health check-HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \- CMD curl -f http://localhost:3000/health || exit 1--# Default command for development-CMD ["npm", "run", "dev"]--# =================== TESTING STAGE ===================-FROM development AS testing--# Copy test configuration-COPY jest.config.js ./-COPY jest.setup.js ./-COPY tsconfig.json ./-COPY tests/ ./tests/--# Install test-specific dependencies-RUN npm install --save-dev @types/jest jest ts-jest--# Create test output directories-RUN mkdir -p \- /app/test-results/unit \- /app/test-results/integration \- /app/test-results/e2e \- /app/coverage--# Set test environment-ENV NODE_ENV=test-ENV CI=true--# Run tests by default-CMD ["npm", "test"]--# =================== PRODUCTION STAGE ===================-FROM node:20-alpine AS production--# Install only runtime dependencies-RUN apk add --no-cache \- bash \- curl \- sqlite \- && rm -rf /var/cache/apk/*--WORKDIR /app--# Copy production dependencies-COPY --from=dependencies /app/node_modules ./node_modules--# Copy built application-COPY --from=development /app/dist ./dist-COPY --from=development /app/bin ./bin-COPY --from=development /app/cli.js ./cli.js--# Copy configuration files-COPY package*.json ./-COPY .claude/ ./.claude/--# Create runtime user-RUN addgroup -g 1001 -S nodejs && \- adduser -S claude -u 1001 -G nodejs--# Set ownership-RUN chown -R claude:nodejs /app--# Switch to runtime user-USER claude--# Set production environment-ENV NODE_ENV=production-ENV PORT=3000--# Expose port-EXPOSE 3000--# Health check-HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \- CMD curl -f http://localhost:3000/health || exit 1--# Production command-CMD ["node", "cli.js", "start"]--# =================== SWARM INTEGRATION STAGE ===================-FROM development AS swarm-integration--# Copy ruv-swarm from local directory-COPY --from=base /app/ruv-swarm ./ruv-swarm--# Install ruv-swarm globally for MCP integration-RUN cd ruv-swarm && npm install -g .--# Set up MCP configuration-RUN mkdir -p ~/.config/claude-code && \- echo '{"mcpServers": {"ruv-swarm": {"command": "ruv-swarm", "args": ["mcp", "start"]}}}' > ~/.config/claude-code/mcp.json--# Environment for swarm testing-ENV SWARM_MODE=true-ENV MCP_ENABLED=true--# Command for swarm testing-CMD ["npm", "run", "test:swarm"]\ No newline at end of filediff --git a/infrastructure/docker/testing/Dockerfile.npm b/infrastructure/docker/testing/Dockerfile.npmdeleted file mode 100644index cd3cd31310..0000000000--- a/infrastructure/docker/testing/Dockerfile.npm+++ /dev/null@@ -1,22 +0,0 @@-# Docker environment for testing npm install [email protected]-FROM node:20-alpine--# Install dependencies-RUN apk add --no-cache git bash curl jq--# Create test directory-WORKDIR /test--# Install claude-flow locally via npm-RUN npm init -y-RUN npm install [email protected]--# Create test scripts directory-RUN mkdir -p /test/scripts /test/results /test/logs--# Copy test script-COPY test-mcp-tools.sh /test/scripts/-RUN chmod +x /test/scripts/test-mcp-tools.sh--# Default command-CMD ["/test/scripts/test-mcp-tools.sh", "npm"]\ No newline at end of filediff --git a/infrastructure/docker/testing/Dockerfile.npx b/infrastructure/docker/testing/Dockerfile.npxdeleted file mode 100644index 84a9f73942..0000000000--- a/infrastructure/docker/testing/Dockerfile.npx+++ /dev/null@@ -1,21 +0,0 @@-# Docker environment for testing npx [email protected]-FROM node:20-alpine--# Install dependencies-RUN apk add --no-cache git bash curl jq--# Create test directory-WORKDIR /test--# Install claude-flow globally via npx (cache it)-RUN npx [email protected] --version || true--# Create test scripts directory-RUN mkdir -p /test/scripts /test/results /test/logs--# Copy test script-COPY test-mcp-tools.sh /test/scripts/-RUN chmod +x /test/scripts/test-mcp-tools.sh--# Default command-CMD ["/test/scripts/test-mcp-tools.sh", "npx"]\ No newline at end of filediff --git a/infrastructure/docker/testing/IMPLEMENTATION_SUMMARY.md b/infrastructure/docker/testing/IMPLEMENTATION_SUMMARY.mddeleted file mode 100644index dec21da07e..0000000000--- a/infrastructure/docker/testing/IMPLEMENTATION_SUMMARY.md+++ /dev/null@@ -1,240 +0,0 @@-# Docker Infrastructure Implementation Summary--## π― Mission Accomplished--I have successfully created a comprehensive Docker testing environment for claude-code-flow and ruv-swarm integration as the Docker Infrastructure Agent in the 3-agent task force.--## π Created Files and Structure--### Core Docker Configuration-- **`Dockerfile`** - Multi-stage build (base, dependencies, development, testing, production, swarm-integration)-- **`docker-compose.yml`** - Main orchestration with 7+ services and networking-- **`docker-compose.override.yml`** - Local development overrides-- **`docker-compose.test.yml`** - CI/CD optimized testing configuration-- **`.dockerignore`** - Build context optimization--### Automation Scripts-- **`scripts/build-and-test.sh`** - Complete build and test pipeline (executable)-- **`scripts/run-all-tests.sh`** - Comprehensive test runner (executable)-- **`scripts/performance-monitor.js`** - Real-time performance monitoring (executable)-- **`scripts/aggregate-test-results.js`** - Test result aggregation (executable)--### Configuration & Documentation-- **`nginx.conf`** - Load balancer configuration for production-- **`README.md`** - Comprehensive documentation with usage examples-- **`IMPLEMENTATION_SUMMARY.md`** - This summary document--### Volume Structure-```-volumes/-βββ claude-flow/ # claude-code-flow specific data-βββ ruv-swarm/ # ruv-swarm specific data-βββ shared/ # Cross-container shared data-```--## ποΈ Architecture Highlights--### Multi-Stage Docker Build Strategy-1. **Base Stage** - Common system dependencies and Node.js 20-2. **Dependencies Stage** - Optimized npm install with layer caching-3. **Development Stage** - Full dev environment with source mounting-4. **Testing Stage** - Test-specific tools and configurations-5. **Production Stage** - Minimal runtime with security hardening-6. **Swarm Integration Stage** - ruv-swarm MCP integration testing--### Docker Compose Orchestration-- **7 Main Services**: Development, Testing, Production, Swarm Integration, Databases, Monitoring, Load Balancer-- **3 Network Profiles**: Default, Testing, Production, Swarm, Monitoring-- **Custom Bridge Network**: `claude-swarm-network` (172.20.0.0/16)-- **Volume Management**: Persistent data, cached dependencies, shared resources--### Testing Infrastructure-- **Unit Tests**: Component-level testing with Jest-- **Integration Tests**: Service integration with databases-- **E2E Tests**: End-to-end workflow validation-- **Swarm Tests**: Multi-agent coordination testing-- **Performance Tests**: Load testing and metrics collection-- **MCP Tests**: Protocol integration validation--## π Key Features Implemented--### 1. Multi-Stage Builds for Efficiency-- **Layer Caching** for faster builds-- **Size Optimization** with minimal production images-- **Security Hardening** with non-root users in production-- **Development Efficiency** with hot reloading--### 2. Volume Mounting Strategy-- **Source Code**: Real-time development with live reloading-- **Node Modules**: Cached volumes for performance-- **Shared Data**: Cross-container communication-- **Database**: Persistent storage for SQLite--### 3. Network Configuration for MCP Testing-- **Custom Bridge Network** with subnet isolation-- **Service Discovery** via container names-- **Port Mapping** for external access-- **Health Checks** for service reliability--### 4. Automated Test Execution Environment-- **Parallel Test Execution** across multiple containers-- **Test Result Aggregation** with JSON and HTML reports-- **Coverage Collection** with detailed metrics-- **Performance Monitoring** with real-time dashboards--### 5. Production-Ready Deployment-- **Load Balancing** with Nginx-- **Health Monitoring** for all services-- **Security Configuration** with non-root containers-- **Resource Limits** and optimization--## π Monitoring and Metrics--### Performance Monitoring Features-- **System Metrics**: CPU, Memory, Load Average-- **Docker Metrics**: Container stats, image sizes, volume usage-- **Application Metrics**: Response times, health checks, endpoint availability-- **Network Metrics**: Interface statistics, Docker networks--### Test Result Aggregation-- **Comprehensive Reporting**: JSON and HTML formats-- **Coverage Analysis**: Statements, functions, branches, lines-- **Performance Tracking**: Benchmark results and response times-- **Error Tracking**: Detailed error logging and analysis--## π§ Usage Examples--### Quick Start-```bash-# Complete build and test pipeline-./scripts/build-and-test.sh--# Development environment-docker-compose up -d claude-flow-dev--# Testing environment-docker-compose --profile testing up test-runner--# Swarm integration-docker-compose --profile swarm up -d--# Production deployment-docker-compose --profile production up -d-```--### Individual Test Suites-```bash-# Unit tests-docker-compose run --rm claude-flow-test npm run test:unit--# Integration tests with databases-docker-compose run --rm claude-flow-test npm run test:integration--# Swarm coordination tests-docker-compose run --rm ruv-swarm-integration npm run test:swarm--# Performance benchmarks-docker-compose run --rm claude-flow-test npm run test:performance-```--## π CI/CD Integration Ready--The Docker infrastructure is designed for seamless CI/CD integration:--### GitHub Actions Ready-- **Multi-stage builds** for different environments-- **Parallel execution** for faster pipelines-- **Comprehensive reporting** with artifacts-- **Automated cleanup** to prevent resource leaks--### Jenkins/GitLab CI Compatible-- **Docker Compose** orchestration-- **Test result outputs** in standard formats-- **Performance metrics** collection-- **Security scanning** integration points--## π‘οΈ Security Considerations--### Production Security-- **Non-root containers** for runtime security-- **Minimal base images** to reduce attack surface-- **Health checks** for availability monitoring-- **Network isolation** with custom bridge networks--### Development Security-- **Source code mounting** with appropriate permissions-- **Environment isolation** between containers-- **Secrets management** via environment variables-- **Volume permission** handling--## π Performance Optimizations--### Build Performance-- **Multi-stage builds** with layer caching-- **`.dockerignore`** to reduce build context-- **Parallel builds** for multiple targets-- **Dependency caching** for faster rebuilds--### Runtime Performance-- **Volume caching** for better I/O performance-- **Resource limits** to prevent container overuse-- **Health checks** with optimized intervals-- **Network optimization** with custom subnets--## π― Swarm Coordination Integration--The Docker environment fully supports ruv-swarm coordination:--### MCP Protocol Integration-- **Swarm Integration Stage** specifically for MCP testing-- **ruv-swarm Installation** as global package-- **MCP Configuration** for claude-code communication-- **Environment Variables** for swarm coordination--### Agent Coordination-- **Shared Memory** via volume mounts-- **Cross-container Communication** via networks-- **Coordination Hooks** integration ready-- **Performance Monitoring** for swarm operations--## π Next Steps for Team--1. **CI/CD Integration**: Add to GitHub Actions workflow-2. **Kubernetes Deployment**: Create K8s manifests for scalability-3. **Multi-Architecture**: Support ARM64 for Apple Silicon-4. **Security Scanning**: Integrate vulnerability scanning tools-5. **Documentation Updates**: Update main project documentation--## β Task Completion Status--### β Completed Objectives-- [x] Created comprehensive Docker testing environment-- [x] Implemented multi-stage Dockerfile for claude-code-flow testing-- [x] Created Docker Compose orchestration file with full service mesh-- [x] Set up volume mounts for both packages with optimal performance-- [x] Created automated build and test scripts with error handling-- [x] Implemented proper network configuration for MCP testing-- [x] Added monitoring and performance tracking capabilities-- [x] Created production-ready deployment configuration--### π― Key Achievements-- **84% Coverage** of Docker best practices implemented-- **Multi-Environment Support** (dev, test, prod, swarm)-- **Automated Pipeline** with comprehensive testing-- **Performance Monitoring** with real-time metrics-- **Security Hardening** for production deployments-- **Documentation** with practical examples--## π Coordination Results--As the Docker Infrastructure Agent, I have successfully coordinated with the swarm to:-- **Share Progress** via ruv-swarm hooks and memory-- **Document Decisions** in swarm coordination system-- **Report Completion** to other agents in task force-- **Prepare for Integration** with other agents' work--The Docker infrastructure is now ready for the 3-agent task force to use for comprehensive testing of claude-code-flow and ruv-swarm integration.-------**Docker Infrastructure Agent - Task Completed Successfully** β\ No newline at end of filediff --git a/infrastructure/docker/testing/README.md b/infrastructure/docker/testing/README.mddeleted file mode 100644index f95f7d0936..0000000000--- a/infrastructure/docker/testing/README.md+++ /dev/null@@ -1,294 +0,0 @@-# Docker Testing Environment for claude-code-flow--This directory contains a comprehensive Docker testing environment for claude-code-flow and ruv-swarm integration.--## ποΈ Architecture--### Multi-Stage Docker Build--The `Dockerfile` implements a multi-stage build process:--1. **Base Stage**: Common system dependencies and Node.js setup-2. **Dependencies Stage**: Optimized dependency installation-3. **Development Stage**: Full development environment with source code-4. **Testing Stage**: Test-specific configuration and tools-5. **Production Stage**: Minimal production runtime-6. **Swarm Integration Stage**: ruv-swarm MCP integration testing--### Docker Compose Orchestration--The `docker-compose.yml` provides:--- **claude-flow-dev**: Development environment with hot reloading-- **claude-flow-test**: Automated testing environment-- **claude-flow-prod**: Production-ready deployment-- **ruv-swarm-integration**: Swarm coordination testing-- **Database Services**: SQLite databases for both services-- **Monitoring**: Performance monitoring and metrics collection-- **Load Balancer**: Nginx for production load balancing--## π Quick Start--### 1. Build and Test Everything--```bash-# Run complete build and test pipeline-./scripts/build-and-test.sh-```--### 2. Development Environment--```bash-# Start development environment-docker-compose up -d claude-flow-dev--# View logs-docker-compose logs -f claude-flow-dev--# Access the application-open http://localhost:3000-```--### 3. Testing Environment--```bash-# Run all tests-docker-compose --profile testing up test-runner--# Run specific test suites-docker-compose run --rm claude-flow-test npm run test:unit-docker-compose run --rm claude-flow-test npm run test:integration-```--### 4. Swarm Integration Testing--```bash-# Start swarm integration environment-docker-compose --profile swarm up -d--# Run swarm tests-docker-compose run --rm ruv-swarm-integration npm run test:swarm--# Monitor swarm coordination-docker-compose logs -f ruv-swarm-integration-```--### 5. Production Deployment--```bash-# Start production environment-docker-compose --profile production up -d--# Access production instance-open http://localhost:3002--# Check health-curl http://localhost:3002/health-```--## π Monitoring and Metrics--### Performance Monitoring--The environment includes comprehensive monitoring:--```bash-# Start performance monitoring-docker-compose --profile monitoring up -d performance-monitor--# View metrics-curl http://localhost/metrics--# Check performance reports-cat infrastructure/docker/testing/volumes/shared/performance-report.json-```--### Health Checks--All services include health checks:--```bash-# Check all service health-docker-compose ps--# Manual health check-curl http://localhost:3000/health-```--## π§ Configuration--### Environment Variables--Key environment variables:--```bash-# Development-NODE_ENV=development-DEBUG=claude-flow:*-SWARM_MODE=true-MCP_ENABLED=true--# Testing-NODE_ENV=test-CI=true-PARALLEL_TESTS=true--# Production-NODE_ENV=production-PORT=3000-```--### Volume Mounts--The environment uses strategic volume mounting:--- **Source Code**: Live mounting for development-- **Node Modules**: Cached for performance-- **Shared Data**: Cross-container communication-- **Test Results**: Persistent test artifacts-- **Database**: Persistent data storage--## π§ͺ Testing Strategy--### Test Suites--1. **Unit Tests**: Component-level testing-2. **Integration Tests**: Service integration testing-3. **E2E Tests**: End-to-end workflow testing-4. **Performance Tests**: Load and stress testing-5. **Swarm Tests**: Multi-agent coordination testing-6. **MCP Tests**: Protocol integration testing--### Test Execution--```bash-# Run all tests-./scripts/run-all-tests.sh--# Run specific test categories-docker-compose run --rm claude-flow-test npm run test:unit-docker-compose run --rm claude-flow-test npm run test:integration-docker-compose run --rm claude-flow-test npm run test:performance-```--## π Directory Structure--```-infrastructure/docker/testing/-βββ Dockerfile # Multi-stage build definition-βββ docker-compose.yml # Service orchestration-βββ docker-compose.test.yml # Test-specific orchestration-βββ docker-compose.override.yml # Local overrides-βββ .dockerignore # Build context exclusions-βββ nginx.conf # Load balancer configuration-βββ README.md # This file-βββ scripts/-β βββ build-and-test.sh # Main build and test pipeline-β βββ run-all-tests.sh # Comprehensive test runner-β βββ performance-monitor.js # Performance monitoring-βββ volumes/- βββ claude-flow/ # claude-code-flow specific data- βββ ruv-swarm/ # ruv-swarm specific data- βββ shared/ # Cross-container shared data-```--## π CI/CD Integration--### GitHub Actions Integration--The Docker environment is designed for CI/CD:--```yaml-# Example GitHub Actions workflow-name: Docker Test Pipeline-on: [push, pull_request]-jobs:- test:- runs-on: ubuntu-latest- steps:- - uses: actions/checkout@v2- - name: Run Docker Tests- run: |- cd infrastructure/docker/testing- ./scripts/build-and-test.sh-```--### Automated Testing--The pipeline includes:--- **Multi-stage builds** for different environments-- **Parallel test execution** for faster feedback-- **Comprehensive reporting** with detailed metrics-- **Automated cleanup** to prevent resource leaks-- **Health monitoring** for service reliability--## π οΈ Troubleshooting--### Common Issues--1. **Port Conflicts**: Ensure ports 3000-3002, 8080 are available-2. **Docker Memory**: Increase Docker memory allocation if needed-3. **Volume Permissions**: Check volume mount permissions-4. **Network Issues**: Verify Docker network configuration--### Debug Commands--```bash-# View container logs-docker-compose logs -f [service-name]--# Execute interactive shell-docker-compose exec claude-flow-dev /bin/bash--# Check container resource usage-docker stats--# Inspect container configuration-docker-compose config-```--### Performance Optimization--For optimal performance:--1. **Use `.dockerignore`** to reduce build context-2. **Layer caching** for faster builds-3. **Multi-stage builds** for smaller images-4. **Volume mounting** for development efficiency-5. **Health checks** for reliability--## π Testing Checklist--Before deployment, verify:--- [ ] All Docker images build successfully-- [ ] Unit tests pass-- [ ] Integration tests pass-- [ ] E2E tests pass-- [ ] Performance tests meet requirements-- [ ] Swarm integration works correctly-- [ ] MCP protocol integration functions-- [ ] Health checks are responsive-- [ ] Monitoring captures metrics-- [ ] Production deployment is secure--## π Next Steps--1. **CI/CD Integration**: Add to GitHub Actions-2. **Kubernetes Deployment**: Create K8s manifests-3. **Multi-Architecture**: Support ARM64 builds-4. **Security Scanning**: Add vulnerability scanning-5. **Documentation**: Update deployment guides--## π Support--For issues or questions:--- **GitHub Issues**: https://github.com/ruvnet/claude-code-flow/issues-- **Documentation**: https://github.com/ruvnet/claude-code-flow/docs-- **Discord**: Community support channel-------**Note**: This Docker environment is optimized for testing claude-code-flow and ruv-swarm integration. For production deployments, review security configurations and resource limits.\ No newline at end of filediff --git a/infrastructure/docker/testing/docker-compose.override.yml b/infrastructure/docker/testing/docker-compose.override.ymldeleted file mode 100644index c4b26fc657..0000000000--- a/infrastructure/docker/testing/docker-compose.override.yml+++ /dev/null@@ -1,54 +0,0 @@-# Docker Compose override for local development-# This file allows developers to customize the environment without modifying the main compose file--version: '3.8'--services:- claude-flow-dev:- # Override for local development- volumes:- - ../:/app:cached # Use cached mounting for better performance on macOS- environment:- - DEBUG=claude-flow:*,ruv-swarm:*- - LOG_LEVEL=debug- - DEVELOPMENT_MODE=true- ports:- - "3000:3000"- - "3001:3001"- - "8080:8080"- - "9229:9229" # Node.js debugging port-- ruv-swarm-integration:- # Override for swarm development- environment:- - SWARM_DEBUG=true- - SWARM_LOG_LEVEL=debug- - MCP_DEBUG=true- volumes:- - ../../ruv-swarm:/app/ruv-swarm:cached-- # Additional development services- redis:- image: redis:alpine- container_name: claude-flow-redis- ports:- - "6379:6379"- volumes:- - redis-data:/data- networks:- - claude-swarm-network-- # Database admin interface- db-admin:- image: sqlitebrowser/sqlitebrowser:latest- container_name: claude-flow-db-admin- ports:- - "8081:8080"- volumes:- - claude-flow-db-data:/data- networks:- - claude-swarm-network--volumes:- redis-data:- driver: local\ No newline at end of filediff --git a/infrastructure/docker/testing/docker-compose.test.yml b/infrastructure/docker/testing/docker-compose.test.ymldeleted file mode 100644index fd5866eca3..0000000000--- a/infrastructure/docker/testing/docker-compose.test.yml+++ /dev/null@@ -1,131 +0,0 @@-# Docker Compose configuration for testing-# Optimized for CI/CD and automated testing environments--version: '3.8'--services:- claude-flow-test:- build:- context: ../../..- dockerfile: infrastructure/docker/testing/Dockerfile- target: testing- container_name: claude-flow-test- environment:- - NODE_ENV=test- - CI=true- - FORCE_COLOR=1- - JEST_JUNIT_OUTPUT_DIR=/app/test-results- - JEST_JUNIT_OUTPUT_NAME=junit.xml- volumes:- - claude-flow-test-results:/app/test-results- - claude-flow-coverage:/app/coverage- depends_on:- - test-db- networks:- - claude-test-network-- test-db:- image: sqlite:latest- container_name: claude-flow-test-db- environment:- - SQLITE_DATABASE=test.db- volumes:- - test-db-data:/var/lib/sqlite- networks:- - claude-test-network-- # Integration test runner- integration-test:- build:- context: ../../..- dockerfile: infrastructure/docker/testing/Dockerfile- target: testing- container_name: claude-flow-integration-test- environment:- - NODE_ENV=test- - TEST_TYPE=integration- - CI=true- volumes:- - claude-flow-test-results:/app/test-results- depends_on:- - claude-flow-test- - test-db- networks:- - claude-test-network- command: ["npm", "run", "test:integration"]-- # E2E test runner- e2e-test:- build:- context: ../../..- dockerfile: infrastructure/docker/testing/Dockerfile- target: testing- container_name: claude-flow-e2e-test- environment:- - NODE_ENV=test- - TEST_TYPE=e2e- - CI=true- - HEADLESS=true- volumes:- - claude-flow-test-results:/app/test-results- - claude-flow-coverage:/app/coverage- depends_on:- - claude-flow-test- - test-db- networks:- - claude-test-network- command: ["npm", "run", "test:e2e"]-- # Performance test runner- performance-test:- build:- context: ../../..- dockerfile: infrastructure/docker/testing/Dockerfile- target: testing- container_name: claude-flow-performance-test- environment:- - NODE_ENV=test- - TEST_TYPE=performance- - CI=true- volumes:- - claude-flow-test-results:/app/test-results- depends_on:- - claude-flow-test- - test-db- networks:- - claude-test-network- command: ["npm", "run", "test:performance"]-- # Test result aggregator- test-aggregator:- image: node:20-alpine- container_name: claude-flow-test-aggregator- working_dir: /app- environment:- - NODE_ENV=test- volumes:- - claude-flow-test-results:/app/test-results- - ./scripts:/app/scripts- networks:- - claude-test-network- command: ["node", "/app/scripts/aggregate-test-results.js"]- depends_on:- - claude-flow-test- - integration-test- - e2e-test- - performance-test--networks:- claude-test-network:- driver: bridge- ipam:- config:- - subnet: 172.21.0.0/16--volumes:- claude-flow-test-results:- driver: local- claude-flow-coverage:- driver: local- test-db-data:- driver: local\ No newline at end of filediff --git a/infrastructure/docker/testing/docker-compose.yml b/infrastructure/docker/testing/docker-compose.ymldeleted file mode 100644index a1f457b359..0000000000--- a/infrastructure/docker/testing/docker-compose.yml+++ /dev/null@@ -1,104 +0,0 @@-version: '3.8'--services:- # NPX installation testing- test-npx-swarm:- build:- context: .- dockerfile: Dockerfile.npx- container_name: claude-flow-test-npx-swarm- volumes:- - ./results:/test/results- - ./logs:/test/logs- command: ["/test/scripts/test-mcp-tools.sh", "npx", "swarm"]- networks:- - claude-flow-test-- test-npx-neural:- build:- context: .- dockerfile: Dockerfile.npx- container_name: claude-flow-test-npx-neural- volumes:- - ./results:/test/results- - ./logs:/test/logs- command: ["/test/scripts/test-mcp-tools.sh", "npx", "neural"]- networks:- - claude-flow-test-- test-npx-memory:- build:- context: .- dockerfile: Dockerfile.npx- container_name: claude-flow-test-npx-memory- volumes:- - ./results:/test/results- - ./logs:/test/logs- command: ["/test/scripts/test-mcp-tools.sh", "npx", "memory"]- networks:- - claude-flow-test-- test-npx-analysis:- build:- context: .- dockerfile: Dockerfile.npx- container_name: claude-flow-test-npx-analysis- volumes:- - ./results:/test/results- - ./logs:/test/logs- command: ["/test/scripts/test-mcp-tools.sh", "npx", "analysis"]- networks:- - claude-flow-test-- # NPM installation testing- test-npm-workflow:- build:- context: .- dockerfile: Dockerfile.npm- container_name: claude-flow-test-npm-workflow- volumes:- - ./results:/test/results- - ./logs:/test/logs- command: ["/test/scripts/test-mcp-tools.sh", "npm", "workflow"]- networks:- - claude-flow-test-- test-npm-github:- build:- context: .- dockerfile: Dockerfile.npm- container_name: claude-flow-test-npm-github- volumes:- - ./results:/test/results- - ./logs:/test/logs- command: ["/test/scripts/test-mcp-tools.sh", "npm", "github"]- networks:- - claude-flow-test-- test-npm-daa:- build:- context: .- dockerfile: Dockerfile.npm- container_name: claude-flow-test-npm-daa- volumes:- - ./results:/test/results- - ./logs:/test/logs- command: ["/test/scripts/test-mcp-tools.sh", "npm", "daa"]- networks:- - claude-flow-test-- test-npm-system:- build:- context: .- dockerfile: Dockerfile.npm- container_name: claude-flow-test-npm-system- volumes:- - ./results:/test/results- - ./logs:/test/logs- command: ["/test/scripts/test-mcp-tools.sh", "npm", "system"]- networks:- - claude-flow-test--networks:- claude-flow-test:- driver: bridge\ No newline at end of filediff --git a/infrastructure/docker/testing/nginx.conf b/infrastructure/docker/testing/nginx.confdeleted file mode 100644index 306ee83d8c..0000000000--- a/infrastructure/docker/testing/nginx.conf+++ /dev/null@@ -1,72 +0,0 @@-# Nginx configuration for claude-code-flow load balancing-events {- worker_connections 1024;-}--http {- upstream claude_flow_backend {- server claude-flow-dev:3000;- server claude-flow-prod:3000 backup;- }-- upstream claude_flow_api {- server claude-flow-dev:3001;- }-- server {- listen 80;- server_name localhost;-- # Health check endpoint- location /health {- access_log off;- return 200 "healthy\n";- add_header Content-Type text/plain;- }-- # Main application- location / {- proxy_pass http://claude_flow_backend;- proxy_set_header Host $host;- proxy_set_header X-Real-IP $remote_addr;- proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;- proxy_set_header X-Forwarded-Proto $scheme;-- # WebSocket support- proxy_http_version 1.1;- proxy_set_header Upgrade $http_upgrade;- proxy_set_header Connection "upgrade";-- # Timeouts- proxy_connect_timeout 60s;- proxy_send_timeout 60s;- proxy_read_timeout 60s;- }-- # API endpoints- location /api/ {- proxy_pass http://claude_flow_api;- proxy_set_header Host $host;- proxy_set_header X-Real-IP $remote_addr;- proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;- proxy_set_header X-Forwarded-Proto $scheme;-- # API-specific headers- proxy_set_header Accept application/json;- proxy_set_header Content-Type application/json;- }-- # Static files- location /static/ {- alias /shared/static/;- expires 1y;- add_header Cache-Control "public, immutable";- }-- # Metrics endpoint- location /metrics {- alias /shared/metrics.json;- add_header Content-Type application/json;- }- }-}\ No newline at end of filediff --git a/infrastructure/docker/testing/scripts/aggregate-test-results.js b/infrastructure/docker/testing/scripts/aggregate-test-results.jsdeleted file mode 100755index f8b1352c6e..0000000000--- a/infrastructure/docker/testing/scripts/aggregate-test-results.js+++ /dev/null@@ -1,387 +0,0 @@-#!/usr/bin/env node--/**- * Test result aggregator for Docker testing environment- * Combines test results from multiple test suites into comprehensive reports- */--const fs = require('fs');-const path = require('path');--const TEST_RESULTS_DIR = '/app/tests/results';-const OUTPUT_DIR = '/app/tests/results/aggregated';-const TIMESTAMP = new Date().toISOString().replace(/[:.]/g, '-');--// Ensure output directory exists-if (!fs.existsSync(OUTPUT_DIR)) {- fs.mkdirSync(OUTPUT_DIR, { recursive: true });-}--class TestResultAggregator {- constructor() {- this.results = {- timestamp: new Date().toISOString(),- summary: {- total_suites: 0,- passed_suites: 0,- failed_suites: 0,- total_tests: 0,- passed_tests: 0,- failed_tests: 0,- skipped_tests: 0,- success_rate: 0,- duration: 0- },- suites: {},- coverage: {},- performance: {},- errors: []- };- }-- log(message) {- console.log(`[${new Date().toISOString()}] ${message}`);- }-- // Aggregate Jest test results- aggregateJestResults() {- const jestResultsPath = path.join(TEST_RESULTS_DIR, 'junit.xml');- const jestJsonPath = path.join(TEST_RESULTS_DIR, 'jest-results.json');-- if (fs.existsSync(jestJsonPath)) {- try {- const jestResults = JSON.parse(fs.readFileSync(jestJsonPath, 'utf8'));-- this.results.suites.jest = {- type: 'jest',- numTotalTests: jestResults.numTotalTests || 0,- numPassedTests: jestResults.numPassedTests || 0,- numFailedTests: jestResults.numFailedTests || 0,- numPendingTests: jestResults.numPendingTests || 0,- testResults: jestResults.testResults || []- };-- this.results.summary.total_tests += jestResults.numTotalTests || 0;- this.results.summary.passed_tests += jestResults.numPassedTests || 0;- this.results.summary.failed_tests += jestResults.numFailedTests || 0;- this.results.summary.skipped_tests += jestResults.numPendingTests || 0;-- this.log(`β Aggregated Jest results: ${jestResults.numTotalTests} tests`);- } catch (error) {- this.log(`β Error aggregating Jest results: ${error.message}`);- this.results.errors.push({- type: 'jest_aggregation',- message: error.message,- timestamp: new Date().toISOString()- });- }- }- }-- // Aggregate coverage results- aggregateCoverageResults() {- const coverageDir = path.join(TEST_RESULTS_DIR, '../coverage');- const coverageJsonPath = path.join(coverageDir, 'coverage-final.json');-- if (fs.existsSync(coverageJsonPath)) {- try {- const coverageData = JSON.parse(fs.readFileSync(coverageJsonPath, 'utf8'));-- // Calculate overall coverage metrics- let totalStatements = 0;- let coveredStatements = 0;- let totalFunctions = 0;- let coveredFunctions = 0;- let totalBranches = 0;- let coveredBranches = 0;- let totalLines = 0;- let coveredLines = 0;-- Object.values(coverageData).forEach(fileCoverage => {- if (fileCoverage.s) {- totalStatements += Object.keys(fileCoverage.s).length;- coveredStatements += Object.values(fileCoverage.s).filter(count => count > 0).length;- }- if (fileCoverage.f) {- totalFunctions += Object.keys(fileCoverage.f).length;- coveredFunctions += Object.values(fileCoverage.f).filter(count => count > 0).length;- }- if (fileCoverage.b) {- totalBranches += Object.keys(fileCoverage.b).length;- coveredBranches += Object.values(fileCoverage.b).filter(branches =>- branches.some(count => count > 0)- ).length;- }- if (fileCoverage.l) {- totalLines += Object.keys(fileCoverage.l).length;- coveredLines += Object.values(fileCoverage.l).filter(count => count > 0).length;- }- });-- this.results.coverage = {- statements: {- total: totalStatements,- covered: coveredStatements,- percentage: totalStatements > 0 ? (coveredStatements / totalStatements * 100).toFixed(2) : 0- },- functions: {- total: totalFunctions,- covered: coveredFunctions,- percentage: totalFunctions > 0 ? (coveredFunctions / totalFunctions * 100).toFixed(2) : 0- },- branches: {- total: totalBranches,- covered: coveredBranches,- percentage: totalBranches > 0 ? (coveredBranches / totalBranches * 100).toFixed(2) : 0- },- lines: {- total: totalLines,- covered: coveredLines,- percentage: totalLines > 0 ? (coveredLines / totalLines * 100).toFixed(2) : 0- }- };-- this.log(`β Aggregated coverage results: ${this.results.coverage.statements.percentage}% statements`);- } catch (error) {- this.log(`β Error aggregating coverage results: ${error.message}`);- this.results.errors.push({- type: 'coverage_aggregation',- message: error.message,- timestamp: new Date().toISOString()- });- }- }- }-- // Aggregate performance test results- aggregatePerformanceResults() {- const performanceFiles = [- 'performance-tests.log',- 'performance-results.json',- 'benchmark-results.json'- ];-- performanceFiles.forEach(filename => {- const filePath = path.join(TEST_RESULTS_DIR, filename);- if (fs.existsSync(filePath)) {- try {- const content = fs.readFileSync(filePath, 'utf8');-- if (filename.endsWith('.json')) {- const data = JSON.parse(content);- this.results.performance[filename.replace('.json', '')] = data;- } else {- this.results.performance[filename.replace('.log', '')] = {- type: 'log',- content: content.split('\n').slice(-100) // Last 100 lines- };- }-- this.log(`β Aggregated performance results from ${filename}`);- } catch (error) {- this.log(`β Error aggregating performance results from ${filename}: ${error.message}`);- this.results.errors.push({- type: 'performance_aggregation',- file: filename,- message: error.message,- timestamp: new Date().toISOString()- });- }- }- });- }-- // Aggregate individual test suite results- aggregateTestSuiteResults() {- const suiteFiles = [- 'unit-tests.log',- 'integration-tests.log',- 'e2e-tests.log',- 'swarm-tests.log'- ];-- suiteFiles.forEach(filename => {- const filePath = path.join(TEST_RESULTS_DIR, filename);- if (fs.existsSync(filePath)) {- try {- const content = fs.readFileSync(filePath, 'utf8');- const suiteName = filename.replace('-tests.log', '');-- // Parse test results from logs- const passed = (content.match(/β |PASS/g) || []).length;- const failed = (content.match(/β|FAIL/g) || []).length;- const skipped = (content.match(/βοΈ|SKIP/g) || []).length;-- this.results.suites[suiteName] = {- type: 'log_based',- passed,- failed,- skipped,- total: passed + failed + skipped,- log_summary: content.split('\n').slice(-50) // Last 50 lines- };-- this.results.summary.total_suites++;- if (failed === 0) {- this.results.summary.passed_suites++;- } else {- this.results.summary.failed_suites++;- }-- this.log(`β Aggregated ${suiteName} results: ${passed} passed, ${failed} failed`);- } catch (error) {- this.log(`β Error aggregating ${filename}: ${error.message}`);- this.results.errors.push({- type: 'suite_aggregation',- file: filename,- message: error.message,- timestamp: new Date().toISOString()- });- }- }- });- }-- // Calculate final metrics- calculateMetrics() {- // Calculate success rate- if (this.results.summary.total_tests > 0) {- this.results.summary.success_rate = (- (this.results.summary.passed_tests / this.results.summary.total_tests) * 100- ).toFixed(2);- }-- // Add environment information- this.results.environment = {- node_version: process.version,- platform: process.platform,- arch: process.arch,- docker: true,- timestamp: new Date().toISOString()- };-- this.log(`π Final metrics: ${this.results.summary.success_rate}% success rate`);- }-- // Generate comprehensive report- generateReport() {- const reportPath = path.join(OUTPUT_DIR, `test-report-${TIMESTAMP}.json`);-- try {- fs.writeFileSync(reportPath, JSON.stringify(this.results, null, 2));- this.log(`π Generated comprehensive report: ${reportPath}`);- } catch (error) {- this.log(`β Error generating report: ${error.message}`);- }- }-- // Generate HTML report- generateHtmlReport() {- const htmlPath = path.join(OUTPUT_DIR, `test-report-${TIMESTAMP}.html`);-- const html = `-<!DOCTYPE html>-<html>-<head>- <title>Test Results - ${this.results.timestamp}</title>- <style>- body { font-family: Arial, sans-serif; margin: 20px; }- .header { background: #f0f0f0; padding: 20px; border-radius: 5px; }- .success { color: #28a745; }- .failed { color: #dc3545; }- .warning { color: #ffc107; }- .suite { margin: 20px 0; padding: 15px; border: 1px solid #ddd; border-radius: 5px; }- .metrics { display: flex; gap: 20px; margin: 20px 0; }- .metric { padding: 10px; background: #f8f9fa; border-radius: 5px; }- pre { background: #f8f9fa; padding: 10px; border-radius: 5px; overflow-x: auto; }- </style>-</head>-<body>- <div class="header">- <h1>Test Results Summary</h1>- <p><strong>Generated:</strong> ${this.results.timestamp}</p>- <p><strong>Environment:</strong> Docker (${this.results.environment?.node_version})</p>- </div>-- <div class="metrics">- <div class="metric">- <h3>Overall Success Rate</h3>- <p class="${this.results.summary.success_rate >= 80 ? 'success' : 'failed'}">${this.results.summary.success_rate}%</p>- </div>- <div class="metric">- <h3>Total Tests</h3>- <p>${this.results.summary.total_tests}</p>- </div>- <div class="metric">- <h3>Test Suites</h3>- <p>${this.results.summary.total_suites}</p>- </div>- <div class="metric">- <h3>Coverage</h3>- <p>${this.results.coverage.statements?.percentage || 'N/A'}%</p>- </div>- </div>-- <h2>Test Suites</h2>- ${Object.entries(this.results.suites).map(([name, suite]) => `- <div class="suite">- <h3>${name}</h3>- <p><span class="success">β ${suite.passed || 0} passed</span> |- <span class="failed">β ${suite.failed || 0} failed</span> |- <span class="warning">βοΈ ${suite.skipped || 0} skipped</span></p>- </div>- `).join('')}-- ${this.results.errors.length > 0 ? `- <h2>Errors</h2>- <div class="suite">- <pre>${JSON.stringify(this.results.errors, null, 2)}</pre>- </div>- ` : ''}-- <h2>Raw Results</h2>- <div class="suite">- <pre>${JSON.stringify(this.results, null, 2)}</pre>- </div>-</body>-</html>`;-- try {- fs.writeFileSync(htmlPath, html);- this.log(`π Generated HTML report: ${htmlPath}`);- } catch (error) {- this.log(`β Error generating HTML report: ${error.message}`);- }- }-- // Run complete aggregation- async aggregate() {- this.log('π Starting test result aggregation...');-- this.aggregateJestResults();- this.aggregateCoverageResults();- this.aggregatePerformanceResults();- this.aggregateTestSuiteResults();- this.calculateMetrics();- this.generateReport();- this.generateHtmlReport();-- this.log('β Test result aggregation completed');-- // Exit with appropriate code- process.exit(this.results.summary.failed_suites > 0 ? 1 : 0);- }-}--// Handle graceful shutdown-process.on('SIGINT', () => {- console.log('\nπ Shutting down test aggregator...');- process.exit(0);-});--// Start aggregation-const aggregator = new TestResultAggregator();-aggregator.aggregate().catch(error => {- console.error('β Fatal error in test aggregator:', error);- process.exit(1);-});\ No newline at end of filediff --git a/infrastructure/docker/testing/scripts/build-and-test.sh b/infrastructure/docker/testing/scripts/build-and-test.shdeleted file mode 100755index 273aa17a2d..0000000000--- a/infrastructure/docker/testing/scripts/build-and-test.sh+++ /dev/null@@ -1,372 +0,0 @@-#!/bin/bash--# Automated build and test script for claude-code-flow Docker environment-# This script handles the complete build, test, and validation pipeline--set -euo pipefail--# Colors for output-RED='\033[0;31m'-GREEN='\033[0;32m'-YELLOW='\033[1;33m'-BLUE='\033[0;34m'-NC='\033[0m' # No Color--# Script configuration-SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"-PROJECT_ROOT="$(cd "${SCRIPT_DIR}/../.." && pwd)"-DOCKER_TEST_DIR="${PROJECT_ROOT}/docker-test"-TIMESTAMP=$(date +%Y%m%d_%H%M%S)-LOG_FILE="${DOCKER_TEST_DIR}/logs/build-test-${TIMESTAMP}.log"--# Ensure logs directory exists-mkdir -p "${DOCKER_TEST_DIR}/logs"--# Logging function-log() {- echo -e "${1}" | tee -a "${LOG_FILE}"-}--# Error handler-error_handler() {- log "${RED}β Error occurred in script at line $1${NC}"- log "${RED}β Build and test process failed${NC}"- exit 1-}--trap 'error_handler $LINENO' ERR--# Function to check if Docker is running-check_docker() {- if ! docker info >/dev/null 2>&1; then- log "${RED}β Docker is not running. Please start Docker first.${NC}"- exit 1- fi- log "${GREEN}β Docker is running${NC}"-}--# Function to check if Docker Compose is available-check_docker_compose() {- if ! command -v docker-compose >/dev/null 2>&1; then- log "${RED}β Docker Compose is not installed${NC}"- exit 1- fi- log "${GREEN}β Docker Compose is available${NC}"-}--# Function to clean up previous containers and volumes-cleanup() {- log "${YELLOW}π§Ή Cleaning up previous containers and volumes...${NC}"-- cd "${DOCKER_TEST_DIR}"-- # Stop and remove containers- docker-compose down --volumes --remove-orphans 2>/dev/null || true-- # Remove dangling images- docker image prune -f 2>/dev/null || true-- # Clean up test results- rm -rf "${DOCKER_TEST_DIR}/test-results"- mkdir -p "${DOCKER_TEST_DIR}/test-results"-- log "${GREEN}β Cleanup completed${NC}"-}--# Function to build all images-build_images() {- log "${YELLOW}ποΈ Building Docker images...${NC}"-- cd "${DOCKER_TEST_DIR}"-- # Build development image- log "${BLUE}π¦ Building development image...${NC}"- docker-compose build claude-flow-dev-- # Build testing image- log "${BLUE}π¦ Building testing image...${NC}"- docker-compose build claude-flow-test-- # Build production image- log "${BLUE}π¦ Building production image...${NC}"- docker-compose build claude-flow-prod-- # Build swarm integration image- log "${BLUE}π¦ Building swarm integration image...${NC}"- docker-compose build ruv-swarm-integration-- log "${GREEN}β All images built successfully${NC}"-}--# Function to run unit tests-run_unit_tests() {- log "${YELLOW}π§ͺ Running unit tests...${NC}"-- cd "${DOCKER_TEST_DIR}"-- # Run unit tests- docker-compose run --rm claude-flow-test npm run test:unit > "${DOCKER_TEST_DIR}/test-results/unit-tests.log" 2>&1-- if [ $? -eq 0 ]; then- log "${GREEN}β Unit tests passed${NC}"- else- log "${RED}β Unit tests failed${NC}"- cat "${DOCKER_TEST_DIR}/test-results/unit-tests.log"- return 1- fi-}--# Function to run integration tests-run_integration_tests() {- log "${YELLOW}π Running integration tests...${NC}"-- cd "${DOCKER_TEST_DIR}"-- # Start dependencies- docker-compose up -d claude-flow-db ruv-swarm-db-- # Wait for databases to be ready- sleep 10-- # Run integration tests- docker-compose run --rm claude-flow-test npm run test:integration > "${DOCKER_TEST_DIR}/test-results/integration-tests.log" 2>&1-- if [ $? -eq 0 ]; then- log "${GREEN}β Integration tests passed${NC}"- else- log "${RED}β Integration tests failed${NC}"- cat "${DOCKER_TEST_DIR}/test-results/integration-tests.log"- return 1- fi-}--# Function to run swarm integration tests-run_swarm_tests() {- log "${YELLOW}π Running swarm integration tests...${NC}"-- cd "${DOCKER_TEST_DIR}"-- # Start swarm integration environment- docker-compose --profile swarm up -d-- # Wait for services to be ready- sleep 20-- # Run swarm tests- docker-compose run --rm ruv-swarm-integration npm run test:swarm > "${DOCKER_TEST_DIR}/test-results/swarm-tests.log" 2>&1-- if [ $? -eq 0 ]; then- log "${GREEN}β Swarm integration tests passed${NC}"- else- log "${RED}β Swarm integration tests failed${NC}"- cat "${DOCKER_TEST_DIR}/test-results/swarm-tests.log"- return 1- fi-}--# Function to run end-to-end tests-run_e2e_tests() {- log "${YELLOW}π Running end-to-end tests...${NC}"-- cd "${DOCKER_TEST_DIR}"-- # Start full environment- docker-compose up -d claude-flow-dev claude-flow-db-- # Wait for services to be ready- sleep 30-- # Run e2e tests- docker-compose run --rm --profile testing test-runner > "${DOCKER_TEST_DIR}/test-results/e2e-tests.log" 2>&1-- if [ $? -eq 0 ]; then- log "${GREEN}β End-to-end tests passed${NC}"- else- log "${RED}β End-to-end tests failed${NC}"- cat "${DOCKER_TEST_DIR}/test-results/e2e-tests.log"- return 1- fi-}--# Function to run performance tests-run_performance_tests() {- log "${YELLOW}β‘ Running performance tests...${NC}"-- cd "${DOCKER_TEST_DIR}"-- # Start performance monitoring- docker-compose --profile monitoring up -d performance-monitor-- # Start services- docker-compose up -d claude-flow-dev claude-flow-db-- # Wait for services- sleep 20-- # Run performance tests- docker-compose run --rm claude-flow-test npm run test:performance > "${DOCKER_TEST_DIR}/test-results/performance-tests.log" 2>&1-- if [ $? -eq 0 ]; then- log "${GREEN}β Performance tests passed${NC}"- else- log "${RED}β Performance tests failed${NC}"- cat "${DOCKER_TEST_DIR}/test-results/performance-tests.log"- return 1- fi-}--# Function to validate production deployment-validate_production() {- log "${YELLOW}π Validating production deployment...${NC}"-- cd "${DOCKER_TEST_DIR}"-- # Start production environment- docker-compose --profile production up -d-- # Wait for services- sleep 30-- # Health check- if curl -f http://localhost:3002/health >/dev/null 2>&1; then- log "${GREEN}β Production deployment is healthy${NC}"- else- log "${RED}β Production deployment health check failed${NC}"- docker-compose --profile production logs claude-flow-prod- return 1- fi-}--# Function to generate test reports-generate_reports() {- log "${YELLOW}π Generating test reports...${NC}"-- cd "${DOCKER_TEST_DIR}"-- # Create reports directory- mkdir -p "${DOCKER_TEST_DIR}/test-results/reports"-- # Generate coverage report- docker-compose run --rm claude-flow-test npm run coverage:report > "${DOCKER_TEST_DIR}/test-results/reports/coverage.html" 2>&1 || true-- # Generate summary report- cat > "${DOCKER_TEST_DIR}/test-results/reports/summary.md" << EOF-# Test Results Summary--**Date:** $(date)-**Build:** ${TIMESTAMP}--## Test Results--- β Unit Tests: $(grep -c "β Unit tests passed" "${LOG_FILE}" || echo "0")/1-- β Integration Tests: $(grep -c "β Integration tests passed" "${LOG_FILE}" || echo "0")/1-- β Swarm Tests: $(grep -c "β Swarm integration tests passed" "${LOG_FILE}" || echo "0")/1-- β E2E Tests: $(grep -c "β End-to-end tests passed" "${LOG_FILE}" || echo "0")/1-- β Performance Tests: $(grep -c "β Performance tests passed" "${LOG_FILE}" || echo "0")/1-- β Production Validation: $(grep -c "β Production deployment is healthy" "${LOG_FILE}" || echo "0")/1--## Build Information--- **Docker Images Built:** $(docker images | grep claude-flow | wc -l)-- **Total Test Duration:** $(grep -o "Build and test completed in [0-9]* seconds" "${LOG_FILE}" | cut -d' ' -f6 || echo "N/A")-- **Log File:** ${LOG_FILE}--## Next Steps--1. Review individual test logs in \`test-results/\` directory-2. Check coverage reports in \`test-results/reports/\`-3. Validate production deployment if all tests pass-4. Update GitHub issue #54 with results--EOF-- log "${GREEN}β Test reports generated${NC}"-}--# Function to post results to GitHub issue-post_to_github() {- log "${YELLOW}π Posting results to GitHub issue #54...${NC}"-- # Create a summary for GitHub- local summary_file="${DOCKER_TEST_DIR}/test-results/github-summary.md"-- cat > "${summary_file}" << EOF-## Docker Infrastructure Test Results - ${TIMESTAMP}--### Build Status: $(if [ $? -eq 0 ]; then echo "β SUCCESS"; else echo "β FAILED"; fi)--**Environment:** Docker multi-stage build with compose orchestration-**Test Coverage:** Unit, Integration, Swarm, E2E, Performance, Production validation--### Key Achievements:-- β Multi-stage Dockerfile with optimized layers-- β Docker Compose orchestration with proper networking-- β Volume mounting for source code and shared data-- β Automated test pipeline with parallel execution-- β Production-ready deployment validation-- β Swarm integration testing environment--### Infrastructure Features:-- **Multi-stage builds** for development, testing, and production-- **Volume mounting** for real-time development-- **Network isolation** with custom bridge network-- **Health checks** for all services-- **Automated testing** pipeline with comprehensive coverage-- **Performance monitoring** with real-time metrics-- **Load balancing** with nginx for production--### Next Steps:-1. Review detailed test logs-2. Validate performance metrics-3. Update deployment documentation-4. Create CI/CD pipeline integration--**Full test log:** [Build Log](${LOG_FILE})-EOF-- log "${GREEN}β GitHub summary prepared${NC}"- log "${BLUE}π Summary written to: ${summary_file}${NC}"-}--# Main execution function-main() {- local start_time=$(date +%s)-- log "${BLUE}π Starting Docker build and test pipeline...${NC}"- log "${BLUE}π Started at: $(date)${NC}"- log "${BLUE}π Project root: ${PROJECT_ROOT}${NC}"- log "${BLUE}π³ Docker test dir: ${DOCKER_TEST_DIR}${NC}"-- # Pre-flight checks- check_docker- check_docker_compose-- # Execute pipeline- cleanup- build_images- run_unit_tests- run_integration_tests- run_swarm_tests- run_e2e_tests- run_performance_tests- validate_production- generate_reports- post_to_github-- # Calculate duration- local end_time=$(date +%s)- local duration=$((end_time - start_time))-- log "${GREEN}π Build and test completed successfully in ${duration} seconds${NC}"- log "${GREEN}π All test results available in: ${DOCKER_TEST_DIR}/test-results/${NC}"- log "${GREEN}π Summary report: ${DOCKER_TEST_DIR}/test-results/reports/summary.md${NC}"-- # Final cleanup- cd "${DOCKER_TEST_DIR}"- docker-compose down --volumes --remove-orphans 2>/dev/null || true-- log "${GREEN}β Docker infrastructure testing completed successfully${NC}"-}--# Execute main function-main "$@"\ No newline at end of filediff --git a/infrastructure/docker/testing/scripts/performance-monitor.js b/infrastructure/docker/testing/scripts/performance-monitor.jsdeleted file mode 100644index e0ce3eb582..0000000000--- a/infrastructure/docker/testing/scripts/performance-monitor.js+++ /dev/null@@ -1,370 +0,0 @@-#!/usr/bin/env node--/**- * Performance monitoring script for Docker environment- * Monitors resource usage, response times, and system metrics- */--const os = require('os');-const fs = require('fs');-const { execSync } = require('child_process');--// Configuration-const MONITOR_INTERVAL = process.env.MONITOR_INTERVAL || 30; // seconds-const METRICS_OUTPUT = process.env.METRICS_OUTPUT || '/shared/metrics.json';-const LOG_FILE = '/shared/performance-monitor.log';--// Metrics collection-class PerformanceMonitor {- constructor() {- this.metrics = {- timestamp: new Date().toISOString(),- system: {},- docker: {},- application: {},- network: {}- };-- this.startTime = Date.now();- this.log('π Performance monitor started');- }-- log(message) {- const timestamp = new Date().toISOString();- const logMessage = `[${timestamp}] ${message}\n`;-- console.log(logMessage.trim());-- try {- fs.appendFileSync(LOG_FILE, logMessage);- } catch (error) {- console.error('Failed to write to log file:', error);- }- }-- // System metrics- collectSystemMetrics() {- try {- this.metrics.system = {- uptime: os.uptime(),- loadavg: os.loadavg(),- memory: {- total: os.totalmem(),- free: os.freemem(),- used: os.totalmem() - os.freemem(),- usage_percent: ((os.totalmem() - os.freemem()) / os.totalmem() * 100).toFixed(2)- },- cpu: {- count: os.cpus().length,- model: os.cpus()[0]?.model || 'unknown'- }- };- } catch (error) {- this.log(`β Error collecting system metrics: ${error.message}`);- }- }-- // Docker metrics- collectDockerMetrics() {- try {- // Get container stats- const dockerStats = execSync('docker stats --no-stream --format "table {{.Container}}\\t{{.CPUPerc}}\\t{{.MemUsage}}\\t{{.NetIO}}"', { encoding: 'utf8' });-- this.metrics.docker = {- containers: this.parseDockerStats(dockerStats),- images: this.getDockerImages(),- volumes: this.getDockerVolumes()- };- } catch (error) {- this.log(`β Error collecting Docker metrics: ${error.message}`);- }- }-- parseDockerStats(stats) {- const lines = stats.split('\n').slice(1); // Skip header- return lines.filter(line => line.trim()).map(line => {- const parts = line.split('\t');- return {- container: parts[0],- cpu_percent: parts[1],- memory_usage: parts[2],- network_io: parts[3]- };- });- }-- getDockerImages() {- try {- const images = execSync('docker images --format "{{.Repository}}:{{.Tag}}\\t{{.Size}}"', { encoding: 'utf8' });- return images.split('\n').filter(line => line.trim()).map(line => {- const [name, size] = line.split('\t');- return { name, size };- });- } catch (error) {- this.log(`β Error getting Docker images: ${error.message}`);- return [];- }- }-- getDockerVolumes() {- try {- const volumes = execSync('docker volume ls --format "{{.Name}}"', { encoding: 'utf8' });- return volumes.split('\n').filter(line => line.trim());- } catch (error) {- this.log(`β Error getting Docker volumes: ${error.message}`);- return [];- }- }-- // Application metrics- collectApplicationMetrics() {- try {- this.metrics.application = {- endpoints: this.checkApplicationEndpoints(),- response_times: this.measureResponseTimes(),- health_status: this.checkHealthStatus()- };- } catch (error) {- this.log(`β Error collecting application metrics: ${error.message}`);- }- }-- checkApplicationEndpoints() {- const endpoints = [- 'http://claude-flow-dev:3000/health',- 'http://claude-flow-prod:3000/health'- ];-- return endpoints.map(endpoint => {- try {- const start = Date.now();- execSync(`curl -f ${endpoint}`, { timeout: 5000 });- const end = Date.now();-- return {- endpoint,- status: 'healthy',- response_time: end - start- };- } catch (error) {- return {- endpoint,- status: 'unhealthy',- error: error.message- };- }- });- }-- measureResponseTimes() {- const urls = [- 'http://claude-flow-dev:3000/api/status',- 'http://claude-flow-dev:3000/api/agents',- 'http://claude-flow-dev:3000/api/memory'- ];-- return urls.map(url => {- try {- const start = Date.now();- execSync(`curl -f ${url}`, { timeout: 10000 });- const end = Date.now();-- return {- url,- response_time: end - start,- status: 'success'- };- } catch (error) {- return {- url,- response_time: -1,- status: 'error',- error: error.message- };- }- });- }-- checkHealthStatus() {- try {- const containers = execSync('docker ps --format "{{.Names}}\\t{{.Status}}"', { encoding: 'utf8' });- return containers.split('\n').filter(line => line.trim()).map(line => {- const [name, status] = line.split('\t');- return { container: name, status };- });- } catch (error) {- this.log(`β Error checking health status: ${error.message}`);- return [];- }- }-- // Network metrics- collectNetworkMetrics() {- try {- this.metrics.network = {- interfaces: this.getNetworkInterfaces(),- docker_networks: this.getDockerNetworks()- };- } catch (error) {- this.log(`β Error collecting network metrics: ${error.message}`);- }- }-- getNetworkInterfaces() {- const interfaces = os.networkInterfaces();- return Object.keys(interfaces).map(name => ({- name,- addresses: interfaces[name].map(addr => ({- address: addr.address,- family: addr.family,- internal: addr.internal- }))- }));- }-- getDockerNetworks() {- try {- const networks = execSync('docker network ls --format "{{.Name}}\\t{{.Driver}}"', { encoding: 'utf8' });- return networks.split('\n').filter(line => line.trim()).map(line => {- const [name, driver] = line.split('\t');- return { name, driver };- });- } catch (error) {- this.log(`β Error getting Docker networks: ${error.message}`);- return [];- }- }-- // Collect all metrics- collectAllMetrics() {- this.log('π Collecting performance metrics...');-- this.collectSystemMetrics();- this.collectDockerMetrics();- this.collectApplicationMetrics();- this.collectNetworkMetrics();-- this.metrics.collection_duration = Date.now() - this.startTime;- this.metrics.timestamp = new Date().toISOString();-- this.log('β Metrics collection completed');- }-- // Save metrics- saveMetrics() {- try {- const metricsJson = JSON.stringify(this.metrics, null, 2);- fs.writeFileSync(METRICS_OUTPUT, metricsJson);- this.log(`π Metrics saved to ${METRICS_OUTPUT}`);- } catch (error) {- this.log(`β Error saving metrics: ${error.message}`);- }- }-- // Generate performance report- generateReport() {- const report = {- summary: {- timestamp: this.metrics.timestamp,- system_health: this.assessSystemHealth(),- docker_health: this.assessDockerHealth(),- application_health: this.assessApplicationHealth(),- recommendations: this.generateRecommendations()- },- detailed_metrics: this.metrics- };-- try {- const reportPath = '/shared/performance-report.json';- fs.writeFileSync(reportPath, JSON.stringify(report, null, 2));- this.log(`π Performance report generated: ${reportPath}`);- } catch (error) {- this.log(`β Error generating report: ${error.message}`);- }- }-- assessSystemHealth() {- const memoryUsage = parseFloat(this.metrics.system.memory?.usage_percent || 0);- const loadAvg = this.metrics.system.loadavg?.[0] || 0;-- if (memoryUsage > 90 || loadAvg > 4) return 'critical';- if (memoryUsage > 70 || loadAvg > 2) return 'warning';- return 'healthy';- }-- assessDockerHealth() {- const containers = this.metrics.docker.containers || [];- const unhealthyContainers = containers.filter(c =>- c.cpu_percent && parseFloat(c.cpu_percent.replace('%', '')) > 90- );-- if (unhealthyContainers.length > 0) return 'warning';- return 'healthy';- }-- assessApplicationHealth() {- const endpoints = this.metrics.application.endpoints || [];- const unhealthyEndpoints = endpoints.filter(e => e.status !== 'healthy');-- if (unhealthyEndpoints.length > 0) return 'critical';- return 'healthy';- }-- generateRecommendations() {- const recommendations = [];-- const memoryUsage = parseFloat(this.metrics.system.memory?.usage_percent || 0);- if (memoryUsage > 80) {- recommendations.push('Consider increasing container memory limits');- }-- const loadAvg = this.metrics.system.loadavg?.[0] || 0;- if (loadAvg > 2) {- recommendations.push('High CPU load detected - consider scaling containers');- }-- const endpoints = this.metrics.application.endpoints || [];- const slowEndpoints = endpoints.filter(e => e.response_time > 5000);- if (slowEndpoints.length > 0) {- recommendations.push('Slow response times detected - optimize application performance');- }-- return recommendations;- }-- // Main monitoring loop- async startMonitoring() {- this.log(`π Starting monitoring loop (interval: ${MONITOR_INTERVAL}s)`);-- while (true) {- try {- this.collectAllMetrics();- this.saveMetrics();- this.generateReport();-- await new Promise(resolve => setTimeout(resolve, MONITOR_INTERVAL * 1000));- } catch (error) {- this.log(`β Error in monitoring loop: ${error.message}`);- await new Promise(resolve => setTimeout(resolve, 5000)); // Wait 5s before retry- }- }- }-}--// Handle graceful shutdown-process.on('SIGINT', () => {- console.log('\nπ Shutting down performance monitor...');- process.exit(0);-});--process.on('SIGTERM', () => {- console.log('\nπ Shutting down performance monitor...');- process.exit(0);-});--// Start monitoring-const monitor = new PerformanceMonitor();-monitor.startMonitoring().catch(error => {- console.error('β Fatal error in performance monitor:', error);- process.exit(1);-});\ No newline at end of filediff --git a/infrastructure/docker/testing/scripts/run-all-tests.sh b/infrastructure/docker/testing/scripts/run-all-tests.shdeleted file mode 100755index 0bc75d0b21..0000000000--- a/infrastructure/docker/testing/scripts/run-all-tests.sh+++ /dev/null@@ -1,143 +0,0 @@-#!/bin/bash--# Comprehensive test runner for Docker environment-# Runs all test suites with proper coordination and reporting--set -euo pipefail--# Colors for output-RED='\033[0;31m'-GREEN='\033[0;32m'-YELLOW='\033[1;33m'-BLUE='\033[0;34m'-NC='\033[0m' # No Color--# Configuration-TEST_DIR="/app/test-results"-SHARED_DIR="/app/docker-test/volumes/shared"-TIMESTAMP=$(date +%Y%m%d_%H%M%S)--# Ensure directories exist-mkdir -p "$TEST_DIR" "$SHARED_DIR"--# Logging function-log() {- echo -e "${1}" | tee -a "$TEST_DIR/test-runner-$TIMESTAMP.log"-}--# Function to run test suite-run_test_suite() {- local suite_name="$1"- local test_command="$2"- local output_file="$TEST_DIR/${suite_name}-${TIMESTAMP}.log"-- log "${YELLOW}π§ͺ Running $suite_name tests...${NC}"-- if eval "$test_command" > "$output_file" 2>&1; then- log "${GREEN}β $suite_name tests passed${NC}"- return 0- else- log "${RED}β $suite_name tests failed${NC}"- cat "$output_file"- return 1- fi-}--# Function to check service health-check_service_health() {- local service_name="$1"- local health_url="$2"- local max_attempts=30- local attempt=0-- log "${BLUE}π Checking $service_name health...${NC}"-- while [ $attempt -lt $max_attempts ]; do- if curl -f "$health_url" >/dev/null 2>&1; then- log "${GREEN}β $service_name is healthy${NC}"- return 0- fi-- attempt=$((attempt + 1))- sleep 2- done-- log "${RED}β $service_name health check failed${NC}"- return 1-}--# Main test execution-main() {- log "${BLUE}π Starting comprehensive test suite...${NC}"- log "${BLUE}π Started at: $(date)${NC}"-- local failed_tests=0-- # Unit tests- if ! run_test_suite "unit" "npm run test:unit -- --verbose --coverage"; then- failed_tests=$((failed_tests + 1))- fi-- # Integration tests- if ! run_test_suite "integration" "npm run test:integration -- --verbose"; then- failed_tests=$((failed_tests + 1))- fi-- # CLI tests- if ! run_test_suite "cli" "npm run test:cli -- --verbose"; then- failed_tests=$((failed_tests + 1))- fi-- # Swarm coordination tests- if ! run_test_suite "swarm" "npm run test:swarm -- --verbose"; then- failed_tests=$((failed_tests + 1))- fi-- # MCP integration tests- if ! run_test_suite "mcp" "npm run test:mcp -- --verbose"; then- failed_tests=$((failed_tests + 1))- fi-- # Memory system tests- if ! run_test_suite "memory" "npm run test:memory -- --verbose"; then- failed_tests=$((failed_tests + 1))- fi-- # Performance tests- if ! run_test_suite "performance" "npm run test:performance -- --verbose"; then- failed_tests=$((failed_tests + 1))- fi-- # E2E tests- if ! run_test_suite "e2e" "npm run test:e2e -- --verbose"; then- failed_tests=$((failed_tests + 1))- fi-- # Generate test report- cat > "$TEST_DIR/test-summary-$TIMESTAMP.json" << EOF-{- "timestamp": "$TIMESTAMP",- "total_suites": 8,- "passed_suites": $((8 - failed_tests)),- "failed_suites": $failed_tests,- "success_rate": $(echo "scale=2; $((8 - failed_tests)) * 100 / 8" | bc -l)%,- "environment": "docker",- "node_version": "$(node --version)",- "npm_version": "$(npm --version)"-}-EOF-- # Store results in shared volume- cp "$TEST_DIR/test-summary-$TIMESTAMP.json" "$SHARED_DIR/"-- if [ $failed_tests -eq 0 ]; then- log "${GREEN}π All test suites passed!${NC}"- exit 0- else- log "${RED}β $failed_tests test suite(s) failed${NC}"- exit 1- fi-}--# Execute main function-main "$@"\ No newline at end of filediff --git a/infrastructure/docker/testing/test-mcp-tools.sh b/infrastructure/docker/testing/test-mcp-tools.shdeleted file mode 100755index bc0b9d2845..0000000000--- a/infrastructure/docker/testing/test-mcp-tools.sh+++ /dev/null@@ -1,331 +0,0 @@-#!/bin/bash--# Comprehensive MCP Tool Testing Script-# Usage: ./test-mcp-tools.sh [npx|npm] [category] [tool_name]--INSTALL_METHOD=${1:-npx}-CATEGORY=${2:-all}-TOOL_NAME=${3:-all}--# Colors for output-RED='\033[0;31m'-GREEN='\033[0;32m'-YELLOW='\033[1;33m'-BLUE='\033[0;34m'-NC='\033[0m' # No Color--# Logging functions-log_info() {- echo -e "${BLUE}[INFO]${NC} $(date '+%Y-%m-%d %H:%M:%S') - $1" | tee -a /test/logs/test.log-}--log_success() {- echo -e "${GREEN}[SUCCESS]${NC} $(date '+%Y-%m-%d %H:%M:%S') - $1" | tee -a /test/logs/test.log-}--log_error() {- echo -e "${RED}[ERROR]${NC} $(date '+%Y-%m-%d %H:%M:%S') - $1" | tee -a /test/logs/test.log-}--log_warning() {- echo -e "${YELLOW}[WARNING]${NC} $(date '+%Y-%m-%d %H:%M:%S') - $1" | tee -a /test/logs/test.log-}--# Initialize results tracking-init_results() {- mkdir -p /test/results- echo '{"test_start": "'$(date -Iseconds)'", "install_method": "'$INSTALL_METHOD'", "results": {}}' > /test/results/test_results.json-}--# Get claude-flow command based on install method-get_command() {- if [ "$INSTALL_METHOD" = "npx" ]; then- echo "npx [email protected]"- else- echo "./node_modules/.bin/claude-flow"- fi-}--# Test individual MCP tool-test_mcp_tool() {- local tool_name=$1- local test_params=$2- local expected_fields=$3-- log_info "Testing tool: $tool_name with params: $test_params"-- local cmd=$(get_command)- local start_time=$(date +%s.%N)-- # Start MCP server in background- timeout 10s $cmd mcp start --stdio > /tmp/mcp_output_$tool_name.log 2>&1 &- local mcp_pid=$!- sleep 2-- # Test tool via JSON-RPC- local test_message="{\"jsonrpc\":\"2.0\",\"id\":1,\"method\":\"initialize\",\"params\":{\"protocolVersion\":\"2024-11-05\",\"capabilities\":{\"tools\":{},\"resources\":{}},\"clientInfo\":{\"name\":\"test\",\"version\":\"1.0.0\"}}}-{\"jsonrpc\":\"2.0\",\"id\":2,\"method\":\"tools/call\",\"params\":{\"name\":\"$tool_name\",\"arguments\":$test_params}}"-- local result=$(echo "$test_message" | timeout 5s $cmd mcp start --stdio 2>/dev/null | tail -1)- local end_time=$(date +%s.%N)- local duration=$(echo "$end_time - $start_time" | bc)-- # Kill MCP server- kill $mcp_pid 2>/dev/null || true-- # Validate result- if echo "$result" | jq -e '.result.content[0].text' > /dev/null 2>&1; then- local response=$(echo "$result" | jq -r '.result.content[0].text')- if echo "$response" | jq -e '.success' > /dev/null 2>&1; then- log_success "Tool $tool_name executed successfully (${duration}s)"- echo "$response" > "/test/results/${tool_name}_result.json"-- # Update results- local temp_file=$(mktemp)- jq --arg tool "$tool_name" --arg status "success" --arg duration "$duration" --argjson response "$response" \- '.results[$tool] = {"status": $status, "duration": ($duration | tonumber), "response": $response}' \- /test/results/test_results.json > "$temp_file" && mv "$temp_file" /test/results/test_results.json-- return 0- else- log_error "Tool $tool_name returned failure response"- return 1- fi- else- log_error "Tool $tool_name failed to execute or returned invalid response"- return 1- fi-}--# Test tool categories-test_swarm_tools() {- log_info "Testing Swarm Coordination Tools (12 tools)"-- test_mcp_tool "swarm_init" '{"topology":"hierarchical","maxAgents":5,"strategy":"auto"}'- test_mcp_tool "agent_spawn" '{"type":"researcher","name":"test-agent"}'- test_mcp_tool "task_orchestrate" '{"task":"test task","strategy":"parallel"}'- test_mcp_tool "swarm_status" '{}'- test_mcp_tool "agent_list" '{}'- test_mcp_tool "agent_metrics" '{"agentId":"test-agent"}'- test_mcp_tool "swarm_monitor" '{"interval":5}'- test_mcp_tool "topology_optimize" '{}'- test_mcp_tool "load_balance" '{"tasks":["task1","task2"]}'- test_mcp_tool "coordination_sync" '{}'- test_mcp_tool "swarm_scale" '{"targetSize":3}'- test_mcp_tool "swarm_destroy" '{"swarmId":"test-swarm"}'-}--test_neural_tools() {- log_info "Testing Neural Network Tools (15 tools)"-- test_mcp_tool "neural_status" '{}'- test_mcp_tool "neural_train" '{"pattern_type":"coordination","training_data":"test_data","epochs":10}'- test_mcp_tool "neural_patterns" '{"action":"analyze","operation":"test_op"}'- test_mcp_tool "neural_predict" '{"modelId":"test-model","input":"test input"}'- test_mcp_tool "model_load" '{"modelPath":"/tmp/test_model"}'- test_mcp_tool "model_save" '{"modelId":"test-model","path":"/tmp/saved_model"}'- test_mcp_tool "wasm_optimize" '{"operation":"test_optimization"}'- test_mcp_tool "inference_run" '{"modelId":"test-model","data":["test","data"]}'- test_mcp_tool "pattern_recognize" '{"data":["pattern1","pattern2"]}'- test_mcp_tool "cognitive_analyze" '{"behavior":"test_behavior"}'- test_mcp_tool "learning_adapt" '{"experience":{"type":"test","outcome":"success"}}'- test_mcp_tool "neural_compress" '{"modelId":"test-model","ratio":0.5}'- test_mcp_tool "ensemble_create" '{"models":["model1","model2"],"strategy":"voting"}'- test_mcp_tool "transfer_learn" '{"sourceModel":"source","targetDomain":"target"}'- test_mcp_tool "neural_explain" '{"modelId":"test-model","prediction":{"class":"A","confidence":0.9}}'-}--test_memory_tools() {- log_info "Testing Memory & Persistence Tools (12 tools)"-- test_mcp_tool "memory_usage" '{"action":"store","key":"test_key","value":"test_value"}'- test_mcp_tool "memory_search" '{"pattern":"test*","limit":10}'- test_mcp_tool "memory_persist" '{"sessionId":"test-session"}'- test_mcp_tool "memory_namespace" '{"namespace":"test_ns","action":"create"}'- test_mcp_tool "memory_backup" '{"path":"/tmp/backup"}'- test_mcp_tool "memory_restore" '{"backupPath":"/tmp/backup"}'- test_mcp_tool "memory_compress" '{"namespace":"test_ns"}'- test_mcp_tool "memory_sync" '{"target":"remote_instance"}'- test_mcp_tool "cache_manage" '{"action":"clear","key":"test_cache"}'- test_mcp_tool "state_snapshot" '{"name":"test_snapshot"}'- test_mcp_tool "context_restore" '{"snapshotId":"test_snapshot"}'- test_mcp_tool "memory_analytics" '{"timeframe":"24h"}'-}--test_analysis_tools() {- log_info "Testing Analysis & Monitoring Tools (13 tools)"-- test_mcp_tool "task_status" '{"taskId":"test-task"}'- test_mcp_tool "task_results" '{"taskId":"test-task"}'- test_mcp_tool "benchmark_run" '{"suite":"performance"}'- test_mcp_tool "bottleneck_analyze" '{"component":"test_component"}'- test_mcp_tool "performance_report" '{"timeframe":"24h","format":"summary"}'- test_mcp_tool "token_usage" '{"operation":"test_op"}'- test_mcp_tool "metrics_collect" '{"components":["cpu","memory"]}'- test_mcp_tool "trend_analysis" '{"metric":"response_time","period":"7d"}'- test_mcp_tool "cost_analysis" '{"timeframe":"30d"}'- test_mcp_tool "quality_assess" '{"target":"test_system","criteria":["performance","reliability"]}'- test_mcp_tool "error_analysis" '{"logs":["error1","error2"]}'- test_mcp_tool "usage_stats" '{"component":"api"}'- test_mcp_tool "health_check" '{"components":["database","api","cache"]}'-}--test_workflow_tools() {- log_info "Testing Workflow & Automation Tools (11 tools)"-- test_mcp_tool "workflow_create" '{"name":"test_workflow","steps":["step1","step2"],"triggers":["manual"]}'- test_mcp_tool "workflow_execute" '{"workflowId":"test_workflow","params":{}}'- test_mcp_tool "workflow_export" '{"workflowId":"test_workflow","format":"json"}'- test_mcp_tool "sparc_mode" '{"mode":"dev","task_description":"test development task"}'- test_mcp_tool "automation_setup" '{"rules":[{"trigger":"event","action":"response"}]}'- test_mcp_tool "pipeline_create" '{"config":{"stages":["build","test","deploy"]}}'- test_mcp_tool "scheduler_manage" '{"action":"create","schedule":{"cron":"0 0 * * *"}}'- test_mcp_tool "trigger_setup" '{"events":["push"],"actions":["build"]}'- test_mcp_tool "workflow_template" '{"action":"create","template":{"name":"ci_template"}}'- test_mcp_tool "batch_process" '{"items":["item1","item2"],"operation":"transform"}'- test_mcp_tool "parallel_execute" '{"tasks":[{"id":"task1"},{"id":"task2"}]}'-}--test_github_tools() {- log_info "Testing GitHub Integration Tools (8 tools)"-- test_mcp_tool "github_repo_analyze" '{"repo":"test/repo","analysis_type":"code_quality"}'- test_mcp_tool "github_pr_manage" '{"repo":"test/repo","action":"review","pr_number":1}'- test_mcp_tool "github_issue_track" '{"repo":"test/repo","action":"list"}'- test_mcp_tool "github_release_coord" '{"repo":"test/repo","version":"v1.0.0"}'- test_mcp_tool "github_workflow_auto" '{"repo":"test/repo","workflow":{"name":"ci"}}'- test_mcp_tool "github_code_review" '{"repo":"test/repo","pr":1}'- test_mcp_tool "github_sync_coord" '{"repos":["repo1","repo2"]}'- test_mcp_tool "github_metrics" '{"repo":"test/repo"}'-}--test_daa_tools() {- log_info "Testing DAA Tools (8 tools)"-- test_mcp_tool "daa_agent_create" '{"agent_type":"worker","capabilities":["compute","storage"]}'- test_mcp_tool "daa_capability_match" '{"task_requirements":["cpu","memory"],"available_agents":[]}'- test_mcp_tool "daa_resource_alloc" '{"resources":{"cpu":2,"memory":"4GB"},"agents":["agent1"]}'- test_mcp_tool "daa_lifecycle_manage" '{"agentId":"test-agent","action":"start"}'- test_mcp_tool "daa_communication" '{"from":"agent1","to":"agent2","message":{"type":"task","data":"test"}}'- test_mcp_tool "daa_consensus" '{"agents":["agent1","agent2"],"proposal":{"action":"migrate"}}'- test_mcp_tool "daa_fault_tolerance" '{"agentId":"test-agent","strategy":"retry"}'- test_mcp_tool "daa_optimization" '{"target":"throughput","metrics":["latency","cpu"]}'-}--test_system_tools() {- log_info "Testing System & Utilities Tools (8 tools)"-- test_mcp_tool "terminal_execute" '{"command":"echo","args":["hello"]}'- test_mcp_tool "config_manage" '{"action":"get","config":{"section":"general"}}'- test_mcp_tool "features_detect" '{"component":"mcp_server"}'- test_mcp_tool "security_scan" '{"target":"localhost","depth":"basic"}'- test_mcp_tool "backup_create" '{"components":["config","data"],"destination":"/tmp/backup"}'- test_mcp_tool "restore_system" '{"backupId":"backup_123"}'- test_mcp_tool "log_analysis" '{"logFile":"/var/log/app.log","patterns":["ERROR","WARN"]}'- test_mcp_tool "diagnostic_run" '{"components":["network","disk","memory"]}'-}--# Test persistence by running multiple operations-test_persistence() {- log_info "Testing data persistence across operations"-- # Store data- test_mcp_tool "memory_usage" '{"action":"store","key":"persist_test","value":"test_data_123"}'-- # Retrieve data- test_mcp_tool "memory_usage" '{"action":"retrieve","key":"persist_test"}'-- # Verify data persisted- if [ -f "/test/results/memory_usage_result.json" ]; then- local retrieved_value=$(jq -r '.value' /test/results/memory_usage_result.json)- if [ "$retrieved_value" = "test_data_123" ] || [ "$retrieved_value" = "Retrieved value for persist_test" ]; then- log_success "Data persistence test passed"- return 0- else- log_error "Data persistence test failed - value mismatch"- return 1- fi- else- log_error "Data persistence test failed - no result file"- return 1- fi-}--# Generate final report-generate_report() {- log_info "Generating final test report"-- local total_tests=$(jq -r '.results | length' /test/results/test_results.json)- local successful_tests=$(jq -r '.results | to_entries | map(select(.value.status == "success")) | length' /test/results/test_results.json)- local success_rate=$(echo "scale=2; $successful_tests * 100 / $total_tests" | bc)- local avg_duration=$(jq -r '.results | to_entries | map(.value.duration) | add / length' /test/results/test_results.json)-- # Update final results- local temp_file=$(mktemp)- jq --arg end_time "$(date -Iseconds)" --arg total "$total_tests" --arg successful "$successful_tests" \- --arg success_rate "$success_rate" --arg avg_duration "$avg_duration" \- '.test_end = $end_time | .summary = {"total_tests": ($total | tonumber), "successful_tests": ($successful | tonumber), "success_rate": ($success_rate | tonumber), "avg_duration": ($avg_duration | tonumber)}' \- /test/results/test_results.json > "$temp_file" && mv "$temp_file" /test/results/test_results.json-- log_success "Test Report Summary:"- log_success "Total Tests: $total_tests"- log_success "Successful: $successful_tests"- log_success "Success Rate: ${success_rate}%"- log_success "Average Duration: ${avg_duration}s"-- # Output final JSON report- cat /test/results/test_results.json-}--# Main execution-main() {- log_info "Starting MCP Tool Testing with $INSTALL_METHOD installation method"- init_results-- case $CATEGORY in- "swarm")- test_swarm_tools- ;;- "neural")- test_neural_tools- ;;- "memory")- test_memory_tools- ;;- "analysis")- test_analysis_tools- ;;- "workflow")- test_workflow_tools- ;;- "github")- test_github_tools- ;;- "daa")- test_daa_tools- ;;- "system")- test_system_tools- ;;- "all")- test_swarm_tools- test_neural_tools- test_memory_tools- test_analysis_tools- test_workflow_tools- test_github_tools- test_daa_tools- test_system_tools- test_persistence- ;;- *)- log_error "Unknown category: $CATEGORY"- exit 1- ;;- esac-- generate_report-}--# Execute main function-main "$@"\ No newline at end of filediff --git a/memory/memory-store.json b/memory/memory-store.jsondeleted file mode 100644index f95e2527ed..0000000000--- a/memory/memory-store.json+++ /dev/null@@ -1,112 +0,0 @@-{- "default": [- {- "key": "key18",- "value": "value18",- "namespace": "default",- "timestamp": 1751683807565- },- {- "key": "research/neural-interfaces/key-findings",- "value": "NEURAL INTERFACE KEY FINDINGS: NON-INVASIVE: EEG (1-5ms temporal, 5-10cm spatial, 9-50k+), fNIRS (blood oxygenation, 1-3cm spatial), MEG (<1ms temporal, 2-5mm spatial, -3M), Transcranial stim (TMS/tDCS/tACS). INVASIVE: Utah Arrays (96-100 electrodes, FDA approved), Michigan Probes (less damage, customizable), Neuralink-style (1024+ flexible electrodes, wireless), ECoG (surface arrays). SIGNAL PROCESSING: CSP (80-90% motor imagery), ICA (artifact removal), Deep Learning (EEGNet, Transformers, 70-95% accuracy). FRAMEWORKS: OpenBCI, BCI2000, MNE-Python, EEGLAB/BCILAB. SAFETY: FDA Class II/III, ISO 14708, ISO 10993, Pt/Ir electrodes. FUTURE: 10k+ channels, bidirectional, edge AI, biodegradable.",- "namespace": "default",- "timestamp": 1752018127114- },- {- "key": "research/neural-interfaces/commercial-systems",- "value": "COMMERCIAL BCI SYSTEMS: Consumer: Emotiv EPOC X (49, 14ch), NeuroSky MindWave (9, 1ch), Muse headband (49, 4ch). Research: g.tec g.USBamp (256ch), Brain Products actiCHamp Plus (160ch), NIRx NIRSport2 (64ch fNIRS), Kernel Flow (full-head fNIRS). Clinical: Utah Array/BrainGate (FDA approved), NeuroPace RNS (epilepsy), Medtronic DBS. High-end: MEGIN TRIUX neo (306ch MEG), CTF MEG (275ch). Development: OpenBCI Cyton (8ch, 99), Ganglion (4ch, 99).",- "namespace": "default",- "timestamp": 1752018139320- },- {- "key": "research/neural-interfaces/performance-benchmarks",- "value": "BCI PERFORMANCE BENCHMARKS: Motor Imagery 4-class: 70-80% accuracy. P300 Speller: 90-95% accuracy. Emotion Recognition: 60-75% accuracy. Sleep Stage Classification: 80-85% accuracy. Single neuron decoding: 95%+ (invasive). Speech decoding: 70-80 WPM (invasive). Cursor control: 6-8 targets/min (invasive), 2-4 targets/min (non-invasive). Information transfer rates: 1-3 bits/s (non-invasive), 3-5 bits/s (invasive). Training time: 10-30 min calibration typical.",- "namespace": "default",- "timestamp": 1752018149865- },- {- "key": "safety/critical-limits",- "value": "{\"electrical\":{\"current_density_max_uA_mm2\":2.0,\"voltage_dc_noninvasive_V\":5.0,\"voltage_dc_invasive_V\":0.5,\"charge_injection_max_uC_cm2\":30.0,\"pulse_duration_max_ms\":1.0,\"leakage_current_max_uA\":10.0,\"isolation_voltage_kV\":4.0},\"thermal\":{\"temperature_rise_max_C\":2.0,\"absolute_temp_max_C\":41.0,\"power_density_max_mW_cm2\":40.0,\"thermal_shutdown_C\":41.0},\"temporal\":{\"duty_cycle_max_percent\":50,\"session_duration_max_min\":120,\"break_interval_min\":30,\"watchdog_timeout_ms\":100},\"cognitive\":{\"information_rate_max_bps\":100,\"frequency_sensory_max_Hz\":1000,\"frequency_motor_max_Hz\":100,\"frequency_cognitive_max_Hz\":40},\"emergency\":{\"estop_response_ms\":10,\"power_removal_ms\":50,\"disconnect_time_ms\":50,\"alert_time_ms\":1000},\"safety_factors\":{\"current_safety_factor\":1.1,\"voltage_safety_factor\":1.05,\"temperature_margin_C\":2.0}}",- "namespace": "default",- "timestamp": 1752018150613- },- {- "key": "research/neural-interfaces/safety-regulations",- "value": "BCI SAFETY REGULATIONS: FDA: Class II non-invasive (510k), Class III invasive (PMA). ISO 14708: Active implantable devices. ISO 10993: Biocompatibility (cytotoxicity, sensitization, irritation, systemic toxicity, genotoxicity, implantation). IEC 60601: Electrical safety. IEC 62304: Software validation. Materials: Platinum/Iridium electrodes, Parylene-C insulation, medical silicone, titanium packaging. Clinical trials required for Class III. MRI compatibility testing. EMC testing. Hermetic sealing for implants.",- "namespace": "default",- "timestamp": 1752018160824- },- {- "key": "safety/emergency-protocols",- "value": "{\"immediate_disconnect\":{\"user_initiated\":[\"physical_estop\",\"voice_command\",\"triple_tap\"],\"system_initiated\":[\"safety_violation\",\"power_loss\",\"component_failure\"],\"response_time_ms\":10},\"medical_response\":{\"auto_alert\":true,\"telemedicine_enabled\":true,\"first_responder_access\":true,\"transport_mode\":\"safe_state\"},\"panic_response\":{\"triggers\":[\"physical_button\",\"voice_help\",\"software_button\"],\"actions\":[\"immediate_disconnect\",\"alert_contacts\",\"log_state\",\"recovery_mode\"]}}",- "namespace": "default",- "timestamp": 1752018161838- },- {- "key": "safety/compliance-requirements",- "value": "{\"standards\":{\"FDA\":\"Class_II_III\",\"CE\":\"MDR_compliant\",\"ISO\":[\"14708\",\"10993\",\"14971\",\"14155\"],\"IEC\":[\"60601-1\",\"60601-1-2\",\"62304\"]},\"testing\":{\"electrical_safety\":\"IEC_60601-1\",\"EMC\":\"IEC_60601-1-2\",\"biocompatibility\":\"ISO_10993_series\",\"software\":\"IEC_62304\"},\"documentation\":{\"DHF\":\"required\",\"risk_management\":\"ISO_14971\",\"clinical_evaluation\":\"ongoing\",\"post_market_surveillance\":\"active\"}}",- "namespace": "default",- "timestamp": 1752018174195- },- {- "key": "design/architecture/decisions",- "value": "Architecture decisions for Neural Link Hive Integration: 1) Microservice architecture for scalability and modularity. 2) Real-time processing pipeline with <50ms end-to-end latency requirement. 3) Multi-layer safety system with hardware kill switches and software monitors. 4) Hybrid C++/Rust core for performance with Python prototyping layer. 5) Time-series database (InfluxDB/TimescaleDB) for neural pattern storage. 6) End-to-end encryption with neural signature authentication. 7) Support for 256 channels at 30kHz sampling rate. 8) Modular hardware abstraction layer for multiple BCI devices. 9) Bidirectional communication with feedback encoding. 10) GPU acceleration for neural decoding. 11) Kubernetes-based deployment for production scalability. 12) Comprehensive safety monitoring with emergency shutoff in <5ms.",- "namespace": "default",- "timestamp": 1752018181435- },- {- "key": "design/architecture/tech-stack",- "value": "Technical Stack: OS: Real-time Linux with PREEMPT_RT. Languages: C++17/20 for signal processing, Rust for memory-safe components, CUDA for GPU acceleration, Python for prototypes. Databases: InfluxDB for time-series neural data, PostgreSQL for patterns, Redis for caching. Communication: gRPC internal, WebRTC streaming, custom TCP for hive. Key Libraries: Eigen for linear algebra, TensorFlow C++ API for ML, OpenCL for cross-platform GPU.",- "namespace": "default",- "timestamp": 1752018192664- },- {- "key": "architecture/decisions",- "value": "{\"module\": \"shared-memory\", \"decisions\": [\"Use SQLite with better-sqlite3 for persistence\", \"Create unified module supporting both .swarm/ and .hive-mind/ directories\", \"Implement base SharedMemory class with core methods\", \"Extend with SwarmMemory for MCP-specific needs\", \"Design flexible schema with migration support\", \"Optimize for performance with caching and pooling\"]}",- "namespace": "default",- "timestamp": 1752116024819- },- {- "key": "test-key",- "value": "Test value for persistence",- "namespace": "default",- "timestamp": 1752116037136- },- {- "key": "restart-test",- "value": "Value before restart",- "namespace": "default",- "timestamp": 1752116074406- },- {- "key": "integration/architecture-found",- "value": "Found SharedMemory module at src/memory/shared-memory.js created by Architecture Agent",- "namespace": "default",- "timestamp": 1752116118573- },- {- "key": "integration/mcp-update-decision",- "value": "Updating MCP server to use SharedMemory class from src/memory/shared-memory.js for memory_usage tool implementation",- "namespace": "default",- "timestamp": 1752116136755- },- {- "key": "integration/completed-tasks",- "value": "Integrated SharedMemory into MCP server, updated init command to create .swarm directory and initialize SQLite database, incremented version to 1.0.44",- "namespace": "default",- "timestamp": 1752116309680- },- {- "key": "testing/complete",- "value": "Testing Agent has completed comprehensive testing. Results: Local persistence PASSED, NPM partially passed, Docker skipped, Regression PASSED. Full report at test-results/memory-persistence-test-report.md",- "namespace": "default",- "timestamp": 1752116402654- },- {- "key": "architecture/memory-module-completed",- "value": "{\"status\": \"completed\", \"files_created\": [\"shared-memory.js\", \"swarm-memory.js\", \"index.js\", \"migration.js\", \"test-example.js\", \"README.md\"], \"features\": [\"SQLite persistence\", \"LRU caching\", \"Migration support\", \"TTL support\", \"Swarm-specific features\", \"MCP integration\"], \"timestamp\": \"2025-07-10T03:00:19Z\"}",- "namespace": "default",- "timestamp": 1752116421782- }- ]-}\ No newline at end of file