Resolve import cycles and migrate to chorus.services module path
This comprehensive refactoring addresses critical architectural issues: IMPORT CYCLE RESOLUTION: • pkg/crypto ↔ pkg/slurp/roles: Created pkg/security/access_levels.go • pkg/ucxl → pkg/dht: Created pkg/storage/interfaces.go • pkg/slurp/leader → pkg/election → pkg/slurp/storage: Moved types to pkg/election/interfaces.go MODULE PATH MIGRATION: • Changed from github.com/anthonyrawlins/bzzz to chorus.services/bzzz • Updated all import statements across 115+ files • Maintains compatibility while removing personal GitHub account dependency TYPE SYSTEM IMPROVEMENTS: • Resolved duplicate type declarations in crypto package • Added missing type definitions (RoleStatus, TimeRestrictions, KeyStatus, KeyRotationResult) • Proper interface segregation to prevent future cycles ARCHITECTURAL BENEFITS: • Build now progresses past structural issues to normal dependency resolution • Cleaner separation of concerns between packages • Eliminates circular dependencies that prevented compilation • Establishes foundation for scalable codebase growth 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -4,8 +4,8 @@ import (
|
||||
"context"
|
||||
"time"
|
||||
|
||||
"github.com/anthonyrawlins/bzzz/pkg/ucxl"
|
||||
slurpContext "github.com/anthonyrawlins/bzzz/pkg/slurp/context"
|
||||
"chorus.services/bzzz/pkg/ucxl"
|
||||
slurpContext "chorus.services/bzzz/pkg/slurp/context"
|
||||
)
|
||||
|
||||
// GoalManager handles definition and management of project goals
|
||||
|
||||
@@ -3,8 +3,8 @@ package alignment
|
||||
import (
|
||||
"time"
|
||||
|
||||
"github.com/anthonyrawlins/bzzz/pkg/ucxl"
|
||||
slurpContext "github.com/anthonyrawlins/bzzz/pkg/slurp/context"
|
||||
"chorus.services/bzzz/pkg/ucxl"
|
||||
slurpContext "chorus.services/bzzz/pkg/slurp/context"
|
||||
)
|
||||
|
||||
// ProjectGoal represents a high-level project objective
|
||||
|
||||
@@ -5,8 +5,8 @@ import (
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
"github.com/anthonyrawlins/bzzz/pkg/ucxl"
|
||||
"github.com/anthonyrawlins/bzzz/pkg/config"
|
||||
"chorus.services/bzzz/pkg/ucxl"
|
||||
"chorus.services/bzzz/pkg/config"
|
||||
)
|
||||
|
||||
// ContextResolver defines the interface for hierarchical context resolution
|
||||
|
||||
@@ -4,8 +4,8 @@ import (
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
"github.com/anthonyrawlins/bzzz/pkg/ucxl"
|
||||
"github.com/anthonyrawlins/bzzz/pkg/config"
|
||||
"chorus.services/bzzz/pkg/ucxl"
|
||||
"chorus.services/bzzz/pkg/config"
|
||||
)
|
||||
|
||||
// ContextNode represents a hierarchical context node in the SLURP system.
|
||||
@@ -36,7 +36,7 @@ type ContextNode struct {
|
||||
|
||||
// Access control
|
||||
EncryptedFor []string `json:"encrypted_for"` // Roles that can access
|
||||
AccessLevel config.RoleAccessLevel `json:"access_level"` // Required access level
|
||||
AccessLevel RoleAccessLevel `json:"access_level"` // Required access level
|
||||
|
||||
// Custom metadata
|
||||
Metadata map[string]interface{} `json:"metadata,omitempty"` // Additional metadata
|
||||
|
||||
@@ -7,12 +7,12 @@ import (
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/anthonyrawlins/bzzz/pkg/dht"
|
||||
"github.com/anthonyrawlins/bzzz/pkg/crypto"
|
||||
"github.com/anthonyrawlins/bzzz/pkg/election"
|
||||
"github.com/anthonyrawlins/bzzz/pkg/config"
|
||||
"github.com/anthonyrawlins/bzzz/pkg/ucxl"
|
||||
slurpContext "github.com/anthonyrawlins/bzzz/pkg/slurp/context"
|
||||
"chorus.services/bzzz/pkg/dht"
|
||||
"chorus.services/bzzz/pkg/crypto"
|
||||
"chorus.services/bzzz/pkg/election"
|
||||
"chorus.services/bzzz/pkg/config"
|
||||
"chorus.services/bzzz/pkg/ucxl"
|
||||
slurpContext "chorus.services/bzzz/pkg/slurp/context"
|
||||
)
|
||||
|
||||
// DistributionCoordinator orchestrates distributed context operations across the cluster
|
||||
|
||||
@@ -9,12 +9,12 @@ import (
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/anthonyrawlins/bzzz/pkg/dht"
|
||||
"github.com/anthonyrawlins/bzzz/pkg/crypto"
|
||||
"github.com/anthonyrawlins/bzzz/pkg/election"
|
||||
"github.com/anthonyrawlins/bzzz/pkg/ucxl"
|
||||
"github.com/anthonyrawlins/bzzz/pkg/config"
|
||||
slurpContext "github.com/anthonyrawlins/bzzz/pkg/slurp/context"
|
||||
"chorus.services/bzzz/pkg/dht"
|
||||
"chorus.services/bzzz/pkg/crypto"
|
||||
"chorus.services/bzzz/pkg/election"
|
||||
"chorus.services/bzzz/pkg/ucxl"
|
||||
"chorus.services/bzzz/pkg/config"
|
||||
slurpContext "chorus.services/bzzz/pkg/slurp/context"
|
||||
)
|
||||
|
||||
// ContextDistributor handles distributed context operations via DHT
|
||||
|
||||
@@ -10,12 +10,12 @@ import (
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/anthonyrawlins/bzzz/pkg/dht"
|
||||
"github.com/anthonyrawlins/bzzz/pkg/crypto"
|
||||
"github.com/anthonyrawlins/bzzz/pkg/election"
|
||||
"github.com/anthonyrawlins/bzzz/pkg/ucxl"
|
||||
"github.com/anthonyrawlins/bzzz/pkg/config"
|
||||
slurpContext "github.com/anthonyrawlins/bzzz/pkg/slurp/context"
|
||||
"chorus.services/bzzz/pkg/dht"
|
||||
"chorus.services/bzzz/pkg/crypto"
|
||||
"chorus.services/bzzz/pkg/election"
|
||||
"chorus.services/bzzz/pkg/ucxl"
|
||||
"chorus.services/bzzz/pkg/config"
|
||||
slurpContext "chorus.services/bzzz/pkg/slurp/context"
|
||||
)
|
||||
|
||||
// DHTContextDistributor implements ContextDistributor using BZZZ DHT infrastructure
|
||||
|
||||
@@ -9,9 +9,9 @@ import (
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/anthonyrawlins/bzzz/pkg/dht"
|
||||
"github.com/anthonyrawlins/bzzz/pkg/config"
|
||||
"github.com/anthonyrawlins/bzzz/pkg/ucxl"
|
||||
"chorus.services/bzzz/pkg/dht"
|
||||
"chorus.services/bzzz/pkg/config"
|
||||
"chorus.services/bzzz/pkg/ucxl"
|
||||
)
|
||||
|
||||
// GossipProtocolImpl implements GossipProtocol interface for metadata synchronization
|
||||
|
||||
@@ -10,7 +10,7 @@ import (
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/anthonyrawlins/bzzz/pkg/config"
|
||||
"chorus.services/bzzz/pkg/config"
|
||||
)
|
||||
|
||||
// MonitoringSystem provides comprehensive monitoring for the distributed context system
|
||||
|
||||
@@ -9,8 +9,8 @@ import (
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/anthonyrawlins/bzzz/pkg/dht"
|
||||
"github.com/anthonyrawlins/bzzz/pkg/config"
|
||||
"chorus.services/bzzz/pkg/dht"
|
||||
"chorus.services/bzzz/pkg/config"
|
||||
"github.com/libp2p/go-libp2p/core/peer"
|
||||
)
|
||||
|
||||
|
||||
@@ -7,9 +7,9 @@ import (
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/anthonyrawlins/bzzz/pkg/dht"
|
||||
"github.com/anthonyrawlins/bzzz/pkg/config"
|
||||
"github.com/anthonyrawlins/bzzz/pkg/ucxl"
|
||||
"chorus.services/bzzz/pkg/dht"
|
||||
"chorus.services/bzzz/pkg/config"
|
||||
"chorus.services/bzzz/pkg/ucxl"
|
||||
"github.com/libp2p/go-libp2p/core/peer"
|
||||
)
|
||||
|
||||
|
||||
@@ -14,8 +14,8 @@ import (
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/anthonyrawlins/bzzz/pkg/config"
|
||||
"github.com/anthonyrawlins/bzzz/pkg/crypto"
|
||||
"chorus.services/bzzz/pkg/config"
|
||||
"chorus.services/bzzz/pkg/crypto"
|
||||
)
|
||||
|
||||
// SecurityManager handles all security aspects of the distributed system
|
||||
|
||||
@@ -11,8 +11,8 @@ import (
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/anthonyrawlins/bzzz/pkg/ucxl"
|
||||
slurpContext "github.com/anthonyrawlins/bzzz/pkg/slurp/context"
|
||||
"chorus.services/bzzz/pkg/ucxl"
|
||||
slurpContext "chorus.services/bzzz/pkg/slurp/context"
|
||||
)
|
||||
|
||||
// DefaultDirectoryAnalyzer provides comprehensive directory structure analysis
|
||||
|
||||
@@ -4,8 +4,8 @@ import (
|
||||
"context"
|
||||
"time"
|
||||
|
||||
"github.com/anthonyrawlins/bzzz/pkg/ucxl"
|
||||
slurpContext "github.com/anthonyrawlins/bzzz/pkg/slurp/context"
|
||||
"chorus.services/bzzz/pkg/ucxl"
|
||||
slurpContext "chorus.services/bzzz/pkg/slurp/context"
|
||||
)
|
||||
|
||||
// IntelligenceEngine provides AI-powered context analysis and generation
|
||||
|
||||
@@ -10,8 +10,8 @@ import (
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/anthonyrawlins/bzzz/pkg/ucxl"
|
||||
slurpContext "github.com/anthonyrawlins/bzzz/pkg/slurp/context"
|
||||
"chorus.services/bzzz/pkg/ucxl"
|
||||
slurpContext "chorus.services/bzzz/pkg/slurp/context"
|
||||
)
|
||||
|
||||
// AnalyzeFile analyzes a single file and generates contextual understanding
|
||||
|
||||
@@ -7,7 +7,7 @@ import (
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
slurpContext "github.com/anthonyrawlins/bzzz/pkg/slurp/context"
|
||||
slurpContext "chorus.services/bzzz/pkg/slurp/context"
|
||||
)
|
||||
|
||||
func TestIntelligenceEngine_Integration(t *testing.T) {
|
||||
|
||||
@@ -9,7 +9,7 @@ import (
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
slurpContext "github.com/anthonyrawlins/bzzz/pkg/slurp/context"
|
||||
slurpContext "chorus.services/bzzz/pkg/slurp/context"
|
||||
)
|
||||
|
||||
// GoalAlignmentEngine provides comprehensive goal alignment assessment
|
||||
|
||||
@@ -9,7 +9,7 @@ import (
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
slurpContext "github.com/anthonyrawlins/bzzz/pkg/slurp/context"
|
||||
slurpContext "chorus.services/bzzz/pkg/slurp/context"
|
||||
)
|
||||
|
||||
// DefaultPatternDetector provides comprehensive pattern detection capabilities
|
||||
|
||||
@@ -11,7 +11,7 @@ import (
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
slurpContext "github.com/anthonyrawlins/bzzz/pkg/slurp/context"
|
||||
slurpContext "chorus.services/bzzz/pkg/slurp/context"
|
||||
)
|
||||
|
||||
// DefaultRAGIntegration provides comprehensive RAG system integration
|
||||
|
||||
@@ -8,8 +8,8 @@ import (
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/anthonyrawlins/bzzz/pkg/crypto"
|
||||
slurpContext "github.com/anthonyrawlins/bzzz/pkg/slurp/context"
|
||||
"chorus.services/bzzz/pkg/crypto"
|
||||
slurpContext "chorus.services/bzzz/pkg/slurp/context"
|
||||
)
|
||||
|
||||
// RoleAwareProcessor provides role-based context processing and insight generation
|
||||
|
||||
@@ -16,7 +16,7 @@ import (
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
slurpContext "github.com/anthonyrawlins/bzzz/pkg/slurp/context"
|
||||
slurpContext "chorus.services/bzzz/pkg/slurp/context"
|
||||
)
|
||||
|
||||
// Utility functions and helper types for the intelligence engine
|
||||
|
||||
@@ -6,7 +6,7 @@ import (
|
||||
"strconv"
|
||||
"strings"
|
||||
"time"
|
||||
"github.com/anthonyrawlins/bzzz/pkg/config"
|
||||
"chorus.services/bzzz/pkg/config"
|
||||
)
|
||||
|
||||
// SLURPLeaderConfig represents comprehensive configuration for SLURP-enabled leader election
|
||||
|
||||
@@ -7,11 +7,11 @@ import (
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/anthonyrawlins/bzzz/pkg/election"
|
||||
"github.com/anthonyrawlins/bzzz/pkg/dht"
|
||||
"github.com/anthonyrawlins/bzzz/pkg/slurp/intelligence"
|
||||
"github.com/anthonyrawlins/bzzz/pkg/slurp/storage"
|
||||
slurpContext "github.com/anthonyrawlins/bzzz/pkg/slurp/context"
|
||||
"chorus.services/bzzz/pkg/election"
|
||||
"chorus.services/bzzz/pkg/dht"
|
||||
"chorus.services/bzzz/pkg/slurp/intelligence"
|
||||
"chorus.services/bzzz/pkg/slurp/storage"
|
||||
slurpContext "chorus.services/bzzz/pkg/slurp/context"
|
||||
)
|
||||
|
||||
// ElectionIntegratedContextManager integrates SLURP context management with BZZZ election system
|
||||
|
||||
@@ -6,13 +6,13 @@ import (
|
||||
"log"
|
||||
"time"
|
||||
|
||||
"github.com/anthonyrawlins/bzzz/pkg/config"
|
||||
"github.com/anthonyrawlins/bzzz/pkg/election"
|
||||
"github.com/anthonyrawlins/bzzz/pkg/dht"
|
||||
"github.com/anthonyrawlins/bzzz/pkg/slurp/intelligence"
|
||||
"github.com/anthonyrawlins/bzzz/pkg/slurp/storage"
|
||||
slurpContext "github.com/anthonyrawlins/bzzz/pkg/slurp/context"
|
||||
"github.com/anthonyrawlins/bzzz/pubsub"
|
||||
"chorus.services/bzzz/pkg/config"
|
||||
"chorus.services/bzzz/pkg/election"
|
||||
"chorus.services/bzzz/pkg/dht"
|
||||
"chorus.services/bzzz/pkg/slurp/intelligence"
|
||||
"chorus.services/bzzz/pkg/slurp/storage"
|
||||
slurpContext "chorus.services/bzzz/pkg/slurp/context"
|
||||
"chorus.services/bzzz/pubsub"
|
||||
libp2p "github.com/libp2p/go-libp2p/core/host"
|
||||
)
|
||||
|
||||
|
||||
@@ -8,12 +8,12 @@ import (
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/anthonyrawlins/bzzz/pkg/election"
|
||||
"github.com/anthonyrawlins/bzzz/pkg/dht"
|
||||
"github.com/anthonyrawlins/bzzz/pkg/ucxl"
|
||||
"github.com/anthonyrawlins/bzzz/pkg/slurp/intelligence"
|
||||
"github.com/anthonyrawlins/bzzz/pkg/slurp/storage"
|
||||
slurpContext "github.com/anthonyrawlins/bzzz/pkg/slurp/context"
|
||||
"chorus.services/bzzz/pkg/election"
|
||||
"chorus.services/bzzz/pkg/dht"
|
||||
"chorus.services/bzzz/pkg/ucxl"
|
||||
"chorus.services/bzzz/pkg/slurp/intelligence"
|
||||
"chorus.services/bzzz/pkg/slurp/storage"
|
||||
slurpContext "chorus.services/bzzz/pkg/slurp/context"
|
||||
)
|
||||
|
||||
// ContextManager handles leader-only context generation duties
|
||||
|
||||
@@ -3,8 +3,8 @@ package leader
|
||||
import (
|
||||
"time"
|
||||
|
||||
"github.com/anthonyrawlins/bzzz/pkg/ucxl"
|
||||
slurpContext "github.com/anthonyrawlins/bzzz/pkg/slurp/context"
|
||||
"chorus.services/bzzz/pkg/ucxl"
|
||||
slurpContext "chorus.services/bzzz/pkg/slurp/context"
|
||||
)
|
||||
|
||||
// Priority represents priority levels for context generation requests
|
||||
|
||||
@@ -4,9 +4,9 @@ import (
|
||||
"context"
|
||||
"time"
|
||||
|
||||
"github.com/anthonyrawlins/bzzz/pkg/crypto"
|
||||
"github.com/anthonyrawlins/bzzz/pkg/ucxl"
|
||||
slurpContext "github.com/anthonyrawlins/bzzz/pkg/slurp/context"
|
||||
"chorus.services/bzzz/pkg/security"
|
||||
"chorus.services/bzzz/pkg/ucxl"
|
||||
slurpContext "chorus.services/bzzz/pkg/slurp/context"
|
||||
)
|
||||
|
||||
// RoleManager handles definition and management of roles and permissions
|
||||
@@ -63,7 +63,7 @@ type AccessController interface {
|
||||
CheckContextAccess(ctx context.Context, userID string, address ucxl.Address, accessType AccessType) (bool, error)
|
||||
|
||||
// CheckAccessLevel checks if a user meets the required access level
|
||||
CheckAccessLevel(ctx context.Context, userID string, requiredLevel crypto.AccessLevel) (bool, error)
|
||||
CheckAccessLevel(ctx context.Context, userID string, requiredLevel security.AccessLevel) (bool, error)
|
||||
|
||||
// BatchCheckPermissions checks multiple permissions efficiently
|
||||
BatchCheckPermissions(ctx context.Context, userID string, permissions []Permission) (map[Permission]bool, error)
|
||||
@@ -72,7 +72,7 @@ type AccessController interface {
|
||||
EvaluateContextPermissions(ctx context.Context, userID string, node *slurpContext.ContextNode) (*ContextPermissions, error)
|
||||
|
||||
// GetUserAccessLevel gets the maximum access level for a user
|
||||
GetUserAccessLevel(ctx context.Context, userID string) (crypto.AccessLevel, error)
|
||||
GetUserAccessLevel(ctx context.Context, userID string) (security.AccessLevel, error)
|
||||
|
||||
// CreateAccessToken creates a time-limited access token
|
||||
CreateAccessToken(ctx context.Context, userID string, permissions []Permission, ttl time.Duration) (*AccessToken, error)
|
||||
|
||||
@@ -3,11 +3,179 @@ package roles
|
||||
import (
|
||||
"time"
|
||||
|
||||
"github.com/anthonyrawlins/bzzz/pkg/crypto"
|
||||
"github.com/anthonyrawlins/bzzz/pkg/ucxl"
|
||||
slurpContext "github.com/anthonyrawlins/bzzz/pkg/slurp/context"
|
||||
"chorus.services/bzzz/pkg/security"
|
||||
"chorus.services/bzzz/pkg/ucxl"
|
||||
slurpContext "chorus.services/bzzz/pkg/slurp/context"
|
||||
)
|
||||
|
||||
// Stub types for interfaces (to be implemented later)
|
||||
type RoleFilter struct {
|
||||
RoleIDs []string `json:"role_ids,omitempty"`
|
||||
Permissions []string `json:"permissions,omitempty"`
|
||||
}
|
||||
|
||||
type RoleHierarchy struct {
|
||||
Roles map[string][]string `json:"roles"`
|
||||
}
|
||||
|
||||
type RoleValidation struct {
|
||||
Valid bool `json:"valid"`
|
||||
Errors []string `json:"errors"`
|
||||
}
|
||||
|
||||
type RoleStatistics struct {
|
||||
TotalRoles int `json:"total_roles"`
|
||||
ActiveRoles int `json:"active_roles"`
|
||||
}
|
||||
|
||||
type AccessStatistics struct {
|
||||
TotalRequests int `json:"total_requests"`
|
||||
GrantedRequests int `json:"granted_requests"`
|
||||
}
|
||||
|
||||
type FilteringStatistics struct {
|
||||
TotalFiltered int `json:"total_filtered"`
|
||||
PassedFilter int `json:"passed_filter"`
|
||||
}
|
||||
|
||||
type EvaluationStatistics struct {
|
||||
TotalEvaluations int `json:"total_evaluations"`
|
||||
SuccessfulEvaluations int `json:"successful_evaluations"`
|
||||
}
|
||||
|
||||
type PermissionChange struct {
|
||||
RoleID string `json:"role_id"`
|
||||
Permission string `json:"permission"`
|
||||
Action string `json:"action"`
|
||||
Timestamp time.Time `json:"timestamp"`
|
||||
}
|
||||
|
||||
type SecurityEvent struct {
|
||||
EventType string `json:"event_type"`
|
||||
RoleID string `json:"role_id"`
|
||||
Timestamp time.Time `json:"timestamp"`
|
||||
Details map[string]interface{} `json:"details"`
|
||||
}
|
||||
|
||||
type AuditFilter struct {
|
||||
RoleIDs []string `json:"role_ids,omitempty"`
|
||||
EventTypes []string `json:"event_types,omitempty"`
|
||||
StartTime *time.Time `json:"start_time,omitempty"`
|
||||
EndTime *time.Time `json:"end_time,omitempty"`
|
||||
}
|
||||
|
||||
type AuditEntry struct {
|
||||
ID string `json:"id"`
|
||||
Timestamp time.Time `json:"timestamp"`
|
||||
EventType string `json:"event_type"`
|
||||
RoleID string `json:"role_id"`
|
||||
Details map[string]interface{} `json:"details"`
|
||||
}
|
||||
|
||||
type AuditStatistics struct {
|
||||
TotalEntries int `json:"total_entries"`
|
||||
RecentEntries int `json:"recent_entries"`
|
||||
}
|
||||
|
||||
type RetentionPolicy struct {
|
||||
Duration time.Duration `json:"duration"`
|
||||
MaxEntries int `json:"max_entries"`
|
||||
}
|
||||
|
||||
type ArchiveResult struct {
|
||||
ArchivedCount int `json:"archived_count"`
|
||||
Success bool `json:"success"`
|
||||
}
|
||||
|
||||
type EncryptionStatistics struct {
|
||||
TotalEncrypted int `json:"total_encrypted"`
|
||||
EncryptionErrors int `json:"encryption_errors"`
|
||||
}
|
||||
|
||||
type AccessPolicy struct {
|
||||
ID string `json:"id"`
|
||||
Name string `json:"name"`
|
||||
Rules []string `json:"rules"`
|
||||
CreatedAt time.Time `json:"created_at"`
|
||||
}
|
||||
|
||||
type PolicyFilter struct {
|
||||
PolicyIDs []string `json:"policy_ids,omitempty"`
|
||||
Names []string `json:"names,omitempty"`
|
||||
}
|
||||
|
||||
type AccessRequest struct {
|
||||
ID string `json:"id"`
|
||||
UserID string `json:"user_id"`
|
||||
RoleID string `json:"role_id"`
|
||||
Resource string `json:"resource"`
|
||||
Action string `json:"action"`
|
||||
Timestamp time.Time `json:"timestamp"`
|
||||
}
|
||||
|
||||
type PolicyEvaluation struct {
|
||||
PolicyID string `json:"policy_id"`
|
||||
Result bool `json:"result"`
|
||||
Reason string `json:"reason"`
|
||||
Timestamp time.Time `json:"timestamp"`
|
||||
}
|
||||
|
||||
type PolicyValidation struct {
|
||||
Valid bool `json:"valid"`
|
||||
Errors []string `json:"errors"`
|
||||
Warnings []string `json:"warnings"`
|
||||
}
|
||||
|
||||
type UserSession struct {
|
||||
ID string `json:"id"`
|
||||
UserID string `json:"user_id"`
|
||||
RoleIDs []string `json:"role_ids"`
|
||||
CreatedAt time.Time `json:"created_at"`
|
||||
LastAccessed time.Time `json:"last_accessed"`
|
||||
ExpiresAt time.Time `json:"expires_at"`
|
||||
Active bool `json:"active"`
|
||||
}
|
||||
|
||||
type SessionUpdate struct {
|
||||
SessionID string `json:"session_id"`
|
||||
RoleIDs []string `json:"role_ids,omitempty"`
|
||||
ExpiresAt *time.Time `json:"expires_at,omitempty"`
|
||||
Active *bool `json:"active,omitempty"`
|
||||
}
|
||||
|
||||
type CleanupResult struct {
|
||||
CleanedSessions int `json:"cleaned_sessions"`
|
||||
Success bool `json:"success"`
|
||||
}
|
||||
|
||||
type SessionStatistics struct {
|
||||
ActiveSessions int `json:"active_sessions"`
|
||||
TotalSessions int `json:"total_sessions"`
|
||||
ExpiredSessions int `json:"expired_sessions"`
|
||||
}
|
||||
|
||||
type Delegation struct {
|
||||
ID string `json:"id"`
|
||||
DelegatorID string `json:"delegator_id"`
|
||||
DelegateID string `json:"delegate_id"`
|
||||
RoleID string `json:"role_id"`
|
||||
CreatedAt time.Time `json:"created_at"`
|
||||
ExpiresAt *time.Time `json:"expires_at,omitempty"`
|
||||
Active bool `json:"active"`
|
||||
}
|
||||
|
||||
type DelegationValidation struct {
|
||||
Valid bool `json:"valid"`
|
||||
Errors []string `json:"errors"`
|
||||
Warnings []string `json:"warnings"`
|
||||
}
|
||||
|
||||
type DelegationStatistics struct {
|
||||
ActiveDelegations int `json:"active_delegations"`
|
||||
TotalDelegations int `json:"total_delegations"`
|
||||
ExpiredDelegations int `json:"expired_delegations"`
|
||||
}
|
||||
|
||||
// Permission represents a specific permission within the system
|
||||
type Permission string
|
||||
|
||||
@@ -75,7 +243,7 @@ type Role struct {
|
||||
Name string `json:"name"` // Human-readable role name
|
||||
Description string `json:"description"` // Role description
|
||||
Permissions []Permission `json:"permissions"` // Granted permissions
|
||||
AccessLevel crypto.AccessLevel `json:"access_level"` // Maximum access level
|
||||
AccessLevel security.AccessLevel `json:"access_level"` // Maximum access level
|
||||
Priority int `json:"priority"` // Role priority for conflicts
|
||||
|
||||
// Hierarchy
|
||||
@@ -182,7 +350,7 @@ type ContextPermissions struct {
|
||||
CanWrite bool `json:"can_write"` // Can write/modify context
|
||||
CanDelete bool `json:"can_delete"` // Can delete context
|
||||
CanDistribute bool `json:"can_distribute"` // Can distribute context
|
||||
AccessLevel crypto.AccessLevel `json:"access_level"` // Granted access level
|
||||
AccessLevel security.AccessLevel `json:"access_level"` // Granted access level
|
||||
AllowedFields []string `json:"allowed_fields"` // Fields user can access
|
||||
RestrictedFields []string `json:"restricted_fields"` // Fields user cannot access
|
||||
Conditions []*PermissionCondition `json:"conditions"` // Access conditions
|
||||
@@ -204,7 +372,7 @@ type AccessToken struct {
|
||||
Token string `json:"token"` // Token string
|
||||
UserID string `json:"user_id"` // User identifier
|
||||
Permissions []Permission `json:"permissions"` // Granted permissions
|
||||
AccessLevel crypto.AccessLevel `json:"access_level"` // Granted access level
|
||||
AccessLevel security.AccessLevel `json:"access_level"` // Granted access level
|
||||
IssuedAt time.Time `json:"issued_at"` // When issued
|
||||
ExpiresAt time.Time `json:"expires_at"` // When expires
|
||||
Scope []string `json:"scope"` // Token scope
|
||||
@@ -251,7 +419,7 @@ type LabeledContext struct {
|
||||
Context *slurpContext.ContextNode `json:"context"` // Original context
|
||||
SecurityLabels []*SecurityLabel `json:"security_labels"` // Applied security labels
|
||||
ClassificationLevel string `json:"classification_level"` // Overall classification
|
||||
RequiredClearance crypto.AccessLevel `json:"required_clearance"` // Required clearance level
|
||||
RequiredClearance security.AccessLevel `json:"required_clearance"` // Required clearance level
|
||||
LabeledAt time.Time `json:"labeled_at"` // When labels were applied
|
||||
LabeledBy string `json:"labeled_by"` // Who/what applied labels
|
||||
}
|
||||
@@ -262,7 +430,7 @@ type SecurityLabel struct {
|
||||
Value string `json:"value"` // Label value
|
||||
Confidence float64 `json:"confidence"` // Labeling confidence
|
||||
AppliedReason string `json:"applied_reason"` // Why label was applied
|
||||
RequiredLevel crypto.AccessLevel `json:"required_level"` // Required access level
|
||||
RequiredLevel security.AccessLevel `json:"required_level"` // Required access level
|
||||
Metadata map[string]interface{} `json:"metadata"` // Additional metadata
|
||||
}
|
||||
|
||||
@@ -439,7 +607,7 @@ type EncryptedData struct {
|
||||
Data []byte `json:"data"` // Encrypted data
|
||||
EncryptionMethod string `json:"encryption_method"` // Encryption method used
|
||||
RoleKeys map[string]string `json:"role_keys"` // Encrypted keys by role
|
||||
AccessLevels map[string]crypto.AccessLevel `json:"access_levels"` // Access levels by role
|
||||
AccessLevels map[string]security.AccessLevel `json:"access_levels"` // Access levels by role
|
||||
CreatedAt time.Time `json:"created_at"` // When encrypted
|
||||
ExpiresAt *time.Time `json:"expires_at,omitempty"` // When encryption expires
|
||||
Metadata map[string]interface{} `json:"metadata"` // Additional metadata
|
||||
|
||||
@@ -31,10 +31,10 @@ import (
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/anthonyrawlins/bzzz/pkg/config"
|
||||
"github.com/anthonyrawlins/bzzz/pkg/crypto"
|
||||
"github.com/anthonyrawlins/bzzz/pkg/dht"
|
||||
"github.com/anthonyrawlins/bzzz/pkg/election"
|
||||
"chorus.services/bzzz/pkg/config"
|
||||
"chorus.services/bzzz/pkg/crypto"
|
||||
"chorus.services/bzzz/pkg/dht"
|
||||
"chorus.services/bzzz/pkg/election"
|
||||
)
|
||||
|
||||
// SLURP is the main coordinator for contextual intelligence operations.
|
||||
|
||||
@@ -13,7 +13,7 @@ import (
|
||||
"time"
|
||||
|
||||
"github.com/robfig/cron/v3"
|
||||
"github.com/anthonyrawlins/bzzz/pkg/crypto"
|
||||
"chorus.services/bzzz/pkg/crypto"
|
||||
)
|
||||
|
||||
// BackupManagerImpl implements the BackupManager interface
|
||||
|
||||
@@ -6,8 +6,8 @@ import (
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/anthonyrawlins/bzzz/pkg/ucxl"
|
||||
slurpContext "github.com/anthonyrawlins/bzzz/pkg/slurp/context"
|
||||
"chorus.services/bzzz/pkg/ucxl"
|
||||
slurpContext "chorus.services/bzzz/pkg/slurp/context"
|
||||
)
|
||||
|
||||
// BatchOperationsImpl provides efficient batch operations for context storage
|
||||
|
||||
@@ -7,10 +7,10 @@ import (
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/anthonyrawlins/bzzz/pkg/crypto"
|
||||
"github.com/anthonyrawlins/bzzz/pkg/dht"
|
||||
"github.com/anthonyrawlins/bzzz/pkg/ucxl"
|
||||
slurpContext "github.com/anthonyrawlins/bzzz/pkg/slurp/context"
|
||||
"chorus.services/bzzz/pkg/crypto"
|
||||
"chorus.services/bzzz/pkg/dht"
|
||||
"chorus.services/bzzz/pkg/ucxl"
|
||||
slurpContext "chorus.services/bzzz/pkg/slurp/context"
|
||||
)
|
||||
|
||||
// ContextStoreImpl is the main implementation of the ContextStore interface
|
||||
|
||||
@@ -7,8 +7,8 @@ import (
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/anthonyrawlins/bzzz/pkg/dht"
|
||||
"github.com/anthonyrawlins/bzzz/pkg/types"
|
||||
"chorus.services/bzzz/pkg/dht"
|
||||
"chorus.services/bzzz/pkg/types"
|
||||
)
|
||||
|
||||
// DistributedStorageImpl implements the DistributedStorage interface
|
||||
|
||||
@@ -8,9 +8,9 @@ import (
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/anthonyrawlins/bzzz/pkg/crypto"
|
||||
"github.com/anthonyrawlins/bzzz/pkg/ucxl"
|
||||
slurpContext "github.com/anthonyrawlins/bzzz/pkg/slurp/context"
|
||||
"chorus.services/bzzz/pkg/crypto"
|
||||
"chorus.services/bzzz/pkg/ucxl"
|
||||
slurpContext "chorus.services/bzzz/pkg/slurp/context"
|
||||
)
|
||||
|
||||
// EncryptedStorageImpl implements the EncryptedStorage interface
|
||||
|
||||
@@ -13,8 +13,8 @@ import (
|
||||
"github.com/blevesearch/bleve/v2/analysis/analyzer/standard"
|
||||
"github.com/blevesearch/bleve/v2/analysis/lang/en"
|
||||
"github.com/blevesearch/bleve/v2/mapping"
|
||||
"github.com/anthonyrawlins/bzzz/pkg/ucxl"
|
||||
slurpContext "github.com/anthonyrawlins/bzzz/pkg/slurp/context"
|
||||
"chorus.services/bzzz/pkg/ucxl"
|
||||
slurpContext "chorus.services/bzzz/pkg/slurp/context"
|
||||
)
|
||||
|
||||
// IndexManagerImpl implements the IndexManager interface using Bleve
|
||||
|
||||
@@ -4,9 +4,9 @@ import (
|
||||
"context"
|
||||
"time"
|
||||
|
||||
"github.com/anthonyrawlins/bzzz/pkg/ucxl"
|
||||
"github.com/anthonyrawlins/bzzz/pkg/crypto"
|
||||
slurpContext "github.com/anthonyrawlins/bzzz/pkg/slurp/context"
|
||||
"chorus.services/bzzz/pkg/ucxl"
|
||||
"chorus.services/bzzz/pkg/crypto"
|
||||
slurpContext "chorus.services/bzzz/pkg/slurp/context"
|
||||
)
|
||||
|
||||
// ContextStore provides the main interface for context storage and retrieval
|
||||
|
||||
@@ -3,10 +3,9 @@ package storage
|
||||
import (
|
||||
"time"
|
||||
|
||||
"github.com/anthonyrawlins/bzzz/pkg/ucxl"
|
||||
"github.com/anthonyrawlins/bzzz/pkg/crypto"
|
||||
slurpContext "github.com/anthonyrawlins/bzzz/pkg/slurp/context"
|
||||
slurpTemporal "github.com/anthonyrawlins/bzzz/pkg/slurp/temporal"
|
||||
"chorus.services/bzzz/pkg/ucxl"
|
||||
"chorus.services/bzzz/pkg/crypto"
|
||||
slurpContext "chorus.services/bzzz/pkg/slurp/context"
|
||||
)
|
||||
|
||||
// DatabaseSchema defines the complete schema for encrypted context storage
|
||||
@@ -123,7 +122,7 @@ type DecisionHopRecord struct {
|
||||
ContextVersion int64 `json:"context_version" db:"context_version"`
|
||||
|
||||
// Decision metadata
|
||||
ChangeReason slurpTemporal.ChangeReason `json:"change_reason" db:"change_reason"`
|
||||
ChangeReason string `json:"change_reason" db:"change_reason"`
|
||||
DecisionMaker string `json:"decision_maker" db:"decision_maker"`
|
||||
DecisionRationale string `json:"decision_rationale" db:"decision_rationale"`
|
||||
ImpactScope string `json:"impact_scope" db:"impact_scope"`
|
||||
|
||||
@@ -3,9 +3,9 @@ package storage
|
||||
import (
|
||||
"time"
|
||||
|
||||
"github.com/anthonyrawlins/bzzz/pkg/ucxl"
|
||||
"github.com/anthonyrawlins/bzzz/pkg/crypto"
|
||||
slurpContext "github.com/anthonyrawlins/bzzz/pkg/slurp/context"
|
||||
"chorus.services/bzzz/pkg/ucxl"
|
||||
"chorus.services/bzzz/pkg/crypto"
|
||||
slurpContext "chorus.services/bzzz/pkg/slurp/context"
|
||||
)
|
||||
|
||||
// ListCriteria represents criteria for listing contexts
|
||||
|
||||
@@ -5,7 +5,7 @@ import (
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
"github.com/anthonyrawlins/bzzz/pkg/slurp/storage"
|
||||
"chorus.services/bzzz/pkg/slurp/storage"
|
||||
)
|
||||
|
||||
// TemporalGraphFactory creates and configures temporal graph components
|
||||
|
||||
@@ -4,8 +4,8 @@ import (
|
||||
"context"
|
||||
"time"
|
||||
|
||||
"github.com/anthonyrawlins/bzzz/pkg/ucxl"
|
||||
slurpContext "github.com/anthonyrawlins/bzzz/pkg/slurp/context"
|
||||
"chorus.services/bzzz/pkg/ucxl"
|
||||
slurpContext "chorus.services/bzzz/pkg/slurp/context"
|
||||
)
|
||||
|
||||
// TemporalGraph manages the temporal evolution of context through decision points
|
||||
|
||||
@@ -9,9 +9,9 @@ import (
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/anthonyrawlins/bzzz/pkg/ucxl"
|
||||
slurpContext "github.com/anthonyrawlins/bzzz/pkg/slurp/context"
|
||||
"github.com/anthonyrawlins/bzzz/pkg/slurp/storage"
|
||||
"chorus.services/bzzz/pkg/ucxl"
|
||||
slurpContext "chorus.services/bzzz/pkg/slurp/context"
|
||||
"chorus.services/bzzz/pkg/slurp/storage"
|
||||
)
|
||||
|
||||
// temporalGraphImpl implements the TemporalGraph interface
|
||||
|
||||
@@ -5,9 +5,9 @@ import (
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/anthonyrawlins/bzzz/pkg/ucxl"
|
||||
slurpContext "github.com/anthonyrawlins/bzzz/pkg/slurp/context"
|
||||
"github.com/anthonyrawlins/bzzz/pkg/slurp/storage"
|
||||
"chorus.services/bzzz/pkg/ucxl"
|
||||
slurpContext "chorus.services/bzzz/pkg/slurp/context"
|
||||
"chorus.services/bzzz/pkg/slurp/storage"
|
||||
)
|
||||
|
||||
// Mock storage for testing
|
||||
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/anthonyrawlins/bzzz/pkg/ucxl"
|
||||
"chorus.services/bzzz/pkg/ucxl"
|
||||
)
|
||||
|
||||
// influenceAnalyzerImpl implements the InfluenceAnalyzer interface
|
||||
|
||||
@@ -5,8 +5,8 @@ import (
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/anthonyrawlins/bzzz/pkg/ucxl"
|
||||
slurpContext "github.com/anthonyrawlins/bzzz/pkg/slurp/context"
|
||||
"chorus.services/bzzz/pkg/ucxl"
|
||||
slurpContext "chorus.services/bzzz/pkg/slurp/context"
|
||||
)
|
||||
|
||||
func TestInfluenceAnalyzer_AnalyzeInfluenceNetwork(t *testing.T) {
|
||||
|
||||
@@ -5,9 +5,9 @@ import (
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/anthonyrawlins/bzzz/pkg/ucxl"
|
||||
slurpContext "github.com/anthonyrawlins/bzzz/pkg/slurp/context"
|
||||
"github.com/anthonyrawlins/bzzz/pkg/slurp/storage"
|
||||
"chorus.services/bzzz/pkg/ucxl"
|
||||
slurpContext "chorus.services/bzzz/pkg/slurp/context"
|
||||
"chorus.services/bzzz/pkg/slurp/storage"
|
||||
)
|
||||
|
||||
// Integration tests for the complete temporal graph system
|
||||
|
||||
@@ -7,7 +7,7 @@ import (
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/anthonyrawlins/bzzz/pkg/ucxl"
|
||||
"chorus.services/bzzz/pkg/ucxl"
|
||||
)
|
||||
|
||||
// decisionNavigatorImpl implements the DecisionNavigator interface
|
||||
|
||||
@@ -5,8 +5,8 @@ import (
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/anthonyrawlins/bzzz/pkg/ucxl"
|
||||
slurpContext "github.com/anthonyrawlins/bzzz/pkg/slurp/context"
|
||||
"chorus.services/bzzz/pkg/ucxl"
|
||||
slurpContext "chorus.services/bzzz/pkg/slurp/context"
|
||||
)
|
||||
|
||||
func TestDecisionNavigator_NavigateDecisionHops(t *testing.T) {
|
||||
|
||||
@@ -7,8 +7,8 @@ import (
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/anthonyrawlins/bzzz/pkg/ucxl"
|
||||
"github.com/anthonyrawlins/bzzz/pkg/slurp/storage"
|
||||
"chorus.services/bzzz/pkg/ucxl"
|
||||
"chorus.services/bzzz/pkg/slurp/storage"
|
||||
)
|
||||
|
||||
// persistenceManagerImpl handles persistence and synchronization of temporal graph data
|
||||
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/anthonyrawlins/bzzz/pkg/ucxl"
|
||||
"chorus.services/bzzz/pkg/ucxl"
|
||||
)
|
||||
|
||||
// querySystemImpl implements decision-hop based query operations
|
||||
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/anthonyrawlins/bzzz/pkg/ucxl"
|
||||
"chorus.services/bzzz/pkg/ucxl"
|
||||
)
|
||||
|
||||
// stalenessDetectorImpl implements the StalenessDetector interface
|
||||
|
||||
@@ -3,8 +3,8 @@ package temporal
|
||||
import (
|
||||
"time"
|
||||
|
||||
"github.com/anthonyrawlins/bzzz/pkg/ucxl"
|
||||
slurpContext "github.com/anthonyrawlins/bzzz/pkg/slurp/context"
|
||||
"chorus.services/bzzz/pkg/ucxl"
|
||||
slurpContext "chorus.services/bzzz/pkg/slurp/context"
|
||||
)
|
||||
|
||||
// ChangeReason represents why a context changed at a decision point
|
||||
|
||||
@@ -3,7 +3,7 @@ package slurp
|
||||
import (
|
||||
"time"
|
||||
|
||||
"github.com/anthonyrawlins/bzzz/pkg/crypto"
|
||||
"chorus.services/bzzz/pkg/crypto"
|
||||
)
|
||||
|
||||
// Core data types for the SLURP contextual intelligence system.
|
||||
|
||||
Reference in New Issue
Block a user