Claude Code
2826b28645
Phase 1: Implement Docker Swarm API agent discovery
Replaces DNS-based discovery (2/34 agents) with Docker API enumeration
to discover ALL running CHORUS containers.
Implementation:
- NEW: internal/p2p/swarm_discovery.go (261 lines)
* Docker API client for Swarm task enumeration
* Extracts container IPs from network attachments
* Optional health verification before registration
* Comprehensive error handling and logging
- MODIFIED: internal/p2p/discovery.go (~50 lines)
* Integrated Swarm discovery with fallback to DNS
* New config: DISCOVERY_METHOD (swarm/dns/auto)
* Tries Swarm first, falls back gracefully
* Backward compatible with existing DNS discovery
- NEW: IMPLEMENTATION-SUMMARY-Phase1-Swarm-Discovery.md
* Complete deployment guide
* Testing checklist
* Performance metrics
* Phase 2 roadmap
Expected Results:
- Discovery: 34/34 agents (100% vs previous ~6%)
- Council activation: Both core roles claimed
- Task execution: Unblocked
Security:
- Read-only Docker socket mount
- No privileged mode required
- Minimal API surface (TaskList + Ping only)
Next: Build image, deploy, verify discovery, activate council
Part of hybrid approach:
- Phase 1: Docker API (this commit) ✅
- Phase 2: NATS migration (planned Week 3)
Related:
- /home/tony/chorus/docs/DIAGNOSIS-Agent-Discovery-And-P2P-Architecture.md
- /home/tony/chorus/docs/ARCHITECTURE-ANALYSIS-LibP2P-HMMM-Migration.md
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>