Class: Ace::Retro::Organisms::RetroDoctor
- Inherits:
-
Object
- Object
- Ace::Retro::Organisms::RetroDoctor
- Defined in:
- lib/ace/retro/organisms/retro_doctor.rb
Overview
Orchestrates comprehensive health checks for the retros system. Runs structure validation, frontmatter validation, and scope/status consistency checks across all retros in a root directory.
Instance Attribute Summary collapse
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#root_path ⇒ Object
readonly
Returns the value of attribute root_path.
Instance Method Summary collapse
-
#auto_fixable?(issue) ⇒ Boolean
Check if an issue can be auto-fixed.
-
#initialize(root_path, options = {}) ⇒ RetroDoctor
constructor
A new instance of RetroDoctor.
-
#run_diagnosis ⇒ Hash
Run comprehensive health check.
Constructor Details
#initialize(root_path, options = {}) ⇒ RetroDoctor
Returns a new instance of RetroDoctor.
20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/ace/retro/organisms/retro_doctor.rb', line 20 def initialize(root_path, = {}) @root_path = root_path @options = @issues = [] @stats = { retros_scanned: 0, folders_checked: 0, errors: 0, warnings: 0, info: 0 } end |
Instance Attribute Details
#options ⇒ Object (readonly)
Returns the value of attribute options.
16 17 18 |
# File 'lib/ace/retro/organisms/retro_doctor.rb', line 16 def @options end |
#root_path ⇒ Object (readonly)
Returns the value of attribute root_path.
16 17 18 |
# File 'lib/ace/retro/organisms/retro_doctor.rb', line 16 def root_path @root_path end |
Instance Method Details
#auto_fixable?(issue) ⇒ Boolean
Check if an issue can be auto-fixed
70 71 72 73 74 |
# File 'lib/ace/retro/organisms/retro_doctor.rb', line 70 def auto_fixable?(issue) return false unless issue[:type] == :error || issue[:type] == :warning Molecules::RetroDoctorFixer::FIXABLE_PATTERNS.any? { |pattern| issue[:message].match?(pattern) } end |
#run_diagnosis ⇒ Hash
Run comprehensive health check
35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 |
# File 'lib/ace/retro/organisms/retro_doctor.rb', line 35 def run_diagnosis unless @root_path && Dir.exist?(@root_path) return { valid: false, health_score: 0, issues: [{type: :error, message: "Retros root directory not found: #{@root_path}"}], stats: @stats, duration: 0, root_path: @root_path } end @start_time = Time.now if [:check] run_specific_check([:check]) else run_full_check end health_score = calculate_health_score { valid: @stats[:errors] == 0, health_score: health_score, issues: @issues, stats: @stats, duration: Time.now - @start_time, root_path: @root_path } end |