mirror of
https://github.com/ruvnet/RuVector.git
synced 2026-05-27 00:25:10 +00:00
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>
22 lines
530 B
TOML
22 lines
530 B
TOML
# node-fast — the premium, low-latency peer.
|
|
#
|
|
# Represents the "hot path" tier: higher per-task cap, tight latency
|
|
# budget. In a CheapestUnderLatency selection this peer wins only when
|
|
# the cheap node is above the caller's latency cap.
|
|
|
|
[policy.default]
|
|
max_cost_usd = 0.05
|
|
max_duration_ms = 2_000
|
|
allowed_skills = ["echo"]
|
|
|
|
[budget.global]
|
|
max_usd_per_minute = 5.00
|
|
overflow = "shed"
|
|
|
|
[recursion]
|
|
max_call_depth = 4
|
|
deny_revisit = true
|
|
|
|
[routing]
|
|
default_selector = "lowest_latency"
|
|
latency_budget_ms = 500
|