Class: Agentilda::Runner::Task

Inherits:
Data
  • Object
show all
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

Instance Method Summary collapse

Instance Attribute Details

#agentAgentilda::Agent (readonly)

Returns:



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

#checkoutAgentilda::Worktree::Checkout? (readonly)

Returns nil when sharing a tree.

Returns:



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

#rootString (readonly)

Returns the tree this agent sees.

Returns:

  • (String)

    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

#roundInteger (readonly)

Returns which pass over the tree this task belongs to.

Returns:

  • (Integer)

    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

#subjectAgentilda::Subject (readonly)

Returns:



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

#labelString

Returns for the spinner line — the pid and round render beside this through the line's own :pid token, once known.

Returns:

  • (String)

    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_fieldsHash

The same facts unpainted and apart, for the log file, where they are columns rather than a sentence.

Returns:

  • (Hash)


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