Class: SkillBench::Execution::SourcePathResolver

Inherits:
Object
  • Object
show all
Defined in:
lib/skill_bench/execution/source_path_resolver.rb

Overview

Resolves the source skill or workflow path for a given evaluation target.

Class Method Summary collapse

Class Method Details

.call(eval_folder_path:, skill_path: nil) ⇒ String?

Resolves the source path using either an explicit override or the eval directory convention.

Examples:

Infer a skill source path (NEW format):

SkillBench::Execution::SourcePathResolver.call(
  eval_folder_path: 'evals/skills/rails-code-review/review-order'
)
# => "skills/rails-code-review"

Infer a skill source path (OLD format, returns category):

SkillBench::Execution::SourcePathResolver.call(
  eval_folder_path: 'evals/skills/code-quality/rails-code-review/review-order'
)
# => "skills/code-quality/rails-code-review"

Parameters:

  • eval_folder_path (String)

    Relative path to the eval directory.

  • skill_path (String, nil) (defaults to: nil)

    Optional explicit override for the source directory.

Returns:

  • (String, nil)

    The resolved source path relative to the evaluator repo root, or nil if unmappable.



22
23
24
25
26
27
28
# File 'lib/skill_bench/execution/source_path_resolver.rb', line 22

def self.call(eval_folder_path:, skill_path: nil)
  return skill_path if skill_path && !skill_path.empty?

  segments = eval_folder_path.to_s.split('/').reject(&:empty?)

  resolve_skills_path(segments) || resolve_workflows_path(segments)
end