Class: Ace::Review::CLI::Commands::FeedbackSubcommands::Resolve

Inherits:
Support::Cli::Command
  • Object
show all
Includes:
SessionDiscovery, Support::Cli::Base
Defined in:
lib/ace/review/cli/commands/feedback/resolve.rb

Overview

ace-support-cli Command class for feedback resolve

Resolves a pending feedback item by marking it as done.

Instance Method Summary collapse

Methods included from SessionDiscovery

#find_all_sessions, #find_latest_session, #resolve_feedback_path, #resolve_session_dir

Instance Method Details

#call(id:, **options) ⇒ Object



42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
# File 'lib/ace/review/cli/commands/feedback/resolve.rb', line 42

def call(id:, **options)
  # Validate resolution is provided
  unless options[:resolution] && !options[:resolution].strip.empty?
    raise Ace::Support::Cli::Error.new("Resolution is required. Use --resolution to describe how the issue was fixed.")
  end

  # Resolve feedback path from session context
  base_path = resolve_feedback_path(options)

  unless base_path
    raise Ace::Support::Cli::Error.new("No session found. Run a review first or use --session to specify path.")
  end

  debug_log("Feedback base path: #{base_path}", options)

  # Find item first for partial ID matching
  resolved_id = resolve_full_id(base_path, id)

  unless resolved_id
    raise Ace::Support::Cli::Error.new("Feedback item not found: #{id}")
  end

  # Resolve the item
  manager = Organisms::FeedbackManager.new
  result = manager.resolve(
    base_path,
    resolved_id,
    resolution: options[:resolution].strip
  )

  if result[:success]
    puts "Feedback #{resolved_id} resolved and archived."
    puts "Resolution: #{options[:resolution]}" unless quiet?(options)
  else
    raise Ace::Support::Cli::Error.new(result[:error])
  end
end