ruvnet / ruvnet/ruflo

[Dream Cycle 2026-08-10] performance: cross-agent KV cache sharing 7.8× prefill gap (ADR-381) + security,hive-mind scan

Open
#2,953 0 comments 0 reactions 0 assignees View on GitHub
dream-cycle hive-mind performance research security
Dominant language
TypeScript
Stars
72.7k
Forks
8.6k
Avg merge
2d 23h
Merged PRs (30d)
83

Description

## Tonight's Rotation

| Field | Value |
|-------|-------|
| Deep surface | **performance** (SLOT 0) |
| Scan surfaces | security, hive-mind |
| Session commit | `913f9eaedee92627950544424e50339feaf98271` |
| Date | 2026-08-10 |

---

## Drift Check

**Prior dream-cycle issues (last 7):**
| # | Title | Date | State |
|---|-------|------|-------|
| #2949 | swarm: SwarmAgentic PSO topology auto-generation +261.8% gap | 2026-08-09 | open |
| #2943 | memory: ScrubJay temporal decay collapses GenGap 5.7× | 2026-08-08 | open |
| #2938 | intelligence: EnvACE World Rehearsal gap | 2026-08-07 | open |
| #2932 | security: AgentDB memory poisoning 84.2% persistence gap | 2026-08-06 | open |
| #2923 | performance: 8.08× inference gap — framework convergence angle | 2026-08-05 | open |
| #2918 | swarm: Stigmergic pheromone bus | 2026-08-04 | open |
| #2902 | memory: Zero-Mem -57.6% retrieval latency | 2026-08-03 | open |

**Phrase drift:** No finding phrase repeats ≥3 times — CLEAR. Tonight's performance topic differs from #2923 (framework selection/convergence) by focusing on serving-layer cross-agent KV cache sharing.

⚠️ **needs-merge:** 0 dream-cycle PRs merged across 75 total issues. No dream-cycle PR merged in 15+ nights. Human review and merge of at least one draft PR strongly recommended.

**Self-score of last night's gist (#2949, swarm/PSO):**
| Criterion | Score |
|-----------|-------|
| Benchmark grade A or B claim | 2/2 (PSO +261.8% Grade A, SwarmBench Grade A) |
| ≥4 competitor rows | 2/2 (LangGraph, AutoGen, CrewAI, OpenAI SDK) |
| Specific actions | 2/2 |
| Witness present | 2/2 |
| <1500 words | 1/1 |
| Novel finding | 1/1 |
| **Total** | **10/10** |

---

## Deep Dive Findings — performance

### SOTA Summary (2026)

**KVCOMM** (arXiv 2605.03884, NeurIPS '25, Grade A): Anchor-based KV cache reuse across swarm agents. In 5-agent settings with shared base context, KVCOMM achieves **7.8× prefill speedup** with **>70% cache reuse rate**. Solves the offset-variance problem when reusing KV caches across different prefix contexts via an anchor-based approximation framework. Code released.

**LatentMAS** (arXiv 2606.05711, Grade B): Agents share KV-cache working memory directly (training-free). Achieves **83.7% token savings** on cross-agent shared context. Ramp Labs' Latent Briefing uses attention-matching compaction for 49% savings on LongBench v2.

**PolyKV** (arXiv 2604.24971, Grade B): Shared asymmetrically-compressed KV cache pool — N agents, 1 pool, memory sub-linear in N. Pre-print, no code link confirmed.

**MemOPD** (arXiv 2608.07068, Grade A): On-policy distillation through memory state alignment — **1.63× actor computation speedup** + 7% F1 gain. Code public (TPssp/MemOPD).

**Framework benchmarks** (Grade B, two independent sources: tensoria.fr + pickaxe.co): CrewAI uses 18% more tokens than LangGraph on equivalent tasks. LangGraph 62% complex task completion > AutoGen 58% > CrewAI 54%. OpenAI Agents SDK: lowest latency (native function calls, no graph overhead).

### Gap vs Current Ruflo

| Gap | Current State | SOTA |
|-----|--------------|------|
| Cross-agent KV cache sharing | None — independent full-precision cache per agent | KVCOMM 7.8× prefill speedup |
| Cross-agent context compression | Text re-encoding on hand-off | LatentMAS 83.7% token savings |
| Shared cache pool API | No `TopologyManager` cache interface | PolyKV shared pool |
| Swarm throughput benchmark | No published metric | LangGraph/AutoGen/CrewAI comparison exists |

`TopologyManager` in `v3/@claude-flow/swarm/src/topology-manager.ts` manages topology graphs but has no `SharedKVPool` interface. The `@claude-flow/memory` AgentDB stores embeddings, not raw KV states — a different layer.

### Recommended Action

→ **ADR-381** proposes `SharedKVPool` interface in `TopologyManager`; `swarm init --shared-kv-pool` opt-in flag. Implementation entry points: `TopologyManager.addNode`, new `v3/@claude-flow/swarm/src/shared-kv-pool.ts`.

---

## Scan Findings — security

**Source:** OWASP GenAI/LLM Top 10 2026 (released 2026-08-06, cybersecuritynews.com + helpnetsecurity.com + sdtimes.com)

**Finding:** OWASP LLM Top 10 2026 released this week. Prompt Injection remains #1 (now covers cross-modal attacks: images/audio). Excessive Agency jumped from 6th to 3rd. Core new philosophy: "Stop trying to build a model that cannot be fooled. Build the system around it." List was 75% data-driven (6,639 real incidents) for the first time.

**Competitive signal:** No competitor changelog (LangGraph, AutoGen, CrewAI, OpenAI SDK) references OWASP LLM 2026 alignment. Ruflo's `@claude-flow/security` covers CVE remediation + input validation but does not reference OWASP LLM 2026 cross-modal prompt injection or Excessive Agency (now #3).

**One-sentence finding (Grade B — OWASP source, crosschecked SD Times + HelpNetSecurity):** OWASP LLM Top 10 2026 adds cross-modal prompt injection (images/audio) and elevates Excessive Agency to #3; Ruflo's security module needs an explicit alignment audit against the new rubric.

---

## Scan Findings — hive-mind

**Source:** arXiv 2605.09076v2 (Robust Multi-Agent LLMs under Byzantine Faults, 2026) + AgentShield dataset (IEEE DataPort)

**Finding:** CP-WBFT (Zheng et al., 2026) achieves Byzantine fault tolerance with up to 6 malicious nodes (85.7%) via confidence-weighted aggregation — 2-3× improvement over topology-agnostic BFT. XSTest accuracy varies 34%–94% by topology choice, showing topology selection is safety-critical.

**Competitive signal:** No competitor framework exposes configurable BFT topology or per-agent confidence weighting in their 2026 changelog. AgentShield provides a public evaluation dataset. Ruflo hive-mind has Raft/BFT modes but no confidence-weighted aggregation.

**One-sentence finding (Grade B — arXiv pre-print, crosschecked AAAI proceedings link):** CP-WBFT confidence-weighted Byzantine aggregation reaches 85.7% fault tolerance with 6/N malicious agents; Ruflo's hive-mind lacks per-agent confidence weighting in its Raft/BFT consensus path.

---

## Competitors Reviewed

| Competitor | Cross-agent KV sharing | OWASP LLM 2026 alignment | BFT confidence weighting | 2026 status |
|---|---|---|---|---|
| LangGraph | None | Not referenced | None | Production leader, 38% enterprise share |
| AutoGen / AG2 | None | Not referenced | None | GA Feb 2026, active |
| CrewAI 0.95 | None | Not referenced | None | Active, async runner added 2026 |
| OpenAI Agents SDK | None | Not referenced | None | Stable, replaced Swarm |

---

## Gist

⚠️ Gist publish blocked by proxy (same constraint as prior nights). Research content captured in this issue and in branch file `v3/research/dream-gist-2026-08-10.md`.

**GIST_HASH (canonical file sha256):** `98307ad3ad8a656119c65bac4578c12e0a78f03e2c2bc8410fa954a75e32a210`

---

## Witness

| Field | Value |
|-------|-------|
| Session commit | `913f9eaedee92627950544424e50339feaf98271` |
| Report SHA-256 | `98307ad3ad8a656119c65bac4578c12e0a78f03e2c2bc8410fa954a75e32a210` |
| Witness stamp | `2f5f39638bc1480aeafcb681fc9de919d98f62e635b012d0b81bf070ce8e8b05` |

Verifier: `sha256sum dream-gist-2026-08-10.md` → concat with session commit → `sha256sum` → must equal Witness stamp.

---

## ADR

**ADR-381:** `v3/docs/adr/ADR-381-dream-cycle-performance-cross-agent-kv-cache-sharing.md` — Cross-Agent KV Cache Sharing for Swarm Prefill Performance. Adds `SharedKVPool` interface to `TopologyManager`; opt-in via `swarm init --shared-kv-pool`. Complementary to ADR-348 (topology selector) and ADR-353 (batch inference); ADR-381 addresses the serving-layer KV sharing gap.

Contributor guide

Open the contributing guide

Research direction

Start with v3/docs/adr/ADR-381-dream-cycle-performance-cross-agent-kv-cache-sharing.md, then inspect v3/@claude-flow/swarm/src/topology-manager.ts and TopologyManager.addNode. Review how the proposed v3/@claude-flow/swarm/src/shared-kv-pool.ts interface and swarm init --shared-kv-pool option fit the existing topology flow. Done means the ADR’s opt-in SharedKVPool path is implemented and its behavior can be verified.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
ai-infra-agents, distributed-systems, performance
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.