Class: RobotLab::To::Config

Inherits:
MywayConfig::Base
  • Object
show all
Defined in:
lib/robot_lab/to/config.rb

Overview

Configuration for a robot-to run.

Sources (lowest to highest precedence):

1. Bundled defaults (config/defaults.yml)
2. User config file (~/.config/robot_lab/to.yml)
3. Environment variables (ROBOT_LAB_TO_*)
4. Constructor keyword arguments (CLI overrides)

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**overrides) ⇒ Config

Returns a new instance of Config.



35
36
37
38
39
40
41
42
43
# File 'lib/robot_lab/to/config.rb', line 35

def initialize(**overrides)
  super()
  @eval = @eval_measure = @eval_target = nil
  @require_improvement = @stop_on_plateau = nil
  @eval_judge_model = @eval_spec = @eval_floor = nil
  @protect_paths = []
  @write_guard = true
  overrides.each { |k, v| public_send(:"#{k}=", v) if respond_to?(:"#{k}=") }
end

Instance Attribute Details

#commit_formatObject



54
# File 'lib/robot_lab/to/config.rb', line 54

def commit_format            = @commit_format    || super

#debug=(value) ⇒ Object (writeonly)

Runtime CLI overrides — applied after load.



21
22
23
# File 'lib/robot_lab/to/config.rb', line 21

def debug=(value)
  @debug = value
end

#decision_modeObject



60
# File 'lib/robot_lab/to/config.rb', line 60

def decision_mode            = @decision_mode      || super

#decision_timeoutObject

nil = wait indefinitely



63
# File 'lib/robot_lab/to/config.rb', line 63

def decision_timeout         = @decision_timeout   || super

#decision_wait_pollObject



61
62
# File 'lib/robot_lab/to/config.rb', line 61

def decision_wait_poll       = @decision_wait_poll || super
# nil = wait indefinitely

#decisions_enabled=(value) ⇒ Object (writeonly)

Runtime CLI overrides — applied after load.



21
22
23
# File 'lib/robot_lab/to/config.rb', line 21

def decisions_enabled=(value)
  @decisions_enabled = value
end

#evalObject

Eval strategy selection + tuning (see RobotLab::To::Evals.build). All CLI-only / nil-default. #eval may hold a strategy name ("code"/"null"), a registered symbol, an instance responding to #score, or a proc. The judge/spec/floor readers Prose needs arrive with Phase 3.



75
# File 'lib/robot_lab/to/config.rb', line 75

def eval                     = @eval

#eval_floorObject

Prose/grader settings (Phase 3). attr_accessor keeps these off the reek method-count budget (Config sits at its TooManyMethods limit); they are assigned in initialize to avoid InstanceVariableAssumption. write_guard (default true) lets local_guards runs opt out of WriteGuard so a robot can freely overwrite files it is iteratively refining (e.g. prose drafts).



33
34
35
# File 'lib/robot_lab/to/config.rb', line 33

def eval_floor
  @eval_floor
end

#eval_judge_modelObject

Prose/grader settings (Phase 3). attr_accessor keeps these off the reek method-count budget (Config sits at its TooManyMethods limit); they are assigned in initialize to avoid InstanceVariableAssumption. write_guard (default true) lets local_guards runs opt out of WriteGuard so a robot can freely overwrite files it is iteratively refining (e.g. prose drafts).



33
34
35
# File 'lib/robot_lab/to/config.rb', line 33

def eval_judge_model
  @eval_judge_model
end

#eval_measureObject



76
# File 'lib/robot_lab/to/config.rb', line 76

def eval_measure             = @eval_measure

#eval_specObject

Prose/grader settings (Phase 3). attr_accessor keeps these off the reek method-count budget (Config sits at its TooManyMethods limit); they are assigned in initialize to avoid InstanceVariableAssumption. write_guard (default true) lets local_guards runs opt out of WriteGuard so a robot can freely overwrite files it is iteratively refining (e.g. prose drafts).



33
34
35
# File 'lib/robot_lab/to/config.rb', line 33

def eval_spec
  @eval_spec
end

#eval_targetObject



77
# File 'lib/robot_lab/to/config.rb', line 77

def eval_target              = @eval_target

#local_guards=(value) ⇒ Object (writeonly)

Runtime CLI overrides — applied after load.



21
22
23
# File 'lib/robot_lab/to/config.rb', line 21

def local_guards=(value)
  @local_guards = value
end

#max_consecutive_failuresObject



48
# File 'lib/robot_lab/to/config.rb', line 48

def max_consecutive_failures = @max_consecutive_failures || super

#max_iterationsObject

CLI-only options with no YAML default (nil means "no limit / not set")



66
# File 'lib/robot_lab/to/config.rb', line 66

def max_iterations           = @max_iterations

#max_submit_nudgesObject



49
# File 'lib/robot_lab/to/config.rb', line 49

def max_submit_nudges        = @max_submit_nudges        || super

#max_tokensObject



67
# File 'lib/robot_lab/to/config.rb', line 67

def max_tokens               = @max_tokens

#max_verify_repairsObject



50
# File 'lib/robot_lab/to/config.rb', line 50

def max_verify_repairs       = @max_verify_repairs       || super

#modelObject



47
# File 'lib/robot_lab/to/config.rb', line 47

def model                    = @model || super

#protect_pathsObject

Prose/grader settings (Phase 3). attr_accessor keeps these off the reek method-count budget (Config sits at its TooManyMethods limit); they are assigned in initialize to avoid InstanceVariableAssumption. write_guard (default true) lets local_guards runs opt out of WriteGuard so a robot can freely overwrite files it is iteratively refining (e.g. prose drafts).



33
34
35
# File 'lib/robot_lab/to/config.rb', line 33

def protect_paths
  @protect_paths
end

#providerObject

Keys defined in defaults.yml — super is safe



46
# File 'lib/robot_lab/to/config.rb', line 46

def provider                 = @provider || super

#require_improvement=(value) ⇒ Object (writeonly)

Runtime CLI overrides — applied after load.



21
22
23
# File 'lib/robot_lab/to/config.rb', line 21

def require_improvement=(value)
  @require_improvement = value
end

#run_dirObject



53
# File 'lib/robot_lab/to/config.rb', line 53

def run_dir                  = @run_dir          || super

#stop_on_plateauObject



78
# File 'lib/robot_lab/to/config.rb', line 78

def stop_on_plateau          = @stop_on_plateau

#stop_whenObject



68
# File 'lib/robot_lab/to/config.rb', line 68

def stop_when                = @stop_when

#stream=(value) ⇒ Object (writeonly)

Runtime CLI overrides — applied after load.



21
22
23
# File 'lib/robot_lab/to/config.rb', line 21

def stream=(value)
  @stream = value
end

#verify_commandObject



69
# File 'lib/robot_lab/to/config.rb', line 69

def verify_command           = @verify_command

#verify_timeoutObject



51
# File 'lib/robot_lab/to/config.rb', line 51

def verify_timeout           = @verify_timeout           || super

#write_guardObject

Prose/grader settings (Phase 3). attr_accessor keeps these off the reek method-count budget (Config sits at its TooManyMethods limit); they are assigned in initialize to avoid InstanceVariableAssumption. write_guard (default true) lets local_guards runs opt out of WriteGuard so a robot can freely overwrite files it is iteratively refining (e.g. prose drafts).



33
34
35
# File 'lib/robot_lab/to/config.rb', line 33

def write_guard
  @write_guard
end

Instance Method Details

#debug?Boolean

Returns:

  • (Boolean)


57
# File 'lib/robot_lab/to/config.rb', line 57

def debug?                   = @debug.nil? ? super : @debug

#decisions_enabled?Boolean

Returns:

  • (Boolean)


59
# File 'lib/robot_lab/to/config.rb', line 59

def decisions_enabled?       = @decisions_enabled.nil? ? super : @decisions_enabled

#local_guards?Boolean

Returns:

  • (Boolean)


55
# File 'lib/robot_lab/to/config.rb', line 55

def local_guards?            = @local_guards.nil? ? super : @local_guards

#require_improvement?Boolean

CLI/Ruby-only with a hardcoded default (MywayConfig does not generate a reliable require_improvement? predicate). Default true per design: the loop is strictly monotone unless --no-require-improvement is passed.

Returns:

  • (Boolean)


83
# File 'lib/robot_lab/to/config.rb', line 83

def require_improvement?     = @require_improvement.nil? || @require_improvement

#stream?Boolean

Returns:

  • (Boolean)


56
# File 'lib/robot_lab/to/config.rb', line 56

def stream?                  = @stream.nil? ? super : @stream