Skip to content

test(agents): AgentSwarm market-routing acceptance gate (#734) - #873

Merged
AmitoVrito merged 1 commit into
mainfrom
feat/agent-swarm-benchmark-734
Aug 1, 2026
Merged

AmitoVrito merged 1 commit into
mainfrom
feat/agent-swarm-benchmark-734

Conversation

@AmitoVrito

Copy link
Copy Markdown
Collaborator

Summary

Closes out #734 by adding the two quantitative acceptance criteria that had no code against them, and wiring them into CI. The other criteria were already met — the replayable receipt + grounding shipped in #822, and determinism (seed=42) + the PrometheusMetrics swarm hooks already existed.

What lands

  • benchmarks/agent_swarm_bench.py — a deterministic 100-task scenario of emergent specialization: 5 agents each expert in one task category (high quality, low cost) + 1 premium generalist (good everywhere, expensive). Compares three routing strategies on mean outcome quality and cost:
    • market AgentSwarm — routes each task to the in-category specialist,
    • hardcoded AgentFederation — real round-robin (category-agnostic),
    • always-best-model — every task to the single highest-average-quality agent.
  • benchmarks/test_agent_swarm_bench.py + agent-swarm-market-gate CI job — hard-enforce the targets:
    • swarm quality ≥ 15% over hardcoded federation → measured ~+41%
    • swarm cost ≥ 25% below always-best → measured ~74% less
    • plus determinism under a fixed seed.
  • tests/agents/test_agent_swarm_metrics.py — behavioral test (hand-written collector, no mocks) proving AgentSwarm.execute() emits the three live-dashboard signals: bids/sec, win rate per agent, avg reward.

Verification

Local: benchmark gate 4/4 pass, metrics test passes, full suite 4854 passed, ruff check src/ tests/ + mypy + async-gate clean. The gate mirrors the existing world-model-retrieval-gate pattern.

Closes #734

Adds the benchmark + CI gate that the #734 acceptance criteria had no code
against, and closes out the remaining items (the replayable receipt + grounding
half shipped in #822; determinism and the PrometheusMetrics hooks already
existed).

- benchmarks/agent_swarm_bench.py: deterministic 100-task scenario with 5
  per-category specialists + 1 premium generalist. Compares market AgentSwarm
  vs. a hardcoded round-robin AgentFederation (quality) and vs. always-route-to-
  best-model (cost). Measured: swarm ~+41% quality over hardcoded federation,
  ~74% cost reduction vs always-best.
- benchmarks/test_agent_swarm_bench.py + agent-swarm-market-gate CI job: hard-
  enforce >=15% quality improvement and >=25% cost reduction, plus determinism
  under a fixed seed.
- tests/agents/test_agent_swarm_metrics.py: behavioral test (hand-written
  collector, no mocks) proving AgentSwarm.execute() emits the three dashboard
  signals — bids/sec, win rate per agent, avg reward.

Closes #734
@AmitoVrito
AmitoVrito merged commit 66ad76a into main Aug 1, 2026
19 checks passed
@AmitoVrito
AmitoVrito deleted the feat/agent-swarm-benchmark-734 branch August 1, 2026 10:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

v2.0: Agent Swarms with Emergent Specialization — market-based role negotiation

1 participant