Skip to content

armgit / ruflo

Public Imported from GitHub
0

🌊 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

πŸ”– Checkpoint: Edit /workspaces/claude-code-flow/benchmark/src/swarm_benchmark/cli/main.py

rUv3b68157c5ff2
diff --git a/.claude/checkpoints/task-1754479611.json b/.claude/checkpoints/task-1754479611.json
new file mode 100644
index 0000000000..97b6cb831b
--- /dev/null
+++ b/.claude/checkpoints/task-1754479611.json
@@ -0,0 +1 @@
+{"checkpoint": "task-20250806-112649", "task": "@ruvnet ➜ /workspaces/claude-code-flow (alpha-88) $ swarm-benchmark real hive-mind "Design hello w", "timestamp": "2025-08-06T11:26:51Z", "commit": "b2a68baeabe65acfad031d491370715fcb43ab99", "github_release": "true"}
diff --git a/benchmark/src/swarm_benchmark/cli/main.py b/benchmark/src/swarm_benchmark/cli/main.py
index 6fea4bd23a..a68816cb04 100644
--- a/benchmark/src/swarm_benchmark/cli/main.py
+++ b/benchmark/src/swarm_benchmark/cli/main.py
@@ -323,6 +323,130 @@ def swarm(ctx, objective, strategy, mode, sparc_mode, all_modes, max_agents, tim
return 0
[email protected]('hive-mind')
[email protected]('--queen-type',
+ type=click.Choice(['strategic', 'tactical', 'adaptive']),
+ default='strategic',
+ help='Queen coordinator type (default: strategic)')
[email protected]('--max-workers', type=int, default=8, help='Maximum worker agents (default: 8)')
[email protected]('--consensus',
+ type=click.Choice(['majority', 'weighted', 'byzantine']),
+ default='majority',
+ help='Consensus algorithm (default: majority)')
[email protected]('--timeout', type=int, default=60, help='Timeout in minutes (default: 60)')
[email protected]('--monitor', is_flag=True, help='Enable monitoring')
[email protected]('--output-dir', type=click.Path(), default='./reports',
+ help='Output directory (default: ./reports)')
+def hive_mind(ctx, task, queen_type, max_workers, consensus, timeout, monitor, output_dir):
+ """Run real claude-flow hive-mind benchmarks.
+
+ TASK: The task for the hive-mind to accomplish
+
+ Examples:
+ swarm-benchmark real hive-mind "Design architecture" --max-workers 8
+ swarm-benchmark real hive-mind "Solve problem" --queen-type adaptive
+ swarm-benchmark real hive-mind "Build system" --consensus byzantine
+ """
+ if ctx.obj.get('verbose'):
+ click.echo(f"Running real hive-mind benchmark")
+ click.echo(f"Task: {task}")
+ click.echo(f"Queen Type: {queen_type}")
+ click.echo(f"Max Workers: {max_workers}")
+ click.echo(f"Consensus: {consensus}")
+
+ # Execute real hive-mind command
+ try:
+ from ..core.claude_flow_real_executor import ClaudeFlowRealExecutor
+ executor = ClaudeFlowRealExecutor()
+
+ result = executor.execute_hive_mind(
+ task=task,
+ queen_type=queen_type,
+ max_workers=max_workers,
+ consensus=consensus,
+ timeout=timeout * 60,
+ monitor=monitor
+ )
+
+ if result.success:
+ click.echo(f"βœ… Hive-mind benchmark completed!")
+ click.echo(f"πŸ“Š Results saved to: {output_dir}")
+ if ctx.obj.get('verbose'):
+ click.echo(f"Execution time: {result.duration:.2f}s")
+ click.echo(f"Workers spawned: {result.metrics.get('workers_spawned', 'N/A')}")
+ else:
+ click.echo(f"❌ Hive-mind benchmark failed: {result.error}")
+ return 1
+
+ except Exception as e:
+ click.echo(f"❌ Error running hive-mind: {e}")
+ return 1
+
+ return 0
+
+
[email protected]('mode', type=click.Choice(['coder', 'architect', 'tdd', 'reviewer', 'tester',
+ 'optimizer', 'documenter', 'debugger']))
[email protected]('--namespace', help='Memory namespace')
[email protected]('--timeout', type=int, default=60, help='Timeout in minutes (default: 60)')
[email protected]('--non-interactive', is_flag=True, default=True, help='Non-interactive mode (default: True)')
[email protected]('--output-dir', type=click.Path(), default='./reports',
+ help='Output directory (default: ./reports)')
+def sparc(ctx, mode, task, namespace, timeout, non_interactive, output_dir):
+ """Run real claude-flow SPARC mode benchmarks.
+
+ MODE: The SPARC mode to use (coder, architect, tdd, etc.)
+ TASK: The task to accomplish
+
+ Examples:
+ swarm-benchmark real sparc coder "Implement authentication"
+ swarm-benchmark real sparc architect "Design microservices"
+ swarm-benchmark real sparc tdd "Create test suite"
+ swarm-benchmark real sparc reviewer "Review codebase"
+ """
+ if ctx.obj.get('verbose'):
+ click.echo(f"Running real SPARC benchmark")
+ click.echo(f"Mode: {mode}")
+ click.echo(f"Task: {task}")
+ if namespace:
+ click.echo(f"Namespace: {namespace}")
+
+ # Execute real SPARC command
+ try:
+ from ..core.claude_flow_real_executor import ClaudeFlowRealExecutor
+ executor = ClaudeFlowRealExecutor()
+
+ result = executor.execute_sparc(
+ mode=mode,
+ task=task,
+ namespace=namespace,
+ timeout=timeout * 60,
+ non_interactive=non_interactive
+ )
+
+ if result.success:
+ click.echo(f"βœ… SPARC {mode} benchmark completed!")
+ click.echo(f"πŸ“Š Results saved to: {output_dir}")
+ if ctx.obj.get('verbose'):
+ click.echo(f"Execution time: {result.duration:.2f}s")
+ if result.total_tokens:
+ click.echo(f"Tokens used: {result.total_tokens}")
+ else:
+ click.echo(f"❌ SPARC benchmark failed: {result.error}")
+ return 1
+
+ except Exception as e:
+ click.echo(f"❌ Error running SPARC: {e}")
+ return 1
+
+ return 0
+
+
async def _run_benchmark(objective: str, config: BenchmarkConfig, use_real_metrics: bool = False) -> Optional[dict]:
"""Run a benchmark with the given objective and configuration."""
# Choose engine based on metrics flag
diff --git a/reports/metrics_f68e7f0f-945b-4cda-afdf-01c3a8803067.json b/reports/metrics_f68e7f0f-945b-4cda-afdf-01c3a8803067.json
new file mode 100644
index 0000000000..27381062ec
--- /dev/null
+++ b/reports/metrics_f68e7f0f-945b-4cda-afdf-01c3a8803067.json
@@ -0,0 +1,66 @@
+{
+ "summary": {
+ "wall_clock_time": 3.6338698863983154,
+ "tasks_per_second": 0.2751887192612565,
+ "success_rate": 1.0,
+ "peak_memory_mb": 0.0,
+ "average_cpu_percent": 0.0
+ },
+ "performance": {
+ "average_duration": 0.0,
+ "median_duration": 0.0,
+ "p95_duration": 0.0,
+ "p99_duration": 0.0,
+ "total_cpu_seconds": 0.0
+ },
+ "resources": {
+ "memory": {
+ "peak_mb": 0.0,
+ "average_mb": 0.0
+ },
+ "cpu": {
+ "average_percent": 0.0,
+ "total_seconds": 0.0
+ },
+ "io": {
+ "disk_read_mb": 0.0,
+ "disk_write_mb": 0.0,
+ "network_sent_mb": 0.0,
+ "network_recv_mb": 0.0
+ }
+ },
+ "processes": {
+ "total": 1,
+ "peak_threads": 0,
+ "peak_fds": 0
+ },
+ "output": {
+ "total_size": 1,
+ "average_size": 1,
+ "complexity_score": 0.2751887192612565
+ },
+ "collectors": {
+ "performance": 1,
+ "resource": 1
+ },
+ "timestamp": "2025-08-06T11:27:45.725465",
+ "process_executions": {
+ "sparc:{\"positional\": [\"coder\", \"Design hello world in ./hello-bench/\"]}": {
+ "command_type": "sparc",
+ "args": {
+ "positional": [
+ "coder",
+ "Design hello world in ./hello-bench/"
+ ]
+ },
+ "execution_count": 1,
+ "success_count": 1,
+ "failure_count": 0,
+ "success_rate": 1.0,
+ "average_duration": 2.6313893795013428,
+ "total_duration": 2.6313893795013428,
+ "average_memory_mb": 51.32512019230769,
+ "peak_memory_mb": 71.80859375
+ }
+ }
+}
\ No newline at end of file
diff --git a/reports/process_report_f68e7f0f-945b-4cda-afdf-01c3a8803067.json b/reports/process_report_f68e7f0f-945b-4cda-afdf-01c3a8803067.json
new file mode 100644
index 0000000000..f248432260
--- /dev/null
+++ b/reports/process_report_f68e7f0f-945b-4cda-afdf-01c3a8803067.json
@@ -0,0 +1,47 @@
+{
+ "summary": {
+ "total_executions": 1,
+ "successful_executions": 1,
+ "failed_executions": 0,
+ "overall_success_rate": 1.0,
+ "total_duration": 2.6313893795013428,
+ "average_duration": 2.6313893795013428,
+ "peak_memory_mb": 71.80859375,
+ "average_memory_mb": 51.32512019230769,
+ "total_output_lines": 1,
+ "total_errors": 1
+ },
+ "command_statistics": {
+ "sparc:{\"positional\": [\"coder\", \"Design hello world in ./hello-bench/\"]}": {
+ "command_type": "sparc",
+ "args": {
+ "positional": [
+ "coder",
+ "Design hello world in ./hello-bench/"
+ ]
+ },
+ "execution_count": 1,
+ "success_count": 1,
+ "failure_count": 0,
+ "success_rate": 1.0,
+ "average_duration": 2.6313893795013428,
+ "total_duration": 2.6313893795013428,
+ "average_memory_mb": 51.32512019230769,
+ "peak_memory_mb": 71.80859375
+ }
+ },
+ "executions": [
+ {
+ "command": "claude-flow sparc coder Design hello world in ./hello-bench/",
+ "exit_code": 0,
+ "success": true,
+ "duration": 2.6313893795013428,
+ "start_time": 1754479660.0887303,
+ "output_size": 1,
+ "error_count": 1,
+ "cpu_percent": 15.326923076923077,
+ "memory_mb": 51.32512019230769,
+ "peak_memory_mb": 71.80859375
+ }
+ ]
+}
\ No newline at end of file
diff --git a/reports/real-benchmark-development-centralized_f68e7f0f-945b-4cda-afdf-01c3a8803067.json b/reports/real-benchmark-development-centralized_f68e7f0f-945b-4cda-afdf-01c3a8803067.json
new file mode 100644
index 0000000000..fa203b93e3
--- /dev/null
+++ b/reports/real-benchmark-development-centralized_f68e7f0f-945b-4cda-afdf-01c3a8803067.json
@@ -0,0 +1,132 @@
+{
+ "id": "f68e7f0f-945b-4cda-afdf-01c3a8803067",
+ "name": "real-benchmark-development-centralized",
+ "description": "Real Benchmark: Design hello world in ./hello-bench/",
+ "status": "completed",
+ "config": {
+ "name": "real-benchmark-development-centralized",
+ "description": "Real Benchmark: Design hello world in ./hello-bench/",
+ "strategy": "development",
+ "mode": "centralized",
+ "max_agents": 5,
+ "max_tasks": 100,
+ "timeout": 3600,
+ "task_timeout": 300,
+ "max_retries": 3,
+ "parallel": false,
+ "background": false,
+ "monitoring": false,
+ "quality_threshold": 0.8,
+ "resource_limits": {
+ "max_memory_mb": 1024,
+ "max_cpu_percent": 80,
+ "max_network_mbps": 100
+ },
+ "output_formats": [
+ "json"
+ ],
+ "output_directory": "./reports",
+ "verbose": false
+ },
+ "tasks": [
+ {
+ "id": "ac1de6a2-1cf9-40f8-a3a7-69c7d8d92c25",
+ "objective": "Design hello world in ./hello-bench/",
+ "description": "Benchmark task: Design hello world in ./hello-bench/",
+ "strategy": "development",
+ "mode": "centralized",
+ "parameters": {},
+ "timeout": 300,
+ "max_retries": 3,
+ "priority": 1,
+ "status": "pending",
+ "created_at": "2025-08-06T11:27:40.088161",
+ "started_at": null,
+ "completed_at": null,
+ "duration": null,
+ "assigned_agents": [],
+ "parent_task_id": null,
+ "subtasks": [],
+ "dependencies": []
+ }
+ ],
+ "results": [
+ {
+ "id": "e1dde8ab-b6af-4daa-a912-270cea003155",
+ "task_id": "ac1de6a2-1cf9-40f8-a3a7-69c7d8d92c25",
+ "agent_id": "claude-flow",
+ "status": "success",
+ "output": {
+ "raw_output": "\u274c Failed to run SPARC mode: Deno is not defined",
+ "lines": [
+ "\u274c Failed to run SPARC mode: Deno is not defined"
+ ],
+ "sections": {}
+ },
+ "errors": [],
+ "warnings": [],
+ "performance_metrics": {
+ "execution_time": 2.5361697673797607,
+ "queue_time": 0.0,
+ "throughput": 0.3942953712570859,
+ "success_rate": 1.0,
+ "error_rate": 0.0,
+ "retry_count": 0,
+ "coordination_overhead": 0.0,
+ "communication_latency": 0.0
+ },
+ "quality_metrics": {
+ "accuracy_score": 0.0,
+ "completeness_score": 1.0,
+ "consistency_score": 0.0,
+ "relevance_score": 0.0,
+ "overall_quality": 0.5,
+ "review_score": null,
+ "automated_score": null
+ },
+ "resource_usage": {
+ "cpu_percent": 15.326923076923077,
+ "memory_mb": 51.32512019230769,
+ "network_bytes_sent": 0,
+ "network_bytes_recv": 0,
+ "disk_bytes_read": 6729728,
+ "disk_bytes_write": 0,
+ "peak_memory_mb": 71.80859375,
+ "average_cpu_percent": 15.326923076923077
+ },
+ "execution_details": {
+ "command": "claude-flow sparc coder Design hello world in ./hello-bench/",
+ "exit_code": 0,
+ "output_lines": 1,
+ "error_count": 1
+ },
+ "created_at": "2025-08-06T11:27:42.720729",
+ "started_at": "2025-08-06T11:27:40.088730",
+ "completed_at": "2025-08-06T11:27:42.720120",
+ "duration": 2.63139
+ }
+ ],
+ "metrics": {
+ "total_tasks": 1,
+ "completed_tasks": 1,
+ "failed_tasks": 0,
+ "total_agents": 0,
+ "active_agents": 0,
+ "average_execution_time": 0.0,
+ "total_execution_time": 3.6338698863983154,
+ "success_rate": 1.0,
+ "throughput": 0.2751887192612565,
+ "resource_efficiency": 0.0,
+ "coordination_efficiency": 1.0,
+ "quality_score": 0.0,
+ "peak_memory_usage": 0.0,
+ "total_cpu_time": 0.0,
+ "network_overhead": 0.0
+ },
+ "created_at": "2025-08-06T11:27:40.088187",
+ "started_at": "2025-08-06T11:27:40.088193",
+ "completed_at": "2025-08-06T11:27:42.720750",
+ "duration": 2.632557,
+ "error_log": [],
+ "metadata": {}
+}
\ No newline at end of file