refactor: eliminar structs muertos del config schema

Elimina 14 structs nunca referenciados en el codebase:
- ObservabilityCfg y sub-structs (LoggingCfg, MetricsCfg, HealthCfg, TracingCfg)
- ResilienceCfg y sub-structs (CircuitBreakerCfg, RetryCfg, ShutdownCfg, QueueCfg)
- AgentsCfg y sub-structs (PeerCfg, DelegationCfg, ProtocolCfg)

Se eliminan los campos Agents, Observability y Resilience del AgentConfig root.
CommunicationCfg se mantiene porque esta activamente usada por pkg/personality/
y agents/commands.go.

schema.go pasa de 561 lineas / 61 structs a 460 lineas / 47 structs.
El template _template/config.yaml se reduce de 414 a ~220 lineas.
Los configs de assistant-bot y asistente-2 se limpian de secciones muertas.

yaml.v3 ignora campos extra, asi que YAMLs antiguos siguen parseando sin error.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-08 23:01:53 +00:00
parent fc235c71c6
commit 2bf3d289ac
4 changed files with 83 additions and 505 deletions
-101
View File
@@ -10,12 +10,9 @@ type AgentConfig struct {
LLM LLMCfg `yaml:"llm"`
Tools ToolsCfg `yaml:"tools"`
Matrix MatrixCfg `yaml:"matrix"`
Agents AgentsCfg `yaml:"agents"`
SSH SSHCfg `yaml:"ssh"`
Security SecurityCfg `yaml:"security"`
Schedules []ScheduleCfg `yaml:"schedules"`
Observability ObservabilityCfg `yaml:"observability"`
Resilience ResilienceCfg `yaml:"resilience"`
Storage StorageCfg `yaml:"storage"`
Memory MemoryCfg `yaml:"memory"`
Skills SkillsCfg `yaml:"skills"`
@@ -276,34 +273,6 @@ type FiltersCfg struct {
MinPowerLevel int `yaml:"min_power_level"`
}
// ── Inter-agent ───────────────────────────────────────────────────────────
type AgentsCfg struct {
Peers []PeerCfg `yaml:"peers"`
Delegation DelegationCfg `yaml:"delegation"`
Protocol ProtocolCfg `yaml:"protocol"`
}
type PeerCfg struct {
ID string `yaml:"id"`
Capabilities []string `yaml:"capabilities"`
Room string `yaml:"room"`
}
type DelegationCfg struct {
Enabled bool `yaml:"enabled"`
CanDelegateTo []string `yaml:"can_delegate_to"`
CanReceiveFrom []string `yaml:"can_receive_from"`
MaxDepth int `yaml:"max_delegation_depth"`
Timeout time.Duration `yaml:"timeout"`
}
type ProtocolCfg struct {
Format string `yaml:"format"` // json | protobuf | msgpack
Channel string `yaml:"channel"` // matrix | grpc | channel
HeartbeatInterval time.Duration `yaml:"heartbeat_interval"`
}
// ── SSH Inventory ─────────────────────────────────────────────────────────
type SSHCfg struct {
@@ -398,76 +367,6 @@ type FailureAction struct {
EscalateTo string `yaml:"escalate_to"`
}
// ── Observability ─────────────────────────────────────────────────────────
type ObservabilityCfg struct {
Logging LoggingCfg `yaml:"logging"`
Metrics MetricsCfg `yaml:"metrics"`
Health HealthCfg `yaml:"health"`
Tracing TracingCfg `yaml:"tracing"`
}
type LoggingCfg struct {
Level string `yaml:"level"`
Format string `yaml:"format"` // json | text
Output string `yaml:"output"` // stdout | file
File string `yaml:"file"`
}
type MetricsCfg struct {
Enabled bool `yaml:"enabled"`
Port int `yaml:"port"`
Path string `yaml:"path"`
Export string `yaml:"export"` // prometheus
}
type HealthCfg struct {
Enabled bool `yaml:"enabled"`
Port int `yaml:"port"`
Path string `yaml:"path"`
}
type TracingCfg struct {
Enabled bool `yaml:"enabled"`
Provider string `yaml:"provider"`
Endpoint string `yaml:"endpoint"`
}
// ── Resilience ────────────────────────────────────────────────────────────
type ResilienceCfg struct {
CircuitBreaker CircuitBreakerCfg `yaml:"circuit_breaker"`
Retry RetryCfg `yaml:"retry"`
Shutdown ShutdownCfg `yaml:"shutdown"`
Queue QueueCfg `yaml:"queue"`
}
type CircuitBreakerCfg struct {
FailureThreshold int `yaml:"failure_threshold"`
Timeout time.Duration `yaml:"timeout"`
HalfOpenMax int `yaml:"half_open_max"`
}
type RetryCfg struct {
MaxAttempts int `yaml:"max_attempts"`
Backoff string `yaml:"backoff"` // fixed | exponential
InitialDelay time.Duration `yaml:"initial_delay"`
MaxDelay time.Duration `yaml:"max_delay"`
}
type ShutdownCfg struct {
Timeout time.Duration `yaml:"timeout"`
DrainMessages bool `yaml:"drain_messages"`
SaveState bool `yaml:"save_state"`
StateFile string `yaml:"state_file"`
}
type QueueCfg struct {
Enabled bool `yaml:"enabled"`
MaxSize int `yaml:"max_size"`
PriorityUsers []string `yaml:"priority_users"`
}
// ── Storage ───────────────────────────────────────────────────────────────
type StorageCfg struct {