Class: Harnex::OrchestrationCommand

Inherits:
Object
  • Object
show all
Defined in:
lib/harnex/commands/orchestration.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(argv) ⇒ OrchestrationCommand

Returns a new instance of OrchestrationCommand.



45
46
47
# File 'lib/harnex/commands/orchestration.rb', line 45

def initialize(argv)
  @argv = argv.dup
end

Class Method Details

.usage(program_name = "harnex orchestration") ⇒ Object



6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# File 'lib/harnex/commands/orchestration.rb', line 6

def self.usage(program_name = "harnex orchestration")
  <<~TEXT
    Usage:
      #{program_name} sample --out PATH --run-id ID --generation-id ID [options]
      #{program_name} report --dispatch PATH --run-id ID [--samples PATH] [--json]

    Sample options:
      --project-id ID
      --queue-id ID
      --session-id ID
      --event NAME                  sample, generation_started, generation_finished, rotation, recovery, or compaction
      --ts ISO8601
      --context-status STATUS       observed, estimated, unsupported, missing, or zero
      --context-tokens N
      --context-window-tokens N
      --context-percent N
      --context-peak-tokens N
      --context-peak-percent N
      --usage-status STATUS         observed, estimated, unsupported, missing, or zero
      --usage-input-tokens N
      --usage-output-tokens N
      --usage-cached-input-tokens N
      --usage-reasoning-tokens N
      --usage-total-tokens N
      --usage-cost-usd N
      --usage-cost-source TEXT
      --tool-calls N
      --compactions N
      --rotation-reason TEXT

    Report options:
      --dispatch PATH               Dispatch summary JSONL
      --samples PATH                External primary sample JSONL
      --run-id ID                   Logical orchestration run id
      --json                        Output the full report JSON
      -h, --help                    Show this help
  TEXT
end

Instance Method Details

#runObject



49
50
51
52
53
54
55
56
57
58
59
60
61
62
# File 'lib/harnex/commands/orchestration.rb', line 49

def run
  subcommand = @argv.shift
  case subcommand
  when "sample"
    run_sample(@argv)
  when "report"
    run_report(@argv)
  when "-h", "--help", nil
    puts self.class.usage
    0
  else
    raise OptionParser::ParseError, "unknown orchestration subcommand #{subcommand.inspect}"
  end
end