anthonyrawlins
3ce9811826
Implement Beat 1: Sequential Thinking Age-Encrypted Wrapper (Skeleton)
...
This commit completes Beat 1 of the SequentialThinkingForCHORUS implementation,
providing a functional plaintext skeleton for the age-encrypted wrapper.
## Deliverables
### 1. Main Wrapper Entry Point
- `cmd/seqthink-wrapper/main.go`: HTTP server on :8443
- Configuration loading from environment variables
- Graceful shutdown handling
- MCP server readiness checking with timeout
### 2. MCP Client Package
- `pkg/seqthink/mcpclient/client.go`: HTTP client for MCP server
- Communicates with MCP server on localhost:8000
- Health check endpoint
- Tool call endpoint with 120s timeout
### 3. Proxy Server Package
- `pkg/seqthink/proxy/server.go`: HTTP handlers for wrapper
- Health and readiness endpoints
- Tool call proxy (plaintext for Beat 1)
- SSE endpoint placeholder
- Metrics endpoint integration
### 4. Observability Package
- `pkg/seqthink/observability/logger.go`: Structured logging with zerolog
- `pkg/seqthink/observability/metrics.go`: Prometheus metrics
- Counters for requests, errors, decrypt/encrypt failures, policy denials
- Request duration histogram
### 5. Docker Infrastructure
- `deploy/seqthink/Dockerfile`: Multi-stage build
- `deploy/seqthink/entrypoint.sh`: Startup orchestration
- `deploy/seqthink/mcp_stub.py`: Minimal MCP server for testing
### 6. Build System Integration
- Updated `Makefile` with `build-seqthink` target
- Uses GOWORK=off and -mod=mod for clean builds
- `docker-seqthink` target for container builds
## Testing
Successfully builds with:
```
make build-seqthink
```
Binary successfully starts and waits for MCP server connection.
## Next Steps
Beat 2 will add:
- Age encryption/decryption (pkg/seqthink/ageio)
- Content-Type: application/age enforcement
- SSE streaming with encrypted frames
- Golden tests for crypto round-trips
🤖 Generated with [Claude Code](https://claude.com/claude-code )
Co-Authored-By: Claude <noreply@anthropic.com >
2025-10-13 08:35:43 +11:00
anthonyrawlins
17673c38a6
fix: P2P connectivity regression + dynamic versioning system
...
## P2P Connectivity Fixes
- **Root Cause**: mDNS discovery was conditionally disabled in Task Execution Engine implementation
- **Solution**: Restored always-enabled mDNS discovery from working baseline (eb2e05f )
- **Result**: 9/9 Docker Swarm replicas with working P2P mesh, democratic elections, and leader consensus
## Dynamic Version System
- **Problem**: Hardcoded version "0.1.0-dev" in 1000+ builds made debugging impossible
- **Solution**: Implemented build-time version injection via ldflags
- **Features**: Shows commit hash, build date, and semantic version
- **Example**: `CHORUS-agent 0.5.5 (build: 9dbd361 , 2025-09-26_05:55:55)`
## Container Compatibility
- **Issue**: Binary execution failed in Alpine due to glibc/musl incompatibility
- **Solution**: Added Ubuntu-based Dockerfile for proper glibc support
- **Benefit**: Reliable container execution across Docker Swarm nodes
## Key Changes
- `internal/runtime/shared.go`: Always enable mDNS discovery, dynamic version vars
- `cmd/agent/main.go`: Build-time version injection and display
- `p2p/node.go`: Restored working "🐝 Bzzz Node Status" logging format
- `Makefile`: Updated version to 0.5.5, proper ldflags configuration
- `Dockerfile.ubuntu`: New glibc-compatible container base
- `docker-compose.yml`: Updated to latest image tag for Watchtower auto-updates
## Verification
✅ P2P mesh connectivity: Peers exchanging availability broadcasts
✅ Democratic elections: Candidacy announcements and leader selection
✅ BACKBEAT integration: Beat synchronization and degraded mode handling
✅ Dynamic versioning: All containers show v0.5.5 with build metadata
✅ Task Execution Engine: All Phase 4 functionality preserved and working
Fixes P2P connectivity regression while preserving complete Task Execution Engine implementation.
🤖 Generated with [Claude Code](https://claude.ai/code )
Co-Authored-By: Claude <noreply@anthropic.com >
2025-09-26 16:05:25 +10:00
anthonyrawlins
aea4d45fd8
Implement Phase 2 & 3: Complete HAP Terminal Interface with Patch Management
...
🎭 Phase 2: HAP Terminal Interface Implementation
✅ **Core Terminal Interface**: Interactive command-driven HAP terminal with help system
✅ **HMMM Message Composition System**:
- New reasoning messages, thread replies, network queries, decision proposals
- Complete message metadata handling (topics, threads, timestamps)
✅ **UCXL Context Browsing System**:
- Address parsing, content retrieval from DHT encrypted storage
- Search functionality, content creation, history navigation
✅ **Decision Participation System**:
- Active decision listing, decision details with voting status
- Vote casting with reasoning, decision proposals, HMMM integration
🔧 Phase 3: Enhanced Human Workflows
✅ **Patch Creation and Submission Workflows**:
- Complete patch lifecycle management (create, review, submit, track)
- Multiple patch types (context, code, config, docs)
- UCXL integration with DHT storage, HMMM coordination
✅ **Time-Travel Diff Support**:
- Temporal navigation operators (~~<n>, ^^<n>, @<time>)
- Decision-hop analysis, visual diff display, version comparison
🏗️ **Architecture Highlights**:
- **Multi-binary structure**: Separate chorus-agent and chorus-hap binaries
- **Shared P2P runtime**: Both binaries use identical libp2p, DHT, HMMM, UCXL systems
- **Interactive sub-shells**: Dedicated command environments for HMMM, UCXL, patches, decisions
- **Network integration**: All features connect to distributed P2P agent network
- **Human-agent parity**: Humans participate as first-class network citizens
📦 **New Files**:
- internal/hapui/terminal.go: Complete HAP terminal interface (2400+ lines)
- prompts/human-roles.yaml: Role-based prompt configuration
- docs/decisions/*: HAP conversion decision record
🔗 **Integration Points**:
- HMMM: Collaborative reasoning and patch/decision announcements
- UCXL: Context addressing and version management
- DHT: Distributed storage of patches and content
- Decision System: Formal approval and consensus workflows
The HAP terminal interface now provides comprehensive human portal into the CHORUS
autonomous agent network, enabling collaborative reasoning, context sharing, patch
management, and distributed decision-making between humans and AI agents.
🤖 Generated with [Claude Code](https://claude.ai/code )
Co-Authored-By: Claude <noreply@anthropic.com >
2025-09-07 09:38:14 +10:00
anthonyrawlins
0dbb6bb588
Implement Phase 1: CHORUS Human Agent Portal (HAP) Multi-Binary Architecture
...
This commit completes Phase 1 of the HAP implementation by restructuring CHORUS
from a single binary to a dual-binary architecture that supports both autonomous
agents and human agent portals using shared P2P infrastructure.
## Key Changes
### Multi-Binary Architecture
- **cmd/agent/main.go**: Autonomous agent binary (preserves all original functionality)
- **cmd/hap/main.go**: Human Agent Portal binary (Phase 2 stub implementation)
- **cmd/chorus/main.go**: Backward compatibility wrapper with deprecation notices
### Shared Runtime Infrastructure
- **internal/runtime/shared.go**: Extracted all P2P infrastructure initialization
- **internal/runtime/agent_support.go**: Agent-specific behaviors and health monitoring
- Preserves 100% of existing CHORUS functionality in shared components
### Enhanced Build System
- **Makefile**: Complete multi-binary build system
- `make build` - Builds all binaries (agent, hap, compatibility wrapper)
- `make build-agent` - Agent only
- `make build-hap` - HAP only
- `make test-compile` - Compilation verification
## Architecture Achievement
✅ **Shared P2P Infrastructure**: Both binaries use identical libp2p, DHT, HMMM, UCXL systems
✅ **Protocol Compatibility**: Human agents appear as valid peers to autonomous agents
✅ **Container-First Design**: Maintains CHORUS's container deployment model
✅ **Zero Functionality Loss**: Existing users see no disruption
## Phase 1 Success Metrics - ALL ACHIEVED
✅ `make build` produces `chorus-agent`, `chorus-hap`, and `chorus` binaries
✅ Existing autonomous agent functionality unchanged
✅ Both new binaries can join same P2P mesh
✅ Clean deprecation path for existing users
## Next Steps
Phase 2 will implement the interactive terminal interface for chorus-hap, enabling:
- HMMM message composition helpers
- UCXL context browsing
- Human-friendly command interface
- Collaborative decision participation
🤖 Generated with [Claude Code](https://claude.ai/code )
Co-Authored-By: Claude <noreply@anthropic.com >
2025-09-06 20:49:05 +10:00
anthonyrawlins
543ab216f9
Complete BZZZ functionality port to CHORUS
...
🎭 CHORUS now contains full BZZZ functionality adapted for containers
Core systems ported:
- P2P networking (libp2p with DHT and PubSub)
- Task coordination (COOEE protocol)
- HMMM collaborative reasoning
- SHHH encryption and security
- SLURP admin election system
- UCXL content addressing
- UCXI server integration
- Hypercore logging system
- Health monitoring and graceful shutdown
- License validation with KACHING
Container adaptations:
- Environment variable configuration (no YAML files)
- Container-optimized logging to stdout/stderr
- Auto-generated agent IDs for container deployments
- Docker-first architecture
All proven BZZZ P2P protocols, AI integration, and collaboration
features are now available in containerized form.
Next: Build and test container deployment.
🤖 Generated with [Claude Code](https://claude.ai/code )
Co-Authored-By: Claude <noreply@anthropic.com >
2025-09-02 20:02:37 +10:00