From c28783eb045ea887e43e92980c8dec46d94c1a48 Mon Sep 17 00:00:00 2001 From: rUv Date: Wed, 6 Aug 2025 01:20:42 +0000 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=96=20Checkpoint:=20Edit=20/workspaces?= =?UTF-8?q?/claude-code-flow/benchmark/src/swarm=5Fbenchmark/claude=5Fopti?= =?UTF-8?q?mizer/optimizer.py?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- benchmark/.claude/checkpoints/1754443238.json | 1 + benchmark/.claude/checkpoints/1754443239.json | 1 + .../claude_optimizer/optimizer.py | 42 ++++++++++++++++++- 3 files changed, 43 insertions(+), 1 deletion(-) create mode 100644 benchmark/.claude/checkpoints/1754443238.json create mode 100644 benchmark/.claude/checkpoints/1754443239.json diff --git a/benchmark/.claude/checkpoints/1754443238.json b/benchmark/.claude/checkpoints/1754443238.json new file mode 100644 index 0000000000..8ec10ef989 --- /dev/null +++ b/benchmark/.claude/checkpoints/1754443238.json @@ -0,0 +1 @@ +{"branch": "checkpoint/pre-edit-20250806-012038", "file": "/workspaces/claude-code-flow/benchmark/src/swarm_benchmark/automation/decision_engine.py", "timestamp": "2025-08-06T01:20:38Z", "type": "pre-edit", "original_branch": "alpha-88"} diff --git a/benchmark/.claude/checkpoints/1754443239.json b/benchmark/.claude/checkpoints/1754443239.json new file mode 100644 index 0000000000..1d54311d89 --- /dev/null +++ b/benchmark/.claude/checkpoints/1754443239.json @@ -0,0 +1 @@ +{"tag": "checkpoint-20250806-012039", "file": "/workspaces/claude-code-flow/benchmark/src/swarm_benchmark/automation/decision_engine.py", "timestamp": "2025-08-06T01:20:39Z", "type": "post-edit", "branch": "alpha-88", "diff_summary": " .claude-flow/metrics/performance.json | 4 +- .claude-flow/metrics/system-metrics.json | 324 +++++++++++++++++++ benchmark/.claude-flow/metrics/performance.json | 2 +- benchmark/.claude-flow/metrics/task-metrics.json | 6 +- benchmark/.claude/checkpoints/1754443228.json | 1 + benchmark/.claude/checkpoints/1754443230.json | 1 + .../swarm_benchmark/automation/decision_engine.py | 359 +++++++++++++++++++++ .../__pycache__/__init__.cpython-312.pyc | Bin 606 -> 738 bytes .../config/__pycache__/__init__.cpython-312.pyc | Bin 891 -> 524 bytes .../mle_star/__pycache__/__init__.cpython-312.pyc | Bin 986 -> 1091 bytes claude-flow-wiki | 0 11 files changed, 691 insertions(+), 6 deletions(-) "} diff --git a/benchmark/src/swarm_benchmark/claude_optimizer/optimizer.py b/benchmark/src/swarm_benchmark/claude_optimizer/optimizer.py index 9486dad09f..0da5dcac3e 100644 --- a/benchmark/src/swarm_benchmark/claude_optimizer/optimizer.py +++ b/benchmark/src/swarm_benchmark/claude_optimizer/optimizer.py @@ -625,4 +625,44 @@ class ClaudeMdOptimizer: parallel_score * weights["parallel_efficiency"] ) - return min(1.0, max(0.0, total_score)) \ No newline at end of file + return min(1.0, max(0.0, total_score)) + + def _optimize_swarm(self, config: Dict, target_value: Any) -> Dict: + """Optimize swarm coordination settings.""" + optimized = config.copy() + + # Optimize topology based on use case + if config.get("use_case") in ["ml_pipeline", "testing_automation"]: + optimized["swarm_topology"] = "mesh" + elif config.get("use_case") in ["api_development", "documentation"]: + optimized["swarm_topology"] = "hierarchical" + + # Add coordination rules + if "critical_rules" not in optimized: + optimized["critical_rules"] = [] + + optimized["critical_rules"].extend([ + "Enable swarm memory synchronization", + "Use collective decision making", + "Implement agent load balancing" + ]) + + return optimized + + def _optimize_tools(self, config: Dict, target_value: Any) -> Dict: + """Optimize tool selection and priorities.""" + optimized = config.copy() + + # Set tool priorities based on use case + use_case = config.get("use_case", "") + + if use_case == "api_development": + optimized["tool_priorities"] = ["MultiEdit", "Edit", "Bash", "Grep"] + elif use_case == "ml_pipeline": + optimized["tool_priorities"] = ["MultiEdit", "Bash", "Edit", "Read"] + elif use_case == "performance_optimization": + optimized["tool_priorities"] = ["Bash", "MultiEdit", "Grep", "Edit"] + else: + optimized["tool_priorities"] = ["MultiEdit", "Edit", "Read", "Bash"] + + return optimized \ No newline at end of file