feat: complete Event Log, Ledger, Memory, Cascade Router, Upgrade Queue, Activity Feed
This commit implements six major features:
1. Event Log System (src/swarm/event_log.py)
- SQLite-based audit trail for all swarm events
- Task lifecycle tracking (created, assigned, completed, failed)
- Agent lifecycle tracking (joined, left, status changes)
- Integrated with coordinator for automatic logging
- Dashboard page at /swarm/events
2. Lightning Ledger (src/lightning/ledger.py)
- Transaction tracking for Lightning Network payments
- Balance calculations (incoming, outgoing, net, available)
- Integrated with payment_handler for automatic logging
- Dashboard page at /lightning/ledger
3. Semantic Memory / Vector Store (src/memory/vector_store.py)
- Embedding-based similarity search for Echo agent
- Fallback to keyword matching if sentence-transformers unavailable
- Personal facts storage and retrieval
- Dashboard page at /memory
4. Cascade Router Integration (src/timmy/cascade_adapter.py)
- Automatic LLM failover between providers (Ollama → AirLLM → API)
- Circuit breaker pattern for failing providers
- Metrics tracking per provider (latency, error rates)
- Dashboard status page at /router/status
5. Self-Upgrade Approval Queue (src/upgrades/)
- State machine for self-modifications: proposed → approved/rejected → applied/failed
- Human approval required before applying changes
- Git integration for branch management
- Dashboard queue at /self-modify/queue
6. Real-Time Activity Feed (src/events/broadcaster.py)
- WebSocket-based live activity streaming
- Bridges event_log to dashboard clients
- Activity panel on /swarm/live
Tests:
- 101 unit tests passing
- 4 new E2E test files for Selenium testing
- Run with: SELENIUM_UI=1 pytest tests/functional/ -v --headed
Documentation:
- 6 ADRs (017-022) documenting architecture decisions
- Implementation summary in docs/IMPLEMENTATION_SUMMARY.md
- Architecture diagram in docs/architecture-v2.md
2026-02-26 08:01:01 -05:00
|
|
|
"""Shared fixtures for functional/E2E tests."""
|
2026-02-25 00:46:22 +00:00
|
|
|
|
|
|
|
|
import os
|
|
|
|
|
import subprocess
|
|
|
|
|
import sys
|
|
|
|
|
import time
|
feat: complete Event Log, Ledger, Memory, Cascade Router, Upgrade Queue, Activity Feed
This commit implements six major features:
1. Event Log System (src/swarm/event_log.py)
- SQLite-based audit trail for all swarm events
- Task lifecycle tracking (created, assigned, completed, failed)
- Agent lifecycle tracking (joined, left, status changes)
- Integrated with coordinator for automatic logging
- Dashboard page at /swarm/events
2. Lightning Ledger (src/lightning/ledger.py)
- Transaction tracking for Lightning Network payments
- Balance calculations (incoming, outgoing, net, available)
- Integrated with payment_handler for automatic logging
- Dashboard page at /lightning/ledger
3. Semantic Memory / Vector Store (src/memory/vector_store.py)
- Embedding-based similarity search for Echo agent
- Fallback to keyword matching if sentence-transformers unavailable
- Personal facts storage and retrieval
- Dashboard page at /memory
4. Cascade Router Integration (src/timmy/cascade_adapter.py)
- Automatic LLM failover between providers (Ollama → AirLLM → API)
- Circuit breaker pattern for failing providers
- Metrics tracking per provider (latency, error rates)
- Dashboard status page at /router/status
5. Self-Upgrade Approval Queue (src/upgrades/)
- State machine for self-modifications: proposed → approved/rejected → applied/failed
- Human approval required before applying changes
- Git integration for branch management
- Dashboard queue at /self-modify/queue
6. Real-Time Activity Feed (src/events/broadcaster.py)
- WebSocket-based live activity streaming
- Bridges event_log to dashboard clients
- Activity panel on /swarm/live
Tests:
- 101 unit tests passing
- 4 new E2E test files for Selenium testing
- Run with: SELENIUM_UI=1 pytest tests/functional/ -v --headed
Documentation:
- 6 ADRs (017-022) documenting architecture decisions
- Implementation summary in docs/IMPLEMENTATION_SUMMARY.md
- Architecture diagram in docs/architecture-v2.md
2026-02-26 08:01:01 -05:00
|
|
|
import urllib.request
|
2026-03-09 21:54:04 -04:00
|
|
|
from unittest.mock import MagicMock
|
2026-02-25 00:46:22 +00:00
|
|
|
|
|
|
|
|
import pytest
|
|
|
|
|
|
2026-03-09 21:54:04 -04:00
|
|
|
# ── Un-stub agno for functional tests ─────────────────────────────────────────
|
|
|
|
|
# Root conftest stubs agno with MagicMock for unit tests.
|
|
|
|
|
# Functional tests need real agno (tool execution, agent creation, etc.).
|
|
|
|
|
_agno_mods = [
|
|
|
|
|
"agno",
|
|
|
|
|
"agno.agent",
|
|
|
|
|
"agno.models",
|
|
|
|
|
"agno.models.ollama",
|
|
|
|
|
"agno.db",
|
|
|
|
|
"agno.db.sqlite",
|
|
|
|
|
"agno.tools",
|
|
|
|
|
"agno.tools.shell",
|
|
|
|
|
"agno.tools.python",
|
|
|
|
|
"agno.tools.file",
|
|
|
|
|
]
|
|
|
|
|
for _mod in _agno_mods:
|
|
|
|
|
if _mod in sys.modules and isinstance(sys.modules[_mod], MagicMock):
|
|
|
|
|
del sys.modules[_mod]
|
|
|
|
|
|
feat: complete Event Log, Ledger, Memory, Cascade Router, Upgrade Queue, Activity Feed
This commit implements six major features:
1. Event Log System (src/swarm/event_log.py)
- SQLite-based audit trail for all swarm events
- Task lifecycle tracking (created, assigned, completed, failed)
- Agent lifecycle tracking (joined, left, status changes)
- Integrated with coordinator for automatic logging
- Dashboard page at /swarm/events
2. Lightning Ledger (src/lightning/ledger.py)
- Transaction tracking for Lightning Network payments
- Balance calculations (incoming, outgoing, net, available)
- Integrated with payment_handler for automatic logging
- Dashboard page at /lightning/ledger
3. Semantic Memory / Vector Store (src/memory/vector_store.py)
- Embedding-based similarity search for Echo agent
- Fallback to keyword matching if sentence-transformers unavailable
- Personal facts storage and retrieval
- Dashboard page at /memory
4. Cascade Router Integration (src/timmy/cascade_adapter.py)
- Automatic LLM failover between providers (Ollama → AirLLM → API)
- Circuit breaker pattern for failing providers
- Metrics tracking per provider (latency, error rates)
- Dashboard status page at /router/status
5. Self-Upgrade Approval Queue (src/upgrades/)
- State machine for self-modifications: proposed → approved/rejected → applied/failed
- Human approval required before applying changes
- Git integration for branch management
- Dashboard queue at /self-modify/queue
6. Real-Time Activity Feed (src/events/broadcaster.py)
- WebSocket-based live activity streaming
- Bridges event_log to dashboard clients
- Activity panel on /swarm/live
Tests:
- 101 unit tests passing
- 4 new E2E test files for Selenium testing
- Run with: SELENIUM_UI=1 pytest tests/functional/ -v --headed
Documentation:
- 6 ADRs (017-022) documenting architecture decisions
- Implementation summary in docs/IMPLEMENTATION_SUMMARY.md
- Architecture diagram in docs/architecture-v2.md
2026-02-26 08:01:01 -05:00
|
|
|
# Default dashboard URL - override with DASHBOARD_URL env var
|
|
|
|
|
DASHBOARD_URL = os.environ.get("DASHBOARD_URL", "http://localhost:8000")
|
2026-02-25 00:46:22 +00:00
|
|
|
|
|
|
|
|
|
feat: complete Event Log, Ledger, Memory, Cascade Router, Upgrade Queue, Activity Feed
This commit implements six major features:
1. Event Log System (src/swarm/event_log.py)
- SQLite-based audit trail for all swarm events
- Task lifecycle tracking (created, assigned, completed, failed)
- Agent lifecycle tracking (joined, left, status changes)
- Integrated with coordinator for automatic logging
- Dashboard page at /swarm/events
2. Lightning Ledger (src/lightning/ledger.py)
- Transaction tracking for Lightning Network payments
- Balance calculations (incoming, outgoing, net, available)
- Integrated with payment_handler for automatic logging
- Dashboard page at /lightning/ledger
3. Semantic Memory / Vector Store (src/memory/vector_store.py)
- Embedding-based similarity search for Echo agent
- Fallback to keyword matching if sentence-transformers unavailable
- Personal facts storage and retrieval
- Dashboard page at /memory
4. Cascade Router Integration (src/timmy/cascade_adapter.py)
- Automatic LLM failover between providers (Ollama → AirLLM → API)
- Circuit breaker pattern for failing providers
- Metrics tracking per provider (latency, error rates)
- Dashboard status page at /router/status
5. Self-Upgrade Approval Queue (src/upgrades/)
- State machine for self-modifications: proposed → approved/rejected → applied/failed
- Human approval required before applying changes
- Git integration for branch management
- Dashboard queue at /self-modify/queue
6. Real-Time Activity Feed (src/events/broadcaster.py)
- WebSocket-based live activity streaming
- Bridges event_log to dashboard clients
- Activity panel on /swarm/live
Tests:
- 101 unit tests passing
- 4 new E2E test files for Selenium testing
- Run with: SELENIUM_UI=1 pytest tests/functional/ -v --headed
Documentation:
- 6 ADRs (017-022) documenting architecture decisions
- Implementation summary in docs/IMPLEMENTATION_SUMMARY.md
- Architecture diagram in docs/architecture-v2.md
2026-02-26 08:01:01 -05:00
|
|
|
def is_server_running():
|
|
|
|
|
"""Check if dashboard is already running."""
|
2026-02-25 00:46:22 +00:00
|
|
|
try:
|
feat: complete Event Log, Ledger, Memory, Cascade Router, Upgrade Queue, Activity Feed
This commit implements six major features:
1. Event Log System (src/swarm/event_log.py)
- SQLite-based audit trail for all swarm events
- Task lifecycle tracking (created, assigned, completed, failed)
- Agent lifecycle tracking (joined, left, status changes)
- Integrated with coordinator for automatic logging
- Dashboard page at /swarm/events
2. Lightning Ledger (src/lightning/ledger.py)
- Transaction tracking for Lightning Network payments
- Balance calculations (incoming, outgoing, net, available)
- Integrated with payment_handler for automatic logging
- Dashboard page at /lightning/ledger
3. Semantic Memory / Vector Store (src/memory/vector_store.py)
- Embedding-based similarity search for Echo agent
- Fallback to keyword matching if sentence-transformers unavailable
- Personal facts storage and retrieval
- Dashboard page at /memory
4. Cascade Router Integration (src/timmy/cascade_adapter.py)
- Automatic LLM failover between providers (Ollama → AirLLM → API)
- Circuit breaker pattern for failing providers
- Metrics tracking per provider (latency, error rates)
- Dashboard status page at /router/status
5. Self-Upgrade Approval Queue (src/upgrades/)
- State machine for self-modifications: proposed → approved/rejected → applied/failed
- Human approval required before applying changes
- Git integration for branch management
- Dashboard queue at /self-modify/queue
6. Real-Time Activity Feed (src/events/broadcaster.py)
- WebSocket-based live activity streaming
- Bridges event_log to dashboard clients
- Activity panel on /swarm/live
Tests:
- 101 unit tests passing
- 4 new E2E test files for Selenium testing
- Run with: SELENIUM_UI=1 pytest tests/functional/ -v --headed
Documentation:
- 6 ADRs (017-022) documenting architecture decisions
- Implementation summary in docs/IMPLEMENTATION_SUMMARY.md
- Architecture diagram in docs/architecture-v2.md
2026-02-26 08:01:01 -05:00
|
|
|
urllib.request.urlopen(f"{DASHBOARD_URL}/health", timeout=2)
|
|
|
|
|
return True
|
2026-02-25 00:46:22 +00:00
|
|
|
except Exception:
|
feat: complete Event Log, Ledger, Memory, Cascade Router, Upgrade Queue, Activity Feed
This commit implements six major features:
1. Event Log System (src/swarm/event_log.py)
- SQLite-based audit trail for all swarm events
- Task lifecycle tracking (created, assigned, completed, failed)
- Agent lifecycle tracking (joined, left, status changes)
- Integrated with coordinator for automatic logging
- Dashboard page at /swarm/events
2. Lightning Ledger (src/lightning/ledger.py)
- Transaction tracking for Lightning Network payments
- Balance calculations (incoming, outgoing, net, available)
- Integrated with payment_handler for automatic logging
- Dashboard page at /lightning/ledger
3. Semantic Memory / Vector Store (src/memory/vector_store.py)
- Embedding-based similarity search for Echo agent
- Fallback to keyword matching if sentence-transformers unavailable
- Personal facts storage and retrieval
- Dashboard page at /memory
4. Cascade Router Integration (src/timmy/cascade_adapter.py)
- Automatic LLM failover between providers (Ollama → AirLLM → API)
- Circuit breaker pattern for failing providers
- Metrics tracking per provider (latency, error rates)
- Dashboard status page at /router/status
5. Self-Upgrade Approval Queue (src/upgrades/)
- State machine for self-modifications: proposed → approved/rejected → applied/failed
- Human approval required before applying changes
- Git integration for branch management
- Dashboard queue at /self-modify/queue
6. Real-Time Activity Feed (src/events/broadcaster.py)
- WebSocket-based live activity streaming
- Bridges event_log to dashboard clients
- Activity panel on /swarm/live
Tests:
- 101 unit tests passing
- 4 new E2E test files for Selenium testing
- Run with: SELENIUM_UI=1 pytest tests/functional/ -v --headed
Documentation:
- 6 ADRs (017-022) documenting architecture decisions
- Implementation summary in docs/IMPLEMENTATION_SUMMARY.md
- Architecture diagram in docs/architecture-v2.md
2026-02-26 08:01:01 -05:00
|
|
|
return False
|
2026-02-25 00:46:22 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
@pytest.fixture(scope="session")
|
feat: complete Event Log, Ledger, Memory, Cascade Router, Upgrade Queue, Activity Feed
This commit implements six major features:
1. Event Log System (src/swarm/event_log.py)
- SQLite-based audit trail for all swarm events
- Task lifecycle tracking (created, assigned, completed, failed)
- Agent lifecycle tracking (joined, left, status changes)
- Integrated with coordinator for automatic logging
- Dashboard page at /swarm/events
2. Lightning Ledger (src/lightning/ledger.py)
- Transaction tracking for Lightning Network payments
- Balance calculations (incoming, outgoing, net, available)
- Integrated with payment_handler for automatic logging
- Dashboard page at /lightning/ledger
3. Semantic Memory / Vector Store (src/memory/vector_store.py)
- Embedding-based similarity search for Echo agent
- Fallback to keyword matching if sentence-transformers unavailable
- Personal facts storage and retrieval
- Dashboard page at /memory
4. Cascade Router Integration (src/timmy/cascade_adapter.py)
- Automatic LLM failover between providers (Ollama → AirLLM → API)
- Circuit breaker pattern for failing providers
- Metrics tracking per provider (latency, error rates)
- Dashboard status page at /router/status
5. Self-Upgrade Approval Queue (src/upgrades/)
- State machine for self-modifications: proposed → approved/rejected → applied/failed
- Human approval required before applying changes
- Git integration for branch management
- Dashboard queue at /self-modify/queue
6. Real-Time Activity Feed (src/events/broadcaster.py)
- WebSocket-based live activity streaming
- Bridges event_log to dashboard clients
- Activity panel on /swarm/live
Tests:
- 101 unit tests passing
- 4 new E2E test files for Selenium testing
- Run with: SELENIUM_UI=1 pytest tests/functional/ -v --headed
Documentation:
- 6 ADRs (017-022) documenting architecture decisions
- Implementation summary in docs/IMPLEMENTATION_SUMMARY.md
- Architecture diagram in docs/architecture-v2.md
2026-02-26 08:01:01 -05:00
|
|
|
def live_server():
|
|
|
|
|
"""Start the real Timmy server for E2E tests.
|
2026-03-08 12:50:44 -04:00
|
|
|
|
feat: complete Event Log, Ledger, Memory, Cascade Router, Upgrade Queue, Activity Feed
This commit implements six major features:
1. Event Log System (src/swarm/event_log.py)
- SQLite-based audit trail for all swarm events
- Task lifecycle tracking (created, assigned, completed, failed)
- Agent lifecycle tracking (joined, left, status changes)
- Integrated with coordinator for automatic logging
- Dashboard page at /swarm/events
2. Lightning Ledger (src/lightning/ledger.py)
- Transaction tracking for Lightning Network payments
- Balance calculations (incoming, outgoing, net, available)
- Integrated with payment_handler for automatic logging
- Dashboard page at /lightning/ledger
3. Semantic Memory / Vector Store (src/memory/vector_store.py)
- Embedding-based similarity search for Echo agent
- Fallback to keyword matching if sentence-transformers unavailable
- Personal facts storage and retrieval
- Dashboard page at /memory
4. Cascade Router Integration (src/timmy/cascade_adapter.py)
- Automatic LLM failover between providers (Ollama → AirLLM → API)
- Circuit breaker pattern for failing providers
- Metrics tracking per provider (latency, error rates)
- Dashboard status page at /router/status
5. Self-Upgrade Approval Queue (src/upgrades/)
- State machine for self-modifications: proposed → approved/rejected → applied/failed
- Human approval required before applying changes
- Git integration for branch management
- Dashboard queue at /self-modify/queue
6. Real-Time Activity Feed (src/events/broadcaster.py)
- WebSocket-based live activity streaming
- Bridges event_log to dashboard clients
- Activity panel on /swarm/live
Tests:
- 101 unit tests passing
- 4 new E2E test files for Selenium testing
- Run with: SELENIUM_UI=1 pytest tests/functional/ -v --headed
Documentation:
- 6 ADRs (017-022) documenting architecture decisions
- Implementation summary in docs/IMPLEMENTATION_SUMMARY.md
- Architecture diagram in docs/architecture-v2.md
2026-02-26 08:01:01 -05:00
|
|
|
Yields the base URL (http://localhost:8000).
|
|
|
|
|
Kills the server after tests complete.
|
2026-02-25 00:46:22 +00:00
|
|
|
"""
|
feat: complete Event Log, Ledger, Memory, Cascade Router, Upgrade Queue, Activity Feed
This commit implements six major features:
1. Event Log System (src/swarm/event_log.py)
- SQLite-based audit trail for all swarm events
- Task lifecycle tracking (created, assigned, completed, failed)
- Agent lifecycle tracking (joined, left, status changes)
- Integrated with coordinator for automatic logging
- Dashboard page at /swarm/events
2. Lightning Ledger (src/lightning/ledger.py)
- Transaction tracking for Lightning Network payments
- Balance calculations (incoming, outgoing, net, available)
- Integrated with payment_handler for automatic logging
- Dashboard page at /lightning/ledger
3. Semantic Memory / Vector Store (src/memory/vector_store.py)
- Embedding-based similarity search for Echo agent
- Fallback to keyword matching if sentence-transformers unavailable
- Personal facts storage and retrieval
- Dashboard page at /memory
4. Cascade Router Integration (src/timmy/cascade_adapter.py)
- Automatic LLM failover between providers (Ollama → AirLLM → API)
- Circuit breaker pattern for failing providers
- Metrics tracking per provider (latency, error rates)
- Dashboard status page at /router/status
5. Self-Upgrade Approval Queue (src/upgrades/)
- State machine for self-modifications: proposed → approved/rejected → applied/failed
- Human approval required before applying changes
- Git integration for branch management
- Dashboard queue at /self-modify/queue
6. Real-Time Activity Feed (src/events/broadcaster.py)
- WebSocket-based live activity streaming
- Bridges event_log to dashboard clients
- Activity panel on /swarm/live
Tests:
- 101 unit tests passing
- 4 new E2E test files for Selenium testing
- Run with: SELENIUM_UI=1 pytest tests/functional/ -v --headed
Documentation:
- 6 ADRs (017-022) documenting architecture decisions
- Implementation summary in docs/IMPLEMENTATION_SUMMARY.md
- Architecture diagram in docs/architecture-v2.md
2026-02-26 08:01:01 -05:00
|
|
|
# Check if server already running
|
|
|
|
|
if is_server_running():
|
|
|
|
|
print(f"\n📡 Using existing server at {DASHBOARD_URL}")
|
|
|
|
|
yield DASHBOARD_URL
|
|
|
|
|
return
|
2026-03-08 12:50:44 -04:00
|
|
|
|
feat: complete Event Log, Ledger, Memory, Cascade Router, Upgrade Queue, Activity Feed
This commit implements six major features:
1. Event Log System (src/swarm/event_log.py)
- SQLite-based audit trail for all swarm events
- Task lifecycle tracking (created, assigned, completed, failed)
- Agent lifecycle tracking (joined, left, status changes)
- Integrated with coordinator for automatic logging
- Dashboard page at /swarm/events
2. Lightning Ledger (src/lightning/ledger.py)
- Transaction tracking for Lightning Network payments
- Balance calculations (incoming, outgoing, net, available)
- Integrated with payment_handler for automatic logging
- Dashboard page at /lightning/ledger
3. Semantic Memory / Vector Store (src/memory/vector_store.py)
- Embedding-based similarity search for Echo agent
- Fallback to keyword matching if sentence-transformers unavailable
- Personal facts storage and retrieval
- Dashboard page at /memory
4. Cascade Router Integration (src/timmy/cascade_adapter.py)
- Automatic LLM failover between providers (Ollama → AirLLM → API)
- Circuit breaker pattern for failing providers
- Metrics tracking per provider (latency, error rates)
- Dashboard status page at /router/status
5. Self-Upgrade Approval Queue (src/upgrades/)
- State machine for self-modifications: proposed → approved/rejected → applied/failed
- Human approval required before applying changes
- Git integration for branch management
- Dashboard queue at /self-modify/queue
6. Real-Time Activity Feed (src/events/broadcaster.py)
- WebSocket-based live activity streaming
- Bridges event_log to dashboard clients
- Activity panel on /swarm/live
Tests:
- 101 unit tests passing
- 4 new E2E test files for Selenium testing
- Run with: SELENIUM_UI=1 pytest tests/functional/ -v --headed
Documentation:
- 6 ADRs (017-022) documenting architecture decisions
- Implementation summary in docs/IMPLEMENTATION_SUMMARY.md
- Architecture diagram in docs/architecture-v2.md
2026-02-26 08:01:01 -05:00
|
|
|
# Start server in subprocess
|
|
|
|
|
print(f"\n🚀 Starting server on {DASHBOARD_URL}...")
|
2026-03-08 12:50:44 -04:00
|
|
|
|
feat: complete Event Log, Ledger, Memory, Cascade Router, Upgrade Queue, Activity Feed
This commit implements six major features:
1. Event Log System (src/swarm/event_log.py)
- SQLite-based audit trail for all swarm events
- Task lifecycle tracking (created, assigned, completed, failed)
- Agent lifecycle tracking (joined, left, status changes)
- Integrated with coordinator for automatic logging
- Dashboard page at /swarm/events
2. Lightning Ledger (src/lightning/ledger.py)
- Transaction tracking for Lightning Network payments
- Balance calculations (incoming, outgoing, net, available)
- Integrated with payment_handler for automatic logging
- Dashboard page at /lightning/ledger
3. Semantic Memory / Vector Store (src/memory/vector_store.py)
- Embedding-based similarity search for Echo agent
- Fallback to keyword matching if sentence-transformers unavailable
- Personal facts storage and retrieval
- Dashboard page at /memory
4. Cascade Router Integration (src/timmy/cascade_adapter.py)
- Automatic LLM failover between providers (Ollama → AirLLM → API)
- Circuit breaker pattern for failing providers
- Metrics tracking per provider (latency, error rates)
- Dashboard status page at /router/status
5. Self-Upgrade Approval Queue (src/upgrades/)
- State machine for self-modifications: proposed → approved/rejected → applied/failed
- Human approval required before applying changes
- Git integration for branch management
- Dashboard queue at /self-modify/queue
6. Real-Time Activity Feed (src/events/broadcaster.py)
- WebSocket-based live activity streaming
- Bridges event_log to dashboard clients
- Activity panel on /swarm/live
Tests:
- 101 unit tests passing
- 4 new E2E test files for Selenium testing
- Run with: SELENIUM_UI=1 pytest tests/functional/ -v --headed
Documentation:
- 6 ADRs (017-022) documenting architecture decisions
- Implementation summary in docs/IMPLEMENTATION_SUMMARY.md
- Architecture diagram in docs/architecture-v2.md
2026-02-26 08:01:01 -05:00
|
|
|
env = os.environ.copy()
|
|
|
|
|
env["PYTHONPATH"] = "src"
|
|
|
|
|
env["TIMMY_ENV"] = "test" # Use test config if available
|
2026-03-08 12:50:44 -04:00
|
|
|
|
feat: complete Event Log, Ledger, Memory, Cascade Router, Upgrade Queue, Activity Feed
This commit implements six major features:
1. Event Log System (src/swarm/event_log.py)
- SQLite-based audit trail for all swarm events
- Task lifecycle tracking (created, assigned, completed, failed)
- Agent lifecycle tracking (joined, left, status changes)
- Integrated with coordinator for automatic logging
- Dashboard page at /swarm/events
2. Lightning Ledger (src/lightning/ledger.py)
- Transaction tracking for Lightning Network payments
- Balance calculations (incoming, outgoing, net, available)
- Integrated with payment_handler for automatic logging
- Dashboard page at /lightning/ledger
3. Semantic Memory / Vector Store (src/memory/vector_store.py)
- Embedding-based similarity search for Echo agent
- Fallback to keyword matching if sentence-transformers unavailable
- Personal facts storage and retrieval
- Dashboard page at /memory
4. Cascade Router Integration (src/timmy/cascade_adapter.py)
- Automatic LLM failover between providers (Ollama → AirLLM → API)
- Circuit breaker pattern for failing providers
- Metrics tracking per provider (latency, error rates)
- Dashboard status page at /router/status
5. Self-Upgrade Approval Queue (src/upgrades/)
- State machine for self-modifications: proposed → approved/rejected → applied/failed
- Human approval required before applying changes
- Git integration for branch management
- Dashboard queue at /self-modify/queue
6. Real-Time Activity Feed (src/events/broadcaster.py)
- WebSocket-based live activity streaming
- Bridges event_log to dashboard clients
- Activity panel on /swarm/live
Tests:
- 101 unit tests passing
- 4 new E2E test files for Selenium testing
- Run with: SELENIUM_UI=1 pytest tests/functional/ -v --headed
Documentation:
- 6 ADRs (017-022) documenting architecture decisions
- Implementation summary in docs/IMPLEMENTATION_SUMMARY.md
- Architecture diagram in docs/architecture-v2.md
2026-02-26 08:01:01 -05:00
|
|
|
# Determine project root
|
|
|
|
|
project_root = os.path.dirname(os.path.dirname(os.path.dirname(__file__)))
|
2026-03-08 12:50:44 -04:00
|
|
|
|
feat: complete Event Log, Ledger, Memory, Cascade Router, Upgrade Queue, Activity Feed
This commit implements six major features:
1. Event Log System (src/swarm/event_log.py)
- SQLite-based audit trail for all swarm events
- Task lifecycle tracking (created, assigned, completed, failed)
- Agent lifecycle tracking (joined, left, status changes)
- Integrated with coordinator for automatic logging
- Dashboard page at /swarm/events
2. Lightning Ledger (src/lightning/ledger.py)
- Transaction tracking for Lightning Network payments
- Balance calculations (incoming, outgoing, net, available)
- Integrated with payment_handler for automatic logging
- Dashboard page at /lightning/ledger
3. Semantic Memory / Vector Store (src/memory/vector_store.py)
- Embedding-based similarity search for Echo agent
- Fallback to keyword matching if sentence-transformers unavailable
- Personal facts storage and retrieval
- Dashboard page at /memory
4. Cascade Router Integration (src/timmy/cascade_adapter.py)
- Automatic LLM failover between providers (Ollama → AirLLM → API)
- Circuit breaker pattern for failing providers
- Metrics tracking per provider (latency, error rates)
- Dashboard status page at /router/status
5. Self-Upgrade Approval Queue (src/upgrades/)
- State machine for self-modifications: proposed → approved/rejected → applied/failed
- Human approval required before applying changes
- Git integration for branch management
- Dashboard queue at /self-modify/queue
6. Real-Time Activity Feed (src/events/broadcaster.py)
- WebSocket-based live activity streaming
- Bridges event_log to dashboard clients
- Activity panel on /swarm/live
Tests:
- 101 unit tests passing
- 4 new E2E test files for Selenium testing
- Run with: SELENIUM_UI=1 pytest tests/functional/ -v --headed
Documentation:
- 6 ADRs (017-022) documenting architecture decisions
- Implementation summary in docs/IMPLEMENTATION_SUMMARY.md
- Architecture diagram in docs/architecture-v2.md
2026-02-26 08:01:01 -05:00
|
|
|
proc = subprocess.Popen(
|
2026-03-08 12:50:44 -04:00
|
|
|
[
|
|
|
|
|
sys.executable,
|
|
|
|
|
"-m",
|
|
|
|
|
"uvicorn",
|
|
|
|
|
"dashboard.app:app",
|
|
|
|
|
"--host",
|
|
|
|
|
"127.0.0.1",
|
|
|
|
|
"--port",
|
|
|
|
|
"8000",
|
|
|
|
|
"--log-level",
|
|
|
|
|
"warning",
|
|
|
|
|
],
|
feat: complete Event Log, Ledger, Memory, Cascade Router, Upgrade Queue, Activity Feed
This commit implements six major features:
1. Event Log System (src/swarm/event_log.py)
- SQLite-based audit trail for all swarm events
- Task lifecycle tracking (created, assigned, completed, failed)
- Agent lifecycle tracking (joined, left, status changes)
- Integrated with coordinator for automatic logging
- Dashboard page at /swarm/events
2. Lightning Ledger (src/lightning/ledger.py)
- Transaction tracking for Lightning Network payments
- Balance calculations (incoming, outgoing, net, available)
- Integrated with payment_handler for automatic logging
- Dashboard page at /lightning/ledger
3. Semantic Memory / Vector Store (src/memory/vector_store.py)
- Embedding-based similarity search for Echo agent
- Fallback to keyword matching if sentence-transformers unavailable
- Personal facts storage and retrieval
- Dashboard page at /memory
4. Cascade Router Integration (src/timmy/cascade_adapter.py)
- Automatic LLM failover between providers (Ollama → AirLLM → API)
- Circuit breaker pattern for failing providers
- Metrics tracking per provider (latency, error rates)
- Dashboard status page at /router/status
5. Self-Upgrade Approval Queue (src/upgrades/)
- State machine for self-modifications: proposed → approved/rejected → applied/failed
- Human approval required before applying changes
- Git integration for branch management
- Dashboard queue at /self-modify/queue
6. Real-Time Activity Feed (src/events/broadcaster.py)
- WebSocket-based live activity streaming
- Bridges event_log to dashboard clients
- Activity panel on /swarm/live
Tests:
- 101 unit tests passing
- 4 new E2E test files for Selenium testing
- Run with: SELENIUM_UI=1 pytest tests/functional/ -v --headed
Documentation:
- 6 ADRs (017-022) documenting architecture decisions
- Implementation summary in docs/IMPLEMENTATION_SUMMARY.md
- Architecture diagram in docs/architecture-v2.md
2026-02-26 08:01:01 -05:00
|
|
|
cwd=project_root,
|
|
|
|
|
env=env,
|
|
|
|
|
stdout=subprocess.PIPE,
|
|
|
|
|
stderr=subprocess.PIPE,
|
|
|
|
|
)
|
2026-03-08 12:50:44 -04:00
|
|
|
|
feat: complete Event Log, Ledger, Memory, Cascade Router, Upgrade Queue, Activity Feed
This commit implements six major features:
1. Event Log System (src/swarm/event_log.py)
- SQLite-based audit trail for all swarm events
- Task lifecycle tracking (created, assigned, completed, failed)
- Agent lifecycle tracking (joined, left, status changes)
- Integrated with coordinator for automatic logging
- Dashboard page at /swarm/events
2. Lightning Ledger (src/lightning/ledger.py)
- Transaction tracking for Lightning Network payments
- Balance calculations (incoming, outgoing, net, available)
- Integrated with payment_handler for automatic logging
- Dashboard page at /lightning/ledger
3. Semantic Memory / Vector Store (src/memory/vector_store.py)
- Embedding-based similarity search for Echo agent
- Fallback to keyword matching if sentence-transformers unavailable
- Personal facts storage and retrieval
- Dashboard page at /memory
4. Cascade Router Integration (src/timmy/cascade_adapter.py)
- Automatic LLM failover between providers (Ollama → AirLLM → API)
- Circuit breaker pattern for failing providers
- Metrics tracking per provider (latency, error rates)
- Dashboard status page at /router/status
5. Self-Upgrade Approval Queue (src/upgrades/)
- State machine for self-modifications: proposed → approved/rejected → applied/failed
- Human approval required before applying changes
- Git integration for branch management
- Dashboard queue at /self-modify/queue
6. Real-Time Activity Feed (src/events/broadcaster.py)
- WebSocket-based live activity streaming
- Bridges event_log to dashboard clients
- Activity panel on /swarm/live
Tests:
- 101 unit tests passing
- 4 new E2E test files for Selenium testing
- Run with: SELENIUM_UI=1 pytest tests/functional/ -v --headed
Documentation:
- 6 ADRs (017-022) documenting architecture decisions
- Implementation summary in docs/IMPLEMENTATION_SUMMARY.md
- Architecture diagram in docs/architecture-v2.md
2026-02-26 08:01:01 -05:00
|
|
|
# Wait for server to start
|
|
|
|
|
max_retries = 30
|
|
|
|
|
for i in range(max_retries):
|
|
|
|
|
if is_server_running():
|
ruff (#169)
* polish: streamline nav, extract inline styles, improve tablet UX
- Restructure desktop nav from 8+ flat links + overflow dropdown into
5 grouped dropdowns (Core, Agents, Intel, System, More) matching
the mobile menu structure to reduce decision fatigue
- Extract all inline styles from mission_control.html and base.html
notification elements into mission-control.css with semantic classes
- Replace JS-built innerHTML with secure DOM construction in
notification loader and chat history
- Add CONNECTING state to connection indicator (amber) instead of
showing OFFLINE before WebSocket connects
- Add tablet breakpoint (1024px) with larger touch targets for
Apple Pencil / stylus use and safe-area padding for iPad toolbar
- Add active-link highlighting in desktop dropdown menus
- Rename "Mission Control" page title to "System Overview" to
disambiguate from the chat home page
- Add "Home — Timmy Time" page title to index.html
https://claude.ai/code/session_015uPUoKyYa8M2UAcyk5Gt6h
* fix(security): move auth-gate credentials to environment variables
Hardcoded username, password, and HMAC secret in auth-gate.py replaced
with os.environ lookups. Startup now refuses to run if any variable is
unset. Added AUTH_GATE_SECRET/USER/PASS to .env.example.
https://claude.ai/code/session_015uPUoKyYa8M2UAcyk5Gt6h
* refactor(tooling): migrate from black+isort+bandit to ruff
Replace three separate linting/formatting tools with a single ruff
invocation. Updates tox.ini (lint, format, pre-push, pre-commit envs),
.pre-commit-config.yaml, and CI workflow. Fixes all ruff errors
including unused imports, missing raise-from, and undefined names.
Ruff config maps existing bandit skips to equivalent S-rules.
https://claude.ai/code/session_015uPUoKyYa8M2UAcyk5Gt6h
---------
Co-authored-by: Claude <noreply@anthropic.com>
2026-03-11 12:23:35 -04:00
|
|
|
print("✅ Server ready!")
|
feat: complete Event Log, Ledger, Memory, Cascade Router, Upgrade Queue, Activity Feed
This commit implements six major features:
1. Event Log System (src/swarm/event_log.py)
- SQLite-based audit trail for all swarm events
- Task lifecycle tracking (created, assigned, completed, failed)
- Agent lifecycle tracking (joined, left, status changes)
- Integrated with coordinator for automatic logging
- Dashboard page at /swarm/events
2. Lightning Ledger (src/lightning/ledger.py)
- Transaction tracking for Lightning Network payments
- Balance calculations (incoming, outgoing, net, available)
- Integrated with payment_handler for automatic logging
- Dashboard page at /lightning/ledger
3. Semantic Memory / Vector Store (src/memory/vector_store.py)
- Embedding-based similarity search for Echo agent
- Fallback to keyword matching if sentence-transformers unavailable
- Personal facts storage and retrieval
- Dashboard page at /memory
4. Cascade Router Integration (src/timmy/cascade_adapter.py)
- Automatic LLM failover between providers (Ollama → AirLLM → API)
- Circuit breaker pattern for failing providers
- Metrics tracking per provider (latency, error rates)
- Dashboard status page at /router/status
5. Self-Upgrade Approval Queue (src/upgrades/)
- State machine for self-modifications: proposed → approved/rejected → applied/failed
- Human approval required before applying changes
- Git integration for branch management
- Dashboard queue at /self-modify/queue
6. Real-Time Activity Feed (src/events/broadcaster.py)
- WebSocket-based live activity streaming
- Bridges event_log to dashboard clients
- Activity panel on /swarm/live
Tests:
- 101 unit tests passing
- 4 new E2E test files for Selenium testing
- Run with: SELENIUM_UI=1 pytest tests/functional/ -v --headed
Documentation:
- 6 ADRs (017-022) documenting architecture decisions
- Implementation summary in docs/IMPLEMENTATION_SUMMARY.md
- Architecture diagram in docs/architecture-v2.md
2026-02-26 08:01:01 -05:00
|
|
|
break
|
|
|
|
|
time.sleep(1)
|
ruff (#169)
* polish: streamline nav, extract inline styles, improve tablet UX
- Restructure desktop nav from 8+ flat links + overflow dropdown into
5 grouped dropdowns (Core, Agents, Intel, System, More) matching
the mobile menu structure to reduce decision fatigue
- Extract all inline styles from mission_control.html and base.html
notification elements into mission-control.css with semantic classes
- Replace JS-built innerHTML with secure DOM construction in
notification loader and chat history
- Add CONNECTING state to connection indicator (amber) instead of
showing OFFLINE before WebSocket connects
- Add tablet breakpoint (1024px) with larger touch targets for
Apple Pencil / stylus use and safe-area padding for iPad toolbar
- Add active-link highlighting in desktop dropdown menus
- Rename "Mission Control" page title to "System Overview" to
disambiguate from the chat home page
- Add "Home — Timmy Time" page title to index.html
https://claude.ai/code/session_015uPUoKyYa8M2UAcyk5Gt6h
* fix(security): move auth-gate credentials to environment variables
Hardcoded username, password, and HMAC secret in auth-gate.py replaced
with os.environ lookups. Startup now refuses to run if any variable is
unset. Added AUTH_GATE_SECRET/USER/PASS to .env.example.
https://claude.ai/code/session_015uPUoKyYa8M2UAcyk5Gt6h
* refactor(tooling): migrate from black+isort+bandit to ruff
Replace three separate linting/formatting tools with a single ruff
invocation. Updates tox.ini (lint, format, pre-push, pre-commit envs),
.pre-commit-config.yaml, and CI workflow. Fixes all ruff errors
including unused imports, missing raise-from, and undefined names.
Ruff config maps existing bandit skips to equivalent S-rules.
https://claude.ai/code/session_015uPUoKyYa8M2UAcyk5Gt6h
---------
Co-authored-by: Claude <noreply@anthropic.com>
2026-03-11 12:23:35 -04:00
|
|
|
print(f"⏳ Waiting for server... ({i + 1}/{max_retries})")
|
feat: complete Event Log, Ledger, Memory, Cascade Router, Upgrade Queue, Activity Feed
This commit implements six major features:
1. Event Log System (src/swarm/event_log.py)
- SQLite-based audit trail for all swarm events
- Task lifecycle tracking (created, assigned, completed, failed)
- Agent lifecycle tracking (joined, left, status changes)
- Integrated with coordinator for automatic logging
- Dashboard page at /swarm/events
2. Lightning Ledger (src/lightning/ledger.py)
- Transaction tracking for Lightning Network payments
- Balance calculations (incoming, outgoing, net, available)
- Integrated with payment_handler for automatic logging
- Dashboard page at /lightning/ledger
3. Semantic Memory / Vector Store (src/memory/vector_store.py)
- Embedding-based similarity search for Echo agent
- Fallback to keyword matching if sentence-transformers unavailable
- Personal facts storage and retrieval
- Dashboard page at /memory
4. Cascade Router Integration (src/timmy/cascade_adapter.py)
- Automatic LLM failover between providers (Ollama → AirLLM → API)
- Circuit breaker pattern for failing providers
- Metrics tracking per provider (latency, error rates)
- Dashboard status page at /router/status
5. Self-Upgrade Approval Queue (src/upgrades/)
- State machine for self-modifications: proposed → approved/rejected → applied/failed
- Human approval required before applying changes
- Git integration for branch management
- Dashboard queue at /self-modify/queue
6. Real-Time Activity Feed (src/events/broadcaster.py)
- WebSocket-based live activity streaming
- Bridges event_log to dashboard clients
- Activity panel on /swarm/live
Tests:
- 101 unit tests passing
- 4 new E2E test files for Selenium testing
- Run with: SELENIUM_UI=1 pytest tests/functional/ -v --headed
Documentation:
- 6 ADRs (017-022) documenting architecture decisions
- Implementation summary in docs/IMPLEMENTATION_SUMMARY.md
- Architecture diagram in docs/architecture-v2.md
2026-02-26 08:01:01 -05:00
|
|
|
else:
|
|
|
|
|
proc.terminate()
|
|
|
|
|
proc.wait()
|
|
|
|
|
raise RuntimeError("Server failed to start")
|
2026-03-08 12:50:44 -04:00
|
|
|
|
feat: complete Event Log, Ledger, Memory, Cascade Router, Upgrade Queue, Activity Feed
This commit implements six major features:
1. Event Log System (src/swarm/event_log.py)
- SQLite-based audit trail for all swarm events
- Task lifecycle tracking (created, assigned, completed, failed)
- Agent lifecycle tracking (joined, left, status changes)
- Integrated with coordinator for automatic logging
- Dashboard page at /swarm/events
2. Lightning Ledger (src/lightning/ledger.py)
- Transaction tracking for Lightning Network payments
- Balance calculations (incoming, outgoing, net, available)
- Integrated with payment_handler for automatic logging
- Dashboard page at /lightning/ledger
3. Semantic Memory / Vector Store (src/memory/vector_store.py)
- Embedding-based similarity search for Echo agent
- Fallback to keyword matching if sentence-transformers unavailable
- Personal facts storage and retrieval
- Dashboard page at /memory
4. Cascade Router Integration (src/timmy/cascade_adapter.py)
- Automatic LLM failover between providers (Ollama → AirLLM → API)
- Circuit breaker pattern for failing providers
- Metrics tracking per provider (latency, error rates)
- Dashboard status page at /router/status
5. Self-Upgrade Approval Queue (src/upgrades/)
- State machine for self-modifications: proposed → approved/rejected → applied/failed
- Human approval required before applying changes
- Git integration for branch management
- Dashboard queue at /self-modify/queue
6. Real-Time Activity Feed (src/events/broadcaster.py)
- WebSocket-based live activity streaming
- Bridges event_log to dashboard clients
- Activity panel on /swarm/live
Tests:
- 101 unit tests passing
- 4 new E2E test files for Selenium testing
- Run with: SELENIUM_UI=1 pytest tests/functional/ -v --headed
Documentation:
- 6 ADRs (017-022) documenting architecture decisions
- Implementation summary in docs/IMPLEMENTATION_SUMMARY.md
- Architecture diagram in docs/architecture-v2.md
2026-02-26 08:01:01 -05:00
|
|
|
yield DASHBOARD_URL
|
2026-03-08 12:50:44 -04:00
|
|
|
|
feat: complete Event Log, Ledger, Memory, Cascade Router, Upgrade Queue, Activity Feed
This commit implements six major features:
1. Event Log System (src/swarm/event_log.py)
- SQLite-based audit trail for all swarm events
- Task lifecycle tracking (created, assigned, completed, failed)
- Agent lifecycle tracking (joined, left, status changes)
- Integrated with coordinator for automatic logging
- Dashboard page at /swarm/events
2. Lightning Ledger (src/lightning/ledger.py)
- Transaction tracking for Lightning Network payments
- Balance calculations (incoming, outgoing, net, available)
- Integrated with payment_handler for automatic logging
- Dashboard page at /lightning/ledger
3. Semantic Memory / Vector Store (src/memory/vector_store.py)
- Embedding-based similarity search for Echo agent
- Fallback to keyword matching if sentence-transformers unavailable
- Personal facts storage and retrieval
- Dashboard page at /memory
4. Cascade Router Integration (src/timmy/cascade_adapter.py)
- Automatic LLM failover between providers (Ollama → AirLLM → API)
- Circuit breaker pattern for failing providers
- Metrics tracking per provider (latency, error rates)
- Dashboard status page at /router/status
5. Self-Upgrade Approval Queue (src/upgrades/)
- State machine for self-modifications: proposed → approved/rejected → applied/failed
- Human approval required before applying changes
- Git integration for branch management
- Dashboard queue at /self-modify/queue
6. Real-Time Activity Feed (src/events/broadcaster.py)
- WebSocket-based live activity streaming
- Bridges event_log to dashboard clients
- Activity panel on /swarm/live
Tests:
- 101 unit tests passing
- 4 new E2E test files for Selenium testing
- Run with: SELENIUM_UI=1 pytest tests/functional/ -v --headed
Documentation:
- 6 ADRs (017-022) documenting architecture decisions
- Implementation summary in docs/IMPLEMENTATION_SUMMARY.md
- Architecture diagram in docs/architecture-v2.md
2026-02-26 08:01:01 -05:00
|
|
|
# Cleanup
|
|
|
|
|
print("\n🛑 Stopping server...")
|
|
|
|
|
proc.terminate()
|
|
|
|
|
try:
|
|
|
|
|
proc.wait(timeout=5)
|
|
|
|
|
except subprocess.TimeoutExpired:
|
|
|
|
|
proc.kill()
|
|
|
|
|
proc.wait()
|
|
|
|
|
print("✅ Server stopped")
|
|
|
|
|
|
|
|
|
|
|
2026-02-26 08:30:04 -05:00
|
|
|
@pytest.fixture
|
|
|
|
|
def app_client():
|
|
|
|
|
"""FastAPI test client for functional tests.
|
2026-03-08 12:50:44 -04:00
|
|
|
|
2026-02-26 08:30:04 -05:00
|
|
|
Same as the 'client' fixture in root conftest but available here.
|
|
|
|
|
"""
|
|
|
|
|
from fastapi.testclient import TestClient
|
2026-03-08 12:50:44 -04:00
|
|
|
|
2026-02-26 08:30:04 -05:00
|
|
|
from dashboard.app import app
|
2026-03-08 12:50:44 -04:00
|
|
|
|
2026-02-26 08:30:04 -05:00
|
|
|
with TestClient(app) as c:
|
|
|
|
|
yield c
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@pytest.fixture
|
|
|
|
|
def timmy_runner():
|
|
|
|
|
"""Typer CLI runner for timmy CLI tests."""
|
|
|
|
|
from typer.testing import CliRunner
|
2026-03-08 12:50:44 -04:00
|
|
|
|
2026-02-26 08:30:04 -05:00
|
|
|
from timmy.cli import app
|
2026-03-08 12:50:44 -04:00
|
|
|
|
2026-02-26 08:30:04 -05:00
|
|
|
yield CliRunner(), app
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@pytest.fixture
|
|
|
|
|
def serve_runner():
|
|
|
|
|
"""Typer CLI runner for timmy-serve CLI tests."""
|
|
|
|
|
from typer.testing import CliRunner
|
2026-03-08 12:50:44 -04:00
|
|
|
|
2026-02-26 08:30:04 -05:00
|
|
|
from timmy_serve.cli import app
|
2026-03-08 12:50:44 -04:00
|
|
|
|
2026-02-26 08:30:04 -05:00
|
|
|
yield CliRunner(), app
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@pytest.fixture
|
|
|
|
|
def docker_stack():
|
|
|
|
|
"""Docker stack URL for container-level tests.
|
2026-03-08 12:50:44 -04:00
|
|
|
|
2026-02-26 08:30:04 -05:00
|
|
|
Skips if FUNCTIONAL_DOCKER env var is not set to "1".
|
|
|
|
|
"""
|
|
|
|
|
import os
|
2026-03-08 12:50:44 -04:00
|
|
|
|
2026-02-26 08:30:04 -05:00
|
|
|
if os.environ.get("FUNCTIONAL_DOCKER") != "1":
|
|
|
|
|
pytest.skip("Set FUNCTIONAL_DOCKER=1 to run Docker tests")
|
|
|
|
|
yield "http://localhost:18000"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@pytest.fixture
|
|
|
|
|
def serve_client():
|
|
|
|
|
"""FastAPI test client for timmy-serve app."""
|
|
|
|
|
pytest.importorskip("timmy_serve.app", reason="timmy_serve not available")
|
|
|
|
|
from fastapi.testclient import TestClient
|
2026-03-08 12:50:44 -04:00
|
|
|
|
|
|
|
|
from timmy_serve.app import create_timmy_serve_app
|
|
|
|
|
|
2026-02-26 08:30:04 -05:00
|
|
|
app = create_timmy_serve_app()
|
|
|
|
|
with TestClient(app) as c:
|
|
|
|
|
yield c
|
|
|
|
|
|
|
|
|
|
|
feat: complete Event Log, Ledger, Memory, Cascade Router, Upgrade Queue, Activity Feed
This commit implements six major features:
1. Event Log System (src/swarm/event_log.py)
- SQLite-based audit trail for all swarm events
- Task lifecycle tracking (created, assigned, completed, failed)
- Agent lifecycle tracking (joined, left, status changes)
- Integrated with coordinator for automatic logging
- Dashboard page at /swarm/events
2. Lightning Ledger (src/lightning/ledger.py)
- Transaction tracking for Lightning Network payments
- Balance calculations (incoming, outgoing, net, available)
- Integrated with payment_handler for automatic logging
- Dashboard page at /lightning/ledger
3. Semantic Memory / Vector Store (src/memory/vector_store.py)
- Embedding-based similarity search for Echo agent
- Fallback to keyword matching if sentence-transformers unavailable
- Personal facts storage and retrieval
- Dashboard page at /memory
4. Cascade Router Integration (src/timmy/cascade_adapter.py)
- Automatic LLM failover between providers (Ollama → AirLLM → API)
- Circuit breaker pattern for failing providers
- Metrics tracking per provider (latency, error rates)
- Dashboard status page at /router/status
5. Self-Upgrade Approval Queue (src/upgrades/)
- State machine for self-modifications: proposed → approved/rejected → applied/failed
- Human approval required before applying changes
- Git integration for branch management
- Dashboard queue at /self-modify/queue
6. Real-Time Activity Feed (src/events/broadcaster.py)
- WebSocket-based live activity streaming
- Bridges event_log to dashboard clients
- Activity panel on /swarm/live
Tests:
- 101 unit tests passing
- 4 new E2E test files for Selenium testing
- Run with: SELENIUM_UI=1 pytest tests/functional/ -v --headed
Documentation:
- 6 ADRs (017-022) documenting architecture decisions
- Implementation summary in docs/IMPLEMENTATION_SUMMARY.md
- Architecture diagram in docs/architecture-v2.md
2026-02-26 08:01:01 -05:00
|
|
|
# Add custom pytest option for headed mode
|
|
|
|
|
def pytest_addoption(parser):
|
|
|
|
|
parser.addoption(
|
|
|
|
|
"--headed",
|
|
|
|
|
action="store_true",
|
|
|
|
|
default=False,
|
|
|
|
|
help="Run browser in non-headless mode (visible)",
|
2026-02-25 00:49:06 +00:00
|
|
|
)
|
2026-02-25 00:46:22 +00:00
|
|
|
|
|
|
|
|
|
feat: complete Event Log, Ledger, Memory, Cascade Router, Upgrade Queue, Activity Feed
This commit implements six major features:
1. Event Log System (src/swarm/event_log.py)
- SQLite-based audit trail for all swarm events
- Task lifecycle tracking (created, assigned, completed, failed)
- Agent lifecycle tracking (joined, left, status changes)
- Integrated with coordinator for automatic logging
- Dashboard page at /swarm/events
2. Lightning Ledger (src/lightning/ledger.py)
- Transaction tracking for Lightning Network payments
- Balance calculations (incoming, outgoing, net, available)
- Integrated with payment_handler for automatic logging
- Dashboard page at /lightning/ledger
3. Semantic Memory / Vector Store (src/memory/vector_store.py)
- Embedding-based similarity search for Echo agent
- Fallback to keyword matching if sentence-transformers unavailable
- Personal facts storage and retrieval
- Dashboard page at /memory
4. Cascade Router Integration (src/timmy/cascade_adapter.py)
- Automatic LLM failover between providers (Ollama → AirLLM → API)
- Circuit breaker pattern for failing providers
- Metrics tracking per provider (latency, error rates)
- Dashboard status page at /router/status
5. Self-Upgrade Approval Queue (src/upgrades/)
- State machine for self-modifications: proposed → approved/rejected → applied/failed
- Human approval required before applying changes
- Git integration for branch management
- Dashboard queue at /self-modify/queue
6. Real-Time Activity Feed (src/events/broadcaster.py)
- WebSocket-based live activity streaming
- Bridges event_log to dashboard clients
- Activity panel on /swarm/live
Tests:
- 101 unit tests passing
- 4 new E2E test files for Selenium testing
- Run with: SELENIUM_UI=1 pytest tests/functional/ -v --headed
Documentation:
- 6 ADRs (017-022) documenting architecture decisions
- Implementation summary in docs/IMPLEMENTATION_SUMMARY.md
- Architecture diagram in docs/architecture-v2.md
2026-02-26 08:01:01 -05:00
|
|
|
@pytest.fixture
|
|
|
|
|
def headed_mode(request):
|
|
|
|
|
"""Check if --headed flag was passed."""
|
|
|
|
|
return request.config.getoption("--headed")
|