Class: SkillBench::Cli::ValidateCommand
- Inherits:
-
Object
- Object
- SkillBench::Cli::ValidateCommand
- Defined in:
- lib/skill_bench/cli/validate_command.rb
Overview
Handles the skill-bench validate / doctor subcommand.
Runs read-only pre-flight checks and prints a PASS/FAIL report:
1. Criteria JSON structure (via {Models::CriteriaValidator}).
2. skill-bench.json shape (hand-rolled, lightweight schema check).
3. Provider credentials for the configured non-mock provider.
It never runs an eval and never makes a network call.
Constant Summary collapse
- DEFAULT_CRITERIA =
Default criteria file validated when --criteria is not given.
'criteria.json'
Class Method Summary collapse
-
.call(argv) ⇒ Integer
Exit code.
Instance Method Summary collapse
-
#call ⇒ Integer
Parses options, runs the pre-flight checks, and prints the report.
-
#initialize(argv) ⇒ ValidateCommand
constructor
A new instance of ValidateCommand.
Constructor Details
#initialize(argv) ⇒ ValidateCommand
Returns a new instance of ValidateCommand.
27 28 29 |
# File 'lib/skill_bench/cli/validate_command.rb', line 27 def initialize(argv) @argv = argv end |
Class Method Details
.call(argv) ⇒ Integer
Returns Exit code.
22 23 24 |
# File 'lib/skill_bench/cli/validate_command.rb', line 22 def self.call(argv) new(argv).call end |
Instance Method Details
#call ⇒ Integer
Parses options, runs the pre-flight checks, and prints the report.
34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 |
# File 'lib/skill_bench/cli/validate_command.rb', line 34 def call = config_path = [:config] || SkillBench::Config::CONFIG_FILENAME config_data = load_config_data(config_path) results = [ check_criteria(), check_config(config_path, config_data), check_provider_key(config_data) ] print_report(results) results.any? { |result| result[:status] == :fail } ? 1 : 0 rescue HelpRequested 0 rescue StandardError => e warn "Error: #{e.}" 1 end |