Skip to content

Commit faed34d

Browse files
feat: Release v5.0.0 - Agent Coordination & Dashboard (Breaking Changes)
BREAKING CHANGES: - Removed ShortTermMemory.send_signal() and receive_signals() methods - Changed Redis key format: empathy:coord:* → empathy:signal:* - Migration required: Use CoordinationSignals API instead New Features: - 6 Agent Coordination Patterns (Patterns 1-6) - Pattern 1: Heartbeat Tracking (TTL-based liveness) - Pattern 2: Coordination Signals (inter-agent communication) - Pattern 4: Event Streaming (Redis Streams) - Pattern 5: Approval Gates (human-in-the-loop) - Pattern 6: Quality Feedback Loop (adaptive routing) - Agent Coordination Dashboard - Zero-dependency web UI (Python stdlib only) - Real-time monitoring of all 6 patterns - 7 dashboard panels with auto-refresh - CLI: empathy dashboard start - VS Code task: Cmd+Shift+B - Adaptive Model Routing - Telemetry-based tier selection - Auto-upgrade when failure rate > 20% - Quality tracking per workflow/stage/tier - Enhanced telemetry CLI commands - routing-stats, routing-check, models, agents, signals - Comprehensive documentation (5 new guides) Security: - Fixed: New CoordinationSignals API now enforces permissions - Requires CONTRIBUTOR tier or higher (matching old system) - Prevents unauthorized agents from sending coordination signals - Backward compatible: warns if credentials not provided - All coordination signals validated before transmission - Credentials passed through to memory backend Improvements: - Descriptive agent names (code-review, orchestrator, validator) - Unified Redis key namespace (empathy: prefix) - 280 tests passing (8 new permission tests) - Better dashboard UX with workflow-based agent names Testing: - 280/280 telemetry tests passing - Dashboard integration verified - Permission enforcement working (OBSERVER blocked, CONTRIBUTOR allowed) - Zero integration issues Documentation: - AGENT_COORDINATION_ARCHITECTURE.md - DASHBOARD_COMPLETE.md (500+ lines) - ADAPTIVE_ROUTING_ANTHROPIC_NATIVE.md - DASHBOARD_QUICKSTART.md - 6 pattern summaries Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
1 parent 3fb1541 commit faed34d

60 files changed

Lines changed: 20898 additions & 111 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

CHANGELOG.md

Lines changed: 201 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,207 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
## [5.0.0] - 2026-01-27
11+
12+
### 🚨 Breaking Changes
13+
14+
**Agent Coordination System Migration**
15+
16+
The legacy coordination system in `ShortTermMemory` has been removed in favor of the new, enhanced `CoordinationSignals` API. This migration provides better security, more features, and cleaner architecture.
17+
18+
**What Changed:**
19+
-**Removed:** `ShortTermMemory.send_signal()` and `receive_signals()` methods
20+
-**Removed:** `TTLStrategy.COORDINATION` constant
21+
-**Changed:** Redis key format: `empathy:coord:*``empathy:signal:*`
22+
-**New API:** `empathy_os.telemetry.CoordinationSignals` (Pattern 2 from Agent Coordination Architecture)
23+
24+
**Migration Guide:**
25+
26+
```python
27+
# Before (v4.x - REMOVED):
28+
from empathy_os.memory import ShortTermMemory, AgentCredentials
29+
30+
memory = ShortTermMemory()
31+
credentials = AgentCredentials("agent-1", AccessTier.CONTRIBUTOR)
32+
memory.send_signal("task_complete", {"status": "done"}, credentials, target_agent="agent-2")
33+
signals = memory.receive_signals(credentials, signal_type="task_complete")
34+
35+
# After (v5.0 - NEW):
36+
from empathy_os.telemetry import CoordinationSignals
37+
from empathy_os.memory.types import AgentCredentials, AccessTier
38+
39+
coordinator = CoordinationSignals(agent_id="agent-1")
40+
credentials = AgentCredentials("agent-1", AccessTier.CONTRIBUTOR)
41+
42+
# Send signal (with permission check)
43+
coordinator.signal(
44+
signal_type="task_complete",
45+
target_agent="agent-2",
46+
payload={"status": "done"},
47+
credentials=credentials # Required for security
48+
)
49+
50+
# Receive signals
51+
signals = coordinator.get_pending_signals(signal_type="task_complete")
52+
```
53+
54+
**Benefits of Migration:**
55+
-**Security:** Permission checks enforced (CONTRIBUTOR tier required)
56+
-**Features:** Blocking wait with timeout, event streaming integration
57+
-**Flexibility:** Per-signal TTL configuration (no fixed 5-minute limit)
58+
-**Type Safety:** Structured `CoordinationSignal` dataclass with validation
59+
-**Consistency:** Unified `empathy:` key namespace across framework
60+
61+
### Added
62+
63+
**Agent Coordination Patterns (Patterns 1-6)**
64+
65+
Complete implementation of agent coordination patterns for multi-agent workflows:
66+
67+
- **Pattern 1: Heartbeat Tracking** (`HeartbeatCoordinator`)
68+
- TTL-based agent liveness monitoring (30s heartbeat expiration)
69+
- Track agent status, progress, and current task
70+
- Detect stale/failed agents automatically
71+
- Files: `src/empathy_os/telemetry/agent_tracking.py`
72+
73+
- **Pattern 2: Coordination Signals** (`CoordinationSignals`)
74+
- TTL-based inter-agent communication (60s default TTL)
75+
- Send targeted signals or broadcast to all agents
76+
- Blocking wait with timeout support
77+
- Permission enforcement (CONTRIBUTOR tier required)
78+
- Files: `src/empathy_os/telemetry/agent_coordination.py`
79+
80+
- **Pattern 4: Event Streaming** (`EventStreamer`)
81+
- Real-time event streaming via Redis Streams
82+
- Publish workflow events for monitoring/audit
83+
- Subscribe with consumer groups
84+
- Files: `src/empathy_os/telemetry/event_streaming.py`
85+
86+
- **Pattern 5: Approval Gates** (`ApprovalGate`)
87+
- Human-in-the-loop workflow control
88+
- Block workflow execution pending approval
89+
- Timeout handling for abandoned requests
90+
- Files: `src/empathy_os/telemetry/approval_gates.py`
91+
92+
- **Pattern 6: Quality Feedback Loop** (`FeedbackLoop`)
93+
- Record quality scores per workflow/stage/tier
94+
- Automatic tier upgrade recommendations (quality < 0.7)
95+
- Adaptive routing based on historical performance
96+
- Files: `src/empathy_os/telemetry/feedback_loop.py`
97+
98+
**Agent Coordination Dashboard**
99+
100+
Web-based dashboard for real-time monitoring of all 6 coordination patterns:
101+
102+
- **Zero-Dependency Design:** Uses Python stdlib `http.server` (no Flask/FastAPI required)
103+
- **Three Implementation Tiers:**
104+
- Standalone: Direct Redis access (recommended)
105+
- Simple: Uses telemetry API classes
106+
- FastAPI: Advanced features (optional dependency)
107+
- **Real-Time Updates:** Auto-refresh every 5 seconds
108+
- **7 Dashboard Panels:**
109+
- Active agents with heartbeat status
110+
- Coordination signals between agents
111+
- Event stream (real-time events)
112+
- Pending approval requests
113+
- Quality metrics by workflow/stage/tier
114+
- Underperforming stages (quality < 0.7)
115+
- System health status
116+
- **CLI Integration:** `empathy dashboard start [--host HOST] [--port PORT]`
117+
- **VS Code Task:** `Cmd+Shift+B` to start dashboard and auto-open browser
118+
- **Files:** `src/empathy_os/dashboard/{standalone_server.py,simple_server.py,app.py,static/}`
119+
120+
**Adaptive Model Routing**
121+
122+
Telemetry-based model selection for cost optimization:
123+
124+
- **AdaptiveModelRouter:** Analyzes historical performance data
125+
- **Auto-Upgrade:** Recommends tier upgrade when failure rate > 20%
126+
- **Quality Tracking:** Per-workflow/stage/tier success rate monitoring
127+
- **Workflow Integration:** `enable_adaptive_routing=True` parameter
128+
- **CLI Commands:** `empathy telemetry routing-stats`, `routing-check`
129+
- **Files:** `src/empathy_os/models/adaptive_routing.py`
130+
131+
**Enhanced Telemetry CLI**
132+
133+
New commands for coordination and routing monitoring:
134+
135+
```bash
136+
empathy telemetry routing-stats [--workflow NAME] [--stage NAME] [--days N]
137+
empathy telemetry routing-check [--workflow NAME] [--threshold 0.7]
138+
empathy telemetry models [--days N]
139+
empathy telemetry agents [--status running|idle|failed]
140+
empathy telemetry signals --agent AGENT_ID [--type TYPE]
141+
```
142+
143+
**Comprehensive Documentation**
144+
145+
- `docs/AGENT_COORDINATION_ARCHITECTURE.md` - Pattern architecture (6 patterns)
146+
- `docs/DASHBOARD_COMPLETE.md` - Dashboard reference guide (500+ lines)
147+
- `docs/DASHBOARD_GUIDE.md` - Usage guide with examples
148+
- `docs/DASHBOARD_USAGE.md` - 5 methods to start dashboard
149+
- `docs/ADAPTIVE_ROUTING_ANTHROPIC_NATIVE.md` - Model selection guide
150+
- `DASHBOARD_QUICKSTART.md` - 3-command quick start
151+
152+
### Changed
153+
154+
**Improved Test Data**
155+
156+
Test data now uses descriptive agent names for better UX:
157+
158+
- **Workflow Agents:** `code-review`, `test-generation`, `security-audit`, `refactoring`, `bug-predict`
159+
- **Role Agents:** `orchestrator`, `validator`, `monitor`
160+
- Makes dashboard immediately understandable
161+
- Professional demo/screenshot appearance
162+
- File: `scripts/populate_redis_direct.py`
163+
164+
**Redis Key Namespace Unification**
165+
166+
All agent coordination keys now use consistent `empathy:` prefix:
167+
168+
- Signals: `empathy:signal:{target}:{type}:{id}` (was `signal:*`)
169+
- Maintains consistency with other keys: `empathy:working:*`, `empathy:staged:*`, etc.
170+
171+
**Workflow Base Class Enhancements**
172+
173+
New opt-in features for workflows:
174+
175+
```python
176+
workflow = MyWorkflow(
177+
enable_adaptive_routing=True, # Pattern 3: Adaptive tier selection
178+
enable_heartbeat_tracking=True, # Pattern 1: Agent liveness
179+
enable_coordination=True, # Pattern 2: Inter-agent signals
180+
agent_id="my-workflow-abc123" # Custom agent ID
181+
)
182+
```
183+
184+
### Fixed
185+
186+
**Security:** Permission enforcement restored in coordination system
187+
- All coordination signals require CONTRIBUTOR tier or higher
188+
- Prevents unauthorized agent communication
189+
- Backward compatible (warns if credentials not provided)
190+
191+
### Testing
192+
193+
**Comprehensive Test Suite:**
194+
- ✅ 280 telemetry tests passing (including 8 new permission tests)
195+
- ✅ Pattern 1-6 tests (19 heartbeat, 28 coordination, 24 feedback, etc.)
196+
- ✅ Dashboard integration tests
197+
- ✅ Permission enforcement tests (OBSERVER blocked, CONTRIBUTOR allowed)
198+
- ✅ Key format migration verified
199+
200+
**Test Files:**
201+
- `tests/unit/telemetry/test_agent_tracking.py` (19 tests)
202+
- `tests/unit/telemetry/test_agent_coordination.py` (28 tests, including 8 permission tests)
203+
- `tests/unit/telemetry/test_event_streaming.py`
204+
- `tests/unit/telemetry/test_approval_gates.py`
205+
- `tests/unit/telemetry/test_feedback_loop.py` (24 tests)
206+
207+
### Deprecated
208+
209+
None (deprecated features removed in this major version)
210+
10211
## [4.9.0] - 2026-01-27
11212

12213
### 🚀 Performance & Memory Optimization Release

DASHBOARD_QUICKSTART.md

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
# 🚀 Dashboard Quick Start
2+
3+
**Everything is ready!** Redis has **679 keys** with test data.
4+
5+
---
6+
7+
## Start in 3 Commands
8+
9+
```bash
10+
cd /Users/patrickroebuck/Documents/empathy1-11-2025-local/empathy-framework
11+
12+
# 1. Start the dashboard
13+
./scripts/start_dashboard.sh
14+
15+
# 2. Open browser to http://localhost:8000
16+
```
17+
18+
---
19+
20+
## What You'll See
21+
22+
**System Health** - Redis status (healthy/degraded)
23+
**5 Active Agents** - With progress bars and status
24+
**2 Pending Approvals** - Click to approve/reject!
25+
**10 Coordination Signals** - Agent-to-agent messages
26+
**15 Event Streams** - Real-time events
27+
**27 Quality Metrics** - Performance by tier
28+
**Auto-refresh** - Updates every 5 seconds
29+
30+
---
31+
32+
## Regenerate Test Data
33+
34+
If data expires (heartbeats = 60s TTL):
35+
36+
```bash
37+
python scripts/populate_redis_direct.py
38+
```
39+
40+
---
41+
42+
## Test API Endpoints
43+
44+
```bash
45+
# Health check
46+
curl http://localhost:8000/api/health | jq
47+
48+
# Active agents
49+
curl http://localhost:8000/api/agents | jq
50+
51+
# Quality metrics
52+
curl http://localhost:8000/api/feedback/workflows | jq
53+
```
54+
55+
---
56+
57+
## Full Documentation
58+
59+
- [docs/DASHBOARD_COMPLETE.md](docs/DASHBOARD_COMPLETE.md) - Complete guide (350+ lines)
60+
- [docs/DASHBOARD_GUIDE.md](docs/DASHBOARD_GUIDE.md) - Usage reference
61+
- [docs/DASHBOARD_TESTING.md](docs/DASHBOARD_TESTING.md) - Testing guide
62+
63+
---
64+
65+
**Status:** ✅ Production Ready
66+
**Dependencies:** Python stdlib + redis-py only
67+
**No Anthropic API calls** - Dashboard is free to run!

0 commit comments

Comments
 (0)