refactor: remove unused UpdateGoal method and document HistoryEnabled field
Amolith
created 2 months ago
- 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
Change summary
internal/config/config.go | 7 ++++---
internal/planning/manager.go | 18 ------------------
2 files changed, 4 insertions(+), 21 deletions(-)
Detailed changes
@@ -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"`
}
@@ -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 {