refactor CHORUS
This commit is contained in:
@@ -579,146 +579,146 @@ func (cfg *SLURPLeaderConfig) GetEffectiveConfig() *SLURPLeaderConfig {
|
||||
return &effective
|
||||
}
|
||||
|
||||
// ToBaseBZZZConfig converts SLURP leader config to base CHORUS config format
|
||||
func (cfg *SLURPLeaderConfig) ToBaseBZZZConfig() *config.Config {
|
||||
// ToBaseCHORUSConfig converts SLURP leader config to base CHORUS config format
|
||||
func (cfg *SLURPLeaderConfig) ToBaseCHORUSConfig() *config.Config {
|
||||
// TODO: Convert to base CHORUS config structure
|
||||
// This would map SLURP-specific configuration to the existing
|
||||
// CHORUS configuration structure for compatibility
|
||||
|
||||
bzzzConfig := &config.Config{
|
||||
chorusConfig := &config.Config{
|
||||
// Map core settings
|
||||
// Map agent settings
|
||||
// Map security settings
|
||||
// etc.
|
||||
}
|
||||
|
||||
return bzzzConfig
|
||||
return chorusConfig
|
||||
}
|
||||
|
||||
// overrideWithEnvironment applies environment variable overrides to configuration
|
||||
func overrideWithEnvironment(cfg *SLURPLeaderConfig) error {
|
||||
// Core configuration overrides
|
||||
if val := os.Getenv("BZZZ_NODE_ID"); val != "" {
|
||||
if val := os.Getenv("CHORUS_NODE_ID"); val != "" {
|
||||
cfg.Core.NodeID = val
|
||||
}
|
||||
if val := os.Getenv("BZZZ_CLUSTER_ID"); val != "" {
|
||||
if val := os.Getenv("CHORUS_CLUSTER_ID"); val != "" {
|
||||
cfg.Core.ClusterID = val
|
||||
}
|
||||
if val := os.Getenv("BZZZ_DATA_DIRECTORY"); val != "" {
|
||||
if val := os.Getenv("CHORUS_DATA_DIRECTORY"); val != "" {
|
||||
cfg.Core.DataDirectory = val
|
||||
}
|
||||
if val := os.Getenv("BZZZ_LISTEN_ADDRESS"); val != "" {
|
||||
if val := os.Getenv("CHORUS_LISTEN_ADDRESS"); val != "" {
|
||||
cfg.Core.ListenAddress = val
|
||||
}
|
||||
if val := os.Getenv("BZZZ_ADVERTISE_ADDRESS"); val != "" {
|
||||
if val := os.Getenv("CHORUS_ADVERTISE_ADDRESS"); val != "" {
|
||||
cfg.Core.AdvertiseAddress = val
|
||||
}
|
||||
if val := os.Getenv("BZZZ_DEBUG_MODE"); val != "" {
|
||||
if val := os.Getenv("CHORUS_DEBUG_MODE"); val != "" {
|
||||
if debug, err := strconv.ParseBool(val); err == nil {
|
||||
cfg.Core.DebugMode = debug
|
||||
}
|
||||
}
|
||||
if val := os.Getenv("BZZZ_VERBOSE_LOGGING"); val != "" {
|
||||
if val := os.Getenv("CHORUS_VERBOSE_LOGGING"); val != "" {
|
||||
if verbose, err := strconv.ParseBool(val); err == nil {
|
||||
cfg.Core.VerboseLogging = verbose
|
||||
}
|
||||
}
|
||||
|
||||
// Capabilities override
|
||||
if val := os.Getenv("BZZZ_CAPABILITIES"); val != "" {
|
||||
if val := os.Getenv("CHORUS_CAPABILITIES"); val != "" {
|
||||
cfg.Core.Capabilities = strings.Split(val, ",")
|
||||
}
|
||||
if val := os.Getenv("BZZZ_PROJECT_MANAGER_ENABLED"); val != "" {
|
||||
if val := os.Getenv("CHORUS_PROJECT_MANAGER_ENABLED"); val != "" {
|
||||
if enabled, err := strconv.ParseBool(val); err == nil {
|
||||
cfg.Core.ProjectManagerEnabled = enabled
|
||||
}
|
||||
}
|
||||
if val := os.Getenv("BZZZ_CONTEXT_CURATION_ENABLED"); val != "" {
|
||||
if val := os.Getenv("CHORUS_CONTEXT_CURATION_ENABLED"); val != "" {
|
||||
if enabled, err := strconv.ParseBool(val); err == nil {
|
||||
cfg.Core.ContextCurationEnabled = enabled
|
||||
}
|
||||
}
|
||||
|
||||
// Election configuration overrides
|
||||
if val := os.Getenv("BZZZ_ELECTION_TIMEOUT"); val != "" {
|
||||
if val := os.Getenv("CHORUS_ELECTION_TIMEOUT"); val != "" {
|
||||
if duration, err := time.ParseDuration(val); err == nil {
|
||||
cfg.Election.ElectionTimeout = duration
|
||||
}
|
||||
}
|
||||
if val := os.Getenv("BZZZ_HEARTBEAT_INTERVAL"); val != "" {
|
||||
if val := os.Getenv("CHORUS_HEARTBEAT_INTERVAL"); val != "" {
|
||||
if duration, err := time.ParseDuration(val); err == nil {
|
||||
cfg.Election.HeartbeatInterval = duration
|
||||
}
|
||||
}
|
||||
if val := os.Getenv("BZZZ_HEARTBEAT_TIMEOUT"); val != "" {
|
||||
if val := os.Getenv("CHORUS_HEARTBEAT_TIMEOUT"); val != "" {
|
||||
if duration, err := time.ParseDuration(val); err == nil {
|
||||
cfg.Election.HeartbeatTimeout = duration
|
||||
}
|
||||
}
|
||||
if val := os.Getenv("BZZZ_MIN_QUORUM_SIZE"); val != "" {
|
||||
if val := os.Getenv("CHORUS_MIN_QUORUM_SIZE"); val != "" {
|
||||
if size, err := strconv.Atoi(val); err == nil {
|
||||
cfg.Election.MinQuorumSize = size
|
||||
}
|
||||
}
|
||||
if val := os.Getenv("BZZZ_REQUIRE_QUORUM"); val != "" {
|
||||
if val := os.Getenv("CHORUS_REQUIRE_QUORUM"); val != "" {
|
||||
if require, err := strconv.ParseBool(val); err == nil {
|
||||
cfg.Election.RequireQuorum = require
|
||||
}
|
||||
}
|
||||
|
||||
// Context management configuration overrides
|
||||
if val := os.Getenv("BZZZ_MAX_CONCURRENT_GENERATION"); val != "" {
|
||||
if val := os.Getenv("CHORUS_MAX_CONCURRENT_GENERATION"); val != "" {
|
||||
if max, err := strconv.Atoi(val); err == nil {
|
||||
cfg.ContextManagement.MaxConcurrentGeneration = max
|
||||
}
|
||||
}
|
||||
if val := os.Getenv("BZZZ_GENERATION_TIMEOUT"); val != "" {
|
||||
if val := os.Getenv("CHORUS_GENERATION_TIMEOUT"); val != "" {
|
||||
if duration, err := time.ParseDuration(val); err == nil {
|
||||
cfg.ContextManagement.GenerationTimeout = duration
|
||||
}
|
||||
}
|
||||
if val := os.Getenv("BZZZ_CONTEXT_CACHE_SIZE"); val != "" {
|
||||
if val := os.Getenv("CHORUS_CONTEXT_CACHE_SIZE"); val != "" {
|
||||
if size, err := strconv.Atoi(val); err == nil {
|
||||
cfg.ContextManagement.ContextCacheSize = size
|
||||
}
|
||||
}
|
||||
|
||||
// Health monitoring overrides
|
||||
if val := os.Getenv("BZZZ_HEALTH_CHECK_INTERVAL"); val != "" {
|
||||
if val := os.Getenv("CHORUS_HEALTH_CHECK_INTERVAL"); val != "" {
|
||||
if duration, err := time.ParseDuration(val); err == nil {
|
||||
cfg.Health.HealthCheckInterval = duration
|
||||
}
|
||||
}
|
||||
if val := os.Getenv("BZZZ_HEALTH_CHECK_TIMEOUT"); val != "" {
|
||||
if val := os.Getenv("CHORUS_HEALTH_CHECK_TIMEOUT"); val != "" {
|
||||
if duration, err := time.ParseDuration(val); err == nil {
|
||||
cfg.Health.HealthCheckTimeout = duration
|
||||
}
|
||||
}
|
||||
|
||||
// Performance overrides
|
||||
if val := os.Getenv("BZZZ_WORKER_POOL_SIZE"); val != "" {
|
||||
if val := os.Getenv("CHORUS_WORKER_POOL_SIZE"); val != "" {
|
||||
if size, err := strconv.Atoi(val); err == nil {
|
||||
cfg.Performance.WorkerPoolSize = size
|
||||
}
|
||||
}
|
||||
if val := os.Getenv("BZZZ_QUEUE_BUFFER_SIZE"); val != "" {
|
||||
if val := os.Getenv("CHORUS_QUEUE_BUFFER_SIZE"); val != "" {
|
||||
if size, err := strconv.Atoi(val); err == nil {
|
||||
cfg.Performance.QueueBufferSize = size
|
||||
}
|
||||
}
|
||||
|
||||
// Observability overrides
|
||||
if val := os.Getenv("BZZZ_METRICS_ENABLED"); val != "" {
|
||||
if val := os.Getenv("CHORUS_METRICS_ENABLED"); val != "" {
|
||||
if enabled, err := strconv.ParseBool(val); err == nil {
|
||||
cfg.Observability.MetricsEnabled = enabled
|
||||
}
|
||||
}
|
||||
if val := os.Getenv("BZZZ_METRICS_PORT"); val != "" {
|
||||
if val := os.Getenv("CHORUS_METRICS_PORT"); val != "" {
|
||||
if port, err := strconv.Atoi(val); err == nil {
|
||||
cfg.Observability.MetricsPort = port
|
||||
}
|
||||
}
|
||||
if val := os.Getenv("BZZZ_LOG_LEVEL"); val != "" {
|
||||
if val := os.Getenv("CHORUS_LOG_LEVEL"); val != "" {
|
||||
cfg.Observability.LogLevel = val
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user