Class: SkillBench::HistoryRecorder

Inherits:
Object
  • Object
show all
Defined in:
lib/skill_bench/history_recorder.rb,
lib/skill_bench/history_recorder/history_file.rb,
lib/skill_bench/history_recorder/summary_service.rb,
lib/skill_bench/history_recorder/persistence_service.rb,
lib/skill_bench/history_recorder/history_path_resolver.rb

Overview

Records evaluation results into a historical benchmarks file. Delegates to specialized services following Single Responsibility Principle.

Defined Under Namespace

Classes: HistoryFile, HistoryPathResolver, PersistenceService, SummaryService

Constant Summary collapse

HISTORY_FILE =

The default file where historical benchmarks are stored.

'benchmarks.json'

Class Method Summary collapse

Class Method Details

.load_history(path = HISTORY_FILE) ⇒ Object

Loads existing history from the benchmarks file. Delegates to HistoryFile.



24
25
26
# File 'lib/skill_bench/history_recorder.rb', line 24

def self.load_history(path = HISTORY_FILE)
  HistoryFile.load(path)
end

.log_error(exception) ⇒ Object

Logs errors with backtrace. Delegates to ErrorLogger.



36
37
38
# File 'lib/skill_bench/history_recorder.rb', line 36

def self.log_error(exception)
  SkillBench::ErrorLogger.log_error(exception, 'HistoryRecorder')
end

.record(results, source_path:, model:) ⇒ Object

Records evaluation results into a historical benchmarks file. Delegates to PersistenceService.



18
19
20
# File 'lib/skill_bench/history_recorder.rb', line 18

def self.record(results, source_path:, model:)
  PersistenceService.record(results, source_path: source_path, model: model)
end

.summarize(tasks) ⇒ Object

Summarizes the results of multiple tasks. Delegates to SummaryService.



30
31
32
# File 'lib/skill_bench/history_recorder.rb', line 30

def self.summarize(tasks)
  SummaryService.summarize(tasks)
end