Class: SpaceArchitect::CLI::Architect::Status
- Inherits:
-
Dry::CLI::Command
- Object
- Dry::CLI::Command
- SpaceArchitect::CLI::Architect::Status
- Includes:
- GlobalOptions, Helpers
- Defined in:
- lib/space_architect/cli/architect.rb
Instance Method Summary collapse
Methods included from Helpers
#display_date, #handle_errors, #project_config, #render, #setup_terminal, #state, #store, #terminal
Methods included from GlobalOptions
Instance Method Details
#call(space: nil, **opts) ⇒ Object
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 79 80 81 82 83 84 85 86 87 88 89 90 91 92 |
# File 'lib/space_architect/cli/architect.rb', line 54 def call(space: nil, **opts) setup_terminal(**opts.slice(:color, :colors)) handle_errors do render(store.find(space)) do |sp| mission = ArchitectMission.new(space: sp) info = mission.status block = info[:block] terminal.say "Mission status: #{block['status'] || '(none)'}" terminal.say "Current iteration: #{block['current_iteration'] || '(none)'}" iterations = block["iterations"] || [] if iterations.empty? terminal.say "Iterations: (none)" else rows = iterations.map do |s| nn = s["ordinal"] ? format("%02d", s["ordinal"]) : "-" lane_list = s["lanes"] || [] lanes_str = lane_list.map do |l| h = l["harness"] || "claude-code" m = l["model"] || Harness::CLAUDE_DEFAULT_MODEL eff = l["effort"] ? "·#{l['effort']}" : "" "#{l['name']}(#{l['repo']}·#{h}·#{m}#{eff})" end.join(", ") lanes = lane_list.any? { |l| l["variant"] } ? "variant: #{lanes_str}" : lanes_str lanes = "#{lanes} → winner: #{s['winner']}" if s["winner"] [nn, s["name"], s["freeze_sha"]&.[](0, 8) || "-", lanes, s["verdict"] || "-"] end terminal.say terminal.table(%w[II Iteration FreezeSHA Lanes Verdict], rows) end unless info[:iteration_files].empty? terminal.say "Iteration files: #{info[:iteration_files].join(', ')}" end CLI.record_outcome(Outcome.new(exit_code: 0)) end end end |