< Summary

Information
Class: Orchestrator.Commands.Observability.ExportExperimentItem.ExportExperimentItemSettings
Assembly: Orchestrator
File(s): /home/runner/work/KicktippAi/KicktippAi/src/Orchestrator/Commands/Observability/ExportExperimentItem/ExportExperimentItemSettings.cs
Line coverage
53%
Covered lines: 17
Uncovered lines: 15
Coverable lines: 32
Total lines: 126
Line coverage: 53.1%
Branch coverage
50%
Covered branches: 10
Total branches: 20
Branch coverage: 50%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
.ctor()100%11100%
Validate()50%812046.43%

File(s)

/home/runner/work/KicktippAi/KicktippAi/src/Orchestrator/Commands/Observability/ExportExperimentItem/ExportExperimentItemSettings.cs

#LineLine coverage
 1using System.ComponentModel;
 2using EHonda.KicktippAi.Core;
 3using Spectre.Console;
 4using Spectre.Console.Cli;
 5
 6namespace Orchestrator.Commands.Observability.ExportExperimentItem;
 7
 8public sealed class ExportExperimentItemSettings : CommandSettings
 9{
 10    [CommandArgument(0, "<MODEL>")]
 11    [Description("The model used for the stored prediction that anchors prompt reconstruction")]
 112    public string Model { get; set; } = string.Empty;
 13
 14    [CommandOption("--community-context")]
 15    [Description("Community context used for the stored prediction")]
 116    public string CommunityContext { get; set; } = string.Empty;
 17
 18    [CommandOption("--home")]
 19    [Description("Home team name")]
 120    public string HomeTeam { get; set; } = string.Empty;
 21
 22    [CommandOption("--away")]
 23    [Description("Away team name")]
 124    public string AwayTeam { get; set; } = string.Empty;
 25
 26    [CommandOption("--matchday")]
 27    [Description("Matchday number for the selected match")]
 28    public int? Matchday { get; set; }
 29
 30    [CommandOption("--with-justification")]
 31    [Description("Reconstruct the justification prompt variant")]
 32    [DefaultValue(false)]
 33    public bool WithJustification { get; set; }
 34
 35    [CommandOption("--reasoning-effort")]
 36    [Description("Optional OpenAI reasoning effort used for the stored prediction (none, minimal, low, medium, high, xhi
 37    public string? ReasoningEffort { get; set; }
 38
 39    [CommandOption("--evaluation-time")]
 40    [Description("Optional explicit evaluation time in NodaTime invariant ZonedDateTime 'G' format, for example '2026-03
 41    public string? EvaluationTime { get; set; }
 42
 43    [CommandOption("--evaluation-policy-kind")]
 44    [Description("Optional evaluation policy kind. Currently only 'relative' is supported.")]
 45    public string? EvaluationPolicyKind { get; set; }
 46
 47    [CommandOption("--evaluation-policy-offset")]
 48    [Description("Optional NodaTime Duration offset for the evaluation policy, for example '-12:00:00'.")]
 49    public string? EvaluationPolicyOffset { get; set; }
 50
 51    [CommandOption("--output")]
 52    [Description("Path to the JSON file to write. Defaults to artifacts/langfuse-experiments/items/<match>.json")]
 53    public string? OutputPath { get; set; }
 54
 55    public override ValidationResult Validate()
 56    {
 157        if (string.IsNullOrWhiteSpace(Model))
 58        {
 059            return ValidationResult.Error("Model is required");
 60        }
 61
 162        if (string.IsNullOrWhiteSpace(CommunityContext))
 63        {
 064            return ValidationResult.Error("--community-context is required");
 65        }
 66
 167        if (string.IsNullOrWhiteSpace(HomeTeam))
 68        {
 069            return ValidationResult.Error("--home must be provided");
 70        }
 71
 172        if (string.IsNullOrWhiteSpace(AwayTeam))
 73        {
 074            return ValidationResult.Error("--away must be provided");
 75        }
 76
 177        if (!Matchday.HasValue)
 78        {
 079            return ValidationResult.Error("--matchday must be provided");
 80        }
 81
 182        if (!string.IsNullOrWhiteSpace(EvaluationTime))
 83        {
 84            try
 85            {
 086                _ = Commands.Observability.EvaluationTimeParser.Parse(EvaluationTime);
 087            }
 88            catch (ArgumentException ex)
 89            {
 090                return ValidationResult.Error(ex.Message);
 91            }
 92        }
 93
 194        if (!PredictionModelConfig.IsValidReasoningEffort(ReasoningEffort))
 95        {
 096            return ValidationResult.Error("--reasoning-effort must be one of: none, minimal, low, medium, high, xhigh");
 97        }
 98
 199        var hasEvaluationPolicyKind = !string.IsNullOrWhiteSpace(EvaluationPolicyKind);
 1100        var hasEvaluationPolicyOffset = !string.IsNullOrWhiteSpace(EvaluationPolicyOffset);
 101
 1102        if (hasEvaluationPolicyKind != hasEvaluationPolicyOffset)
 103        {
 0104            return ValidationResult.Error("--evaluation-policy-kind and --evaluation-policy-offset must be provided toge
 105        }
 106
 1107        if (!string.IsNullOrWhiteSpace(EvaluationTime) && hasEvaluationPolicyKind)
 108        {
 0109            return ValidationResult.Error("--evaluation-time cannot be combined with --evaluation-policy-kind/--evaluati
 110        }
 111
 1112        if (hasEvaluationPolicyKind)
 113        {
 114            try
 115            {
 0116                _ = Commands.Observability.EvaluationTimestampPolicyParser.Parse(EvaluationPolicyKind, EvaluationPolicyO
 0117            }
 118            catch (ArgumentException ex)
 119            {
 0120                return ValidationResult.Error(ex.Message);
 121            }
 122        }
 123
 1124        return ValidationResult.Success();
 0125    }
 126}

Methods/Properties

.ctor()
Validate()