Class: Aidp::Harness::Configuration
- Inherits:
-
Object
- Object
- Aidp::Harness::Configuration
- Defined in:
- lib/aidp/harness/configuration.rb
Overview
Handles loading and validation of harness configuration from aidp.yml
Defined Under Namespace
Classes: ConfigurationError
Instance Attribute Summary collapse
-
#project_dir ⇒ Object
readonly
Returns the value of attribute project_dir.
Instance Method Summary collapse
-
#allow_provider_switch_for_tier? ⇒ Boolean
Check if provider switching for tier is allowed.
-
#auto_escalate? ⇒ Boolean
Check if auto-escalation is enabled.
-
#build_commands ⇒ Object
Get build commands.
-
#circuit_breaker_config ⇒ Object
Get circuit breaker configuration.
-
#config_exists? ⇒ Boolean
Check if configuration file exists.
-
#config_path ⇒ Object
Get configuration path.
-
#configuration_summary ⇒ Object
Get configuration summary.
-
#configured_providers ⇒ Object
Get all configured providers.
-
#configured_tiers(provider_name) ⇒ Array<String>
Get all configured tiers for a provider.
-
#conventional_commits? ⇒ Boolean
Check if conventional commits are enabled.
-
#coverage_config ⇒ Object
Get coverage configuration.
-
#coverage_enabled? ⇒ Boolean
Check if coverage is enabled.
-
#coverage_fail_on_drop? ⇒ Boolean
Check if should fail on coverage drop.
-
#coverage_minimum ⇒ Object
Get minimum coverage threshold.
-
#coverage_report_paths ⇒ Object
Get coverage report paths.
-
#coverage_run_command ⇒ Object
Get coverage run command.
-
#coverage_tool ⇒ Object
Get coverage tool.
-
#create_example_config ⇒ Object
Create example configuration.
-
#default_flags(provider_name) ⇒ Object
Get default flags for a provider.
-
#default_model(provider_name) ⇒ Object
Get default model for provider.
-
#default_provider ⇒ Object
Get default provider.
-
#default_tier ⇒ Object
Get default thinking tier.
-
#devcontainer_allowed_domains ⇒ Object
Get allowed domains for devcontainer firewall.
-
#devcontainer_config ⇒ Object
Get devcontainer configuration.
-
#devcontainer_dangerous_ops_allowed? ⇒ Boolean
Check if dangerous filesystem operations are allowed in devcontainer.
-
#devcontainer_enabled? ⇒ Boolean
Check if devcontainer features are enabled.
-
#devcontainer_force_detection ⇒ Object
Get forced detection value (nil for auto-detection).
-
#devcontainer_permissions ⇒ Object
Get devcontainer permissions config.
-
#devcontainer_settings ⇒ Object
Get devcontainer settings.
-
#devcontainer_skip_permission_checks ⇒ Object
Get list of providers that should skip permission checks in devcontainer.
-
#devcontainer_skip_permissions_for?(provider_name) ⇒ Boolean
Check if a specific provider should skip permission checks in devcontainer.
-
#devcontainer_timeout_multiplier ⇒ Object
Get timeout multiplier for devcontainer.
-
#devcontainer_verbose_logging? ⇒ Boolean
Check if verbose logging is enabled in devcontainer.
-
#documentation_commands ⇒ Object
Get documentation commands.
-
#escalation_complexity_threshold ⇒ Object
Get complexity threshold configuration for escalation.
-
#escalation_config ⇒ Object
Get escalation configuration.
-
#escalation_fail_attempts ⇒ Object
Get fail attempts threshold for escalation.
-
#escalation_threshold ⇒ Object
Get escalation threshold.
-
#fallback_config ⇒ Object
Get fallback configuration.
-
#fallback_providers ⇒ Object
Get fallback providers.
-
#formatter_commands ⇒ Object
Get formatter commands.
-
#full_permissions_in_devcontainer? ⇒ Boolean
Check if full permissions should be granted in devcontainer.
-
#guards_bypass? ⇒ Boolean
Check if guards are bypassed.
-
#guards_config ⇒ Object
Get guards configuration.
-
#guards_confirm_files ⇒ Object
Get files requiring confirmation for guards.
-
#guards_enabled? ⇒ Boolean
Check if guards are enabled.
-
#guards_exclude_files ⇒ Object
Get exclude file patterns for guards.
-
#guards_include_files ⇒ Object
Get include file patterns for guards.
-
#guards_max_lines_per_commit ⇒ Object
Get max lines per commit for guards.
-
#harness_config ⇒ Object
Get harness-specific configuration.
-
#health_check_config ⇒ Object
Get provider health check configuration.
-
#in_devcontainer? ⇒ Boolean
Check if currently in devcontainer (with optional force override).
-
#initialize(project_dir) ⇒ Configuration
constructor
A new instance of Configuration.
-
#interactive_testing_app_type ⇒ Object
Get interactive testing app type.
-
#interactive_testing_config ⇒ Object
Get interactive testing configuration.
-
#interactive_testing_enabled? ⇒ Boolean
Check if interactive testing is enabled.
-
#interactive_testing_tools ⇒ Object
Get interactive testing tools configuration.
-
#lint_commands ⇒ Object
Get lint commands.
-
#lint_max_output_lines ⇒ Object
Get max output lines for linters.
-
#lint_output_mode ⇒ Object
Get lint output mode.
-
#load_balancing_config ⇒ Object
Get load balancing configuration.
-
#logging_config ⇒ Object
Get logging configuration.
-
#max_retries ⇒ Object
Get maximum retries.
-
#max_tier ⇒ Object
Get maximum thinking tier.
-
#max_tokens(provider_name) ⇒ Object
Get maximum tokens for API providers.
-
#metrics_config ⇒ Object
Get metrics configuration.
-
#model_config(provider_name, model_name) ⇒ Object
Get model configuration for provider.
-
#model_family(provider_name) ⇒ Object
Get model family for a provider.
-
#model_flags(provider_name, model_name) ⇒ Object
Get model-specific flags.
-
#model_max_tokens(provider_name, model_name) ⇒ Object
Get model-specific max tokens.
-
#model_switching_config ⇒ Object
Get model switching configuration.
-
#model_timeout(provider_name, model_name) ⇒ Object
Get model-specific timeout.
-
#model_weights(provider_name) ⇒ Object
Get model weights for load balancing.
-
#models_for_tier(tier, provider_name) ⇒ Array<String>
Get models configured for a specific tier and provider.
-
#no_api_keys_required? ⇒ Boolean
Check if restricted to providers that don’t require API keys.
-
#permission_for_tier(tier) ⇒ Object
Get permission level for a tier.
-
#permissions_by_tier ⇒ Object
Get permissions by tier configuration.
-
#prompt_dynamic_adjustment? ⇒ Boolean
Check if dynamic adjustment is enabled.
-
#prompt_include_thresholds ⇒ Object
Get include threshold configuration.
-
#prompt_log_fragments? ⇒ Boolean
Check if fragment logging is enabled.
-
#prompt_max_tokens ⇒ Object
Get maximum tokens for prompt.
-
#prompt_optimization_config ⇒ Object
Get prompt optimization configuration.
-
#prompt_optimization_enabled? ⇒ Boolean
Check if prompt optimization is enabled.
-
#prompt_source_threshold ⇒ Object
Get source code include threshold.
-
#prompt_style_guide_threshold ⇒ Object
Get style guide include threshold.
-
#prompt_templates_threshold ⇒ Object
Get templates include threshold.
-
#provider_auth_config(provider_name) ⇒ Object
Get provider authentication configuration.
-
#provider_config(provider_name) ⇒ Object
Get provider configuration.
-
#provider_configured?(provider_name) ⇒ Boolean
Check if provider is configured.
-
#provider_cost_config(provider_name) ⇒ Object
Get provider cost configuration.
-
#provider_endpoints(provider_name) ⇒ Object
Get provider endpoint configuration.
-
#provider_features(provider_name) ⇒ Object
Get provider feature flags.
-
#provider_models(provider_name) ⇒ Object
Get provider models configuration.
-
#provider_monitoring_config(provider_name) ⇒ Object
Get provider monitoring configuration.
-
#provider_priority(provider_name) ⇒ Object
Get provider priority.
-
#provider_regions(provider_name) ⇒ Object
Get provider region configuration.
-
#provider_thinking_tiers(provider_name) ⇒ Hash
Get thinking tiers configuration for a specific provider.
-
#provider_type(provider_name) ⇒ Object
Get provider type (usage_based, subscription, etc.).
-
#provider_weights ⇒ Object
Get provider weights for load balancing.
-
#rate_limit_config ⇒ Object
Get rate limit configuration.
-
#raw_config ⇒ Object
Get raw configuration.
-
#retry_config ⇒ Object
Get retry configuration.
-
#session_config ⇒ Object
Get session configuration.
-
#should_use_full_permissions?(provider_name) ⇒ Boolean
Check if provider should run with full permissions Combines devcontainer detection with configuration.
-
#task_completion_required? ⇒ Boolean
Check if task completion is required for work loop completion.
-
#test_commands ⇒ Object
Get test commands.
-
#test_max_output_lines ⇒ Object
Get max output lines for tests.
-
#test_output_mode ⇒ Object
Get test output mode.
-
#thinking_config ⇒ Object
Get thinking depth configuration.
-
#thinking_overrides ⇒ Object
Get thinking tier overrides.
-
#tier_override_for(key) ⇒ Object
Get tier override for a skill or template.
-
#tier_overrides ⇒ Object
Get tier overrides.
-
#validate_model_config(provider_name, model_name, model_config, errors) ⇒ Object
Validate model configuration.
-
#validate_provider_config(provider_name) ⇒ Object
Validate provider configuration.
-
#vcs_behavior ⇒ Object
Get VCS behavior (stage/commit/nothing).
-
#vcs_tool ⇒ Object
Get VCS tool.
-
#version_control_config ⇒ Object
Get version control configuration.
-
#work_loop_config ⇒ Object
Get work loop configuration.
-
#work_loop_enabled? ⇒ Boolean
Check if work loops are enabled.
-
#work_loop_max_iterations ⇒ Object
Get maximum iterations for work loops.
- #work_loop_units_config ⇒ Object
-
#zfc_ab_testing_config ⇒ Object
Get ZFC A/B testing configuration.
-
#zfc_ab_testing_enabled? ⇒ Boolean
Check if ZFC A/B testing is enabled.
-
#zfc_config ⇒ Object
Get ZFC configuration.
-
#zfc_cost_limits ⇒ Object
Get ZFC cost limits.
-
#zfc_decision_cache_ttl(decision_type) ⇒ Object
Get ZFC decision cache TTL.
-
#zfc_decision_confidence_threshold(decision_type) ⇒ Object
Get ZFC decision confidence threshold.
-
#zfc_decision_config(decision_type) ⇒ Object
Get ZFC decision configuration.
-
#zfc_decision_enabled?(decision_type) ⇒ Boolean
Check if specific ZFC decision type is enabled.
-
#zfc_decision_tier(decision_type) ⇒ Object
Get ZFC decision tier.
-
#zfc_enabled? ⇒ Boolean
Check if ZFC is enabled.
-
#zfc_fallback_to_legacy? ⇒ Boolean
Check if ZFC should fallback to legacy on failure.
Constructor Details
#initialize(project_dir) ⇒ Configuration
Returns a new instance of Configuration.
12 13 14 15 16 |
# File 'lib/aidp/harness/configuration.rb', line 12 def initialize(project_dir) @project_dir = project_dir @config = Aidp::Config.load_harness_config(project_dir) validate_configuration! end |
Instance Attribute Details
#project_dir ⇒ Object (readonly)
Returns the value of attribute project_dir.
10 11 12 |
# File 'lib/aidp/harness/configuration.rb', line 10 def project_dir @project_dir end |
Instance Method Details
#allow_provider_switch_for_tier? ⇒ Boolean
Check if provider switching for tier is allowed
400 401 402 |
# File 'lib/aidp/harness/configuration.rb', line 400 def allow_provider_switch_for_tier? thinking_config[:allow_provider_switch] != false end |
#auto_escalate? ⇒ Boolean
Check if auto-escalation is enabled
556 557 558 |
# File 'lib/aidp/harness/configuration.rb', line 556 def auto_escalate? thinking_config[:auto_escalate] != false end |
#build_commands ⇒ Object
Get build commands
190 191 192 |
# File 'lib/aidp/harness/configuration.rb', line 190 def build_commands normalize_commands(work_loop_config[:build_commands] || []) end |
#circuit_breaker_config ⇒ Object
Get circuit breaker configuration
111 112 113 |
# File 'lib/aidp/harness/configuration.rb', line 111 def circuit_breaker_config harness_config[:circuit_breaker] || default_circuit_breaker_config end |
#config_exists? ⇒ Boolean
Check if configuration file exists
479 480 481 |
# File 'lib/aidp/harness/configuration.rb', line 479 def config_exists? Aidp::Config.config_exists?(@project_dir) end |
#config_path ⇒ Object
Get configuration path
375 376 377 |
# File 'lib/aidp/harness/configuration.rb', line 375 def config_path Aidp::ConfigPaths.config_file(@project_dir) end |
#configuration_summary ⇒ Object
Get configuration summary
510 511 512 513 514 515 516 517 518 519 520 521 522 523 |
# File 'lib/aidp/harness/configuration.rb', line 510 def configuration_summary { providers: configured_providers.size, default_provider: default_provider, fallback_providers: fallback_providers.size, max_retries: max_retries, no_api_keys_required: no_api_keys_required?, load_balancing_enabled: load_balancing_config[:enabled], model_switching_enabled: model_switching_config[:enabled], circuit_breaker_enabled: circuit_breaker_config[:enabled], health_check_enabled: health_check_config[:enabled], metrics_enabled: metrics_config[:enabled] } end |
#configured_providers ⇒ Object
Get all configured providers
29 30 31 |
# File 'lib/aidp/harness/configuration.rb', line 29 def configured_providers @config[:providers]&.keys&.map(&:to_s) || [] end |
#configured_tiers(provider_name) ⇒ Array<String>
Get all configured tiers for a provider
469 470 471 |
# File 'lib/aidp/harness/configuration.rb', line 469 def configured_tiers(provider_name) provider_thinking_tiers(provider_name).keys.map(&:to_s) end |
#conventional_commits? ⇒ Boolean
Check if conventional commits are enabled
270 271 272 |
# File 'lib/aidp/harness/configuration.rb', line 270 def conventional_commits? version_control_config[:conventional_commits] == true end |
#coverage_config ⇒ Object
Get coverage configuration
275 276 277 |
# File 'lib/aidp/harness/configuration.rb', line 275 def coverage_config work_loop_config[:coverage] || default_coverage_config end |
#coverage_enabled? ⇒ Boolean
Check if coverage is enabled
280 281 282 |
# File 'lib/aidp/harness/configuration.rb', line 280 def coverage_enabled? coverage_config[:enabled] == true end |
#coverage_fail_on_drop? ⇒ Boolean
Check if should fail on coverage drop
300 301 302 |
# File 'lib/aidp/harness/configuration.rb', line 300 def coverage_fail_on_drop? coverage_config[:fail_on_drop] == true end |
#coverage_minimum ⇒ Object
Get minimum coverage threshold
305 306 307 |
# File 'lib/aidp/harness/configuration.rb', line 305 def coverage_minimum coverage_config[:minimum_coverage] end |
#coverage_report_paths ⇒ Object
Get coverage report paths
295 296 297 |
# File 'lib/aidp/harness/configuration.rb', line 295 def coverage_report_paths coverage_config[:report_paths] || [] end |
#coverage_run_command ⇒ Object
Get coverage run command
290 291 292 |
# File 'lib/aidp/harness/configuration.rb', line 290 def coverage_run_command coverage_config[:run_command] end |
#coverage_tool ⇒ Object
Get coverage tool
285 286 287 |
# File 'lib/aidp/harness/configuration.rb', line 285 def coverage_tool coverage_config[:tool] end |
#create_example_config ⇒ Object
Create example configuration
484 485 486 |
# File 'lib/aidp/harness/configuration.rb', line 484 def create_example_config Aidp::Config.create_example_config(@project_dir) end |
#default_flags(provider_name) ⇒ Object
Get default flags for a provider
64 65 66 |
# File 'lib/aidp/harness/configuration.rb', line 64 def default_flags(provider_name) provider_config(provider_name)[:default_flags] || [] end |
#default_model(provider_name) ⇒ Object
Get default model for provider
74 75 76 77 |
# File 'lib/aidp/harness/configuration.rb', line 74 def default_model(provider_name) models = provider_models(provider_name) models.first || default_model_for_provider(provider_name) end |
#default_provider ⇒ Object
Get default provider
34 35 36 |
# File 'lib/aidp/harness/configuration.rb', line 34 def default_provider harness_config[:default_provider] end |
#default_tier ⇒ Object
Get default thinking tier
390 391 392 |
# File 'lib/aidp/harness/configuration.rb', line 390 def default_tier thinking_config[:default_tier] || default_thinking_config[:default_tier] end |
#devcontainer_allowed_domains ⇒ Object
Get allowed domains for devcontainer firewall
761 762 763 |
# File 'lib/aidp/harness/configuration.rb', line 761 def devcontainer_allowed_domains devcontainer_settings[:allowed_domains] || [] end |
#devcontainer_config ⇒ Object
Get devcontainer configuration
677 678 679 680 681 682 683 684 685 686 687 688 |
# File 'lib/aidp/harness/configuration.rb', line 677 def devcontainer_config return @devcontainer_config if defined?(@devcontainer_config) raw_config = @config[:devcontainer] || @config["devcontainer"] base = deep_dup(default_devcontainer_config) @devcontainer_config = if raw_config.is_a?(Hash) deep_merge_hashes(base, deep_symbolize_keys(raw_config)) else base end end |
#devcontainer_dangerous_ops_allowed? ⇒ Boolean
Check if dangerous filesystem operations are allowed in devcontainer
723 724 725 |
# File 'lib/aidp/harness/configuration.rb', line 723 def devcontainer_dangerous_ops_allowed? [:dangerous_filesystem_ops] == true end |
#devcontainer_enabled? ⇒ Boolean
Check if devcontainer features are enabled
691 692 693 |
# File 'lib/aidp/harness/configuration.rb', line 691 def devcontainer_enabled? devcontainer_config[:enabled] != false end |
#devcontainer_force_detection ⇒ Object
Get forced detection value (nil for auto-detection)
701 702 703 |
# File 'lib/aidp/harness/configuration.rb', line 701 def devcontainer_force_detection devcontainer_config[:force_detection] end |
#devcontainer_permissions ⇒ Object
Get devcontainer permissions config
715 716 717 718 719 720 |
# File 'lib/aidp/harness/configuration.rb', line 715 def = devcontainer_config[:permissions] return {} unless .is_a?(Hash) .transform_keys { |key| key.to_sym } end |
#devcontainer_settings ⇒ Object
Get devcontainer settings
746 747 748 |
# File 'lib/aidp/harness/configuration.rb', line 746 def devcontainer_settings devcontainer_config[:settings] || {} end |
#devcontainer_skip_permission_checks ⇒ Object
Get list of providers that should skip permission checks in devcontainer
728 729 730 731 732 733 734 735 736 737 738 |
# File 'lib/aidp/harness/configuration.rb', line 728 def = devcontainer_config[:permissions] list = nil if .is_a?(Hash) list = [:skip_permission_checks] || ["skip_permission_checks"] end list = if list.nil? Array(list).map(&:to_s) end |
#devcontainer_skip_permissions_for?(provider_name) ⇒ Boolean
Check if a specific provider should skip permission checks in devcontainer
741 742 743 |
# File 'lib/aidp/harness/configuration.rb', line 741 def (provider_name) .include?(provider_name.to_s) end |
#devcontainer_timeout_multiplier ⇒ Object
Get timeout multiplier for devcontainer
751 752 753 |
# File 'lib/aidp/harness/configuration.rb', line 751 def devcontainer_timeout_multiplier devcontainer_settings[:timeout_multiplier] || 1.0 end |
#devcontainer_verbose_logging? ⇒ Boolean
Check if verbose logging is enabled in devcontainer
756 757 758 |
# File 'lib/aidp/harness/configuration.rb', line 756 def devcontainer_verbose_logging? devcontainer_settings[:verbose_logging] == true end |
#documentation_commands ⇒ Object
Get documentation commands
195 196 197 |
# File 'lib/aidp/harness/configuration.rb', line 195 def documentation_commands normalize_commands(work_loop_config[:documentation_commands] || []) end |
#escalation_complexity_threshold ⇒ Object
Get complexity threshold configuration for escalation
415 416 417 |
# File 'lib/aidp/harness/configuration.rb', line 415 def escalation_complexity_threshold escalation_config[:on_complexity_threshold] || {} end |
#escalation_config ⇒ Object
Get escalation configuration
405 406 407 |
# File 'lib/aidp/harness/configuration.rb', line 405 def escalation_config thinking_config[:escalation] || default_escalation_config end |
#escalation_fail_attempts ⇒ Object
Get fail attempts threshold for escalation
410 411 412 |
# File 'lib/aidp/harness/configuration.rb', line 410 def escalation_fail_attempts escalation_config[:on_fail_attempts] || 2 end |
#escalation_threshold ⇒ Object
Get escalation threshold
561 562 563 |
# File 'lib/aidp/harness/configuration.rb', line 561 def escalation_threshold thinking_config[:escalation_threshold] || 2 end |
#fallback_config ⇒ Object
Get fallback configuration
474 475 476 |
# File 'lib/aidp/harness/configuration.rb', line 474 def fallback_config harness_config[:fallback] || default_fallback_config end |
#fallback_providers ⇒ Object
Get fallback providers
39 40 41 |
# File 'lib/aidp/harness/configuration.rb', line 39 def fallback_providers harness_config[:fallback_providers] end |
#formatter_commands ⇒ Object
Get formatter commands
185 186 187 |
# File 'lib/aidp/harness/configuration.rb', line 185 def formatter_commands normalize_commands(work_loop_config[:formatter_commands] || []) end |
#full_permissions_in_devcontainer? ⇒ Boolean
Check if full permissions should be granted in devcontainer
696 697 698 |
# File 'lib/aidp/harness/configuration.rb', line 696 def devcontainer_config[:full_permissions_when_in_devcontainer] == true end |
#guards_bypass? ⇒ Boolean
Check if guards are bypassed
250 251 252 |
# File 'lib/aidp/harness/configuration.rb', line 250 def guards_bypass? guards_config[:bypass] == true end |
#guards_config ⇒ Object
Get guards configuration
220 221 222 |
# File 'lib/aidp/harness/configuration.rb', line 220 def guards_config work_loop_config[:guards] || default_guards_config end |
#guards_confirm_files ⇒ Object
Get files requiring confirmation for guards
240 241 242 |
# File 'lib/aidp/harness/configuration.rb', line 240 def guards_confirm_files guards_config[:confirm_files] || [] end |
#guards_enabled? ⇒ Boolean
Check if guards are enabled
225 226 227 |
# File 'lib/aidp/harness/configuration.rb', line 225 def guards_enabled? guards_config[:enabled] == true end |
#guards_exclude_files ⇒ Object
Get exclude file patterns for guards
235 236 237 |
# File 'lib/aidp/harness/configuration.rb', line 235 def guards_exclude_files guards_config[:exclude_files] || [] end |
#guards_include_files ⇒ Object
Get include file patterns for guards
230 231 232 |
# File 'lib/aidp/harness/configuration.rb', line 230 def guards_include_files guards_config[:include_files] || [] end |
#guards_max_lines_per_commit ⇒ Object
Get max lines per commit for guards
245 246 247 |
# File 'lib/aidp/harness/configuration.rb', line 245 def guards_max_lines_per_commit guards_config[:max_lines_per_commit] end |
#harness_config ⇒ Object
Get harness-specific configuration
19 20 21 |
# File 'lib/aidp/harness/configuration.rb', line 19 def harness_config @config[:harness] end |
#health_check_config ⇒ Object
Get provider health check configuration
136 137 138 |
# File 'lib/aidp/harness/configuration.rb', line 136 def health_check_config harness_config[:health_check] || default_health_check_config end |
#in_devcontainer? ⇒ Boolean
Check if currently in devcontainer (with optional force override)
706 707 708 709 710 711 712 |
# File 'lib/aidp/harness/configuration.rb', line 706 def in_devcontainer? forced = devcontainer_force_detection return forced unless forced.nil? require_relative "../utils/devcontainer_detector" Aidp::Utils::DevcontainerDetector.in_devcontainer? end |
#interactive_testing_app_type ⇒ Object
Get interactive testing app type
320 321 322 |
# File 'lib/aidp/harness/configuration.rb', line 320 def interactive_testing_app_type interactive_testing_config[:app_type] end |
#interactive_testing_config ⇒ Object
Get interactive testing configuration
310 311 312 |
# File 'lib/aidp/harness/configuration.rb', line 310 def interactive_testing_config work_loop_config[:interactive_testing] || default_interactive_testing_config end |
#interactive_testing_enabled? ⇒ Boolean
Check if interactive testing is enabled
315 316 317 |
# File 'lib/aidp/harness/configuration.rb', line 315 def interactive_testing_enabled? interactive_testing_config[:enabled] == true end |
#interactive_testing_tools ⇒ Object
Get interactive testing tools configuration
325 326 327 |
# File 'lib/aidp/harness/configuration.rb', line 325 def interactive_testing_tools interactive_testing_config[:tools] || {} end |
#lint_commands ⇒ Object
Get lint commands
180 181 182 |
# File 'lib/aidp/harness/configuration.rb', line 180 def lint_commands normalize_commands(work_loop_config[:lint_commands] || []) end |
#lint_max_output_lines ⇒ Object
Get max output lines for linters
215 216 217 |
# File 'lib/aidp/harness/configuration.rb', line 215 def lint_max_output_lines work_loop_config.dig(:lint, :max_output_lines) || 300 end |
#lint_output_mode ⇒ Object
Get lint output mode
210 211 212 |
# File 'lib/aidp/harness/configuration.rb', line 210 def lint_output_mode work_loop_config.dig(:lint, :output_mode) || :full end |
#load_balancing_config ⇒ Object
Get load balancing configuration
126 127 128 |
# File 'lib/aidp/harness/configuration.rb', line 126 def load_balancing_config harness_config[:load_balancing] || default_load_balancing_config end |
#logging_config ⇒ Object
Get logging configuration
380 381 382 |
# File 'lib/aidp/harness/configuration.rb', line 380 def logging_config harness_config[:logging] || default_logging_config end |
#max_retries ⇒ Object
Get maximum retries
44 45 46 |
# File 'lib/aidp/harness/configuration.rb', line 44 def max_retries harness_config[:max_retries] end |
#max_tier ⇒ Object
Get maximum thinking tier
395 396 397 |
# File 'lib/aidp/harness/configuration.rb', line 395 def max_tier thinking_config[:max_tier] || default_thinking_config[:max_tier] end |
#max_tokens(provider_name) ⇒ Object
Get maximum tokens for API providers
59 60 61 |
# File 'lib/aidp/harness/configuration.rb', line 59 def max_tokens(provider_name) provider_config(provider_name)[:max_tokens] end |
#metrics_config ⇒ Object
Get metrics configuration
141 142 143 |
# File 'lib/aidp/harness/configuration.rb', line 141 def metrics_config harness_config[:metrics] || default_metrics_config end |
#model_config(provider_name, model_name) ⇒ Object
Get model configuration for provider
80 81 82 83 |
# File 'lib/aidp/harness/configuration.rb', line 80 def model_config(provider_name, model_name) models_config = provider_config(provider_name)[:models_config] || {} models_config[model_name] || {} end |
#model_family(provider_name) ⇒ Object
Get model family for a provider
330 331 332 |
# File 'lib/aidp/harness/configuration.rb', line 330 def model_family(provider_name) provider_config(provider_name)[:model_family] || "auto" end |
#model_flags(provider_name, model_name) ⇒ Object
Get model-specific flags
86 87 88 |
# File 'lib/aidp/harness/configuration.rb', line 86 def model_flags(provider_name, model_name) model_config(provider_name, model_name)[:flags] || [] end |
#model_max_tokens(provider_name, model_name) ⇒ Object
Get model-specific max tokens
91 92 93 |
# File 'lib/aidp/harness/configuration.rb', line 91 def model_max_tokens(provider_name, model_name) model_config(provider_name, model_name)[:max_tokens] || max_tokens(provider_name) end |
#model_switching_config ⇒ Object
Get model switching configuration
131 132 133 |
# File 'lib/aidp/harness/configuration.rb', line 131 def model_switching_config harness_config[:model_switching] || default_model_switching_config end |
#model_timeout(provider_name, model_name) ⇒ Object
Get model-specific timeout
96 97 98 |
# File 'lib/aidp/harness/configuration.rb', line 96 def model_timeout(provider_name, model_name) model_config(provider_name, model_name)[:timeout] || default_timeout_for_provider(provider_name) end |
#model_weights(provider_name) ⇒ Object
Get model weights for load balancing
106 107 108 |
# File 'lib/aidp/harness/configuration.rb', line 106 def model_weights(provider_name) provider_config(provider_name)[:model_weights] || {} end |
#models_for_tier(tier, provider_name) ⇒ Array<String>
Get models configured for a specific tier and provider
452 453 454 455 456 457 458 459 460 461 462 463 464 |
# File 'lib/aidp/harness/configuration.rb', line 452 def models_for_tier(tier, provider_name) return [] unless provider_name tier_config = provider_thinking_tiers(provider_name)[tier] || provider_thinking_tiers(provider_name)[tier.to_sym] return [] unless tier_config models = tier_config[:models] || tier_config["models"] return [] unless models # Return simple array of model name strings Array(models).map(&:to_s).compact end |
#no_api_keys_required? ⇒ Boolean
Check if restricted to providers that don’t require API keys
49 50 51 |
# File 'lib/aidp/harness/configuration.rb', line 49 def no_api_keys_required? harness_config[:no_api_keys_required] end |
#permission_for_tier(tier) ⇒ Object
Get permission level for a tier
425 426 427 |
# File 'lib/aidp/harness/configuration.rb', line 425 def (tier) [tier] || [tier.to_sym] || "tools" end |
#permissions_by_tier ⇒ Object
Get permissions by tier configuration
420 421 422 |
# File 'lib/aidp/harness/configuration.rb', line 420 def thinking_config[:permissions_by_tier] || {} end |
#prompt_dynamic_adjustment? ⇒ Boolean
Check if dynamic adjustment is enabled
665 666 667 |
# File 'lib/aidp/harness/configuration.rb', line 665 def prompt_dynamic_adjustment? prompt_optimization_config[:dynamic_adjustment] != false end |
#prompt_include_thresholds ⇒ Object
Get include threshold configuration
645 646 647 |
# File 'lib/aidp/harness/configuration.rb', line 645 def prompt_include_thresholds prompt_optimization_config[:include_threshold] || default_include_thresholds end |
#prompt_log_fragments? ⇒ Boolean
Check if fragment logging is enabled
670 671 672 |
# File 'lib/aidp/harness/configuration.rb', line 670 def prompt_log_fragments? prompt_optimization_config[:log_selected_fragments] == true end |
#prompt_max_tokens ⇒ Object
Get maximum tokens for prompt
640 641 642 |
# File 'lib/aidp/harness/configuration.rb', line 640 def prompt_max_tokens prompt_optimization_config[:max_tokens] || 16000 end |
#prompt_optimization_config ⇒ Object
Get prompt optimization configuration
630 631 632 |
# File 'lib/aidp/harness/configuration.rb', line 630 def prompt_optimization_config @config[:prompt_optimization] || default_prompt_optimization_config end |
#prompt_optimization_enabled? ⇒ Boolean
Check if prompt optimization is enabled
635 636 637 |
# File 'lib/aidp/harness/configuration.rb', line 635 def prompt_optimization_enabled? prompt_optimization_config[:enabled] == true end |
#prompt_source_threshold ⇒ Object
Get source code include threshold
660 661 662 |
# File 'lib/aidp/harness/configuration.rb', line 660 def prompt_source_threshold prompt_include_thresholds[:source] || 0.7 end |
#prompt_style_guide_threshold ⇒ Object
Get style guide include threshold
650 651 652 |
# File 'lib/aidp/harness/configuration.rb', line 650 def prompt_style_guide_threshold prompt_include_thresholds[:style_guide] || 0.75 end |
#prompt_templates_threshold ⇒ Object
Get templates include threshold
655 656 657 |
# File 'lib/aidp/harness/configuration.rb', line 655 def prompt_templates_threshold prompt_include_thresholds[:templates] || 0.8 end |
#provider_auth_config(provider_name) ⇒ Object
Get provider authentication configuration
350 351 352 |
# File 'lib/aidp/harness/configuration.rb', line 350 def provider_auth_config(provider_name) provider_config(provider_name)[:auth] || {} end |
#provider_config(provider_name) ⇒ Object
Get provider configuration
24 25 26 |
# File 'lib/aidp/harness/configuration.rb', line 24 def provider_config(provider_name) @config.dig(:providers, provider_name.to_sym) || {} end |
#provider_configured?(provider_name) ⇒ Boolean
Check if provider is configured
370 371 372 |
# File 'lib/aidp/harness/configuration.rb', line 370 def provider_configured?(provider_name) configured_providers.include?(provider_name.to_s) end |
#provider_cost_config(provider_name) ⇒ Object
Get provider cost configuration
340 341 342 |
# File 'lib/aidp/harness/configuration.rb', line 340 def provider_cost_config(provider_name) provider_config(provider_name)[:cost] || {} end |
#provider_endpoints(provider_name) ⇒ Object
Get provider endpoint configuration
355 356 357 |
# File 'lib/aidp/harness/configuration.rb', line 355 def provider_endpoints(provider_name) provider_config(provider_name)[:endpoints] || {} end |
#provider_features(provider_name) ⇒ Object
Get provider feature flags
360 361 362 |
# File 'lib/aidp/harness/configuration.rb', line 360 def provider_features(provider_name) provider_config(provider_name)[:features] || {} end |
#provider_models(provider_name) ⇒ Object
Get provider models configuration
69 70 71 |
# File 'lib/aidp/harness/configuration.rb', line 69 def provider_models(provider_name) provider_config(provider_name)[:models] || default_models_for_provider(provider_name) end |
#provider_monitoring_config(provider_name) ⇒ Object
Get provider monitoring configuration
365 366 367 |
# File 'lib/aidp/harness/configuration.rb', line 365 def provider_monitoring_config(provider_name) provider_config(provider_name)[:monitoring] || {} end |
#provider_priority(provider_name) ⇒ Object
Get provider priority
335 336 337 |
# File 'lib/aidp/harness/configuration.rb', line 335 def provider_priority(provider_name) provider_config(provider_name)[:priority] || 0 end |
#provider_regions(provider_name) ⇒ Object
Get provider region configuration
345 346 347 |
# File 'lib/aidp/harness/configuration.rb', line 345 def provider_regions(provider_name) provider_config(provider_name)[:regions] || [] end |
#provider_thinking_tiers(provider_name) ⇒ Hash
Get thinking tiers configuration for a specific provider
443 444 445 446 |
# File 'lib/aidp/harness/configuration.rb', line 443 def provider_thinking_tiers(provider_name) provider_cfg = provider_config(provider_name) provider_cfg[:thinking_tiers] || provider_cfg["thinking_tiers"] || {} end |
#provider_type(provider_name) ⇒ Object
Get provider type (usage_based, subscription, etc.)
54 55 56 |
# File 'lib/aidp/harness/configuration.rb', line 54 def provider_type(provider_name) provider_config(provider_name)[:type] || "unknown" end |
#provider_weights ⇒ Object
Get provider weights for load balancing
101 102 103 |
# File 'lib/aidp/harness/configuration.rb', line 101 def provider_weights harness_config[:provider_weights] || {} end |
#rate_limit_config ⇒ Object
Get rate limit configuration
121 122 123 |
# File 'lib/aidp/harness/configuration.rb', line 121 def rate_limit_config harness_config[:rate_limit] || default_rate_limit_config end |
#raw_config ⇒ Object
Get raw configuration
489 490 491 |
# File 'lib/aidp/harness/configuration.rb', line 489 def raw_config @config.dup end |
#retry_config ⇒ Object
Get retry configuration
116 117 118 |
# File 'lib/aidp/harness/configuration.rb', line 116 def retry_config harness_config[:retry] || default_retry_config end |
#session_config ⇒ Object
Get session configuration
146 147 148 |
# File 'lib/aidp/harness/configuration.rb', line 146 def session_config harness_config[:session] || default_session_config end |
#should_use_full_permissions?(provider_name) ⇒ Boolean
Check if provider should run with full permissions Combines devcontainer detection with configuration
767 768 769 770 771 772 773 774 775 776 |
# File 'lib/aidp/harness/configuration.rb', line 767 def (provider_name) return false unless devcontainer_enabled? return false unless in_devcontainer? # Check if full permissions are globally enabled for devcontainer return true if # Check if this specific provider should skip permissions (provider_name) end |
#task_completion_required? ⇒ Boolean
Check if task completion is required for work loop completion
170 171 172 |
# File 'lib/aidp/harness/configuration.rb', line 170 def task_completion_required? work_loop_config.fetch(:task_completion_required, true) end |
#test_commands ⇒ Object
Get test commands
175 176 177 |
# File 'lib/aidp/harness/configuration.rb', line 175 def test_commands normalize_commands(work_loop_config[:test_commands] || []) end |
#test_max_output_lines ⇒ Object
Get max output lines for tests
205 206 207 |
# File 'lib/aidp/harness/configuration.rb', line 205 def test_max_output_lines work_loop_config.dig(:test, :max_output_lines) || 500 end |
#test_output_mode ⇒ Object
Get test output mode
200 201 202 |
# File 'lib/aidp/harness/configuration.rb', line 200 def test_output_mode work_loop_config.dig(:test, :output_mode) || :full end |
#thinking_config ⇒ Object
Get thinking depth configuration
385 386 387 |
# File 'lib/aidp/harness/configuration.rb', line 385 def thinking_config @config[:thinking] || default_thinking_config end |
#thinking_overrides ⇒ Object
Get thinking tier overrides
430 431 432 |
# File 'lib/aidp/harness/configuration.rb', line 430 def thinking_overrides thinking_config[:overrides] || {} end |
#tier_override_for(key) ⇒ Object
Get tier override for a skill or template
436 437 438 |
# File 'lib/aidp/harness/configuration.rb', line 436 def tier_override_for(key) thinking_overrides[key] || thinking_overrides[key.to_sym] end |
#tier_overrides ⇒ Object
Get tier overrides
566 567 568 |
# File 'lib/aidp/harness/configuration.rb', line 566 def tier_overrides thinking_config[:overrides] || {} end |
#validate_model_config(provider_name, model_name, model_config, errors) ⇒ Object
Validate model configuration
494 495 496 497 498 499 500 501 502 503 504 505 506 507 |
# File 'lib/aidp/harness/configuration.rb', line 494 def validate_model_config(provider_name, model_name, model_config, errors) # Validate model-specific fields if model_config[:max_tokens] && !model_config[:max_tokens].is_a?(Integer) errors << "Model '#{provider_name}:#{model_name}' max_tokens must be integer" end if model_config[:timeout] && !model_config[:timeout].is_a?(Integer) errors << "Model '#{provider_name}:#{model_name}' timeout must be integer" end if model_config[:flags] && !model_config[:flags].is_a?(Array) errors << "Model '#{provider_name}:#{model_name}' flags must be array" end end |
#validate_provider_config(provider_name) ⇒ Object
Validate provider configuration
526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 |
# File 'lib/aidp/harness/configuration.rb', line 526 def validate_provider_config(provider_name) errors = [] unless provider_configured?(provider_name) errors << "Provider '#{provider_name}' not configured" return errors end # Validate provider type provider_type = provider_type(provider_name) unless %w[usage_based subscription passthrough].include?(provider_type) errors << "Provider '#{provider_name}' has invalid type: #{provider_type}" end # Validate required fields based on type case provider_type when "usage_based" unless max_tokens(provider_name) errors << "Provider '#{provider_name}' missing max_tokens for usage_based type" end when "passthrough" unless provider_config(provider_name)[:underlying_service] errors << "Provider '#{provider_name}' missing underlying_service for passthrough type" end end errors end |
#vcs_behavior ⇒ Object
Get VCS behavior (stage/commit/nothing)
265 266 267 |
# File 'lib/aidp/harness/configuration.rb', line 265 def vcs_behavior version_control_config[:behavior] end |
#vcs_tool ⇒ Object
Get VCS tool
260 261 262 |
# File 'lib/aidp/harness/configuration.rb', line 260 def vcs_tool version_control_config[:tool] end |
#version_control_config ⇒ Object
Get version control configuration
255 256 257 |
# File 'lib/aidp/harness/configuration.rb', line 255 def version_control_config work_loop_config[:version_control] || default_version_control_config end |
#work_loop_config ⇒ Object
Get work loop configuration
151 152 153 |
# File 'lib/aidp/harness/configuration.rb', line 151 def work_loop_config harness_config[:work_loop] || default_work_loop_config end |
#work_loop_enabled? ⇒ Boolean
Check if work loops are enabled
160 161 162 |
# File 'lib/aidp/harness/configuration.rb', line 160 def work_loop_enabled? work_loop_config[:enabled] end |
#work_loop_max_iterations ⇒ Object
Get maximum iterations for work loops
165 166 167 |
# File 'lib/aidp/harness/configuration.rb', line 165 def work_loop_max_iterations work_loop_config[:max_iterations] end |
#work_loop_units_config ⇒ Object
155 156 157 |
# File 'lib/aidp/harness/configuration.rb', line 155 def work_loop_units_config work_loop_config[:units] || default_units_config end |
#zfc_ab_testing_config ⇒ Object
Get ZFC A/B testing configuration
618 619 620 |
# File 'lib/aidp/harness/configuration.rb', line 618 def zfc_ab_testing_config zfc_config[:ab_testing] || default_zfc_ab_testing_config end |
#zfc_ab_testing_enabled? ⇒ Boolean
Check if ZFC A/B testing is enabled
623 624 625 |
# File 'lib/aidp/harness/configuration.rb', line 623 def zfc_ab_testing_enabled? zfc_ab_testing_config[:enabled] == true end |
#zfc_config ⇒ Object
Get ZFC configuration
571 572 573 |
# File 'lib/aidp/harness/configuration.rb', line 571 def zfc_config @config[:zfc] || default_zfc_config end |
#zfc_cost_limits ⇒ Object
Get ZFC cost limits
613 614 615 |
# File 'lib/aidp/harness/configuration.rb', line 613 def zfc_cost_limits zfc_config[:cost_limits] || default_zfc_cost_limits end |
#zfc_decision_cache_ttl(decision_type) ⇒ Object
Get ZFC decision cache TTL
603 604 605 |
# File 'lib/aidp/harness/configuration.rb', line 603 def zfc_decision_cache_ttl(decision_type) zfc_decision_config(decision_type)[:cache_ttl] end |
#zfc_decision_confidence_threshold(decision_type) ⇒ Object
Get ZFC decision confidence threshold
608 609 610 |
# File 'lib/aidp/harness/configuration.rb', line 608 def zfc_decision_confidence_threshold(decision_type) zfc_decision_config(decision_type)[:confidence_threshold] || 0.7 end |
#zfc_decision_config(decision_type) ⇒ Object
Get ZFC decision configuration
586 587 588 |
# File 'lib/aidp/harness/configuration.rb', line 586 def zfc_decision_config(decision_type) zfc_config.dig(:decisions, decision_type.to_sym) || {} end |
#zfc_decision_enabled?(decision_type) ⇒ Boolean
Check if specific ZFC decision type is enabled
591 592 593 594 595 |
# File 'lib/aidp/harness/configuration.rb', line 591 def zfc_decision_enabled?(decision_type) return false unless zfc_enabled? decision_config = zfc_decision_config(decision_type) decision_config[:enabled] == true end |
#zfc_decision_tier(decision_type) ⇒ Object
Get ZFC decision tier
598 599 600 |
# File 'lib/aidp/harness/configuration.rb', line 598 def zfc_decision_tier(decision_type) zfc_decision_config(decision_type)[:tier] || "mini" end |
#zfc_enabled? ⇒ Boolean
Check if ZFC is enabled
576 577 578 |
# File 'lib/aidp/harness/configuration.rb', line 576 def zfc_enabled? zfc_config[:enabled] == true end |
#zfc_fallback_to_legacy? ⇒ Boolean
Check if ZFC should fallback to legacy on failure
581 582 583 |
# File 'lib/aidp/harness/configuration.rb', line 581 def zfc_fallback_to_legacy? zfc_config[:fallback_to_legacy] != false end |