🎭 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>
64 lines
2.9 KiB
Go
64 lines
2.9 KiB
Go
// Package context provides core context types and interfaces for the SLURP contextual intelligence system.
|
|
//
|
|
// This package defines the foundational data structures and interfaces for hierarchical
|
|
// context resolution within the BZZZ distributed AI development system. It implements
|
|
// bounded hierarchy traversal with role-based access control for efficient context
|
|
// resolution and caching.
|
|
//
|
|
// Key Features:
|
|
// - Hierarchical context resolution with bounded traversal depth
|
|
// - Role-based access control and encryption for context data
|
|
// - CSS-like inheritance patterns for cascading context properties
|
|
// - Efficient caching with selective invalidation
|
|
// - Integration with BZZZ election system for leader-only generation
|
|
//
|
|
// Core Types:
|
|
// - ContextNode: Represents a single context entry in the hierarchy
|
|
// - ResolvedContext: Final resolved context output with metadata
|
|
// - RoleAccessLevel: Defines encryption levels for different roles
|
|
// - EncryptedContext: Role-encrypted context data for DHT storage
|
|
//
|
|
// Primary Interfaces:
|
|
// - ContextResolver: Main interface for hierarchical context resolution
|
|
// - HierarchyManager: Manages the context hierarchy structure
|
|
// - GlobalContextManager: Manages system-wide applicable contexts
|
|
//
|
|
// Integration Points:
|
|
// - pkg/election: Leader election for context generation duties
|
|
// - pkg/crypto: Role-based encryption and access control
|
|
// - pkg/dht: Distributed storage of encrypted context data
|
|
// - pkg/ucxl: UCXL address parsing and handling
|
|
//
|
|
// Example Usage:
|
|
//
|
|
// resolver := context.NewDefaultResolver(storage, crypto)
|
|
// ctx := context.Background()
|
|
//
|
|
// // Resolve context for a UCXL address with bounded depth
|
|
// resolved, err := resolver.ResolveWithDepth(ctx, "ucxl://project/src/main.go", 5)
|
|
// if err != nil {
|
|
// log.Fatal(err)
|
|
// }
|
|
//
|
|
// fmt.Printf("Resolved context: %s\n", resolved.Summary)
|
|
// fmt.Printf("Technologies: %v\n", resolved.Technologies)
|
|
// fmt.Printf("Inheritance chain: %v\n", resolved.InheritanceChain)
|
|
//
|
|
// Architecture Design:
|
|
// The context system uses a tree-like hierarchy where child contexts inherit
|
|
// and override properties from their parents, similar to CSS cascading rules.
|
|
// This enables efficient context resolution while maintaining consistency
|
|
// and reducing duplication across the system.
|
|
//
|
|
// Performance Considerations:
|
|
// - Bounded traversal prevents infinite loops and limits resource usage
|
|
// - Caching with TTL reduces repeated resolution overhead
|
|
// - Batch operations optimize multi-address resolution
|
|
// - Role-based filtering reduces unnecessary data transfer
|
|
//
|
|
// Security Model:
|
|
// All context data is encrypted based on role access levels before storage
|
|
// in the distributed DHT. Only nodes with appropriate role permissions can
|
|
// decrypt and access context information, ensuring secure context sharing
|
|
// across the BZZZ cluster.
|
|
package context |