mirror of
https://github.com/ruvnet/RuVector.git
synced 2026-05-30 20:43:38 +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
543 B
TOML
22 lines
543 B
TOML
# node-cheap — the low-cost, deliberately-slow peer.
|
|
#
|
|
# Represents the "bulk compute" tier: cheap per-task cap, generous latency
|
|
# budget. In a CheapestUnderLatency selection this peer tends to win when
|
|
# the caller's latency cap is loose.
|
|
|
|
[policy.default]
|
|
max_cost_usd = 0.01
|
|
max_duration_ms = 10_000
|
|
allowed_skills = ["echo"]
|
|
|
|
[budget.global]
|
|
max_usd_per_minute = 1.00
|
|
overflow = "shed"
|
|
|
|
[recursion]
|
|
max_call_depth = 4
|
|
deny_revisit = true
|
|
|
|
[routing]
|
|
default_selector = "cheapest_under_latency"
|
|
latency_budget_ms = 5_000
|