Class: LLMExperiment::CLI::SanitizeCommand

Inherits:
Command
  • Object
show all
Defined in:
lib/llm_experiment/cli/sanitize_command.rb

Constant Summary collapse

NAME =
"sanitize"
SUMMARY =
"gate results-raw/ into the committed results/"

Instance Method Summary collapse

Methods inherited from Command

#call, #initialize, summary

Constructor Details

This class inherits a constructor from LLMExperiment::CLI::Command

Instance Method Details

#add_options(parser) ⇒ Object



9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/llm_experiment/cli/sanitize_command.rb', line 9

def add_options(parser)
  parser.banner = <<~BANNER
    Usage: llmx sanitize [--check]

    Copies each trial from results-raw/ into results/. Derived measurements
    always cross; raw transcripts cross only for an app declared with
    `publish_transcripts: true`, because a transcript contains whatever
    source the agent read.

    Anything that looks like a host path or a secret is a hard failure, not
    a redaction: something unexpected in a transcript should stop the commit
    and be looked at, not be quietly rewritten into something that looks safe.

  BANNER
  parser.on("--check", "report what would be refused, copy nothing") { @check = true }
end

#run(_argv) ⇒ Object



26
27
28
29
# File 'lib/llm_experiment/cli/sanitize_command.rb', line 26

def run(_argv)
  sanitizer = Sanitizer.new(experiment: experiment)
  @check ? sanitizer.check : sanitizer.publish
end