feat: Mission Control v2 — swarm, L402, voice, marketplace, React dashboard
Major expansion of the Timmy Time Dashboard:
Backend modules:
- Swarm subsystem: registry, manager, bidder, coordinator, agent_runner, swarm_node, tasks, comms
- L402/Lightning: payment_handler, l402_proxy with HMAC macaroons
- Voice NLU: regex-based intent detection (chat, status, swarm, task, help, voice)
- Notifications: push notifier for swarm events
- Shortcuts: Siri Shortcuts iOS integration endpoints
- WebSocket: live dashboard event manager
- Inter-agent: agent-to-agent messaging layer
Dashboard routes:
- /swarm/* — swarm management and agent registry
- /marketplace — agent catalog with sat pricing
- /voice/* — voice command processing
- /mobile — mobile status endpoint
- /swarm/live — WebSocket live feed
React web dashboard (dashboard-web/):
- Sovereign Terminal design — dark theme with Bitcoin orange accents
- Three-column layout: status sidebar, workspace tabs, context panel
- Chat, Swarm, Tasks, Marketplace tab views
- JetBrains Mono typography, terminal aesthetic
- Framer Motion animations throughout
Tests: 228 passing (expanded from 93)
Includes Kimi's additional templates and QA work.
2026-02-21 12:57:38 -05:00
|
|
|
"""Tests for new dashboard routes: swarm, marketplace, voice, mobile, shortcuts."""
|
|
|
|
|
|
|
|
|
|
import tempfile
|
|
|
|
|
from unittest.mock import AsyncMock, MagicMock, patch
|
|
|
|
|
|
|
|
|
|
import pytest
|
|
|
|
|
from fastapi.testclient import TestClient
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@pytest.fixture(autouse=True)
|
|
|
|
|
def tmp_swarm_db(tmp_path, monkeypatch):
|
|
|
|
|
"""Point swarm SQLite to a temp directory for test isolation."""
|
|
|
|
|
db_path = tmp_path / "swarm.db"
|
|
|
|
|
monkeypatch.setattr("swarm.tasks.DB_PATH", db_path)
|
|
|
|
|
monkeypatch.setattr("swarm.registry.DB_PATH", db_path)
|
feat(swarm): agent personas, bid stats persistence, marketplace frontend
v2.0.0 Exodus — three roadmap items implemented in one PR:
**1. Agent Personas (Echo, Mace, Helm, Seer, Forge, Quill)**
- src/swarm/personas.py — PERSONAS dict with role, description, capabilities,
rate_sats, bid_base/jitter, and preferred_keywords for each of the 6 agents
- src/swarm/persona_node.py — PersonaNode extends SwarmNode with capability-
aware bidding: bids lower when the task description contains a preferred
keyword (specialist advantage), higher otherwise (off-spec inflation)
- SwarmCoordinator.spawn_persona(persona_id) — registers the persona in the
SQLite registry with its full capabilities string and wires it into the
shared AuctionManager via comms subscription
**2. Bid History Persistence (prerequisite for marketplace stats)**
- src/swarm/stats.py — bid_history table in data/swarm.db:
record_bid(), mark_winner(), get_agent_stats(), get_all_agent_stats()
- coordinator.run_auction_and_assign() now calls swarm_stats.mark_winner()
when a winner is chosen, so tasks_won/total_earned survive restarts
- spawn_persona() records each bid for stats tracking
**3. Marketplace Frontend wired to real data**
- /marketplace/ui — new HTML route renders marketplace.html with live
registry status (idle/busy/offline/planned) and cumulative bid stats
- /marketplace JSON endpoint enriched with same registry+stats data
- marketplace.html — fixed field names (rate_sats, tasks_completed,
total_earned), added role subtitle, comma-split capabilities string,
FREE label for Timmy, "planned_count" display
- base.html — added MARKET nav link pointing to /marketplace/ui
Tests: 315 passed (87 new) covering personas, persona_node, stats CRUD,
marketplace UI route, and enriched catalog data.
https://claude.ai/code/session_013CPPgLc589wfdS8LDNuarL
2026-02-22 12:21:50 +00:00
|
|
|
monkeypatch.setattr("swarm.stats.DB_PATH", db_path)
|
feat: Mission Control v2 — swarm, L402, voice, marketplace, React dashboard
Major expansion of the Timmy Time Dashboard:
Backend modules:
- Swarm subsystem: registry, manager, bidder, coordinator, agent_runner, swarm_node, tasks, comms
- L402/Lightning: payment_handler, l402_proxy with HMAC macaroons
- Voice NLU: regex-based intent detection (chat, status, swarm, task, help, voice)
- Notifications: push notifier for swarm events
- Shortcuts: Siri Shortcuts iOS integration endpoints
- WebSocket: live dashboard event manager
- Inter-agent: agent-to-agent messaging layer
Dashboard routes:
- /swarm/* — swarm management and agent registry
- /marketplace — agent catalog with sat pricing
- /voice/* — voice command processing
- /mobile — mobile status endpoint
- /swarm/live — WebSocket live feed
React web dashboard (dashboard-web/):
- Sovereign Terminal design — dark theme with Bitcoin orange accents
- Three-column layout: status sidebar, workspace tabs, context panel
- Chat, Swarm, Tasks, Marketplace tab views
- JetBrains Mono typography, terminal aesthetic
- Framer Motion animations throughout
Tests: 228 passing (expanded from 93)
Includes Kimi's additional templates and QA work.
2026-02-21 12:57:38 -05:00
|
|
|
yield db_path
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@pytest.fixture
|
|
|
|
|
def client():
|
|
|
|
|
from dashboard.app import app
|
|
|
|
|
with TestClient(app) as c:
|
|
|
|
|
yield c
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# ── Swarm routes ─────────────────────────────────────────────────────────────
|
|
|
|
|
|
|
|
|
|
def test_swarm_status(client):
|
|
|
|
|
response = client.get("/swarm")
|
|
|
|
|
assert response.status_code == 200
|
|
|
|
|
data = response.json()
|
|
|
|
|
assert "agents" in data
|
|
|
|
|
assert "tasks_total" in data
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def test_swarm_list_agents(client):
|
|
|
|
|
response = client.get("/swarm/agents")
|
|
|
|
|
assert response.status_code == 200
|
|
|
|
|
assert "agents" in response.json()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def test_swarm_spawn_agent(client):
|
|
|
|
|
response = client.post("/swarm/spawn", data={"name": "TestBot"})
|
|
|
|
|
assert response.status_code == 200
|
|
|
|
|
data = response.json()
|
|
|
|
|
assert data["name"] == "TestBot"
|
|
|
|
|
assert "agent_id" in data
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def test_swarm_list_tasks(client):
|
|
|
|
|
response = client.get("/swarm/tasks")
|
|
|
|
|
assert response.status_code == 200
|
|
|
|
|
assert "tasks" in response.json()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def test_swarm_post_task(client):
|
|
|
|
|
response = client.post("/swarm/tasks", data={"description": "Research Bitcoin"})
|
|
|
|
|
assert response.status_code == 200
|
|
|
|
|
data = response.json()
|
|
|
|
|
assert data["description"] == "Research Bitcoin"
|
|
|
|
|
assert data["status"] == "bidding"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def test_swarm_get_task(client):
|
|
|
|
|
# Create a task first
|
|
|
|
|
create_resp = client.post("/swarm/tasks", data={"description": "Find me"})
|
|
|
|
|
task_id = create_resp.json()["task_id"]
|
|
|
|
|
# Retrieve it
|
|
|
|
|
response = client.get(f"/swarm/tasks/{task_id}")
|
|
|
|
|
assert response.status_code == 200
|
|
|
|
|
assert response.json()["description"] == "Find me"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def test_swarm_get_task_not_found(client):
|
|
|
|
|
response = client.get("/swarm/tasks/nonexistent")
|
|
|
|
|
assert response.status_code == 200
|
|
|
|
|
assert "error" in response.json()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# ── Marketplace routes ───────────────────────────────────────────────────────
|
|
|
|
|
|
|
|
|
|
def test_marketplace_list(client):
|
|
|
|
|
response = client.get("/marketplace")
|
|
|
|
|
assert response.status_code == 200
|
|
|
|
|
data = response.json()
|
|
|
|
|
assert "agents" in data
|
|
|
|
|
assert data["total"] >= 7 # Timmy + 6 planned personas
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def test_marketplace_has_timmy(client):
|
|
|
|
|
response = client.get("/marketplace")
|
|
|
|
|
agents = response.json()["agents"]
|
|
|
|
|
timmy = next((a for a in agents if a["id"] == "timmy"), None)
|
|
|
|
|
assert timmy is not None
|
|
|
|
|
assert timmy["status"] == "active"
|
|
|
|
|
assert timmy["rate_sats"] == 0
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def test_marketplace_has_planned_agents(client):
|
|
|
|
|
response = client.get("/marketplace")
|
|
|
|
|
data = response.json()
|
feat: add full creative studio + DevOps tools (Pixel, Lyra, Reel personas)
Adds 3 new personas (Pixel, Lyra, Reel) and 5 new tool modules:
- Git/DevOps tools (GitPython): clone, status, diff, log, blame, branch,
add, commit, push, pull, stash — wired to Forge and Helm personas
- Image generation (FLUX via diffusers): text-to-image, storyboards,
variations — Pixel persona
- Music generation (ACE-Step 1.5): full songs with vocals+instrumentals,
instrumental tracks, vocal-only tracks — Lyra persona
- Video generation (Wan 2.1 via diffusers): text-to-video, image-to-video
clips — Reel persona
- Creative Director pipeline: multi-step orchestration that chains
storyboard → music → video → assembly into 3+ minute final videos
- Video assembler (MoviePy + FFmpeg): stitch clips, overlay audio,
title cards, subtitles, final export
Also includes:
- Spark Intelligence tool-level + creative pipeline event capture
- Creative Studio dashboard page (/creative/ui) with 4 tabs
- Config settings for all new models and output directories
- pyproject.toml creative optional extra for GPU dependencies
- 107 new tests covering all modules (624 total, all passing)
https://claude.ai/code/session_01KJm6jQkNi3aA3yoQJn636c
2026-02-24 16:31:47 +00:00
|
|
|
# Total should be 10 (1 Timmy + 9 personas)
|
|
|
|
|
assert data["total"] == 10
|
feat: swarm E2E, MCP tools, timmy-serve L402, tests, notifications
Major Features:
- Auto-spawn persona agents (Echo, Forge, Seer) on app startup
- WebSocket broadcasts for real-time swarm UI updates
- MCP tool integration: web search, file I/O, shell, Python execution
- New /tools dashboard page showing agent capabilities
- Real timmy-serve start with L402 payment gating middleware
- Browser push notifications for briefings and task events
Tests:
- test_docker_agent.py: 9 tests for Docker agent runner
- test_swarm_integration_full.py: 18 E2E lifecycle tests
- Fixed all pytest warnings (436 tests, 0 warnings)
Improvements:
- Fixed coroutine warnings in coordinator broadcasts
- Fixed ResourceWarning for unclosed process pipes
- Added pytest-asyncio config to pyproject.toml
- Test isolation with proper event loop cleanup
2026-02-22 19:01:04 -05:00
|
|
|
# planned_count + active_count should equal total
|
|
|
|
|
assert data["planned_count"] + data["active_count"] == data["total"]
|
|
|
|
|
# Timmy should always be in the active list
|
|
|
|
|
timmy = next((a for a in data["agents"] if a["id"] == "timmy"), None)
|
|
|
|
|
assert timmy is not None
|
|
|
|
|
assert timmy["status"] == "active"
|
feat: Mission Control v2 — swarm, L402, voice, marketplace, React dashboard
Major expansion of the Timmy Time Dashboard:
Backend modules:
- Swarm subsystem: registry, manager, bidder, coordinator, agent_runner, swarm_node, tasks, comms
- L402/Lightning: payment_handler, l402_proxy with HMAC macaroons
- Voice NLU: regex-based intent detection (chat, status, swarm, task, help, voice)
- Notifications: push notifier for swarm events
- Shortcuts: Siri Shortcuts iOS integration endpoints
- WebSocket: live dashboard event manager
- Inter-agent: agent-to-agent messaging layer
Dashboard routes:
- /swarm/* — swarm management and agent registry
- /marketplace — agent catalog with sat pricing
- /voice/* — voice command processing
- /mobile — mobile status endpoint
- /swarm/live — WebSocket live feed
React web dashboard (dashboard-web/):
- Sovereign Terminal design — dark theme with Bitcoin orange accents
- Three-column layout: status sidebar, workspace tabs, context panel
- Chat, Swarm, Tasks, Marketplace tab views
- JetBrains Mono typography, terminal aesthetic
- Framer Motion animations throughout
Tests: 228 passing (expanded from 93)
Includes Kimi's additional templates and QA work.
2026-02-21 12:57:38 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
def test_marketplace_agent_detail(client):
|
|
|
|
|
response = client.get("/marketplace/echo")
|
|
|
|
|
assert response.status_code == 200
|
|
|
|
|
assert response.json()["name"] == "Echo"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def test_marketplace_agent_not_found(client):
|
|
|
|
|
response = client.get("/marketplace/nonexistent")
|
|
|
|
|
assert response.status_code == 200
|
|
|
|
|
assert "error" in response.json()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# ── Voice routes ─────────────────────────────────────────────────────────────
|
|
|
|
|
|
|
|
|
|
def test_voice_nlu(client):
|
|
|
|
|
response = client.post("/voice/nlu", data={"text": "What is your status?"})
|
|
|
|
|
assert response.status_code == 200
|
|
|
|
|
data = response.json()
|
|
|
|
|
assert data["intent"] == "status"
|
|
|
|
|
assert data["confidence"] >= 0.8
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def test_voice_nlu_chat_fallback(client):
|
|
|
|
|
response = client.post("/voice/nlu", data={"text": "Tell me about Bitcoin"})
|
|
|
|
|
assert response.status_code == 200
|
|
|
|
|
assert response.json()["intent"] == "chat"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def test_voice_tts_status(client):
|
|
|
|
|
response = client.get("/voice/tts/status")
|
|
|
|
|
assert response.status_code == 200
|
|
|
|
|
assert "available" in response.json()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# ── Mobile routes ────────────────────────────────────────────────────────────
|
|
|
|
|
|
|
|
|
|
def test_mobile_dashboard(client):
|
|
|
|
|
response = client.get("/mobile")
|
|
|
|
|
assert response.status_code == 200
|
|
|
|
|
assert "TIMMY TIME" in response.text
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def test_mobile_status(client):
|
|
|
|
|
with patch("dashboard.routes.health.check_ollama", new_callable=AsyncMock, return_value=True):
|
|
|
|
|
response = client.get("/mobile/status")
|
|
|
|
|
assert response.status_code == 200
|
|
|
|
|
data = response.json()
|
|
|
|
|
assert data["agent"] == "timmy"
|
|
|
|
|
assert data["ready"] is True
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# ── Shortcuts route ──────────────────────────────────────────────────────────
|
|
|
|
|
|
|
|
|
|
def test_shortcuts_setup(client):
|
|
|
|
|
response = client.get("/shortcuts/setup")
|
|
|
|
|
assert response.status_code == 200
|
|
|
|
|
data = response.json()
|
|
|
|
|
assert "title" in data
|
|
|
|
|
assert "actions" in data
|
|
|
|
|
assert len(data["actions"]) >= 4
|
feat(swarm): agent personas, bid stats persistence, marketplace frontend
v2.0.0 Exodus — three roadmap items implemented in one PR:
**1. Agent Personas (Echo, Mace, Helm, Seer, Forge, Quill)**
- src/swarm/personas.py — PERSONAS dict with role, description, capabilities,
rate_sats, bid_base/jitter, and preferred_keywords for each of the 6 agents
- src/swarm/persona_node.py — PersonaNode extends SwarmNode with capability-
aware bidding: bids lower when the task description contains a preferred
keyword (specialist advantage), higher otherwise (off-spec inflation)
- SwarmCoordinator.spawn_persona(persona_id) — registers the persona in the
SQLite registry with its full capabilities string and wires it into the
shared AuctionManager via comms subscription
**2. Bid History Persistence (prerequisite for marketplace stats)**
- src/swarm/stats.py — bid_history table in data/swarm.db:
record_bid(), mark_winner(), get_agent_stats(), get_all_agent_stats()
- coordinator.run_auction_and_assign() now calls swarm_stats.mark_winner()
when a winner is chosen, so tasks_won/total_earned survive restarts
- spawn_persona() records each bid for stats tracking
**3. Marketplace Frontend wired to real data**
- /marketplace/ui — new HTML route renders marketplace.html with live
registry status (idle/busy/offline/planned) and cumulative bid stats
- /marketplace JSON endpoint enriched with same registry+stats data
- marketplace.html — fixed field names (rate_sats, tasks_completed,
total_earned), added role subtitle, comma-split capabilities string,
FREE label for Timmy, "planned_count" display
- base.html — added MARKET nav link pointing to /marketplace/ui
Tests: 315 passed (87 new) covering personas, persona_node, stats CRUD,
marketplace UI route, and enriched catalog data.
https://claude.ai/code/session_013CPPgLc589wfdS8LDNuarL
2026-02-22 12:21:50 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
# ── Marketplace UI route ──────────────────────────────────────────────────────
|
|
|
|
|
|
|
|
|
|
def test_marketplace_ui_renders_html(client):
|
|
|
|
|
response = client.get("/marketplace/ui")
|
|
|
|
|
assert response.status_code == 200
|
|
|
|
|
assert "text/html" in response.headers["content-type"]
|
|
|
|
|
assert "Agent Marketplace" in response.text
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def test_marketplace_ui_shows_all_agents(client):
|
|
|
|
|
response = client.get("/marketplace/ui")
|
|
|
|
|
assert response.status_code == 200
|
|
|
|
|
# All seven catalog entries should appear
|
|
|
|
|
for name in ["Timmy", "Echo", "Mace", "Helm", "Seer", "Forge", "Quill"]:
|
|
|
|
|
assert name in response.text, f"{name} not found in marketplace UI"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def test_marketplace_ui_shows_timmy_free(client):
|
|
|
|
|
response = client.get("/marketplace/ui")
|
|
|
|
|
assert "FREE" in response.text
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def test_marketplace_ui_shows_planned_status(client):
|
|
|
|
|
response = client.get("/marketplace/ui")
|
|
|
|
|
# Personas not yet in registry show as "planned"
|
|
|
|
|
assert "planned" in response.text
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def test_marketplace_ui_shows_active_timmy(client):
|
|
|
|
|
response = client.get("/marketplace/ui")
|
|
|
|
|
# Timmy is always active even without registry entry
|
|
|
|
|
assert "active" in response.text
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# ── Marketplace enriched data ─────────────────────────────────────────────────
|
|
|
|
|
|
|
|
|
|
def test_marketplace_enriched_includes_stats_fields(client):
|
|
|
|
|
response = client.get("/marketplace")
|
|
|
|
|
agents = response.json()["agents"]
|
|
|
|
|
for a in agents:
|
|
|
|
|
assert "tasks_completed" in a, f"Missing tasks_completed in {a['id']}"
|
|
|
|
|
assert "total_earned" in a, f"Missing total_earned in {a['id']}"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def test_marketplace_persona_spawned_changes_status(client):
|
|
|
|
|
"""Spawning a persona into the registry changes its marketplace status."""
|
feat: swarm E2E, MCP tools, timmy-serve L402, tests, notifications
Major Features:
- Auto-spawn persona agents (Echo, Forge, Seer) on app startup
- WebSocket broadcasts for real-time swarm UI updates
- MCP tool integration: web search, file I/O, shell, Python execution
- New /tools dashboard page showing agent capabilities
- Real timmy-serve start with L402 payment gating middleware
- Browser push notifications for briefings and task events
Tests:
- test_docker_agent.py: 9 tests for Docker agent runner
- test_swarm_integration_full.py: 18 E2E lifecycle tests
- Fixed all pytest warnings (436 tests, 0 warnings)
Improvements:
- Fixed coroutine warnings in coordinator broadcasts
- Fixed ResourceWarning for unclosed process pipes
- Added pytest-asyncio config to pyproject.toml
- Test isolation with proper event loop cleanup
2026-02-22 19:01:04 -05:00
|
|
|
# Spawn Echo via swarm route (or ensure it's already spawned)
|
feat(swarm): agent personas, bid stats persistence, marketplace frontend
v2.0.0 Exodus — three roadmap items implemented in one PR:
**1. Agent Personas (Echo, Mace, Helm, Seer, Forge, Quill)**
- src/swarm/personas.py — PERSONAS dict with role, description, capabilities,
rate_sats, bid_base/jitter, and preferred_keywords for each of the 6 agents
- src/swarm/persona_node.py — PersonaNode extends SwarmNode with capability-
aware bidding: bids lower when the task description contains a preferred
keyword (specialist advantage), higher otherwise (off-spec inflation)
- SwarmCoordinator.spawn_persona(persona_id) — registers the persona in the
SQLite registry with its full capabilities string and wires it into the
shared AuctionManager via comms subscription
**2. Bid History Persistence (prerequisite for marketplace stats)**
- src/swarm/stats.py — bid_history table in data/swarm.db:
record_bid(), mark_winner(), get_agent_stats(), get_all_agent_stats()
- coordinator.run_auction_and_assign() now calls swarm_stats.mark_winner()
when a winner is chosen, so tasks_won/total_earned survive restarts
- spawn_persona() records each bid for stats tracking
**3. Marketplace Frontend wired to real data**
- /marketplace/ui — new HTML route renders marketplace.html with live
registry status (idle/busy/offline/planned) and cumulative bid stats
- /marketplace JSON endpoint enriched with same registry+stats data
- marketplace.html — fixed field names (rate_sats, tasks_completed,
total_earned), added role subtitle, comma-split capabilities string,
FREE label for Timmy, "planned_count" display
- base.html — added MARKET nav link pointing to /marketplace/ui
Tests: 315 passed (87 new) covering personas, persona_node, stats CRUD,
marketplace UI route, and enriched catalog data.
https://claude.ai/code/session_013CPPgLc589wfdS8LDNuarL
2026-02-22 12:21:50 +00:00
|
|
|
spawn_resp = client.post("/swarm/spawn", data={"name": "Echo"})
|
|
|
|
|
assert spawn_resp.status_code == 200
|
|
|
|
|
|
feat: swarm E2E, MCP tools, timmy-serve L402, tests, notifications
Major Features:
- Auto-spawn persona agents (Echo, Forge, Seer) on app startup
- WebSocket broadcasts for real-time swarm UI updates
- MCP tool integration: web search, file I/O, shell, Python execution
- New /tools dashboard page showing agent capabilities
- Real timmy-serve start with L402 payment gating middleware
- Browser push notifications for briefings and task events
Tests:
- test_docker_agent.py: 9 tests for Docker agent runner
- test_swarm_integration_full.py: 18 E2E lifecycle tests
- Fixed all pytest warnings (436 tests, 0 warnings)
Improvements:
- Fixed coroutine warnings in coordinator broadcasts
- Fixed ResourceWarning for unclosed process pipes
- Added pytest-asyncio config to pyproject.toml
- Test isolation with proper event loop cleanup
2026-02-22 19:01:04 -05:00
|
|
|
# Echo should now show as idle (or busy) in the marketplace
|
feat(swarm): agent personas, bid stats persistence, marketplace frontend
v2.0.0 Exodus — three roadmap items implemented in one PR:
**1. Agent Personas (Echo, Mace, Helm, Seer, Forge, Quill)**
- src/swarm/personas.py — PERSONAS dict with role, description, capabilities,
rate_sats, bid_base/jitter, and preferred_keywords for each of the 6 agents
- src/swarm/persona_node.py — PersonaNode extends SwarmNode with capability-
aware bidding: bids lower when the task description contains a preferred
keyword (specialist advantage), higher otherwise (off-spec inflation)
- SwarmCoordinator.spawn_persona(persona_id) — registers the persona in the
SQLite registry with its full capabilities string and wires it into the
shared AuctionManager via comms subscription
**2. Bid History Persistence (prerequisite for marketplace stats)**
- src/swarm/stats.py — bid_history table in data/swarm.db:
record_bid(), mark_winner(), get_agent_stats(), get_all_agent_stats()
- coordinator.run_auction_and_assign() now calls swarm_stats.mark_winner()
when a winner is chosen, so tasks_won/total_earned survive restarts
- spawn_persona() records each bid for stats tracking
**3. Marketplace Frontend wired to real data**
- /marketplace/ui — new HTML route renders marketplace.html with live
registry status (idle/busy/offline/planned) and cumulative bid stats
- /marketplace JSON endpoint enriched with same registry+stats data
- marketplace.html — fixed field names (rate_sats, tasks_completed,
total_earned), added role subtitle, comma-split capabilities string,
FREE label for Timmy, "planned_count" display
- base.html — added MARKET nav link pointing to /marketplace/ui
Tests: 315 passed (87 new) covering personas, persona_node, stats CRUD,
marketplace UI route, and enriched catalog data.
https://claude.ai/code/session_013CPPgLc589wfdS8LDNuarL
2026-02-22 12:21:50 +00:00
|
|
|
resp = client.get("/marketplace")
|
|
|
|
|
agents = {a["id"]: a for a in resp.json()["agents"]}
|
feat: swarm E2E, MCP tools, timmy-serve L402, tests, notifications
Major Features:
- Auto-spawn persona agents (Echo, Forge, Seer) on app startup
- WebSocket broadcasts for real-time swarm UI updates
- MCP tool integration: web search, file I/O, shell, Python execution
- New /tools dashboard page showing agent capabilities
- Real timmy-serve start with L402 payment gating middleware
- Browser push notifications for briefings and task events
Tests:
- test_docker_agent.py: 9 tests for Docker agent runner
- test_swarm_integration_full.py: 18 E2E lifecycle tests
- Fixed all pytest warnings (436 tests, 0 warnings)
Improvements:
- Fixed coroutine warnings in coordinator broadcasts
- Fixed ResourceWarning for unclosed process pipes
- Added pytest-asyncio config to pyproject.toml
- Test isolation with proper event loop cleanup
2026-02-22 19:01:04 -05:00
|
|
|
assert agents["echo"]["status"] in ("idle", "busy")
|