| | | 1 | | using System.ComponentModel; |
| | | 2 | | using Spectre.Console; |
| | | 3 | | using Spectre.Console.Cli; |
| | | 4 | | |
| | | 5 | | namespace Orchestrator.Commands.Observability.ExportExperimentAnalysis; |
| | | 6 | | |
| | | 7 | | public sealed class PublishExperimentAnalysisSettings : CommandSettings |
| | | 8 | | { |
| | | 9 | | [CommandOption("--input")] |
| | | 10 | | [Description("Path to a normalized experiment analysis bundle JSON file")] |
| | 1 | 11 | | public string InputPath { get; set; } = string.Empty; |
| | | 12 | | |
| | | 13 | | [CommandOption("--experiment-name")] |
| | | 14 | | [Description("Optional stable experiment name to attach to all published runs")] |
| | | 15 | | public string? ExperimentName { get; set; } |
| | | 16 | | |
| | | 17 | | [CommandOption("--run-name-suffix")] |
| | | 18 | | [Description("Suffix appended to source run names when creating beta UI aliases")] |
| | | 19 | | [DefaultValue("__experiments-beta")] |
| | 1 | 20 | | public string RunNameSuffix { get; set; } = "__experiments-beta"; |
| | | 21 | | |
| | | 22 | | [CommandOption("--description")] |
| | | 23 | | [Description("Optional description for the published Langfuse dataset runs")] |
| | | 24 | | public string? Description { get; set; } |
| | | 25 | | |
| | | 26 | | [CommandOption("--replace-runs")] |
| | | 27 | | [Description("Delete existing published alias runs before recreating them")] |
| | | 28 | | public bool ReplaceRuns { get; set; } |
| | | 29 | | |
| | | 30 | | [CommandOption("--dry-run")] |
| | | 31 | | [Description("Print the runs that would be published without writing to Langfuse")] |
| | | 32 | | public bool DryRun { get; set; } |
| | | 33 | | |
| | | 34 | | public override ValidationResult Validate() |
| | | 35 | | { |
| | 1 | 36 | | if (string.IsNullOrWhiteSpace(InputPath)) |
| | | 37 | | { |
| | 0 | 38 | | return ValidationResult.Error("--input is required"); |
| | | 39 | | } |
| | | 40 | | |
| | 1 | 41 | | if (!File.Exists(InputPath)) |
| | | 42 | | { |
| | 0 | 43 | | return ValidationResult.Error($"Input file does not exist: {InputPath}"); |
| | | 44 | | } |
| | | 45 | | |
| | 1 | 46 | | if (string.IsNullOrWhiteSpace(RunNameSuffix)) |
| | | 47 | | { |
| | 0 | 48 | | return ValidationResult.Error("--run-name-suffix must be non-empty so existing dataset runs are not modified |
| | | 49 | | } |
| | | 50 | | |
| | 1 | 51 | | return ValidationResult.Success(); |
| | | 52 | | } |
| | | 53 | | } |