Class: Ralph::Iteration::Result
- Inherits:
-
Object
- Object
- Ralph::Iteration::Result
- Defined in:
- lib/ralph/iteration.rb
Overview
Statuses:
:completed — completion promise detected, iteration succeeded
:continuing — no completion detected, keep looping
:failed — non-zero exit code from the agent process
:fatal — fatal error detected in agent output (unrecoverable)
:error — iteration raised an exception
Constant Summary collapse
- STATUSES =
%i[completed continuing failed fatal error].freeze
Instance Attribute Summary collapse
-
#agent_result ⇒ Object
readonly
Returns the value of attribute agent_result.
-
#completion_detected ⇒ Object
readonly
Returns the value of attribute completion_detected.
-
#duration_ms ⇒ Object
readonly
Returns the value of attribute duration_ms.
-
#errors ⇒ Object
readonly
Returns the value of attribute errors.
-
#files_modified ⇒ Object
readonly
Returns the value of attribute files_modified.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
Instance Method Summary collapse
- #combined_output ⇒ Object
- #completed? ⇒ Boolean
- #continuing? ⇒ Boolean
- #error? ⇒ Boolean
- #exit_code ⇒ Object
- #failed? ⇒ Boolean
- #fatal? ⇒ Boolean
-
#initialize(status:, agent_result:, duration_ms:, files_modified:, completion_detected:, errors:) ⇒ Result
constructor
A new instance of Result.
- #stderr_text ⇒ Object
- #stdout_text ⇒ Object
- #tool_counts ⇒ Object
Constructor Details
#initialize(status:, agent_result:, duration_ms:, files_modified:, completion_detected:, errors:) ⇒ Result
Returns a new instance of Result.
16 17 18 19 20 21 22 23 |
# File 'lib/ralph/iteration.rb', line 16 def initialize(status:, agent_result:, duration_ms:, files_modified:, completion_detected:, errors:) @status = status @agent_result = agent_result @duration_ms = duration_ms @files_modified = files_modified @completion_detected = completion_detected @errors = errors end |
Instance Attribute Details
#agent_result ⇒ Object (readonly)
Returns the value of attribute agent_result.
14 15 16 |
# File 'lib/ralph/iteration.rb', line 14 def agent_result @agent_result end |
#completion_detected ⇒ Object (readonly)
Returns the value of attribute completion_detected.
14 15 16 |
# File 'lib/ralph/iteration.rb', line 14 def completion_detected @completion_detected end |
#duration_ms ⇒ Object (readonly)
Returns the value of attribute duration_ms.
14 15 16 |
# File 'lib/ralph/iteration.rb', line 14 def duration_ms @duration_ms end |
#errors ⇒ Object (readonly)
Returns the value of attribute errors.
14 15 16 |
# File 'lib/ralph/iteration.rb', line 14 def errors @errors end |
#files_modified ⇒ Object (readonly)
Returns the value of attribute files_modified.
14 15 16 |
# File 'lib/ralph/iteration.rb', line 14 def files_modified @files_modified end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
14 15 16 |
# File 'lib/ralph/iteration.rb', line 14 def status @status end |
Instance Method Details
#combined_output ⇒ Object
29 |
# File 'lib/ralph/iteration.rb', line 29 def combined_output = agent_result&.combined_output || "" |
#completed? ⇒ Boolean
31 |
# File 'lib/ralph/iteration.rb', line 31 def completed? = status == :completed |
#continuing? ⇒ Boolean
32 |
# File 'lib/ralph/iteration.rb', line 32 def continuing? = status == :continuing |
#error? ⇒ Boolean
35 |
# File 'lib/ralph/iteration.rb', line 35 def error? = status == :error |
#exit_code ⇒ Object
25 |
# File 'lib/ralph/iteration.rb', line 25 def exit_code = agent_result&.exit_code |
#failed? ⇒ Boolean
33 |
# File 'lib/ralph/iteration.rb', line 33 def failed? = status == :failed |
#fatal? ⇒ Boolean
34 |
# File 'lib/ralph/iteration.rb', line 34 def fatal? = status == :fatal |
#stderr_text ⇒ Object
27 |
# File 'lib/ralph/iteration.rb', line 27 def stderr_text = agent_result&.stderr_text || "" |
#stdout_text ⇒ Object
26 |
# File 'lib/ralph/iteration.rb', line 26 def stdout_text = agent_result&.stdout_text || "" |
#tool_counts ⇒ Object
28 |
# File 'lib/ralph/iteration.rb', line 28 def tool_counts = agent_result&.tool_counts || {} |