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

@@ -11,10 +11,10 @@ import (
"strings"
"time"
"github.com/anthonyrawlins/bzzz/executor"
"github.com/anthonyrawlins/bzzz/logging"
"github.com/anthonyrawlins/bzzz/pkg/types"
"github.com/anthonyrawlins/bzzz/sandbox"
"chorus.services/bzzz/executor"
"chorus.services/bzzz/logging"
"chorus.services/bzzz/pkg/types"
"chorus.services/bzzz/sandbox"
"github.com/gorilla/mux"
)

View File

@@ -5,8 +5,8 @@ import (
"fmt"
"time"
"github.com/anthonyrawlins/bzzz/pubsub"
"github.com/anthonyrawlins/bzzz/pkg/coordination"
"chorus.services/bzzz/pubsub"
"chorus.services/bzzz/pkg/coordination"
)
// HmmmTestSuite runs comprehensive tests for the HMMM coordination system

View File

@@ -5,7 +5,7 @@ import (
"testing"
"time"
"github.com/anthonyrawlins/bzzz/pkg/dht"
"chorus.services/bzzz/pkg/dht"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)

View File

@@ -6,8 +6,8 @@ import (
"testing"
"time"
"github.com/anthonyrawlins/bzzz/pkg/dht"
"github.com/anthonyrawlins/bzzz/pkg/ucxl"
"chorus.services/bzzz/pkg/dht"
"chorus.services/bzzz/pkg/ucxl"
)
// Phase 1 Integration Tests for BZZZ-RUSTLE Mock Implementation

View File

@@ -6,8 +6,8 @@ import (
"testing"
"time"
"github.com/anthonyrawlins/bzzz/pkg/config"
"github.com/anthonyrawlins/bzzz/pkg/dht"
"chorus.services/bzzz/pkg/config"
"chorus.services/bzzz/pkg/dht"
)
// Phase 2 Hybrid DHT Integration Tests
@@ -40,7 +40,7 @@ func TestPhase2HybridDHTBasic(t *testing.T) {
func testHybridDHTCreation(t *testing.T, ctx context.Context) {
// Create configuration for mock-only mode
config := &config.HybridConfig{
DHT: config.DHTConfig{
DHT: config.HybridDHTConfig{
Backend: "mock",
FallbackOnError: true,
HealthCheckInterval: 5 * time.Second,
@@ -75,7 +75,7 @@ func testHybridDHTCreation(t *testing.T, ctx context.Context) {
func testMockBackendOperations(t *testing.T, ctx context.Context) {
config := &config.HybridConfig{
DHT: config.DHTConfig{
DHT: config.HybridDHTConfig{
Backend: "mock",
FallbackOnError: true,
HealthCheckInterval: 5 * time.Second,
@@ -149,7 +149,7 @@ func testMockBackendOperations(t *testing.T, ctx context.Context) {
func testBackendSwitching(t *testing.T, ctx context.Context) {
config := &config.HybridConfig{
DHT: config.DHTConfig{
DHT: config.HybridDHTConfig{
Backend: "mock",
FallbackOnError: true,
HealthCheckInterval: 5 * time.Second,
@@ -204,7 +204,7 @@ func testBackendSwitching(t *testing.T, ctx context.Context) {
func testHealthMonitoring(t *testing.T, ctx context.Context) {
config := &config.HybridConfig{
DHT: config.DHTConfig{
DHT: config.HybridDHTConfig{
Backend: "mock",
FallbackOnError: true,
HealthCheckInterval: 1 * time.Second, // Fast for testing
@@ -254,7 +254,7 @@ func testHealthMonitoring(t *testing.T, ctx context.Context) {
func testMetricsCollection(t *testing.T, ctx context.Context) {
config := &config.HybridConfig{
DHT: config.DHTConfig{
DHT: config.HybridDHTConfig{
Backend: "mock",
FallbackOnError: true,
HealthCheckInterval: 5 * time.Second,
@@ -401,7 +401,7 @@ func TestPhase2ConfigurationFromEnv(t *testing.T) {
func TestPhase2ConcurrentOperations(t *testing.T) {
config := &config.HybridConfig{
DHT: config.DHTConfig{
DHT: config.HybridDHTConfig{
Backend: "mock",
FallbackOnError: true,
HealthCheckInterval: 5 * time.Second,

View File

@@ -3,7 +3,7 @@ package integration
import (
"testing"
"github.com/anthonyrawlins/bzzz/pkg/ucxl"
"chorus.services/bzzz/pkg/ucxl"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)

View File

@@ -7,7 +7,7 @@ import (
"math/rand"
"time"
"github.com/anthonyrawlins/bzzz/pubsub"
"chorus.services/bzzz/pubsub"
)
// TaskSimulator generates realistic task scenarios for testing HMMM coordination
@@ -287,7 +287,7 @@ func generateMockRepositories() []MockRepository {
{
Owner: "deepblackcloud",
Name: "bzzz",
URL: "https://github.com/anthonyrawlins/bzzz",
URL: "https://chorus.services/bzzz",
Dependencies: []string{"whoosh"},
Tasks: []MockTask{
{