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

2.1 KB
Raw Blame

Self-Healing Workflows

Purpose

Automatically detect and recover from errors without interrupting your flow.

Self-Healing Features

1. Error Detection

Monitors for:

  • Failed commands
  • Syntax errors
  • Missing dependencies
  • Broken tests

2. Automatic Recovery

Missing Dependencies:

Error: Cannot find module 'express'
β†’ Automatically runs: npm install express
β†’ Retries original command

Syntax Errors:

Error: Unexpected token
β†’ Analyzes error location
β†’ Suggests fix through analyzer agent
β†’ Applies fix with confirmation

Test Failures:

Test failed: "user authentication"
β†’ Spawns debugger agent
β†’ Analyzes failure cause
β†’ Implements fix
β†’ Re-runs tests

3. Learning from Failures

Each recovery improves future prevention:

  • Patterns saved to knowledge base
  • Similar errors prevented proactively
  • Recovery strategies optimized

Pattern Storage:

// Store error patterns
mcp__claude-flow__memory_usage({
  "action": "store",
  "key": "error-pattern-" + Date.now(),
  "value": JSON.stringify(errorData),
  "namespace": "error-patterns",
  "ttl": 2592000 // 30 days
})

// Analyze patterns
mcp__claude-flow__neural_patterns({
  "action": "analyze",
  "operation": "error-recovery",
  "outcome": "success"
})

Self-Healing Integration

MCP Tool Coordination

// Initialize self-healing swarm
mcp__claude-flow__swarm_init({
  "topology": "star",
  "maxAgents": 4,
  "strategy": "adaptive"
})

// Spawn recovery agents
mcp__claude-flow__agent_spawn({
  "type": "monitor",
  "name": "Error Monitor",
  "capabilities": ["error-detection", "recovery"]
})

// Orchestrate recovery
mcp__claude-flow__task_orchestrate({
  "task": "recover from error",
  "strategy": "sequential",
  "priority": "critical"
})

Fallback Hook Configuration

{
  "PostToolUse": [{
    "matcher": "^Bash$",
    "command": "npx claude-flow hook post-bash --exit-code '${tool.result.exitCode}' --auto-recover"
  }]
}

Benefits

  • πŸ›‘οΈ Resilient workflows
  • πŸ”„ Automatic recovery
  • πŸ“š Learns from errors
  • ⏱️ Saves debugging time