Class: Agentilda::Runner::Task
- Inherits:
-
Data
- Object
- Data
- Agentilda::Runner::Task
- Defined in:
- lib/agentilda/runner.rb
Overview
One unit of work: an agent, a plan, and the checkout it happens in.
Instance Attribute Summary collapse
- #agent ⇒ Agentilda::Agent readonly
-
#checkout ⇒ Agentilda::Worktree::Checkout?
readonly
Nil when sharing a tree.
-
#root ⇒ String
readonly
The tree this agent sees.
-
#round ⇒ Integer
readonly
Which pass over the tree this task belongs to.
- #subject ⇒ Agentilda::Subject readonly
Instance Method Summary collapse
-
#label ⇒ String
For the spinner line — the pid and round render beside this through the line's own
:pidtoken, once known. -
#log_fields ⇒ Hash
The same facts unpainted and apart, for the log file, where they are columns rather than a sentence.
Instance Attribute Details
#agent ⇒ Agentilda::Agent (readonly)
71 72 73 74 75 76 77 78 79 80 81 82 83 84 |
# File 'lib/agentilda/runner.rb', line 71 Task = Data.define(:agent, :subject, :root, :checkout, :round) do # @return [String] for the spinner line — the pid and round render # beside this through the line's own `:pid` token, once known def label = "#{subject.feature.ordinal} #{UI.paint(agent.name, :yellow, :bold)}" # The same facts unpainted and apart, for the log file, where they # are columns rather than a sentence. # # @return [Hash] def log_fields {plan: subject.feature.ordinal.to_s, status: subject.status.to_s, agent: agent.name, round: format("%02d", round)} end end |
#checkout ⇒ Agentilda::Worktree::Checkout? (readonly)
Returns nil when sharing a tree.
71 72 73 74 75 76 77 78 79 80 81 82 83 84 |
# File 'lib/agentilda/runner.rb', line 71 Task = Data.define(:agent, :subject, :root, :checkout, :round) do # @return [String] for the spinner line — the pid and round render # beside this through the line's own `:pid` token, once known def label = "#{subject.feature.ordinal} #{UI.paint(agent.name, :yellow, :bold)}" # The same facts unpainted and apart, for the log file, where they # are columns rather than a sentence. # # @return [Hash] def log_fields {plan: subject.feature.ordinal.to_s, status: subject.status.to_s, agent: agent.name, round: format("%02d", round)} end end |
#root ⇒ String (readonly)
Returns the tree this agent sees.
71 72 73 74 75 76 77 78 79 80 81 82 83 84 |
# File 'lib/agentilda/runner.rb', line 71 Task = Data.define(:agent, :subject, :root, :checkout, :round) do # @return [String] for the spinner line — the pid and round render # beside this through the line's own `:pid` token, once known def label = "#{subject.feature.ordinal} #{UI.paint(agent.name, :yellow, :bold)}" # The same facts unpainted and apart, for the log file, where they # are columns rather than a sentence. # # @return [Hash] def log_fields {plan: subject.feature.ordinal.to_s, status: subject.status.to_s, agent: agent.name, round: format("%02d", round)} end end |
#round ⇒ Integer (readonly)
Returns which pass over the tree this task belongs to.
71 72 73 74 75 76 77 78 79 80 81 82 83 84 |
# File 'lib/agentilda/runner.rb', line 71 Task = Data.define(:agent, :subject, :root, :checkout, :round) do # @return [String] for the spinner line — the pid and round render # beside this through the line's own `:pid` token, once known def label = "#{subject.feature.ordinal} #{UI.paint(agent.name, :yellow, :bold)}" # The same facts unpainted and apart, for the log file, where they # are columns rather than a sentence. # # @return [Hash] def log_fields {plan: subject.feature.ordinal.to_s, status: subject.status.to_s, agent: agent.name, round: format("%02d", round)} end end |
#subject ⇒ Agentilda::Subject (readonly)
71 72 73 74 75 76 77 78 79 80 81 82 83 84 |
# File 'lib/agentilda/runner.rb', line 71 Task = Data.define(:agent, :subject, :root, :checkout, :round) do # @return [String] for the spinner line — the pid and round render # beside this through the line's own `:pid` token, once known def label = "#{subject.feature.ordinal} #{UI.paint(agent.name, :yellow, :bold)}" # The same facts unpainted and apart, for the log file, where they # are columns rather than a sentence. # # @return [Hash] def log_fields {plan: subject.feature.ordinal.to_s, status: subject.status.to_s, agent: agent.name, round: format("%02d", round)} end end |
Instance Method Details
#label ⇒ String
Returns for the spinner line — the pid and round render
beside this through the line's own :pid token, once known.
74 |
# File 'lib/agentilda/runner.rb', line 74 def label = "#{subject.feature.ordinal} #{UI.paint(agent.name, :yellow, :bold)}" |
#log_fields ⇒ Hash
The same facts unpainted and apart, for the log file, where they are columns rather than a sentence.
80 81 82 83 |
# File 'lib/agentilda/runner.rb', line 80 def log_fields {plan: subject.feature.ordinal.to_s, status: subject.status.to_s, agent: agent.name, round: format("%02d", round)} end |