Class: Aidp::Harness::CompletionChecker

Inherits:
Object
  • Object
show all
Defined in:
lib/aidp/harness/completion_checker.rb

Overview

Checks completion criteria for the workflow

Instance Method Summary collapse

Constructor Details

#initialize(project_dir, workflow_type = :exploration) ⇒ CompletionChecker

Returns a new instance of CompletionChecker.



7
8
9
10
11
# File 'lib/aidp/harness/completion_checker.rb', line 7

def initialize(project_dir, workflow_type = :exploration)
  @project_dir = project_dir
  @workflow_type = workflow_type
  @completion_results = {}
end

Instance Method Details

#all_criteria_met?Boolean

Check if all completion criteria are met

Returns:

  • (Boolean)


14
15
16
17
18
19
20
21
22
# File 'lib/aidp/harness/completion_checker.rb', line 14

def all_criteria_met?
  criteria = completion_criteria

  criteria.all? do |criterion, checker|
    result = send(checker)
    @completion_results[criterion] = result
    result
  end
end

#completion_criteriaObject

Get completion criteria based on workflow type



25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# File 'lib/aidp/harness/completion_checker.rb', line 25

def completion_criteria
  base_criteria = {
    steps_completed: :all_steps_completed?,
    tests_passing: :tests_passing?,
    linting_clean: :linting_clean?
  }

  if @workflow_type == :full
    base_criteria.merge({
      build_successful: :build_successful?,
      documentation_complete: :documentation_complete?
    })
  else
    base_criteria
  end
end

#completion_statusObject

Get completion status report



43
44
45
46
47
48
49
50
51
# File 'lib/aidp/harness/completion_checker.rb', line 43

def completion_status
  all_criteria_met? # This populates @completion_results

  {
    all_complete: @completion_results.values.all?,
    criteria: @completion_results,
    summary: generate_summary
  }
end