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>
This commit is contained in:
anthonyrawlins
2025-09-02 20:02:37 +10:00
parent 7c6cbd562a
commit 543ab216f9
224 changed files with 86331 additions and 186 deletions

97
pkg/slurp/temporal/doc.go Normal file
View File

@@ -0,0 +1,97 @@
// Package temporal provides decision-hop temporal analysis for the SLURP contextual intelligence system.
//
// This package implements temporal analysis of context evolution based on decision points
// rather than chronological time. It tracks how contexts change through different decisions,
// analyzes decision influence networks, and provides navigation through the decision graph
// to understand the evolution of project understanding over time.
//
// Key Features:
// - Decision-hop based temporal analysis instead of chronological progression
// - Context evolution tracking through decision influence graphs
// - Temporal navigation by conceptual distance rather than time
// - Decision pattern analysis and learning from historical changes
// - Staleness detection based on decision relationships
// - Conflict detection and resolution in temporal context
// - Decision impact analysis and propagation tracking
//
// Core Concepts:
// - Decision Hops: Conceptual distance measured by decision relationships
// - Temporal Nodes: Context snapshots at specific decision points
// - Influence Graph: Network of decisions that affect each other
// - Decision Timeline: Sequence of decisions affecting a context
// - Staleness Score: Measure of how outdated context is relative to decisions
//
// Core Components:
// - TemporalGraph: Main interface for temporal context management
// - DecisionNavigator: Navigation through decision-hop space
// - InfluenceAnalyzer: Analysis of decision influence relationships
// - StalenessDetector: Detection of outdated contexts
// - ConflictDetector: Detection of temporal conflicts
// - PatternAnalyzer: Analysis of decision-making patterns
//
// Integration Points:
// - pkg/slurp/context: Context types and resolution
// - pkg/slurp/intelligence: Decision metadata generation
// - pkg/slurp/storage: Persistent temporal data storage
// - pkg/ucxl: UCXL address parsing and handling
// - Version control systems: Git commit correlation
//
// Example Usage:
//
// graph := temporal.NewTemporalGraph(storage, intelligence)
// ctx := context.Background()
//
// // Create initial context version
// initial, err := graph.CreateInitialContext(ctx, address, contextNode, "developer")
// if err != nil {
// log.Fatal(err)
// }
//
// // Evolve context due to a decision
// decision := &DecisionMetadata{
// ID: "commit-abc123",
// Maker: "developer",
// Rationale: "Refactored for better performance",
// }
// evolved, err := graph.EvolveContext(ctx, address, newContext,
// ReasonRefactoring, decision)
//
// // Navigate through decision timeline
// timeline, err := navigator.GetDecisionTimeline(ctx, address, true, 5)
// if err != nil {
// log.Fatal(err)
// }
//
// // Find contexts affected by a decision
// affected, err := graph.FindRelatedDecisions(ctx, address, 3)
// for _, path := range affected {
// fmt.Printf("Decision path: %d hops to %s\n",
// path.HopDistance, path.ToAddress)
// }
//
// Decision-Hop Analysis:
// Unlike traditional time-based analysis, this system measures context evolution
// by conceptual distance through decision relationships. A decision that affects
// multiple related components may be "closer" to those components than chronologically
// recent but unrelated changes. This provides more meaningful context for
// understanding code evolution and architectural decisions.
//
// Temporal Navigation:
// Navigation through the temporal space allows developers to understand how
// decisions led to the current state, explore alternative decision paths,
// and identify points where different approaches were taken. This supports
// architectural archaeology and decision rationale understanding.
//
// Performance Characteristics:
// - O(log N) lookup for temporal nodes by decision hop
// - O(N) traversal for decision paths within hop limits
// - Cached decision influence graphs for fast relationship queries
// - Background analysis for pattern detection and staleness scoring
// - Incremental updates to minimize computational overhead
//
// Consistency Model:
// Temporal data maintains consistency through eventual convergence across
// the cluster, with conflict resolution based on decision metadata and
// vector clocks. The system handles concurrent decision recording and
// provides mechanisms for resolving temporal conflicts when they occur.
package temporal