23f7624596
ADR-166 MCP Bridge Security Lock / Static-source security lock (push) Failing after 0s
ADR-166 MCP Bridge Security Lock / Compose default binds loopback + Mongo has auth (push) Failing after 2s
CodeQL Advanced / Analyze (rust) (push) Failing after 0s
ADR-166 MCP Bridge Security Lock / plugin-agent-federation bindHost default (push) Failing after 1s
ADR-166 MCP Bridge Security Lock / Runtime behavior — 401 + terminal gate + fail-closed (push) Failing after 4s
business-pods-smoke / smoke (push) Failing after 1s
all-plugins-smoke / smoke-all (push) Failing after 2s
CI/CD Pipeline / Security & Code Quality (push) Failing after 1s
CI/CD Pipeline / Test Suite (ubuntu-latest) (push) Failing after 1s
CI/CD Pipeline / Build & Package (macos-latest) (push) Has been skipped
CI/CD Pipeline / Build & Package (ubuntu-latest) (push) Has been skipped
CI/CD Pipeline / Build & Package (windows-latest) (push) Has been skipped
CI/CD Pipeline / Documentation & Examples (push) Failing after 1s
Clone Tracker (14-day rolling) / Snapshot clones for ruflo ecosystem (push) Failing after 1s
CodeQL Advanced / Analyze (actions) (push) Failing after 1s
CodeQL Advanced / Analyze (javascript-typescript) (push) Failing after 1s
federation-peer-rust / stable-noop (push) Failing after 1s
metaharness-ci / score (push) Failing after 1s
metaharness-ci / router-compat (push) Failing after 0s
metaharness-ci / similarity-tests (push) Failing after 0s
no-agentbbs-smoke / smoke-without-agentbbs (push) Failing after 1s
V3 CI/CD Pipeline / Build V3 (windows-latest) (push) Has been skipped
codex-integration-audit / Codex integration audit (push) Failing after 1s
helpers-manifest-guard / guard (push) Failing after 1s
🔗 Cross-Agent Integration Tests / 🤝 Agent Coordination Tests (push) Has been skipped
🔗 Cross-Agent Integration Tests / 🧠 Memory Sharing Integration (push) Has been skipped
🔗 Cross-Agent Integration Tests / 🛡️ Fault Tolerance Tests (push) Has been skipped
🔗 Cross-Agent Integration Tests / ⚡ Performance Integration Tests (push) Has been skipped
metaharness-ci / mcp-scan (push) Failing after 1s
metaharness-ci / eject-dryrun (push) Failing after 1s
metaharness-ci / metaharness-real-data (push) Failing after 0s
no-cli-optdep-bloat-2561 / guard (push) Failing after 1s
no-metaharness-smoke / smoke-without-metaharness (push) Failing after 1s
no-phantom-agentic-flow-subpath / guard (push) Failing after 1s
🔄 Automated Rollback Manager / 🚨 Failure Detection (push) Failing after 1s
V3 CI/CD Pipeline / Plugin hooks smoke / ubuntu-latest / Node 22 (push) Failing after 1s
V3 CI/CD Pipeline / ruflo-graph-intelligence build + test smoke (#2044, ADR-123) (push) Failing after 1s
CVE Audit Gate / Audit root (critical-blocking) (push) Failing after 2s
cost-tracker-smoke / smoke (push) Failing after 3s
oia-audit-weekly / audit (push) Failing after 2s
ruflo-agent-smoke / ruflo-agent structural smoke (push) Failing after 1s
📊 Status Badges Update / 📊 Update Status Badges (push) Failing after 1s
V3 CI/CD Pipeline / Static regression guards (#2267 YAML + (push) Failing after 1s
V3 CI/CD Pipeline / Test V3 Packages (push) Failing after 0s
V3 CI/CD Pipeline / agent_execute provider routing smoke (#2042) (push) Failing after 0s
CVE Audit Gate / Audit v3 (critical-blocking) (push) Failing after 1s
federation-peer-rust / stable-native (push) Failing after 2s
🔗 Cross-Agent Integration Tests / 🚀 Integration Test Setup (push) Failing after 2s
neural-trader-smoke / runtime-smoke (push) Failing after 1s
V3 CI/CD Pipeline / Build V3 (macos-latest) (push) Has been skipped
V3 CI/CD Pipeline / Build V3 (ubuntu-latest) (push) Has been skipped
V3 CI/CD Pipeline / Type Check V3 (push) Failing after 1s
V3 CI/CD Pipeline / Smoke (no better-sqlite3) / ubuntu-latest / Node 24 (push) Failing after 1s
V3 CI/CD Pipeline / Smoke (no better-sqlite3) / ubuntu-latest / Node 22 (push) Failing after 2s
V3 CI/CD Pipeline / browser rvf create flag smoke (#2015) (push) Failing after 0s
V3 CI/CD Pipeline / Dependency review (#2046) (push) Has been skipped
V3 CI/CD Pipeline / Supply-chain audit (#2046) (push) Failing after 0s
V3 CI/CD Pipeline / witness marker drift smoke (#2021) (push) Failing after 1s
V3 CI/CD Pipeline / neural-trader portfolio CG smoke (#2068, ADR-126 Phase 3) (push) Failing after 1s
V3 CI/CD Pipeline / neural-trader backtest signing smoke (#2068, ADR-126 Phase 4) (push) Failing after 1s
V3 CI/CD Pipeline / kg-extract type-import classification smoke (#2049) (push) Failing after 0s
V3 CI/CD Pipeline / witness verify precondition smoke (#1880) (push) Failing after 2s
V3 CI/CD Pipeline / neural-trader pipeline risk-gate smoke (#2068, ADR-126 Phase 5) (push) Failing after 0s
V3 CI/CD Pipeline / neural-trader feature attribution smoke (#2068, ADR-126 Phase 6) (push) Failing after 0s
V3 CI/CD Pipeline / plugin-registry signature verification smoke (#1922, CWE-347) (push) Failing after 4s
V3 CI/CD Pipeline / memory stats legacy-DB smoke (#2120) (push) Failing after 4s
V3 CI/CD Pipeline / github deprecated actions smoke (#2089, ADR-127 Phase 3) (push) Failing after 1s
V3 CI/CD Pipeline / graph query + pathfinder smoke (ADR-130 P2+P5) (push) Has been skipped
V3 CI/CD Pipeline / graph trajectory hooks smoke (ADR-130 P3) (push) Has been skipped
V3 CI/CD Pipeline / graph plugin adapter smoke (ADR-130 P4) (push) Has been skipped
V3 CI/CD Pipeline / graph benchmark (ADR-130 P6) (push) Has been skipped
V3 CI/CD Pipeline / statusline generator delegation smoke (#2195) (push) Failing after 1s
V3 CI/CD Pipeline / wizard init regression guard (#2206 (push) Failing after 1s
V3 CI/CD Pipeline / memory no-stray-db smoke (ADR-125 P7) (push) Failing after 1s
V3 CI/CD Pipeline / github-safe injection smoke (#2089, ADR-127 Phase 1) (push) Failing after 1s
V3 CI/CD Pipeline / github actions pin smoke (#2089, ADR-127 Phase 1) (push) Failing after 1s
V3 CI/CD Pipeline / github attribution opt-in smoke (#2089, ADR-127 Phase 4) (push) Failing after 1s
V3 CI/CD Pipeline / pre-bash hook safety smoke (#2017) (push) Failing after 1s
V3 CI/CD Pipeline / Memory import smoke / ubuntu-latest (push) Failing after 0s
V3 CI/CD Pipeline / MCP protocol smoke / ubuntu-latest (push) Failing after 2s
V3 CI/CD Pipeline / ruvllm WASM auto-init smoke (#2086) (push) Failing after 4s
V3 CI/CD Pipeline / MCP paired-tool round-trip smoke (#1889) (push) Failing after 1s
V3 CI/CD Pipeline / Plugin package install-safety (#1902/#1903/#1904) (push) Failing after 1s
V3 CI/CD Pipeline / Tool description discoverability (ADR-112) (push) Failing after 3s
V3 CI/CD Pipeline / CLI npx-install smoke (#1147 / (22) (push) Failing after 1s
V3 CI/CD Pipeline / CLI npx-install smoke (#1147 / (24) (push) Failing after 1s
V3 CI/CD Pipeline / Windows hook shim smoke (#2132) / ubuntu-latest (push) Failing after 2s
V3 CI/CD Pipeline / Windows hook execution smoke (#2132) / ubuntu-latest (push) Failing after 1s
V3 CI/CD Pipeline / Windows init hooks smoke (#2132) / ubuntu-latest (push) Failing after 1s
V3 CI/CD Pipeline / Vector-index dimension audit (#1947) (push) Failing after 0s
V3 CI/CD Pipeline / Hook-command install safety (#1921) (push) Failing after 1s
V3 CI/CD Pipeline / ToolOutputGuardrail smoke (ADR-131, (push) Failing after 1s
V3 CI/CD Pipeline / init-bundle invariants smoke (#2095, ADR-128 Phase 5) (push) Failing after 1s
V3 CI/CD Pipeline / wasm provider bridge smoke (ADR-129 P1) (push) Failing after 2s
V3 CI/CD Pipeline / wasm gallery CRUD smoke (ADR-129 P3) (push) Failing after 1s
V3 CI/CD Pipeline / wasm plugin bridge smoke (ADR-129 P4) (push) Failing after 0s
V3 CI/CD Pipeline / wasm compose smoke (ADR-129 P2) (push) Failing after 4s
V3 CI/CD Pipeline / graph schema smoke (ADR-130 P1) (push) Failing after 0s
Validate Marketplace / validate (push) Failing after 1s
🔍 Verification Pipeline / 🚀 Setup Verification (push) Failing after 1s
🔍 Verification Pipeline / 🛡️ Security Verification (push) Has been skipped
🔍 Verification Pipeline / 📝 Code Quality (push) Has been skipped
🔍 Verification Pipeline / 🧪 Test Verification (${{ matrix.os }}, Node ${{ matrix.node }}) (push) Has been skipped
🔍 Verification Pipeline / 🏗️ Build Verification (push) Has been skipped
🔍 Verification Pipeline / 📚 Documentation Verification (push) Has been skipped
CVE Audit Gate / High-severity report (warn only) (push) Has been cancelled
🔄 Automated Rollback Manager / 🔄 Execute Rollback (push) Has been cancelled
🔄 Automated Rollback Manager / ✅ Post-Rollback Verification (push) Has been cancelled
🔄 Automated Rollback Manager / 📊 Rollback Monitoring (push) Has been cancelled
V3 CI/CD Pipeline / Windows init hooks smoke (#2132) / windows-latest (push) Has been cancelled
V3 CI/CD Pipeline / Windows hook execution smoke (#2132) / macos-latest (push) Has been cancelled
V3 CI/CD Pipeline / Windows hook execution smoke (#2132) / windows-latest (push) Has been cancelled
🔄 Automated Rollback Manager / ⏳ Manual Rollback Approval (push) Has been cancelled
V3 CI/CD Pipeline / MCP protocol smoke / macos-latest (push) Has been cancelled
V3 CI/CD Pipeline / Memory import smoke / macos-latest (push) Has been cancelled
V3 CI/CD Pipeline / Windows hook shim smoke (#2132) / macos-latest (push) Has been cancelled
V3 CI/CD Pipeline / Windows hook shim smoke (#2132) / windows-latest (push) Has been cancelled
V3 CI/CD Pipeline / Windows init hooks smoke (#2132) / macos-latest (push) Has been cancelled
V3 CI/CD Pipeline / Witness verify (signed manifest) / macos-latest (push) Has been cancelled
V3 CI/CD Pipeline / Witness verify (signed manifest) / ubuntu-latest (push) Has been cancelled
V3 CI/CD Pipeline / Witness verify (signed manifest) / windows-latest (push) Has been cancelled
V3 CI/CD Pipeline / Publish to npm (alpha) (push) Has been cancelled
V3 CI/CD Pipeline / Smoke (no better-sqlite3) / macos-latest / Node 22 (push) Has been cancelled
V3 CI/CD Pipeline / Plugin hooks smoke / macos-latest / Node 22 (push) Has been cancelled
CI/CD Pipeline / Deploy & Release (push) Has been cancelled
CI/CD Pipeline / CI Status (push) Has been cancelled
🔗 Cross-Agent Integration Tests / 📊 Integration Test Report (push) Has been cancelled
🔄 Automated Rollback Manager / 🔍 Pre-Rollback Validation (push) Has been cancelled
🔍 Verification Pipeline / ⚡ Performance Verification (push) Has been cancelled
🔍 Verification Pipeline / 📊 Verification Report (push) Has been cancelled
12 KiB
12 KiB
SwarmHub → UnifiedSwarmCoordinator Migration Guide
Quick reference for migrating from SwarmHub to UnifiedSwarmCoordinator
Why Migrate?
ADR-003 establishes UnifiedSwarmCoordinator as the single canonical coordination engine. SwarmHub is now a thin compatibility layer maintained only for backward compatibility.
Benefits of Migrating
- ✅ Direct access to full coordinator API
- ✅ Better performance (no facade overhead)
- ✅ Advanced features (domain routing, parallel execution)
- ✅ Future-proof (SwarmHub will be removed in v3.1.0+)
- ✅ Cleaner code
Quick Migration
Import Changes
// OLD (deprecated)
import { createSwarmHub } from '@claude-flow/swarm';
// NEW (recommended)
import { createUnifiedSwarmCoordinator } from '@claude-flow/swarm';
Initialization
// OLD
const hub = createSwarmHub();
await hub.initialize();
// NEW
const coordinator = createUnifiedSwarmCoordinator({
topology: { type: 'hierarchical', maxAgents: 15 },
consensus: { algorithm: 'raft', threshold: 0.66 },
});
await coordinator.initialize();
Spawning Agents
// OLD
await hub.spawnAllAgents();
// NEW (more powerful)
const agents = await coordinator.spawnFullHierarchy();
// Returns Map<number, {agentId, domain}>
Task Management
// OLD
const task = hub.submitTask({ name: 'Task', type: 'coding' });
// NEW (same API)
const taskId = await coordinator.submitTask({
type: 'coding',
name: 'Task',
priority: 'normal',
maxRetries: 3,
});
Advanced Features (New)
// Domain-based routing (not available in SwarmHub)
await coordinator.assignTaskToDomain(taskId, 'security');
// Parallel execution across domains
const results = await coordinator.executeParallel([
{ task: { type: 'coding', name: 'Core' }, domain: 'core' },
{ task: { type: 'testing', name: 'Tests' }, domain: 'security' },
{ task: { type: 'review', name: 'Review' }, domain: 'support' },
]);
// Get domain-specific status
const status = coordinator.getStatus();
status.domains.forEach(domain => {
console.log(`${domain.name}: ${domain.availableAgents} available`);
});
Shutdown
// OLD
await hub.shutdown();
// NEW (same API)
await coordinator.shutdown();
Complete Example
Before (SwarmHub)
import { createSwarmHub } from '@claude-flow/swarm';
async function runSwarm() {
const hub = createSwarmHub();
await hub.initialize();
const agents = await hub.spawnAllAgents();
console.log(`Spawned ${agents.size} agents`);
const task = hub.submitTask({
name: 'Security Review',
type: 'review',
});
const nextTask = hub.assignNextTask('agent-2');
if (nextTask) {
hub.completeTask(nextTask.id, { success: true });
}
await hub.shutdown();
}
After (UnifiedSwarmCoordinator)
import { createUnifiedSwarmCoordinator } from '@claude-flow/swarm';
async function runSwarm() {
const coordinator = createUnifiedSwarmCoordinator({
topology: { type: 'hierarchical', maxAgents: 15 },
consensus: { algorithm: 'raft', threshold: 0.66 },
});
await coordinator.initialize();
// Spawn 15-agent hierarchy across 5 domains
const agents = await coordinator.spawnFullHierarchy();
console.log(`Spawned ${agents.size} agents across 5 domains`);
// Submit task
const taskId = await coordinator.submitTask({
type: 'review',
name: 'Security Review',
priority: 'high',
maxRetries: 3,
});
// Route to security domain
await coordinator.assignTaskToDomain(taskId, 'security');
// Get comprehensive status
const status = coordinator.getStatus();
console.log('Metrics:', status.metrics);
console.log('Domain Status:', status.domains);
await coordinator.shutdown();
}
API Mapping
| SwarmHub Method | UnifiedSwarmCoordinator Method | Notes |
|---|---|---|
initialize() |
initialize() |
Same API |
shutdown() |
shutdown() |
Same API |
isInitialized() |
Check getState().status |
Slightly different |
spawnAgent(id) |
registerAgent(agent) |
Different API |
spawnAllAgents() |
spawnFullHierarchy() |
Better return type |
spawnAgentsByDomain(d) |
getAgentsByDomain(d) + register |
Different approach |
terminateAgent(id) |
unregisterAgent(id) |
Same API |
submitTask(spec) |
submitTask(task) |
Similar API |
assignNextTask(agentId) |
Use task orchestration | Different pattern |
completeTask(id, result) |
Handle via events | Different pattern |
getState() |
getState() |
Same API |
getMetrics() |
getMetrics() |
Same API |
| N/A | assignTaskToDomain(id, domain) |
New feature |
| N/A | executeParallel(tasks) |
New feature |
| N/A | getStatus() |
New feature |
Compatibility Layer (Temporary)
If you can't migrate immediately, use the compatibility layer:
import { createSwarmHub } from '@claude-flow/swarm';
const hub = createSwarmHub();
await hub.initialize();
// Access the underlying coordinator for advanced features
const coordinator = hub.getCoordinator();
// Use coordinator directly for new features
await coordinator.executeParallel([
{ task: task1, domain: 'core' },
{ task: task2, domain: 'security' },
]);
// Continue using hub for legacy API
const agents = await hub.spawnAllAgents();
New Features Only in UnifiedSwarmCoordinator
1. Domain-Based Routing
// Route tasks to specific domains
await coordinator.assignTaskToDomain(securityTaskId, 'security');
await coordinator.assignTaskToDomain(coreTaskId, 'core');
await coordinator.assignTaskToDomain(integrationTaskId, 'integration');
2. Parallel Execution
const results = await coordinator.executeParallel([
{ task: { type: 'coding', name: 'Impl Auth' }, domain: 'core' },
{ task: { type: 'testing', name: 'Security Tests' }, domain: 'security' },
{ task: { type: 'review', name: 'Code Review' }, domain: 'support' },
]);
// Check results
results.forEach(r => {
console.log(`${r.domain}: ${r.success ? '✅' : '❌'} (${r.durationMs}ms)`);
});
3. Domain Status
const status = coordinator.getStatus();
status.domains.forEach(domain => {
console.log(`${domain.name}:`, {
agentCount: domain.agentCount,
available: domain.availableAgents,
busy: domain.busyAgents,
queued: domain.tasksQueued,
completed: domain.tasksCompleted,
});
});
4. Performance Reporting
const report = coordinator.getPerformanceReport();
console.log({
coordinationLatencyP50: report.coordinationLatencyP50,
coordinationLatencyP99: report.coordinationLatencyP99,
messagesPerSecond: report.messagesPerSecond,
taskThroughput: report.taskThroughput,
agentUtilization: report.agentUtilization,
consensusSuccessRate: report.consensusSuccessRate,
});
5. Agent Domain Management
// Register agent with automatic domain assignment
const { agentId, domain } = await coordinator.registerAgentWithDomain(
agentData,
2 // Agent number → determines domain
);
// Get all agents in a domain
const securityAgents = coordinator.getAgentsByDomain('security');
TypeScript Types
UnifiedSwarmCoordinator Config
interface CoordinatorConfig {
topology: {
type: 'mesh' | 'hierarchical' | 'centralized' | 'hybrid';
maxAgents: number;
replicationFactor?: number;
partitionStrategy?: 'hash' | 'range';
failoverEnabled?: boolean;
autoRebalance?: boolean;
};
consensus: {
algorithm: 'raft' | 'byzantine' | 'gossip' | 'paxos';
threshold: number;
timeoutMs?: number;
maxRounds?: number;
requireQuorum?: boolean;
};
messageBus?: {
maxQueueSize?: number;
processingIntervalMs?: number;
ackTimeoutMs?: number;
retryAttempts?: number;
};
maxAgents?: number;
maxTasks?: number;
heartbeatIntervalMs?: number;
healthCheckIntervalMs?: number;
taskTimeoutMs?: number;
autoScaling?: boolean;
autoRecovery?: boolean;
}
Domain Types
type AgentDomain = 'queen' | 'security' | 'core' | 'integration' | 'support';
interface DomainStatus {
name: AgentDomain;
agentCount: number;
availableAgents: number;
busyAgents: number;
tasksQueued: number;
tasksCompleted: number;
}
interface ParallelExecutionResult {
taskId: string;
domain: AgentDomain;
success: boolean;
result?: unknown;
error?: Error;
durationMs: number;
}
Common Pitfalls
1. Different Task Submission API
// ❌ SwarmHub API (spec object)
hub.submitTask({ name: 'Task', type: 'coding' });
// ✅ UnifiedSwarmCoordinator API (full task definition)
coordinator.submitTask({
type: 'coding',
name: 'Task',
priority: 'normal',
maxRetries: 3,
});
2. Agent Registration
// ❌ SwarmHub (simple ID)
hub.spawnAgent('agent-1');
// ✅ UnifiedSwarmCoordinator (full state)
coordinator.registerAgent({
name: 'agent-1',
type: 'worker',
status: 'idle',
capabilities: { /* ... */ },
metrics: { /* ... */ },
workload: 0,
health: 1.0,
// ...
});
3. Task Assignment
// ❌ SwarmHub (pull model)
const task = hub.assignNextTask(agentId);
// ✅ UnifiedSwarmCoordinator (push model)
const taskId = await coordinator.submitTask(taskDef);
await coordinator.assignTaskToDomain(taskId, 'security');
Testing
Unit Tests
import { createUnifiedSwarmCoordinator } from '@claude-flow/swarm';
describe('UnifiedSwarmCoordinator', () => {
let coordinator;
beforeEach(async () => {
coordinator = createUnifiedSwarmCoordinator({
topology: { type: 'hierarchical', maxAgents: 15 },
});
await coordinator.initialize();
});
afterEach(async () => {
await coordinator.shutdown();
});
it('should spawn 15-agent hierarchy', async () => {
const agents = await coordinator.spawnFullHierarchy();
expect(agents.size).toBe(15);
});
it('should route tasks to domains', async () => {
const taskId = await coordinator.submitTask({
type: 'review',
name: 'Security Audit',
priority: 'high',
maxRetries: 3,
});
const agentId = await coordinator.assignTaskToDomain(taskId, 'security');
expect(agentId).toBeDefined();
});
});
Deprecation Timeline
| Version | SwarmHub Status | Action Required |
|---|---|---|
| v3.0.0-alpha | Deprecated with warnings | Start migrating |
| v3.0.0-beta | Legacy compatibility mode | Complete migration |
| v3.0.0 | Final deprecation notices | Migration recommended |
| v3.1.0+ | REMOVED | Must use UnifiedSwarmCoordinator |
Getting Help
- Documentation: See
@claude-flow/swarm/README.md - Examples: See
/v3/examples/swarm-coordinator.ts - Implementation: See
/v3/docs/ADR-003-implementation-status.md - Issues: Report at GitHub
Summary
Do This ✅
import { createUnifiedSwarmCoordinator } from '@claude-flow/swarm';
const coordinator = createUnifiedSwarmCoordinator({
topology: { type: 'hierarchical', maxAgents: 15 },
consensus: { algorithm: 'raft', threshold: 0.66 },
});
await coordinator.initialize();
const agents = await coordinator.spawnFullHierarchy();
await coordinator.executeParallel(tasks);
Not This ❌
import { createSwarmHub } from '@claude-flow/swarm';
const hub = createSwarmHub();
await hub.initialize();
await hub.spawnAllAgents();
// Missing domain routing, parallel execution, etc.
Questions? The UnifiedSwarmCoordinator is the future. Migrate today! 🚀