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:
anthonyrawlins
2025-08-17 10:04:25 +10:00
parent e9252ccddc
commit d96c931a29
115 changed files with 1010 additions and 534 deletions

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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"`

View File

@@ -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