From 18c8bfa930c239fa8c4cbec519d11bfdd6c838c9 Mon Sep 17 00:00:00 2001 From: Amolith Date: Fri, 8 Aug 2025 15:12:09 -0600 Subject: [PATCH] refactor: remove unused UpdateGoal method and document HistoryEnabled field - Remove unused UpdateGoal method from planning manager - Add documentation comment for HistoryEnabled config field indicating it's reserved for future use - Improves code maintainability by eliminating dead code --- internal/config/config.go | 7 ++++--- internal/planning/manager.go | 18 ------------------ 2 files changed, 4 insertions(+), 21 deletions(-) diff --git a/internal/config/config.go b/internal/config/config.go index 1155c0d8e1321757d991d1828ca0b7da039adee4..c0f997ac76b9417d783e9f85d53d15742c22f59e 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -35,9 +35,10 @@ type LoggingConfig struct { // PlanningConfig contains planning-related limits type PlanningConfig struct { - MaxTasks int `mapstructure:"max_tasks" toml:"max_tasks"` - MaxGoalLength int `mapstructure:"max_goal_length" toml:"max_goal_length"` - MaxTaskLength int `mapstructure:"max_task_length" toml:"max_task_length"` + MaxTasks int `mapstructure:"max_tasks" toml:"max_tasks"` + MaxGoalLength int `mapstructure:"max_goal_length" toml:"max_goal_length"` + MaxTaskLength int `mapstructure:"max_task_length" toml:"max_task_length"` + // Reserved for future persistence/history features HistoryEnabled bool `mapstructure:"history_enabled" toml:"history_enabled"` } diff --git a/internal/planning/manager.go b/internal/planning/manager.go index 3a9725395d5d50d3907dd166cb3fef7cc09e0406..f0005e086743c3487d3ae522c2996bff8e9306e1 100644 --- a/internal/planning/manager.go +++ b/internal/planning/manager.go @@ -35,24 +35,6 @@ func New(cfg *config.Config, logger *slog.Logger) *Manager { } } -// UpdateGoal sets or updates the overarching goal (kept for compatibility) -func (m *Manager) UpdateGoal(goalText string) error { - if len(goalText) > m.config.Planning.MaxGoalLength { - return fmt.Errorf("goal too long (max %d characters)", m.config.Planning.MaxGoalLength) - } - - m.mu.Lock() - defer m.mu.Unlock() - - m.goal = &Goal{ - Text: strings.TrimSpace(goalText), - UpdatedAt: time.Now(), - } - - m.logger.Info("Goal updated", "goal", goalText) - return nil -} - // SetGoal sets the initial goal (returns error if already set) func (m *Manager) SetGoal(title, description string) error { if len(title) > m.config.Planning.MaxGoalLength {