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

πŸ”– Task: reply to issue with detailed status, clean up the md files in /benchmark/, run optmization process, ...

rUv0349a0f67009
diff --git a/.claude-flow/metrics/performance.json b/.claude-flow/metrics/performance.json
index c5dd71214c..24f02d68b7 100644
--- a/.claude-flow/metrics/performance.json
+++ b/.claude-flow/metrics/performance.json
@@ -1,7 +1,7 @@
{
- "startTime": 1754443386288,
- "totalTasks": 2,
- "successfulTasks": 2,
+ "startTime": 1754444016854,
+ "totalTasks": 1,
+ "successfulTasks": 1,
"failedTasks": 0,
"totalAgents": 0,
"activeAgents": 0,
diff --git a/.claude-flow/metrics/system-metrics.json b/.claude-flow/metrics/system-metrics.json
index 9d22d21143..8ab848b85f 100644
--- a/.claude-flow/metrics/system-metrics.json
+++ b/.claude-flow/metrics/system-metrics.json
@@ -4558,5 +4558,329 @@
"cpuLoad": 0.22625,
"platform": "linux",
"uptime": 11532.84
+ },
+ {
+ "timestamp": 1754443494247,
+ "memoryTotal": 67427545088,
+ "memoryUsed": 6335787008,
+ "memoryFree": 61091758080,
+ "memoryUsagePercent": 9.396437316131168,
+ "memoryEfficiency": 90.60356268386883,
+ "cpuCount": 16,
+ "cpuLoad": 0.203125,
+ "platform": "linux",
+ "uptime": 11562.87
+ },
+ {
+ "timestamp": 1754443524257,
+ "memoryTotal": 67427545088,
+ "memoryUsed": 6381846528,
+ "memoryFree": 61045698560,
+ "memoryUsagePercent": 9.46474696605226,
+ "memoryEfficiency": 90.53525303394774,
+ "cpuCount": 16,
+ "cpuLoad": 0.233125,
+ "platform": "linux",
+ "uptime": 11592.88
+ },
+ {
+ "timestamp": 1754443554264,
+ "memoryTotal": 67427545088,
+ "memoryUsed": 6390419456,
+ "memoryFree": 61037125632,
+ "memoryUsagePercent": 9.477461247713874,
+ "memoryEfficiency": 90.52253875228612,
+ "cpuCount": 16,
+ "cpuLoad": 0.215,
+ "platform": "linux",
+ "uptime": 11622.88
+ },
+ {
+ "timestamp": 1754443584294,
+ "memoryTotal": 67427545088,
+ "memoryUsed": 6463959040,
+ "memoryFree": 60963586048,
+ "memoryUsagePercent": 9.586525850175706,
+ "memoryEfficiency": 90.4134741498243,
+ "cpuCount": 16,
+ "cpuLoad": 0.24625,
+ "platform": "linux",
+ "uptime": 11652.91
+ },
+ {
+ "timestamp": 1754443614324,
+ "memoryTotal": 67427545088,
+ "memoryUsed": 6370652160,
+ "memoryFree": 61056892928,
+ "memoryUsagePercent": 9.448144896400473,
+ "memoryEfficiency": 90.55185510359952,
+ "cpuCount": 16,
+ "cpuLoad": 0.208125,
+ "platform": "linux",
+ "uptime": 11682.94
+ },
+ {
+ "timestamp": 1754443644355,
+ "memoryTotal": 67427545088,
+ "memoryUsed": 6286069760,
+ "memoryFree": 61141475328,
+ "memoryUsagePercent": 9.322702987030034,
+ "memoryEfficiency": 90.67729701296997,
+ "cpuCount": 16,
+ "cpuLoad": 0.228125,
+ "platform": "linux",
+ "uptime": 11712.97
+ },
+ {
+ "timestamp": 1754443674384,
+ "memoryTotal": 67427545088,
+ "memoryUsed": 6198939648,
+ "memoryFree": 61228605440,
+ "memoryUsagePercent": 9.193482633706648,
+ "memoryEfficiency": 90.80651736629335,
+ "cpuCount": 16,
+ "cpuLoad": 0.215,
+ "platform": "linux",
+ "uptime": 11743
+ },
+ {
+ "timestamp": 1754443704394,
+ "memoryTotal": 67427545088,
+ "memoryUsed": 6104055808,
+ "memoryFree": 61323489280,
+ "memoryUsagePercent": 9.052762932468577,
+ "memoryEfficiency": 90.94723706753142,
+ "cpuCount": 16,
+ "cpuLoad": 0.20125,
+ "platform": "linux",
+ "uptime": 11773.01
+ },
+ {
+ "timestamp": 1754443734398,
+ "memoryTotal": 67427545088,
+ "memoryUsed": 7020519424,
+ "memoryFree": 60407025664,
+ "memoryUsagePercent": 10.411945763170657,
+ "memoryEfficiency": 89.58805423682935,
+ "cpuCount": 16,
+ "cpuLoad": 0.23125,
+ "platform": "linux",
+ "uptime": 11803.02
+ },
+ {
+ "timestamp": 1754443764428,
+ "memoryTotal": 67427545088,
+ "memoryUsed": 7279988736,
+ "memoryFree": 60147556352,
+ "memoryUsagePercent": 10.79675780350427,
+ "memoryEfficiency": 89.20324219649572,
+ "cpuCount": 16,
+ "cpuLoad": 0.246875,
+ "platform": "linux",
+ "uptime": 11833.05
+ },
+ {
+ "timestamp": 1754443794446,
+ "memoryTotal": 67427545088,
+ "memoryUsed": 7041990656,
+ "memoryFree": 60385554432,
+ "memoryUsagePercent": 10.44378917667767,
+ "memoryEfficiency": 89.55621082332233,
+ "cpuCount": 16,
+ "cpuLoad": 0.2,
+ "platform": "linux",
+ "uptime": 11863.06
+ },
+ {
+ "timestamp": 1754443824471,
+ "memoryTotal": 67427545088,
+ "memoryUsed": 7104319488,
+ "memoryFree": 60323225600,
+ "memoryUsagePercent": 10.536227410812776,
+ "memoryEfficiency": 89.46377258918723,
+ "cpuCount": 16,
+ "cpuLoad": 0.220625,
+ "platform": "linux",
+ "uptime": 11893.09
+ },
+ {
+ "timestamp": 1754443854502,
+ "memoryTotal": 67427545088,
+ "memoryUsed": 7191576576,
+ "memoryFree": 60235968512,
+ "memoryUsagePercent": 10.665636078866939,
+ "memoryEfficiency": 89.33436392113306,
+ "cpuCount": 16,
+ "cpuLoad": 0.276875,
+ "platform": "linux",
+ "uptime": 11923.12
+ },
+ {
+ "timestamp": 1754443884532,
+ "memoryTotal": 67427545088,
+ "memoryUsed": 7471050752,
+ "memoryFree": 59956494336,
+ "memoryUsagePercent": 11.080116801300562,
+ "memoryEfficiency": 88.91988319869944,
+ "cpuCount": 16,
+ "cpuLoad": 0.270625,
+ "platform": "linux",
+ "uptime": 11953.15
+ },
+ {
+ "timestamp": 1754443914561,
+ "memoryTotal": 67427545088,
+ "memoryUsed": 7116627968,
+ "memoryFree": 60310917120,
+ "memoryUsagePercent": 10.554481790360388,
+ "memoryEfficiency": 89.44551820963962,
+ "cpuCount": 16,
+ "cpuLoad": 0.274375,
+ "platform": "linux",
+ "uptime": 11983.18
+ },
+ {
+ "timestamp": 1754443944591,
+ "memoryTotal": 67427545088,
+ "memoryUsed": 7289835520,
+ "memoryFree": 60137709568,
+ "memoryUsagePercent": 10.81136130714236,
+ "memoryEfficiency": 89.18863869285764,
+ "cpuCount": 16,
+ "cpuLoad": 0.273125,
+ "platform": "linux",
+ "uptime": 12013.21
+ },
+ {
+ "timestamp": 1754443974621,
+ "memoryTotal": 67427545088,
+ "memoryUsed": 7231565824,
+ "memoryFree": 60195979264,
+ "memoryUsagePercent": 10.724943069723286,
+ "memoryEfficiency": 89.27505693027672,
+ "cpuCount": 16,
+ "cpuLoad": 0.2475,
+ "platform": "linux",
+ "uptime": 12043.24
+ },
+ {
+ "timestamp": 1754444004651,
+ "memoryTotal": 67427545088,
+ "memoryUsed": 7478054912,
+ "memoryFree": 59949490176,
+ "memoryUsagePercent": 11.090504484836806,
+ "memoryEfficiency": 88.9094955151632,
+ "cpuCount": 16,
+ "cpuLoad": 0.206875,
+ "platform": "linux",
+ "uptime": 12073.27
+ },
+ {
+ "timestamp": 1754444034659,
+ "memoryTotal": 67427545088,
+ "memoryUsed": 7013994496,
+ "memoryFree": 60413550592,
+ "memoryUsagePercent": 10.402268815876365,
+ "memoryEfficiency": 89.59773118412363,
+ "cpuCount": 16,
+ "cpuLoad": 0.179375,
+ "platform": "linux",
+ "uptime": 12103.28
+ },
+ {
+ "timestamp": 1754444064690,
+ "memoryTotal": 67427545088,
+ "memoryUsed": 6972092416,
+ "memoryFree": 60455452672,
+ "memoryUsagePercent": 10.340124954720938,
+ "memoryEfficiency": 89.65987504527907,
+ "cpuCount": 16,
+ "cpuLoad": 0.16625,
+ "platform": "linux",
+ "uptime": 12133.31
+ },
+ {
+ "timestamp": 1754444094715,
+ "memoryTotal": 67427545088,
+ "memoryUsed": 7029555200,
+ "memoryFree": 60397989888,
+ "memoryUsagePercent": 10.425346482399284,
+ "memoryEfficiency": 89.57465351760072,
+ "cpuCount": 16,
+ "cpuLoad": 0.163125,
+ "platform": "linux",
+ "uptime": 12163.33
+ },
+ {
+ "timestamp": 1754444124745,
+ "memoryTotal": 67427545088,
+ "memoryUsed": 6863777792,
+ "memoryFree": 60563767296,
+ "memoryUsagePercent": 10.179486414701962,
+ "memoryEfficiency": 89.82051358529804,
+ "cpuCount": 16,
+ "cpuLoad": 0.14,
+ "platform": "linux",
+ "uptime": 12193.36
+ },
+ {
+ "timestamp": 1754444154775,
+ "memoryTotal": 67427545088,
+ "memoryUsed": 6843363328,
+ "memoryFree": 60584181760,
+ "memoryUsagePercent": 10.149210265728486,
+ "memoryEfficiency": 89.85078973427152,
+ "cpuCount": 16,
+ "cpuLoad": 0.09625,
+ "platform": "linux",
+ "uptime": 12223.39
+ },
+ {
+ "timestamp": 1754444184796,
+ "memoryTotal": 67427545088,
+ "memoryUsed": 6831345664,
+ "memoryFree": 60596199424,
+ "memoryUsagePercent": 10.131387187661035,
+ "memoryEfficiency": 89.86861281233897,
+ "cpuCount": 16,
+ "cpuLoad": 0.07625,
+ "platform": "linux",
+ "uptime": 12253.41
+ },
+ {
+ "timestamp": 1754444214827,
+ "memoryTotal": 67427545088,
+ "memoryUsed": 7085907968,
+ "memoryFree": 60341637120,
+ "memoryUsagePercent": 10.508921774850544,
+ "memoryEfficiency": 89.49107822514945,
+ "cpuCount": 16,
+ "cpuLoad": 0.0675,
+ "platform": "linux",
+ "uptime": 12283.44
+ },
+ {
+ "timestamp": 1754444244857,
+ "memoryTotal": 67427545088,
+ "memoryUsed": 6980685824,
+ "memoryFree": 60446859264,
+ "memoryUsagePercent": 10.352869609726225,
+ "memoryEfficiency": 89.64713039027377,
+ "cpuCount": 16,
+ "cpuLoad": 0.073125,
+ "platform": "linux",
+ "uptime": 12313.47
+ },
+ {
+ "timestamp": 1754444274873,
+ "memoryTotal": 67427545088,
+ "memoryUsed": 6816641024,
+ "memoryFree": 60610904064,
+ "memoryUsagePercent": 10.109579126903657,
+ "memoryEfficiency": 89.89042087309635,
+ "cpuCount": 16,
+ "cpuLoad": 0.06125,
+ "platform": "linux",
+ "uptime": 12343.49
}
]
\ No newline at end of file
diff --git a/.claude-flow/metrics/task-metrics.json b/.claude-flow/metrics/task-metrics.json
index 0bd7130c3d..3533d64871 100644
--- a/.claude-flow/metrics/task-metrics.json
+++ b/.claude-flow/metrics/task-metrics.json
@@ -1,18 +1,10 @@
[
{
- "id": "cmd-sparc-1754443386389",
- "type": "sparc",
+ "id": "cmd-hooks-1754444016957",
+ "type": "hooks",
"success": true,
- "duration": 4.414234000000022,
- "timestamp": 1754443386394,
- "metadata": {}
- },
- {
- "id": "cmd-sparc-1754443415206",
- "type": "sparc",
- "success": true,
- "duration": 4956.067975,
- "timestamp": 1754443420162,
+ "duration": 8.451373000000046,
+ "timestamp": 1754444016966,
"metadata": {}
}
]
\ No newline at end of file
diff --git a/CLAUDE.md b/CLAUDE.md
index 5065da67d4..aeb07c50b2 100644
--- a/CLAUDE.md
+++ b/CLAUDE.md
@@ -48,10 +48,10 @@
### Core:
- `npx claude-flow sparc modes` - List modes
-- `npx claude-flow sparc run <mode> "<task>" --non-interactive` - Execute mode
+- `npx claude-flow sparc run <mode> "<task>"` - Execute mode
- `npx claude-flow sparc tdd "<feature>"` - TDD workflow
-- `npx claude-flow sparc batch <modes> "<task>" ` - Parallel modes
-- `npx claude-flow sparc pipeline "<task>" --non-interactive` - Full pipeline
+- `npx claude-flow sparc batch <modes> "<task>"` - Parallel modes
+- `npx claude-flow sparc pipeline "<task>"` - Full pipeline
### Build:
- `npm run build/test/lint/typecheck`
diff --git a/benchmark/.claude-flow/metrics/performance.json b/benchmark/.claude-flow/metrics/performance.json
index 6827850226..69c166ea75 100644
--- a/benchmark/.claude-flow/metrics/performance.json
+++ b/benchmark/.claude-flow/metrics/performance.json
@@ -1,5 +1,5 @@
{
- "startTime": 1754443468062,
+ "startTime": 1754444238887,
"totalTasks": 1,
"successfulTasks": 1,
"failedTasks": 0,
diff --git a/benchmark/.claude-flow/metrics/task-metrics.json b/benchmark/.claude-flow/metrics/task-metrics.json
index 8807f1dd74..23ece3d56e 100644
--- a/benchmark/.claude-flow/metrics/task-metrics.json
+++ b/benchmark/.claude-flow/metrics/task-metrics.json
@@ -1,10 +1,10 @@
[
{
- "id": "cmd-hooks-1754443468174",
+ "id": "cmd-hooks-1754444238990",
"type": "hooks",
"success": true,
- "duration": 13.888449000000037,
- "timestamp": 1754443468188,
+ "duration": 11.308054000000027,
+ "timestamp": 1754444239001,
"metadata": {}
}
]
\ No newline at end of file
diff --git a/benchmark/.claude/checkpoints/1754443356.json b/benchmark/.claude/checkpoints/1754443356.json
index 9c58646195..bfaf8ade1c 100644
--- a/benchmark/.claude/checkpoints/1754443356.json
+++ b/benchmark/.claude/checkpoints/1754443356.json
@@ -1 +1,5 @@
+<<<<<<< Updated upstream
{"branch": "checkpoint/pre-edit-20250806-012236", "file": "/workspaces/claude-code-flow/benchmark/src/swarm_benchmark/automation/models.py", "timestamp": "2025-08-06T01:22:36Z", "type": "pre-edit", "original_branch": "alpha-88"}
+=======
+{"tag": "checkpoint-20250806-012236", "file": "/workspaces/claude-code-flow/benchmark/tests/unit/test_collective.py", "timestamp": "2025-08-06T01:22:36Z", "type": "post-edit", "branch": "alpha-88", "diff_summary": " .claude-flow/metrics/performance.json | 6 +- .claude-flow/metrics/system-metrics.json | 4852 ++++++++++---------- .claude-flow/metrics/task-metrics.json | 14 +- CLAUDE.md | 6 +- benchmark/.claude-flow/metrics/performance.json | 2 +- benchmark/.claude-flow/metrics/task-metrics.json | 6 +- benchmark/.claude/checkpoints/1754443330.json | 1 + benchmark/.claude/checkpoints/1754443332.json | 1 + benchmark/.claude/checkpoints/1754443354.json | 1 + .../__pycache__/batch_processor.cpython-312.pyc | Bin 0 -> 40734 bytes .../__pycache__/decision_engine.cpython-312.pyc | Bin 44989 -> 44959 bytes benchmark/tests/unit/test_collective.py | 1277 ++++++ claude-flow-wiki | 0 13 files changed, 3731 insertions(+), 2435 deletions(-) "}
+>>>>>>> Stashed changes
diff --git a/benchmark/.claude/checkpoints/1754443992.json b/benchmark/.claude/checkpoints/1754443992.json
new file mode 100644
index 0000000000..55734d7a0e
--- /dev/null
+++ b/benchmark/.claude/checkpoints/1754443992.json
@@ -0,0 +1 @@
+{"branch": "checkpoint/pre-edit-20250806-013311", "file": "/workspaces/claude-code-flow/benchmark/reports/AGENT4_COMPLETION_REPORT.md", "timestamp": "2025-08-06T01:33:12Z", "type": "pre-edit", "original_branch": "alpha-88"}
diff --git a/benchmark/.claude/checkpoints/1754443993.json b/benchmark/.claude/checkpoints/1754443993.json
new file mode 100644
index 0000000000..6625ef3188
--- /dev/null
+++ b/benchmark/.claude/checkpoints/1754443993.json
@@ -0,0 +1 @@
+{"tag": "checkpoint-20250806-013313", "file": "/workspaces/claude-code-flow/benchmark/reports/AGENT4_COMPLETION_REPORT.md", "timestamp": "2025-08-06T01:33:13Z", "type": "post-edit", "branch": "alpha-88", "diff_summary": " .claude-flow/metrics/performance.json | 6 +- .claude-flow/metrics/system-metrics.json | 204 ++++++++++++++++ .claude-flow/metrics/task-metrics.json | 16 +- CLAUDE.md | 6 +- benchmark/.claude-flow/metrics/performance.json | 2 +- benchmark/.claude-flow/metrics/task-metrics.json | 6 +- benchmark/.claude/checkpoints/1754443356.json | 4 + benchmark/.claude/checkpoints/1754443871.json | 1 + benchmark/.claude/checkpoints/1754443873.json | 1 + benchmark/reports/AGENT4_COMPLETION_REPORT.md | 210 ++++++++++++++++ .../__pycache__/__init__.cpython-312.pyc | Bin 972 -> 1345 bytes .../performance_analyzer.cpython-312.pyc | Bin 0 -> 57821 bytes benchmark/test_automation_implementation.py | 269 --------------------- benchmark/tests/run_tests.py | 0 claude-flow-wiki | 0 15 files changed, 434 insertions(+), 291 deletions(-) "}
diff --git a/benchmark/src/swarm_benchmark/advanced_metrics/__pycache__/__init__.cpython-312.pyc b/benchmark/src/swarm_benchmark/advanced_metrics/__pycache__/__init__.cpython-312.pyc
index 65dccc35d7..4d62337cc2 100644
Binary files a/benchmark/src/swarm_benchmark/advanced_metrics/__pycache__/__init__.cpython-312.pyc and b/benchmark/src/swarm_benchmark/advanced_metrics/__pycache__/__init__.cpython-312.pyc differ
diff --git a/benchmark/test_automation_implementation.py b/benchmark/test_automation_implementation.py
deleted file mode 100644
index 381e831bb4..0000000000
--- a/benchmark/test_automation_implementation.py
+++ /dev/null
@@ -1,269 +0,0 @@
-#!/usr/bin/env python3
-"""
-Test script to verify the automation module implementation.
-
-This script tests the basic functionality of all automation components
-to ensure they work correctly and integrate properly.
-"""
-
-import asyncio
-import sys
-import os
-import time
-from datetime import datetime, timedelta
-
-# Add the benchmark source to the path
-sys.path.insert(0, os.path.join(os.path.dirname(__file__), 'src'))
-
-from swarm_benchmark.automation import (
- BenchmarkTask, BenchmarkResult,
- BatchProcessor, BatchConfig, BatchResult,
- PipelineManager, Pipeline, PipelineStage,
- WorkflowExecutor, WorkflowConfig,
- ResourcePool, ResourceConfig, ResourceSpec,
- DecisionEngine, DecisionContext, DecisionType
-)
-
-
-def create_test_tasks(count: int = 10) -> list:
- """Create test benchmark tasks."""
- tasks = []
- for i in range(count):
- task = BenchmarkTask(
- id=f"test_task_{i}",
- name=f"Test Task {i}",
- description=f"Test benchmark task number {i}",
- type="test",
- parameters={"test_param": i}
- )
- tasks.append(task)
- return tasks
-
-
-async def test_batch_processor():
- """Test BatchProcessor functionality."""
- print("Testing BatchProcessor...")
-
- config = BatchConfig(
- max_parallel=5,
- timeout_seconds=60,
- retry_attempts=2
- )
-
- processor = BatchProcessor(config)
- tasks = create_test_tasks(10)
-
- try:
- result = await processor.process_batch(tasks)
- print(f" βœ… Batch completed: {result.success_rate:.2%} success rate")
- print(f" Tasks: {result.completed_tasks} completed, {result.failed_tasks} failed")
- return True
- except Exception as e:
- print(f" ❌ BatchProcessor test failed: {e}")
- return False
-
-
-async def test_resource_pool():
- """Test ResourcePool functionality."""
- print("Testing ResourcePool...")
-
- config = ResourceConfig(
- initial_pool_size=3,
- max_pool_size=10
- )
-
- try:
- async with ResourcePool(config) as pool:
- # Test resource allocation
- spec = ResourceSpec(cpu_cores=1.0, memory_mb=512)
- allocation = await pool.allocate_resource(spec, task_id="test_task")
-
- print(f" βœ… Resource allocated: {allocation.allocation_id}")
-
- # Test resource release
- success = await pool.release_resource(allocation.allocation_id)
- print(f" βœ… Resource released: {success}")
-
- # Test pool status
- status = await pool.get_pool_status()
- print(f" βœ… Pool status: {status['total_resources']} resources, "
- f"{status['cpu_utilization']:.2%} CPU utilization")
-
- return True
- except Exception as e:
- print(f" ❌ ResourcePool test failed: {e}")
- return False
-
-
-async def test_decision_engine():
- """Test DecisionEngine functionality."""
- print("Testing DecisionEngine...")
-
- try:
- engine = DecisionEngine(strategy="adaptive")
-
- # Create test context
- context = DecisionContext(
- current_metrics={"cpu_usage": 0.7, "memory_usage": 0.5},
- system_load=0.6
- )
-
- # Test decision making
- decision = await engine.make_decision(
- DecisionType.RESOURCE_ALLOCATION,
- context
- )
-
- print(f" βœ… Decision made: {decision.selected_option.name}")
- print(f" Confidence: {decision.confidence.value}")
- print(f" Rationale: {decision.rationale[:80]}...")
-
- # Test decision execution
- success = await engine.execute_decision(decision)
- print(f" βœ… Decision executed: {success}")
-
- return True
- except Exception as e:
- print(f" ❌ DecisionEngine test failed: {e}")
- return False
-
-
-async def test_workflow_executor():
- """Test WorkflowExecutor functionality."""
- print("Testing WorkflowExecutor...")
-
- config = WorkflowConfig(
- execution_strategy="adaptive",
- max_parallel_tasks=5,
- timeout_seconds=120
- )
-
- executor = WorkflowExecutor(config)
-
- try:
- objective = "Run a comprehensive benchmark test with multiple task types"
- result = await executor.execute_autonomous_workflow(objective)
-
- print(f" βœ… Workflow completed: {result.status.value}")
- print(f" Success rate: {result.success_rate:.2%}")
- print(f" Tasks: {result.tasks_completed} completed, {result.tasks_failed} failed")
- print(f" Duration: {result.total_duration:.2f}s")
-
- return True
- except Exception as e:
- print(f" ❌ WorkflowExecutor test failed: {e}")
- return False
-
-
-async def test_pipeline_manager():
- """Test PipelineManager functionality."""
- print("Testing PipelineManager...")
-
- try:
- manager = PipelineManager()
-
- # Create a simple ML pipeline
- pipeline = manager.create_ml_pipeline("test_ml_pipeline", {
- "data_sources": ["test_data"],
- "model_configs": [{"type": "test_model"}],
- "metrics": ["accuracy"],
- "report_formats": ["json"]
- })
-
- print(f" βœ… Pipeline created: {pipeline.name}")
-
- # Execute pipeline
- result = await manager.execute_pipeline("test_ml_pipeline")
-
- print(f" βœ… Pipeline executed: {result.status.value}")
- print(f" Success rate: {result.success_rate:.2%}")
-
- return True
- except Exception as e:
- print(f" ❌ PipelineManager test failed: {e}")
- return False
-
-
-async def run_integration_test():
- """Run integrated test using multiple components."""
- print("Testing Integration...")
-
- try:
- # Initialize components
- batch_config = BatchConfig(max_parallel=3)
- resource_config = ResourceConfig(initial_pool_size=2)
- workflow_config = WorkflowConfig(max_parallel_tasks=3)
-
- processor = BatchProcessor(batch_config)
- executor = WorkflowExecutor(workflow_config)
-
- # Create test scenario
- tasks = create_test_tasks(5)
-
- # Execute using batch processor
- batch_result = await processor.process_batch(tasks)
-
- # Execute autonomous workflow
- workflow_result = await executor.execute_autonomous_workflow(
- "Process test tasks with optimal resource allocation"
- )
-
- print(f" βœ… Integration test completed")
- print(f" Batch success: {batch_result.success_rate:.2%}")
- print(f" Workflow success: {workflow_result.success_rate:.2%}")
-
- return True
- except Exception as e:
- print(f" ❌ Integration test failed: {e}")
- return False
-
-
-async def main():
- """Run all automation tests."""
- print("=" * 60)
- print("πŸ€– AUTOMATION MODULE IMPLEMENTATION TEST")
- print("=" * 60)
- print()
-
- start_time = time.time()
- tests_passed = 0
- total_tests = 6
-
- # Run individual component tests
- test_results = await asyncio.gather(
- test_batch_processor(),
- test_resource_pool(),
- test_decision_engine(),
- test_workflow_executor(),
- test_pipeline_manager(),
- run_integration_test(),
- return_exceptions=True
- )
-
- # Count successful tests
- for i, result in enumerate(test_results):
- if isinstance(result, Exception):
- print(f" ❌ Test {i+1} failed with exception: {result}")
- elif result:
- tests_passed += 1
-
- duration = time.time() - start_time
-
- print()
- print("=" * 60)
- print("πŸ“Š TEST SUMMARY")
- print("=" * 60)
- print(f"Tests passed: {tests_passed}/{total_tests}")
- print(f"Success rate: {tests_passed/total_tests:.1%}")
- print(f"Total duration: {duration:.2f}s")
-
- if tests_passed == total_tests:
- print("πŸŽ‰ All tests passed! Automation module is working correctly.")
- return 0
- else:
- print("⚠️ Some tests failed. Check implementation.")
- return 1
-
-
-if __name__ == "__main__":
- sys.exit(asyncio.run(main()))
\ No newline at end of file
diff --git a/benchmark/tests/run_tests.py b/benchmark/tests/run_tests.py
old mode 100644
new mode 100755