claude-flow 3.6.9 → 3.6.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"sessionId":"ea43bca2-cc37-44fb-97ff-f1c914a31fb1","pid":12017,"procStart":"Tue Apr 28 01:25:58 2026","acquiredAt":1777350938971}
1
+ {"sessionId":"ea43bca2-cc37-44fb-97ff-f1c914a31fb1","pid":24292,"procStart":"Wed Apr 29 22:31:28 2026","acquiredAt":1777507213673}
package/README.md CHANGED
@@ -12,15 +12,15 @@
12
12
 
13
13
  </div>
14
14
 
15
- Deploy 16 specialized agent roles + custom types in coordinated swarms with self-learning capabilities, fault-tolerant consensus, and enterprise-grade security.
15
+ Orchestrate 100+ specialized AI agents across machines, teams, and trust boundaries. Ruflo adds coordinated swarms, self-learning memory, federated comms, and enterprise security to Claude Code — so agents don't just run, they collaborate.
16
16
 
17
17
  ### Why Ruflo?
18
18
 
19
- > **Why Ruflo?** Claude Flow is now Ruflo — named by Ruv, who loves Rust, flow states, and building things that feel inevitable. The "Ru" is the Ruv. The "flo" is the flow. Underneath, WASM kernels written in Rust power the policy engine, embeddings, and proof system.
19
+ > Claude Flow is now Ruflo — named by Ruv, who loves Rust, flow states, and building things that feel inevitable. The "Ru" is the Ruv. The "flo" is the flow. Underneath, WASM kernels written in Rust power the policy engine, embeddings, and proof system.
20
20
 
21
- ### Getting into the Flow
21
+ ### What Ruflo Does
22
22
 
23
- Ruflo is a comprehensive AI agent orchestration framework that transforms Claude Code into a powerful multi-agent development platform. It enables teams to deploy, coordinate, and optimize specialized AI agents working together on complex software engineering tasks.
23
+ One `init` gives Claude Code a nervous system: agents self-organize into swarms, learn from every task, remember across sessions, and with federation securely talk to agents on other machines without leaking data. You keep writing code. Ruflo handles the coordination.
24
24
 
25
25
  ```
26
26
  Self-Learning / Self-Optimizing Agent Architecture
@@ -48,33 +48,88 @@ Install Ruflo as a native Claude Code plugin -- adds skills, commands, agents, a
48
48
  /plugin install ruflo-core@ruflo
49
49
  /plugin install ruflo-swarm@ruflo
50
50
  /plugin install ruflo-autopilot@ruflo
51
+ /plugin install ruflo-federation@ruflo
51
52
  ```
52
53
 
53
54
  <details>
54
- <summary><strong>All 20 plugins</strong></summary>
55
+ <summary><strong>All 32 plugins</strong></summary>
55
56
 
56
- | Plugin | What it adds |
57
+ #### Core & Orchestration
58
+
59
+ | Plugin | What it does |
60
+ |--------|-------------|
61
+ | **ruflo-core** | Foundation — server, health checks, plugin discovery |
62
+ | **ruflo-swarm** | Coordinate multiple agents as a team |
63
+ | **ruflo-autopilot** | Let agents run autonomously in a loop |
64
+ | **ruflo-loop-workers** | Schedule background tasks on a timer |
65
+ | **ruflo-workflows** | Reusable multi-step task templates |
66
+ | **ruflo-federation** | Agents on different machines collaborate securely |
67
+
68
+ #### Memory & Knowledge
69
+
70
+ | Plugin | What it does |
71
+ |--------|-------------|
72
+ | **ruflo-agentdb** | Fast vector database for agent memory |
73
+ | **ruflo-rag-memory** | Smart retrieval — hybrid search, graph hops, diversity ranking |
74
+ | **ruflo-rvf** | Save and restore agent memory across sessions |
75
+ | **ruflo-ruvector** | [`ruvector`](https://npmjs.com/package/ruvector) — GPU-accelerated search, Graph RAG, 103 tools |
76
+ | **ruflo-knowledge-graph** | Build and traverse entity relationship maps |
77
+
78
+ #### Intelligence & Learning
79
+
80
+ | Plugin | What it does |
81
+ |--------|-------------|
82
+ | **ruflo-intelligence** | Agents learn from past successes and get smarter |
83
+ | **ruflo-daa** | Dynamic agent behavior and cognitive patterns |
84
+ | **ruflo-ruvllm** | Run local LLMs (Ollama, etc.) with smart routing |
85
+ | **ruflo-goals** | Break big goals into plans and track progress |
86
+
87
+ #### Code Quality & Testing
88
+
89
+ | Plugin | What it does |
90
+ |--------|-------------|
91
+ | **ruflo-testgen** | Find missing tests and generate them automatically |
92
+ | **ruflo-browser** | Automate browser testing with Playwright |
93
+ | **ruflo-jujutsu** | Analyze git diffs, score risk, suggest reviewers |
94
+ | **ruflo-docs** | Generate and maintain documentation automatically |
95
+
96
+ #### Security & Compliance
97
+
98
+ | Plugin | What it does |
57
99
  |--------|-------------|
58
- | **ruflo-core** | MCP server, `/status`, `/doctor`, plugin discovery, base agents |
59
- | **ruflo-swarm** | Swarm coordination, Monitor streams, worktree isolation |
60
- | **ruflo-autopilot** | Autonomous `/loop` completion with learning and prediction |
61
- | **ruflo-intelligence** | Self-learning SONA patterns, trajectory learning, model routing |
62
- | **ruflo-agentdb** | AgentDB controllers, HNSW vector search, RuVector embeddings |
63
- | **ruflo-aidefence** | AI safety scanning, PII detection, prompt injection defense |
64
- | **ruflo-browser** | Playwright browser automation for testing and scraping |
65
- | **ruflo-jujutsu** | Git diff analysis, risk scoring, reviewer recommendations |
66
- | **ruflo-wasm** | Sandboxed WASM agent creation and gallery sharing |
67
- | **ruflo-workflows** | Workflow templates, orchestration, lifecycle management |
68
- | **ruflo-daa** | Dynamic Agentic Architecture, cognitive patterns |
69
- | **ruflo-ruvllm** | Local LLM inference, MicroLoRA, multi-provider chat |
70
- | **ruflo-rvf** | RVF portable memory, session persistence, transfer |
71
- | **ruflo-loop-workers** | Background `/loop` workers, CronCreate scheduling |
72
- | **ruflo-security-audit** | Security scanning, CVE checks, dependency audit |
73
- | **ruflo-rag-memory** | Memory bridge, simple store/search/recall interface |
74
- | **ruflo-testgen** | Test gap detection, TDD workflow, tester agent |
75
- | **ruflo-docs** | Doc generation, drift detection, docs-writer agent |
76
- | **ruflo-plugin-creator** | Scaffold, validate, and publish new plugins |
77
- | **ruflo-goals** | GOAP planning, deep research, long-horizon tracking |
100
+ | **ruflo-security-audit** | Scan for vulnerabilities and CVEs |
101
+ | **ruflo-aidefence** | Block prompt injection, detect PII, safety scanning |
102
+
103
+ #### Architecture & Methodology
104
+
105
+ | Plugin | What it does |
106
+ |--------|-------------|
107
+ | **ruflo-adr** | Track architecture decisions with a living record |
108
+ | **ruflo-ddd** | Scaffold domain-driven design contexts, aggregates, events |
109
+ | **ruflo-sparc** | Guided 5-phase development methodology with quality gates |
110
+
111
+ #### DevOps & Observability
112
+
113
+ | Plugin | What it does |
114
+ |--------|-------------|
115
+ | **ruflo-migrations** | Manage database schema changes safely |
116
+ | **ruflo-observability** | Structured logs, traces, and metrics in one place |
117
+ | **ruflo-cost-tracker** | Track token usage, set budgets, get cost alerts |
118
+
119
+ #### Extensibility
120
+
121
+ | Plugin | What it does |
122
+ |--------|-------------|
123
+ | **ruflo-wasm** | Run sandboxed WebAssembly agents |
124
+ | **ruflo-plugin-creator** | Scaffold, validate, and publish your own plugins |
125
+
126
+ #### Domain-Specific
127
+
128
+ | Plugin | What it does |
129
+ |--------|-------------|
130
+ | **ruflo-iot-cognitum** | IoT device management — trust scoring, anomaly detection, fleets |
131
+ | **ruflo-neural-trader** | [`neural-trader`](https://npmjs.com/package/neural-trader) — AI trading with 4 agents, backtesting, 112+ tools |
132
+ | **ruflo-market-data** | Ingest market data, vectorize OHLCV, detect patterns |
78
133
 
79
134
  </details>
80
135
 
@@ -105,13 +160,80 @@ claude mcp add ruflo -- npx -y @claude-flow/cli@latest
105
160
  | Capability | Description |
106
161
  |------------|-------------|
107
162
  | 🤖 **100+ Agents** | Specialized agents for coding, testing, security, docs, architecture |
163
+ | 📡 **Comms Layer** | Zero-trust federation — agents across machines/orgs discover, authenticate, and exchange work securely |
108
164
  | 🐝 **Swarm Coordination** | Hierarchical, mesh, and adaptive topologies with consensus |
109
165
  | 🧠 **Self-Learning** | SONA neural patterns, ReasoningBank, trajectory learning |
110
166
  | 💾 **Vector Memory** | HNSW-indexed AgentDB with 150x-12,500x faster search |
111
167
  | ⚡ **Background Workers** | 12 auto-triggered workers (audit, optimize, testgaps, etc.) |
112
- | 🧩 **Plugin Marketplace** | 20 native Claude Code plugins + 20 npm plugins |
168
+ | 🧩 **Plugin Marketplace** | 32 native Claude Code plugins + 21 npm plugins |
113
169
  | 🔌 **Multi-Provider** | Claude, GPT, Gemini, Cohere, Ollama with smart routing |
114
170
  | 🛡️ **Security** | AIDefence, input validation, CVE remediation, path traversal prevention |
171
+ | 🌐 **Agent Federation** | Cross-installation agent collaboration with zero-trust security
172
+
173
+ ### Agent Federation — Slack for Agents
174
+
175
+ ```
176
+ Your Agent --> [ Remove secrets ] --> [ Sign message ] --> [ Encrypted channel ]
177
+ Emails, SSNs, Proves it came No one reads it
178
+ keys stripped from you in transit
179
+ |
180
+ v
181
+ Their Agent <-- [ Block attacks ] <-- [ Check identity ] <------+
182
+ Stops prompt Rejects forgeries
183
+ injection
184
+
185
+ Audit trail on both sides.
186
+ Trust builds over time. Bad behavior = instant downgrade.
187
+ ```
188
+
189
+ Slack gave teams channels. Federation gives agents the same thing — **shared workspaces across trust boundaries**, where agents on different machines, orgs, or cloud regions can discover each other, prove who they are, and collaborate on tasks.
190
+
191
+ The difference: some channels are trusted, some aren't. [`@claude-flow/plugin-agent-federation`](https://github.com/ruvnet/ruflo/issues/1669) handles that automatically. Your agents join a federation, get verified via mTLS + ed25519, and start exchanging work — with PII stripped before anything leaves your node and every message auditable. Untrusted agents can still participate at lower privilege: they see discovery info, not your memory. As they prove reliable, trust upgrades. If they misbehave, they get downgraded instantly — no human in the loop required.
192
+
193
+ You don't configure handshakes or manage certificates. You `federation init`, `federation join`, and your agents start talking. The protocol handles identity, the PII pipeline handles data safety, and the audit trail handles compliance.
194
+
195
+ <details>
196
+ <summary><strong>Federation capabilities</strong></summary>
197
+
198
+ | | Capability | How it works |
199
+ |---|---|---|
200
+ | 🔒 | **Zero-trust federation** | Remote agents start untrusted. Identity proven via mTLS + ed25519 challenge-response. No API keys, no shared secrets. |
201
+ | 🛡️ | **PII-gated data flow** | 14-type detection pipeline scans every outbound message. Per-trust-level policies: BLOCK, REDACT, HASH, or PASS. Adaptive calibration reduces false positives. |
202
+ | 📊 | **Behavioral trust scoring** | Formula (`0.4×success + 0.2×uptime + 0.2×threat + 0.2×integrity`) continuously evaluates peers. Upgrades require history; downgrades are instant. |
203
+ | 📋 | **Compliance built-in** | HIPAA, SOC2, GDPR audit trails as compliance modes. Every federation event produces a structured record searchable via HNSW. |
204
+ | 🤝 | **9 MCP tools + 10 CLI commands** | Full lifecycle: `federation_init`, `federation_send`, `federation_trust`, `federation_audit`, and more. |
205
+
206
+ </details>
207
+
208
+ <details>
209
+ <summary><strong>Example: two teams sharing fraud signals without sharing customer data</strong></summary>
210
+
211
+ ```bash
212
+ # Team A: initialize federation and generate keypair
213
+ npx claude-flow@latest federation init
214
+
215
+ # Team A: join Team B's federation endpoint
216
+ npx claude-flow@latest federation join wss://team-b.example.com:8443
217
+
218
+ # Team A: send a task — PII is stripped automatically before it leaves
219
+ npx claude-flow@latest federation send --to team-b --type task-request \
220
+ --message "Analyze transaction patterns for account anomalies"
221
+
222
+ # Team A: check peer trust levels and session health
223
+ npx claude-flow@latest federation status
224
+ ```
225
+
226
+ </details>
227
+
228
+ See [issue #1669](https://github.com/ruvnet/ruflo/issues/1669) for the complete architecture, trust model, and implementation roadmap.
229
+
230
+ ```bash
231
+ # Claude Code plugin
232
+ /plugin install ruflo-federation@ruflo
233
+
234
+ # Or via CLI
235
+ npx claude-flow@latest plugins install @claude-flow/plugin-agent-federation
236
+ ```
115
237
 
116
238
  <details>
117
239
  <summary><strong>Claude Code: With vs Without Ruflo</strong></summary>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claude-flow",
3
- "version": "3.6.9",
3
+ "version": "3.6.11",
4
4
  "description": "Ruflo - Enterprise AI agent orchestration for Claude Code. Deploy 60+ specialized agents in coordinated swarms with self-learning, fault-tolerant consensus, vector memory, and MCP integration",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",
@@ -12,15 +12,15 @@
12
12
 
13
13
  </div>
14
14
 
15
- Deploy 16 specialized agent roles + custom types in coordinated swarms with self-learning capabilities, fault-tolerant consensus, and enterprise-grade security.
15
+ Orchestrate 100+ specialized AI agents across machines, teams, and trust boundaries. Ruflo adds coordinated swarms, self-learning memory, federated comms, and enterprise security to Claude Code — so agents don't just run, they collaborate.
16
16
 
17
17
  ### Why Ruflo?
18
18
 
19
- > **Why Ruflo?** Claude Flow is now Ruflo — named by Ruv, who loves Rust, flow states, and building things that feel inevitable. The "Ru" is the Ruv. The "flo" is the flow. Underneath, WASM kernels written in Rust power the policy engine, embeddings, and proof system.
19
+ > Claude Flow is now Ruflo — named by Ruv, who loves Rust, flow states, and building things that feel inevitable. The "Ru" is the Ruv. The "flo" is the flow. Underneath, WASM kernels written in Rust power the policy engine, embeddings, and proof system.
20
20
 
21
- ### Getting into the Flow
21
+ ### What Ruflo Does
22
22
 
23
- Ruflo is a comprehensive AI agent orchestration framework that transforms Claude Code into a powerful multi-agent development platform. It enables teams to deploy, coordinate, and optimize specialized AI agents working together on complex software engineering tasks.
23
+ One `init` gives Claude Code a nervous system: agents self-organize into swarms, learn from every task, remember across sessions, and with federation securely talk to agents on other machines without leaking data. You keep writing code. Ruflo handles the coordination.
24
24
 
25
25
  ```
26
26
  Self-Learning / Self-Optimizing Agent Architecture
@@ -48,33 +48,88 @@ Install Ruflo as a native Claude Code plugin -- adds skills, commands, agents, a
48
48
  /plugin install ruflo-core@ruflo
49
49
  /plugin install ruflo-swarm@ruflo
50
50
  /plugin install ruflo-autopilot@ruflo
51
+ /plugin install ruflo-federation@ruflo
51
52
  ```
52
53
 
53
54
  <details>
54
- <summary><strong>All 20 plugins</strong></summary>
55
+ <summary><strong>All 32 plugins</strong></summary>
55
56
 
56
- | Plugin | What it adds |
57
+ #### Core & Orchestration
58
+
59
+ | Plugin | What it does |
60
+ |--------|-------------|
61
+ | **ruflo-core** | Foundation — server, health checks, plugin discovery |
62
+ | **ruflo-swarm** | Coordinate multiple agents as a team |
63
+ | **ruflo-autopilot** | Let agents run autonomously in a loop |
64
+ | **ruflo-loop-workers** | Schedule background tasks on a timer |
65
+ | **ruflo-workflows** | Reusable multi-step task templates |
66
+ | **ruflo-federation** | Agents on different machines collaborate securely |
67
+
68
+ #### Memory & Knowledge
69
+
70
+ | Plugin | What it does |
71
+ |--------|-------------|
72
+ | **ruflo-agentdb** | Fast vector database for agent memory |
73
+ | **ruflo-rag-memory** | Smart retrieval — hybrid search, graph hops, diversity ranking |
74
+ | **ruflo-rvf** | Save and restore agent memory across sessions |
75
+ | **ruflo-ruvector** | [`ruvector`](https://npmjs.com/package/ruvector) — GPU-accelerated search, Graph RAG, 103 tools |
76
+ | **ruflo-knowledge-graph** | Build and traverse entity relationship maps |
77
+
78
+ #### Intelligence & Learning
79
+
80
+ | Plugin | What it does |
81
+ |--------|-------------|
82
+ | **ruflo-intelligence** | Agents learn from past successes and get smarter |
83
+ | **ruflo-daa** | Dynamic agent behavior and cognitive patterns |
84
+ | **ruflo-ruvllm** | Run local LLMs (Ollama, etc.) with smart routing |
85
+ | **ruflo-goals** | Break big goals into plans and track progress |
86
+
87
+ #### Code Quality & Testing
88
+
89
+ | Plugin | What it does |
90
+ |--------|-------------|
91
+ | **ruflo-testgen** | Find missing tests and generate them automatically |
92
+ | **ruflo-browser** | Automate browser testing with Playwright |
93
+ | **ruflo-jujutsu** | Analyze git diffs, score risk, suggest reviewers |
94
+ | **ruflo-docs** | Generate and maintain documentation automatically |
95
+
96
+ #### Security & Compliance
97
+
98
+ | Plugin | What it does |
57
99
  |--------|-------------|
58
- | **ruflo-core** | MCP server, `/status`, `/doctor`, plugin discovery, base agents |
59
- | **ruflo-swarm** | Swarm coordination, Monitor streams, worktree isolation |
60
- | **ruflo-autopilot** | Autonomous `/loop` completion with learning and prediction |
61
- | **ruflo-intelligence** | Self-learning SONA patterns, trajectory learning, model routing |
62
- | **ruflo-agentdb** | AgentDB controllers, HNSW vector search, RuVector embeddings |
63
- | **ruflo-aidefence** | AI safety scanning, PII detection, prompt injection defense |
64
- | **ruflo-browser** | Playwright browser automation for testing and scraping |
65
- | **ruflo-jujutsu** | Git diff analysis, risk scoring, reviewer recommendations |
66
- | **ruflo-wasm** | Sandboxed WASM agent creation and gallery sharing |
67
- | **ruflo-workflows** | Workflow templates, orchestration, lifecycle management |
68
- | **ruflo-daa** | Dynamic Agentic Architecture, cognitive patterns |
69
- | **ruflo-ruvllm** | Local LLM inference, MicroLoRA, multi-provider chat |
70
- | **ruflo-rvf** | RVF portable memory, session persistence, transfer |
71
- | **ruflo-loop-workers** | Background `/loop` workers, CronCreate scheduling |
72
- | **ruflo-security-audit** | Security scanning, CVE checks, dependency audit |
73
- | **ruflo-rag-memory** | Memory bridge, simple store/search/recall interface |
74
- | **ruflo-testgen** | Test gap detection, TDD workflow, tester agent |
75
- | **ruflo-docs** | Doc generation, drift detection, docs-writer agent |
76
- | **ruflo-plugin-creator** | Scaffold, validate, and publish new plugins |
77
- | **ruflo-goals** | GOAP planning, deep research, long-horizon tracking |
100
+ | **ruflo-security-audit** | Scan for vulnerabilities and CVEs |
101
+ | **ruflo-aidefence** | Block prompt injection, detect PII, safety scanning |
102
+
103
+ #### Architecture & Methodology
104
+
105
+ | Plugin | What it does |
106
+ |--------|-------------|
107
+ | **ruflo-adr** | Track architecture decisions with a living record |
108
+ | **ruflo-ddd** | Scaffold domain-driven design contexts, aggregates, events |
109
+ | **ruflo-sparc** | Guided 5-phase development methodology with quality gates |
110
+
111
+ #### DevOps & Observability
112
+
113
+ | Plugin | What it does |
114
+ |--------|-------------|
115
+ | **ruflo-migrations** | Manage database schema changes safely |
116
+ | **ruflo-observability** | Structured logs, traces, and metrics in one place |
117
+ | **ruflo-cost-tracker** | Track token usage, set budgets, get cost alerts |
118
+
119
+ #### Extensibility
120
+
121
+ | Plugin | What it does |
122
+ |--------|-------------|
123
+ | **ruflo-wasm** | Run sandboxed WebAssembly agents |
124
+ | **ruflo-plugin-creator** | Scaffold, validate, and publish your own plugins |
125
+
126
+ #### Domain-Specific
127
+
128
+ | Plugin | What it does |
129
+ |--------|-------------|
130
+ | **ruflo-iot-cognitum** | IoT device management — trust scoring, anomaly detection, fleets |
131
+ | **ruflo-neural-trader** | [`neural-trader`](https://npmjs.com/package/neural-trader) — AI trading with 4 agents, backtesting, 112+ tools |
132
+ | **ruflo-market-data** | Ingest market data, vectorize OHLCV, detect patterns |
78
133
 
79
134
  </details>
80
135
 
@@ -105,13 +160,80 @@ claude mcp add ruflo -- npx -y @claude-flow/cli@latest
105
160
  | Capability | Description |
106
161
  |------------|-------------|
107
162
  | 🤖 **100+ Agents** | Specialized agents for coding, testing, security, docs, architecture |
163
+ | 📡 **Comms Layer** | Zero-trust federation — agents across machines/orgs discover, authenticate, and exchange work securely |
108
164
  | 🐝 **Swarm Coordination** | Hierarchical, mesh, and adaptive topologies with consensus |
109
165
  | 🧠 **Self-Learning** | SONA neural patterns, ReasoningBank, trajectory learning |
110
166
  | 💾 **Vector Memory** | HNSW-indexed AgentDB with 150x-12,500x faster search |
111
167
  | ⚡ **Background Workers** | 12 auto-triggered workers (audit, optimize, testgaps, etc.) |
112
- | 🧩 **Plugin Marketplace** | 20 native Claude Code plugins + 20 npm plugins |
168
+ | 🧩 **Plugin Marketplace** | 32 native Claude Code plugins + 21 npm plugins |
113
169
  | 🔌 **Multi-Provider** | Claude, GPT, Gemini, Cohere, Ollama with smart routing |
114
170
  | 🛡️ **Security** | AIDefence, input validation, CVE remediation, path traversal prevention |
171
+ | 🌐 **Agent Federation** | Cross-installation agent collaboration with zero-trust security
172
+
173
+ ### Agent Federation — Slack for Agents
174
+
175
+ ```
176
+ Your Agent --> [ Remove secrets ] --> [ Sign message ] --> [ Encrypted channel ]
177
+ Emails, SSNs, Proves it came No one reads it
178
+ keys stripped from you in transit
179
+ |
180
+ v
181
+ Their Agent <-- [ Block attacks ] <-- [ Check identity ] <------+
182
+ Stops prompt Rejects forgeries
183
+ injection
184
+
185
+ Audit trail on both sides.
186
+ Trust builds over time. Bad behavior = instant downgrade.
187
+ ```
188
+
189
+ Slack gave teams channels. Federation gives agents the same thing — **shared workspaces across trust boundaries**, where agents on different machines, orgs, or cloud regions can discover each other, prove who they are, and collaborate on tasks.
190
+
191
+ The difference: some channels are trusted, some aren't. [`@claude-flow/plugin-agent-federation`](https://github.com/ruvnet/ruflo/issues/1669) handles that automatically. Your agents join a federation, get verified via mTLS + ed25519, and start exchanging work — with PII stripped before anything leaves your node and every message auditable. Untrusted agents can still participate at lower privilege: they see discovery info, not your memory. As they prove reliable, trust upgrades. If they misbehave, they get downgraded instantly — no human in the loop required.
192
+
193
+ You don't configure handshakes or manage certificates. You `federation init`, `federation join`, and your agents start talking. The protocol handles identity, the PII pipeline handles data safety, and the audit trail handles compliance.
194
+
195
+ <details>
196
+ <summary><strong>Federation capabilities</strong></summary>
197
+
198
+ | | Capability | How it works |
199
+ |---|---|---|
200
+ | 🔒 | **Zero-trust federation** | Remote agents start untrusted. Identity proven via mTLS + ed25519 challenge-response. No API keys, no shared secrets. |
201
+ | 🛡️ | **PII-gated data flow** | 14-type detection pipeline scans every outbound message. Per-trust-level policies: BLOCK, REDACT, HASH, or PASS. Adaptive calibration reduces false positives. |
202
+ | 📊 | **Behavioral trust scoring** | Formula (`0.4×success + 0.2×uptime + 0.2×threat + 0.2×integrity`) continuously evaluates peers. Upgrades require history; downgrades are instant. |
203
+ | 📋 | **Compliance built-in** | HIPAA, SOC2, GDPR audit trails as compliance modes. Every federation event produces a structured record searchable via HNSW. |
204
+ | 🤝 | **9 MCP tools + 10 CLI commands** | Full lifecycle: `federation_init`, `federation_send`, `federation_trust`, `federation_audit`, and more. |
205
+
206
+ </details>
207
+
208
+ <details>
209
+ <summary><strong>Example: two teams sharing fraud signals without sharing customer data</strong></summary>
210
+
211
+ ```bash
212
+ # Team A: initialize federation and generate keypair
213
+ npx claude-flow@latest federation init
214
+
215
+ # Team A: join Team B's federation endpoint
216
+ npx claude-flow@latest federation join wss://team-b.example.com:8443
217
+
218
+ # Team A: send a task — PII is stripped automatically before it leaves
219
+ npx claude-flow@latest federation send --to team-b --type task-request \
220
+ --message "Analyze transaction patterns for account anomalies"
221
+
222
+ # Team A: check peer trust levels and session health
223
+ npx claude-flow@latest federation status
224
+ ```
225
+
226
+ </details>
227
+
228
+ See [issue #1669](https://github.com/ruvnet/ruflo/issues/1669) for the complete architecture, trust model, and implementation roadmap.
229
+
230
+ ```bash
231
+ # Claude Code plugin
232
+ /plugin install ruflo-federation@ruflo
233
+
234
+ # Or via CLI
235
+ npx claude-flow@latest plugins install @claude-flow/plugin-agent-federation
236
+ ```
115
237
 
116
238
  <details>
117
239
  <summary><strong>Claude Code: With vs Without Ruflo</strong></summary>
@@ -47,17 +47,28 @@ if (isMCPMode) {
47
47
 
48
48
  for (const line of lines) {
49
49
  if (line.trim()) {
50
+ let message;
51
+ try {
52
+ message = JSON.parse(line);
53
+ } catch {
54
+ console.log(JSON.stringify({
55
+ jsonrpc: '2.0',
56
+ id: null,
57
+ error: { code: -32700, message: 'Parse error' },
58
+ }));
59
+ continue;
60
+ }
50
61
  try {
51
- const message = JSON.parse(line);
52
62
  const response = await handleMessage(message);
53
63
  if (response) {
54
64
  console.log(JSON.stringify(response));
55
65
  }
56
66
  } catch (error) {
67
+ // #1606: Return proper internal error instead of parse error
57
68
  console.log(JSON.stringify({
58
69
  jsonrpc: '2.0',
59
- id: null,
60
- error: { code: -32700, message: 'Parse error' },
70
+ id: message.id ?? null,
71
+ error: { code: -32603, message: error instanceof Error ? error.message : 'Internal error' },
61
72
  }));
62
73
  }
63
74
  }
@@ -252,12 +252,20 @@ const searchCommand = {
252
252
  description: 'Build/rebuild HNSW index before searching (enables 150x-12,500x speedup)',
253
253
  type: 'boolean',
254
254
  default: false
255
+ },
256
+ {
257
+ name: 'smart',
258
+ short: 's',
259
+ description: 'Use SmartRetrieval pipeline (query expansion, RRF, MMR, recency)',
260
+ type: 'boolean',
261
+ default: false
255
262
  }
256
263
  ],
257
264
  examples: [
258
265
  { command: 'claude-flow memory search -q "authentication patterns"', description: 'Semantic search' },
259
266
  { command: 'claude-flow memory search -q "JWT" -t keyword', description: 'Keyword search' },
260
- { command: 'claude-flow memory search -q "test" --build-hnsw', description: 'Build HNSW index and search' }
267
+ { command: 'claude-flow memory search -q "test" --build-hnsw', description: 'Build HNSW index and search' },
268
+ { command: 'claude-flow memory search -q "auth patterns" --smart', description: 'SmartRetrieval with RRF + MMR' }
261
269
  ],
262
270
  action: async (ctx) => {
263
271
  const query = ctx.flags.query || ctx.args[0];
@@ -300,28 +308,76 @@ const searchCommand = {
300
308
  // Use direct sql.js search with vector similarity
301
309
  try {
302
310
  const { searchEntries } = await import('../memory/memory-initializer.js');
303
- const searchResult = await searchEntries({
304
- query,
305
- namespace,
306
- limit,
307
- threshold
308
- });
309
- if (!searchResult.success) {
310
- output.printError(searchResult.error || 'Search failed');
311
- return { success: false, exitCode: 1 };
311
+ const useSmart = (ctx.flags.smart || ctx.flags.s);
312
+ let results;
313
+ let searchTimeMs;
314
+ let smartStats;
315
+ let backendLabel = 'HNSW + sql.js';
316
+ if (useSmart) {
317
+ const { smartSearch } = await import('@claude-flow/memory');
318
+ // Adapt searchEntries to the SearchFn interface
319
+ const rawSearch = async (req) => {
320
+ const r = await searchEntries({
321
+ query: req.query,
322
+ namespace: req.namespace || namespace,
323
+ limit: req.limit || limit * 3,
324
+ threshold: req.threshold ?? threshold,
325
+ });
326
+ return {
327
+ results: r.results.map(e => ({
328
+ id: e.id,
329
+ key: e.key,
330
+ content: e.content,
331
+ score: e.score,
332
+ namespace: e.namespace,
333
+ })),
334
+ };
335
+ };
336
+ const smartResult = await smartSearch(rawSearch, {
337
+ query,
338
+ namespace,
339
+ limit,
340
+ threshold,
341
+ });
342
+ results = smartResult.results.map(r => ({
343
+ key: r.key,
344
+ score: r.score,
345
+ namespace: r.namespace,
346
+ preview: r.content,
347
+ }));
348
+ searchTimeMs = smartResult.stats.durationMs;
349
+ smartStats = smartResult.stats;
350
+ backendLabel = 'SmartRetrieval (RRF + MMR + Recency)';
351
+ }
352
+ else {
353
+ const searchResult = await searchEntries({
354
+ query,
355
+ namespace,
356
+ limit,
357
+ threshold
358
+ });
359
+ if (!searchResult.success) {
360
+ output.printError(searchResult.error || 'Search failed');
361
+ return { success: false, exitCode: 1 };
362
+ }
363
+ results = searchResult.results.map(r => ({
364
+ key: r.key,
365
+ score: r.score,
366
+ namespace: r.namespace,
367
+ preview: r.content
368
+ }));
369
+ searchTimeMs = searchResult.searchTime;
312
370
  }
313
- const results = searchResult.results.map(r => ({
314
- key: r.key,
315
- score: r.score,
316
- namespace: r.namespace,
317
- preview: r.content
318
- }));
319
371
  if (ctx.flags.format === 'json') {
320
- output.printJson({ query, searchType, results, searchTime: `${searchResult.searchTime}ms` });
372
+ output.printJson({ query, searchType, results, searchTime: `${searchTimeMs}ms`, ...(smartStats ? { stats: smartStats } : {}) });
321
373
  return { success: true, data: results };
322
374
  }
323
375
  // Performance stats
324
- output.writeln(output.dim(` Search time: ${searchResult.searchTime}ms`));
376
+ output.writeln(output.dim(` Search time: ${searchTimeMs}ms`));
377
+ if (useSmart && smartStats) {
378
+ output.writeln(output.dim(` Backend: ${backendLabel}`));
379
+ output.writeln(output.dim(` Variants: ${smartStats.variantCount}, Raw candidates: ${smartStats.rawCandidateCount}`));
380
+ }
325
381
  output.writeln();
326
382
  if (results.length === 0) {
327
383
  output.printWarning('No results found');
@@ -1,22 +1,13 @@
1
1
  /**
2
2
  * CLAUDE.md Generator
3
- * Generates enforceable, analyzer-optimized Claude Code configuration
4
- * with template variants for different usage patterns.
3
+ * Generates lean, enforceable Claude Code configuration optimized for token efficiency.
5
4
  *
6
5
  * Templates: minimal | standard | full | security | performance | solo
7
- * All templates use bullet-format rules with imperative keywords for enforceability.
6
+ * All templates use imperative rules and agent comms-first coordination.
8
7
  */
9
8
  import type { InitOptions, ClaudeMdTemplate } from './types.js';
10
- /**
11
- * Generate CLAUDE.md content based on init options and template.
12
- * Template is determined by: options.runtime.claudeMdTemplate > explicit param > 'standard'
13
- */
14
9
  export declare function generateClaudeMd(options: InitOptions, template?: ClaudeMdTemplate): string;
15
- /**
16
- * Generate minimal CLAUDE.md content (backward-compatible alias).
17
- */
18
10
  export declare function generateMinimalClaudeMd(options: InitOptions): string;
19
- /** Available template names for CLI wizard */
20
11
  export declare const CLAUDE_MD_TEMPLATES: Array<{
21
12
  name: ClaudeMdTemplate;
22
13
  description: string;