CHORUS Packages Documentation
Complete API reference for all public packages in pkg/
Overview
CHORUS provides 30+ public packages organized into functional categories. This index provides quick navigation to all package documentation with implementation status and key features.
Core System Packages
Execution & Sandboxing
| Package | Status | Purpose | Key Features | 
| pkg/execution | ✅ Production | Task execution engine with Docker sandboxing | Docker Exec API, 4-tier language detection, workspace isolation, resource limits | 
Configuration & Runtime
| Package | Status | Purpose | Key Features | 
| pkg/config | ✅ Production | Configuration management | 80+ env vars, dynamic assignments, SIGHUP reload, role definitions | 
| pkg/bootstrap | ✅ Production | System bootstrapping | Initialization sequences, dependency ordering | 
Distributed Infrastructure
P2P Networking
| Package | Status | Purpose | Key Features | 
| pkg/dht | ✅ Production | Distributed hash table | Kademlia DHT, encrypted storage, bootstrap, cache management | 
| p2p/ | ✅ Production | libp2p networking | Host wrapper, multiaddr, connection management, DHT modes | 
| pubsub/ | ✅ Production | PubSub messaging | GossipSub, 31 message types, role-based topics, HMMM integration | 
| discovery/ | ✅ Production | Peer discovery | mDNS local discovery, automatic LAN detection | 
Coordination & Election
| Package | Status | Purpose | Key Features | 
| pkg/election | ✅ Production | Leader election | Democratic election, heartbeat (5s), candidate scoring, SLURP integration | 
| pkg/coordination | 🔶 Beta | Meta-coordination | Dependency detection, AI-powered plans, cross-repo sessions | 
| coordinator/ | ✅ Production | Task coordination | Task assignment, scoring, availability tracking, role-based routing | 
SLURP System
| Package | Status | Purpose | Key Features | 
| pkg/slurp/ | 🔷 Alpha | Distributed orchestration | 8 subpackages, policy learning, temporal coordination | 
| pkg/slurp/alignment | 🔷 Alpha | Goal alignment | Consensus building, objective tracking | 
| pkg/slurp/context | 🔷 Alpha | Context management | Context generation, propagation, versioning | 
| pkg/slurp/distribution | 🔷 Alpha | Work distribution | Load balancing, task routing, capacity management | 
| pkg/slurp/intelligence | 🔷 Alpha | Intelligence layer | Learning, adaptation, pattern recognition | 
| pkg/slurp/leader | 🔷 Alpha | Leadership coordination | Leader management, failover, delegation | 
| pkg/slurp/roles | 🔷 Alpha | Role assignments | Dynamic roles, capability matching, hierarchy | 
| pkg/slurp/storage | 🔷 Alpha | Distributed storage | Replicated state, consistency, versioning | 
| pkg/slurp/temporal | ✅ Production | Time-based coordination | DHT integration, temporal queries, event ordering | 
Security & Validation
Cryptography
| Package | Status | Purpose | Key Features | 
| pkg/crypto | ✅ Production | Encryption primitives | Age encryption, key derivation, secure random | 
| pkg/shhh | ✅ Production | Secrets management | Sentinel, pattern matching, redaction, audit logging | 
| pkg/security | ✅ Production | Security policies | Policy enforcement, validation, threat detection | 
Validation & Compliance
| Package | Status | Purpose | Key Features | 
| pkg/ucxl | ✅ Production | UCXL validation | Decision publishing, content addressing (ucxl://), immutable audit | 
| pkg/ucxi | 🔶 Beta | UCXI server | Content resolution, address parsing, HTTP API | 
AI & Intelligence
AI Providers
| Package | Status | Purpose | Key Features | 
| pkg/ai | ✅ Production | AI provider interfaces | Provider abstraction, model selection, fallback | 
| pkg/providers | ✅ Production | Concrete AI implementations | Ollama, ResetData, OpenAI-compatible | 
| reasoning/ | ✅ Production | Reasoning engine | Provider switching, prompt composition, model routing | 
| pkg/prompt | ✅ Production | Prompt management | System prompts, role composition, template rendering | 
Protocols
| Package | Status | Purpose | Key Features | 
| pkg/mcp | 🔶 Beta | Model Context Protocol | MCP server/client, tool integration, context management | 
| pkg/hmmm | 🔶 Beta | HMMM protocol | Meta-discussion, collaborative reasoning, per-issue rooms | 
| pkg/hmmm_adapter | 🔶 Beta | HMMM adapter | GossipSub bridge, room management, message routing | 
Observability
Monitoring
| Package | Status | Purpose | Key Features | 
| pkg/metrics | ✅ Production | Metrics collection | 80+ Prometheus metrics, custom collectors, histograms | 
| pkg/health | ✅ Production | Health monitoring | 4 HTTP endpoints, 7 built-in checks, enhanced monitoring, Kubernetes probes | 
Infrastructure Support
Storage & Data
| Package | Status | Purpose | Key Features | 
| pkg/storage | ✅ Production | Storage abstractions | Key-value interface, backends, caching | 
| pkg/repository | ✅ Production | Git operations | Clone, commit, push, branch management, credential handling | 
Utilities
| Package | Status | Purpose | Key Features | 
| pkg/types | ✅ Production | Common type definitions | Shared structs, interfaces, constants across packages | 
| pkg/agentid | ✅ Production | Agent identity | ID generation, validation, uniqueness | 
| pkg/version | ✅ Production | Version information | Build info, version comparison, semantic versioning | 
| pkg/shutdown | ✅ Production | Graceful shutdown | Component ordering, timeout management, signal handling | 
Web & API
| Package | Status | Purpose | Key Features | 
| pkg/web | ✅ Production | Web server utilities | Static file serving, middleware, routing helpers | 
| pkg/protocol | ✅ Production | Protocol definitions | Message formats, RPC protocols, serialization | 
| pkg/integration | ✅ Production | Integration utilities | External system connectors, webhooks, adapters | 
Status Legend
| Symbol | Status | Meaning | 
| ✅ | Production | Fully implemented, tested, production-ready | 
| 🔶 | Beta | Core features complete, testing in progress | 
| 🔷 | Alpha | Basic implementation, experimental | 
| ⏳ | Stubbed | Interface defined, implementation incomplete | 
| ❌ | Planned | Not yet implemented | 
Quick Navigation by Use Case
Building a Task Execution System
- pkg/execution - Sandboxed execution
- pkg/config - Configuration
- coordinator/ - Task routing
- pkg/metrics - Monitoring
Setting Up P2P Networking
- p2p/ - libp2p setup
- discovery/ - Peer discovery
- pubsub/ - Messaging
- pkg/dht - Distributed storage
Implementing Security
- pkg/crypto - Encryption
- pkg/shhh - Secrets detection
- pkg/security - Policy enforcement
- pkg/ucxl - Decision validation
Integrating AI
- pkg/ai - Provider interface
- pkg/providers - Implementations
- reasoning/ - Reasoning engine
- pkg/prompt - Prompt management
Health & Monitoring
- pkg/health - Health checks
- pkg/metrics - Metrics collection
- internal/backbeat - P2P telemetry
Package Dependencies
Foundational (No Dependencies)
- pkg/types
- pkg/version
- pkg/agentid
Infrastructure Layer (Depends on Foundational)
- pkg/config
- pkg/crypto
- pkg/storage
- p2p/
- pkg/dht
Coordination Layer (Depends on Infrastructure)
- pubsub/
- pkg/election
- discovery/
- coordinator/
Application Layer (Depends on All Below)
- pkg/execution
- pkg/coordination
- pkg/slurp
- internal/runtime
Documentation Standards
Each package documentation includes:
- Overview - Purpose, key capabilities, architecture
- API Reference - All exported types, functions, constants
- Configuration - Environment variables, config structs
- Usage Examples - Minimum 3 practical examples
- Implementation Status - Production/Beta/Alpha/TODO features
- Error Handling - Error types, handling patterns
- Testing - Test structure, running tests, coverage
- Related Packages - Cross-references to dependencies
- Troubleshooting - Common issues and solutions
Contributing to Documentation
When documenting new packages:
- Follow the standard template structure
- Include line numbers for code references
- Provide runnable code examples
- Mark implementation status clearly
- Cross-reference related packages
- Update this index with the new package
Additional Resources
Last Updated: 2025-09-30
Packages Documented: 22/30+ (73%)
Lines Documented: ~40,000+
Examples Provided: 100+