Back to Ruflo

ADR-105 — Federation v1 state snapshot (post-alpha.9)

v3/docs/adr/ADR-105-federation-v1-state-snapshot.md

3.10.06.4 KB
Original Source

ADR-105 — Federation v1 state snapshot (post-alpha.9)

Purpose

Single source of truth for "where is federation today, what works, what's deferred, and where to look for each piece." Updated on every plugin alpha bump that changes the answer.

Snapshot as of 2026-05-09 (post-@claude-flow/[email protected])

What works end-to-end

CapabilityADRImplementationValidated
Cryptographic identity (Ed25519, persisted)(pre-existing G2)plugin.ts keypair persistence, @noble/ed25519 for sign/verifyCross-OS install + load
PII pipeline(pre-existing)domain/services/pii-pipeline-service.ts44 tests
Trust levels (UNTRUSTED → PRIVILEGED)(pre-existing)domain/entities/trust-level.ts + application/trust-evaluator.ts31 tests
Budget envelope + hop counterADR-097 P1domain/value-objects/federation-budget.ts41 tests
Peer state machine (ACTIVE/SUSPENDED/EVICTED)ADR-097 P2.adomain/value-objects/federation-node-state.ts + domain/entities/federation-node.ts27 tests
Breaker service + outbound short-circuitADR-097 P2.bapplication/federation-breaker-service.ts25 tests
Cost-tracker consumer (ruflo-cost-tracker)ADR-097 P3 consumerplugins/ruflo-cost-tracker/scripts/federation.mjsIntegration
Coordinator reportSpend() + SpendReporter interfaceADR-097 P3 upstreamapplication/spend-reporter.ts (InMemorySpendReporter reference)10 tests
3 operator MCP tools (federation_breaker_status, _evict, _reactivate)ADR-097 P4mcp-tools.ts11 coordinator tests
ruflo doctor --component federation health-checkADR-097 P4v3/@claude-flow/cli/src/commands/doctor.tsSmoke
Wire transport (WebSocket fallback today, QUIC roadmap)ADR-104Plugin imports agentic-flow/transport/loaderLive mac↔ruvultra over tailscale, 150ms send

What's deferred (each its own ADR)

GapADRStatusWhy deferred
Auto peer discovery (mDNS/Bonjour) — today only staticPeers configADR-106ProposedmDNS binding choice (bonjour-service vs multicast-dns) needs a security review for tailnet vs LAN scopes
TLS pinning for cross-tailnet federation — today assumes WireGuardADR-107ProposedCert lifecycle is a real ops concern; not blocking today's intra-tailnet use case
Native QUIC binding — today WS fallback, native lives behind AGENTIC_FLOW_QUIC_NATIVE=1ADR-108ProposedUpstream agentic-flow Phase-1 issues #15-21 need to land first; we don't fork that
Receive-side dispatch — today inbound bytes accepted but coordinator not wokenADR-109In progress this iterationSmallest, highest-value gap; closing it makes federation truly bidirectional
Production SpendReporter adapter — today InMemorySpendReporter reference impl onlyADR-110In progress this iterationOne-screenful adapter; was deferred only because it touches the cost-tracker plugin's memory-namespace contract

Ship-side artifacts (npm)

PackageTagVersion
@claude-flow/plugin-agent-federationalpha1.0.0-alpha.9
@claude-flow/clialpha/latest/v3alpha3.7.0-alpha.20
claude-flowalpha/latest/v3alpha3.7.0-alpha.20
rufloalpha/latest/v3alpha3.7.0-alpha.20
agentic-flow (companion fix)fix2.0.12-fix.2 (until ruvnet/agentic-flow#153 merges)

Plugin surface (alpha.9)

  • 13 MCP tools: federation_init, federation_join, federation_peers, federation_send, federation_query, federation_status, federation_trust, federation_audit, federation_breaker_status, federation_evict, federation_reactivate, federation_report_spend, federation_consensus
  • 8 services in container: federation:coordinator, federation:discovery, federation:audit, federation:pii, federation:trust, federation:policy, federation:routing, federation:transport
  • Public exports: AgentFederationPlugin, FederationCoordinator, FederationNode, FederationNodeState, FederationBreakerService, InMemorySpendReporter, evaluatePolicy, DEFAULT_BREAKER_POLICY, plus types

Test coverage

  • 450 unit tests across 14 test files in __tests__/unit/
  • Cross-OS validated on macOS arm64 + Linux x64
  • Witness manifest carries 91 signed fixes (Ed25519); CI re-verifies on every push across 3 OSes (linux/macos/windows)
  • 12-hour scheduled remote agent runs 8 verification checks against published packages, files GitHub issues on regressions, escalates @ruvnet after 3 occurrences

Operator entry points

bash
# Install
npm install @claude-flow/plugin-agent-federation@alpha

# Health-check
npx ruflo@latest doctor --component federation

# Inspect breaker (from MCP context)
federation_breaker_status

# Manually evict misbehaving peer
federation_evict { "nodeId": "...", "correlationId": "ops-ticket-N" }

# Reactivate after probe
federation_reactivate { "nodeId": "...", "correlationId": "probe-ok-N" }

# Report actual cost from downstream completion
federation_report_spend { "peerId": "...", "tokensUsed": ..., "usdSpent": ..., "success": true }

Maintenance protocol

This document is updated by the agent that bumps the federation plugin version. Specifically: the commit that bumps package.json should include an edit to ADR-105 reflecting the new state. The 12h verification routine flags drift between this document and the published artifacts.

Decision

This ADR exists as a navigation document, not a decision record. Its status is Accepted — Reference and it is intentionally lightweight — when the answer to "what's the current state" changes, only this document needs editing. The substantive decisions live in their per-ADR files.