🐝 muse-swarm Quota Routing Playground
1 In 10 Seconds: What Is the muse-swarm Multi-Vendor AI Hive?
Start with the big picture, then play with the math formula next — hit ▶ Play Demo or click any bee role

In one sentence: Give one prompt to the Queen, and she splits the task across a multi-vendor AI swarm (Claude, Codex, Gemini, Devin) picked by live quota — each worker codes in its own Git worktree without collisions, a different AI family independently verifies the commit, and any new Queen can seamlessly resume from the GitHub issue.

① Trigger 🧑‍💻 You (Boss) One goal / issue ② Orchestrator 👑 Queen Split · run route.py Cap ≤4 · deliver PR ③ Worker 1 · Worktree A 🐝 Claude / AGY Code module A · commit ③ Worker 2 · Parallel 🐝 Codex (OpenAI) On-demand Risk Audit 🔭 Scout ④ Cross-Family Audit 🛡️ Guard Re-run tests on SHA verdict.py PASS → merge
queen/SKILL.md

👑 QueenOrchestrator

Splits tasks, runs the quota routing formula, guards concurrency & lifeline, and logs state in one issue for handoff.

🐝 WorkerBuilder

Strong models across vendors (Claude, Codex, AGY) coding in isolated Git worktrees without overwriting each other.

🛡️ GuardVerifier

Enforces a different AI family to re-run tests and inspect the exact commit — never letting a model grade its own homework.

🔭 ScoutReviewer

On-demand read-only reviewer hunting design flaws and missing edge-case tests under the same cross-family rule.

2 30-Second Intuition: How One Formula Picks the Best AI Pool
Drag water levels up/down & reset timers left/right right on the canvas, or mute any formula block to watch it break
💧

Bottleneck Level min(5h, 7d)

Whichever tank is lower (5-hour or 7-day) sets the cap — never fooled by a full 5h bucket when weekly quota is almost dry.

⏳

Expiry Urgency ÷ max(h₅, 0.25)

Use-it-or-lose-it! Pools about to reset score higher so we burn expiring quota first and earn a fresh refill cycle.

🛡️

Queen Shield × 0.15

The Queen's own AGY pool is scaled to 15% so external pools take the heavy load first, keeping the orchestrator alive.

① Bottleneck
min(r₅ₕ, r₇d)
Uses the lower of 5h and 7d quota
÷
② Hours to Reset
max(h₅, 0.25h)
Soon-to-reset wins; 15m brake guards ÷0
×
③ Queen Shield
w_agy = 0.15
0.15 for AGY pools, 1.0 for external
=
Selected Top Pool Claude · 38.00
Presets:
3 Full Routing Pipeline: How Every Dispatch Clears 4 Hard Gates
Switch scenarios to watch the live path reroute; click any node to inspect its real code & thresholds
🟢 Safe Pool model-pool.json Roles · Models · 5% 🔵 Live Probe quota.py 5h / 7d / reset time ① Eligibility Gate Family & Role Filter --exclude-family ② Cooldown Floor 5h ≤ 5% or 7d ≤ 5% Drop into cooldown ③ Burn Pressure & Rank score_pool + _rank_key Metered > Fallback(0.5) > Score ④ Queen Lifeline Gate queen_health() agy_gemini 5h≤12% / 7d≤8% ✅ EXIT 0 · Dispatch gate.py load check → run.py ⛔ EXIT 4 · Stop Safe Never downgrade · needs-boss 🚨 EXIT 3 Handoff EXIT 2 Bad Config Fail loud, no fallback
4 Anti-Self-Review Gate & Hard-Threshold Cheat Sheet
Switching CLI clients can still hide the same model family — pick a Worker & Guard to test resolve_family()

🛡️ Cross-Family Merge Gate (verdict.py) Single Truth: route.resolve_family

① Worker that wrote the commit (click to pick):
② Guard reviewing the commit (click to pick):
Worker Family claude ✅ Cross-Family Guard Family openai
Hidden Same-Family Traps:

📋 Component Ownership & Hard Thresholds Source-Verified

Mechanism Type Hard Thresholds & Rules Source
Burn-Pressure Score 🟣 Math min(r5h, r7d) / max(h5, 0.25); AGY scaled by 0.15; if 5h is missing, 7d divides by 24.0 route.py:280
Cooldown & Fallback 🟢 Router Default 5h ≤ 5% or 7d ≤ 5% enters cooldown; unmetered devin = 0.5 ranks behind all metered pools route.py:24,34
Queen Lifeline 🟢 Safety agy_gemini 5h ≤ 20% throttles; 5h ≤ 12% or 7d ≤ 8% triggers EXIT 3 handoff route.py:26,309
Cross-Family Truth 🟢 Gate resolve_family() maps both claude and agy_claude to claude; guards must avoid every worker family in the round route.py:214
verdict.py:36
Host Load Gate 🔵 Ops Checks real host CPU/RAM/IO before dispatch, caps concurrent heavy jobs at ≤ 4, fails loud if script is missing gate.py:8-37