Commit graph

1 commit

Author SHA1 Message Date
ruvnet
39d67c9d80 feat(examples): a2a-swarm — 3-node demo of ADR-159 routing peer-forwarding
Runnable end-to-end demonstration of the ADR-159 A2A protocol with
three real rvagent processes routing tasks between each other:

  node-cheap   on 127.0.0.1:18001 — low cost, slower latency
  node-fast    on 127.0.0.1:18002 — high cost, fast latency
  node-router  on 127.0.0.1:18003 — CheapestUnderLatency selector

The orchestrator (src/main.rs) spawns three `rvagent a2a serve`
children with distinct TOML configs, waits for each to print
`listening on <addr>` to stdout, dispatches an `echo` task to the
router, and asserts the response carries
`metadata.ruvector.routed_via.peer_url` showing the task was actually
forwarded — not handled locally on the router.

Run:
    cargo run -p a2a-swarm

What it proves vs ADR-159 acceptance tests:
  Test 1 (remote ≡ local): real reqwest/HTTP forwarding through the
    router; identical response shape from local and remote paths.
  Test 2 (constant-size memory transfer): each peer's signed AgentCard
    is published; tasks reference RuLakeWitness if used (not exercised
    in this demo, but the wire format is shared).
  Test 3 (bounded cost): each peer carries an independent GlobalBudget;
    router-side budget gates dispatch before peer selection runs.

Measured round-trip ~26ms per task on a laptop. Clean SIGTERM shutdown.

Refs: ADR-159

Co-Authored-By: claude-flow <ruv@ruv.net>
2026-04-25 16:59:18 -04:00