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/run_swe_bench.py

rUva4941bcb0068
diff --git a/.claude/checkpoints/1754574059.json b/.claude/checkpoints/1754574059.json
new file mode 100644
index 0000000000..7dc13a4627
--- /dev/null
+++ b/.claude/checkpoints/1754574059.json
@@ -0,0 +1 @@
+{"branch": "checkpoint/pre-edit-20250807-134059", "file": "/workspaces/claude-code-flow/benchmark/src/swarm_benchmark/cli/main.py", "timestamp": "2025-08-07T13:40:59Z", "type": "pre-edit", "original_branch": "swe-bench"}
diff --git a/.claude/checkpoints/1754574061.json b/.claude/checkpoints/1754574061.json
new file mode 100644
index 0000000000..48eb93c924
--- /dev/null
+++ b/.claude/checkpoints/1754574061.json
@@ -0,0 +1 @@
+{"tag": "checkpoint-20250807-134101", "file": "/workspaces/claude-code-flow/benchmark/src/swarm_benchmark/cli/main.py", "timestamp": "2025-08-07T13:41:01Z", "type": "post-edit", "branch": "swe-bench", "diff_summary": " .claude-flow/metrics/performance.json | 2 +- .claude-flow/metrics/system-metrics.json | 312 ++++++++++++++++++++++++++++++ .claude-flow/metrics/task-metrics.json | 6 +- .claude/checkpoints/1754574030.json | 1 + .claude/checkpoints/1754574032.json | 1 + benchmark/src/swarm_benchmark/cli/main.py | 3 + 6 files changed, 321 insertions(+), 4 deletions(-) "}
diff --git a/benchmark/run_swe_bench.py b/benchmark/run_swe_bench.py
new file mode 100644
index 0000000000..61d194026c
--- /dev/null
+++ b/benchmark/run_swe_bench.py
@@ -0,0 +1,139 @@
+#!/usr/bin/env python3
+"""
+SWE-Bench Runner - Software Engineering Benchmark for Claude Flow
+
+This script runs comprehensive benchmarks to evaluate Claude Flow's
+software engineering capabilities across multiple domains.
+"""
+
+import asyncio
+import sys
+import argparse
+from pathlib import Path
+
+# Add src to path
+sys.path.insert(0, str(Path(__file__).parent / "src"))
+
+from swarm_benchmark.swe_bench import SWEBenchEngine
+from swarm_benchmark.core.models import BenchmarkConfig, StrategyType, CoordinationMode
+
+
+async def main():
+ parser = argparse.ArgumentParser(description="SWE-Bench Runner for Claude Flow")
+ parser.add_argument(
+ "--categories",
+ nargs="+",
+ choices=["code_generation", "bug_fix", "refactoring", "testing",
+ "documentation", "code_review", "performance"],
+ help="Categories to benchmark"
+ )
+ parser.add_argument(
+ "--difficulty",
+ choices=["easy", "medium", "hard"],
+ help="Filter by difficulty level"
+ )
+ parser.add_argument(
+ "--optimize",
+ action="store_true",
+ help="Enable optimization iterations"
+ )
+ parser.add_argument(
+ "--iterations",
+ type=int,
+ default=1,
+ help="Number of iterations (default: 1)"
+ )
+ parser.add_argument(
+ "--strategy",
+ choices=["development", "optimization", "testing", "analysis"],
+ default="development",
+ help="Execution strategy"
+ )
+ parser.add_argument(
+ "--mode",
+ choices=["hierarchical", "mesh", "distributed", "centralized"],
+ default="hierarchical",
+ help="Coordination mode"
+ )
+ parser.add_argument(
+ "--agents",
+ type=int,
+ default=5,
+ help="Maximum number of agents"
+ )
+ parser.add_argument(
+ "--output",
+ type=str,
+ default="benchmark/swe-bench/reports",
+ help="Output directory for reports"
+ )
+
+ args = parser.parse_args()
+
+ # Create configuration
+ config = BenchmarkConfig(
+ name="SWE-Bench",
+ description="Software Engineering Benchmark",
+ strategy=StrategyType[args.strategy.upper()],
+ mode=CoordinationMode[args.mode.upper()],
+ max_agents=args.agents,
+ output_directory=args.output
+ )
+
+ # Initialize engine
+ engine = SWEBenchEngine(config)
+
+ print(f"""
+╔══════════════════════════════════════════════════════════════╗
+β•‘ SWE-Bench for Claude Flow β•‘
+β•‘ Software Engineering Benchmark Suite β•‘
+β•šβ•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•
+
+Configuration:
+ Strategy: {args.strategy}
+ Mode: {args.mode}
+ Agents: {args.agents}
+ Iterations: {args.iterations}
+ Optimize: {args.optimize}
+ Categories: {args.categories or 'All'}
+ Difficulty: {args.difficulty or 'All'}
+""")
+
+ # Run benchmark
+ results = await engine.run_swe_benchmark(
+ categories=args.categories,
+ difficulty=args.difficulty,
+ optimize=args.optimize,
+ iterations=args.iterations
+ )
+
+ # Display results
+ summary = results.get('summary', {})
+ final_perf = summary.get('final_performance', {})
+
+ print(f"""
+╔══════════════════════════════════════════════════════════════╗
+β•‘ BENCHMARK RESULTS β•‘
+β•šβ•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•
+
+πŸ“Š Final Performance:
+ Success Rate: {final_perf.get('success_rate', 0):.1%}
+ Tasks Completed: {final_perf.get('successful_tasks', 0)}/{final_perf.get('total_tasks', 0)}
+ Average Duration: {final_perf.get('average_duration', 0):.2f}s
+""")
+
+ if args.optimize and summary.get('improvement'):
+ imp = summary['improvement']
+ print(f"""
+πŸ“ˆ Optimization Impact:
+ Success Rate Change: {imp.get('success_rate_change', 0):+.1%}
+ Duration Change: {imp.get('duration_change', 0):+.2f}s
+ Optimization Effective: {'βœ… Yes' if imp.get('optimization_effective') else '❌ No'}
+""")
+
+ print(f"\nβœ… Full report saved to: {config.output_directory}")
+ print("\n" + "="*60)
+
+
+if __name__ == "__main__":
+ asyncio.run(main())
\ No newline at end of file