< Summary

Information
Class: Orchestrator.Program
Assembly: Orchestrator
File(s): /home/runner/work/KicktippAi/KicktippAi/src/Orchestrator/Program.cs
Line coverage
0%
Covered lines: 0
Uncovered lines: 120
Coverable lines: 120
Total lines: 155
Line coverage: 0%
Branch coverage
0%
Covered branches: 0
Total branches: 8
Branch coverage: 0%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
Main()0%620%

File(s)

/home/runner/work/KicktippAi/KicktippAi/src/Orchestrator/Program.cs

#LineLine coverage
 1using Microsoft.Extensions.DependencyInjection;
 2using Spectre.Console;
 3using Spectre.Console.Cli;
 4using Orchestrator.Commands.Operations.Matchday;
 5using Orchestrator.Commands.Operations.Bonus;
 6using Orchestrator.Commands.Operations.CollectContext;
 7using Orchestrator.Commands.Operations.Verify;
 8using Orchestrator.Commands.Observability.AnalyzeMatch;
 9using Orchestrator.Commands.Observability.ContextChanges;
 10using Orchestrator.Commands.Observability.Cost;
 11using Orchestrator.Commands.Utility.UploadKpi;
 12using Orchestrator.Commands.Utility.UploadTransfers;
 13using Orchestrator.Commands.Utility.ListKpi;
 14using Orchestrator.Commands.Utility.Snapshots;
 15using Orchestrator.Infrastructure;
 16
 17namespace Orchestrator;
 18
 19public class Program
 20{
 21    public static async Task<int> Main(string[] args)
 22    {
 23        // Load environment variables once at startup
 024        var startupLogger = LoggingConfiguration.CreateLogger<Program>();
 025        EnvironmentHelper.LoadEnvironmentVariables(startupLogger);
 26
 27        // Dependency Injection setup follows Spectre.Console.Cli patterns:
 28        // - Tutorial: https://github.com/spectreconsole/website/blob/main/Spectre.Docs/Content/cli/tutorials/dependency
 29        // - Testing: https://github.com/spectreconsole/website/blob/main/Spectre.Docs/Content/cli/how-to/testing-comman
 030        var services = new ServiceCollection();
 31
 32        // Register IAnsiConsole for dependency injection into commands
 033        services.AddSingleton<IAnsiConsole>(AnsiConsole.Console);
 34
 35        // Register all command services (factories and shared infrastructure)
 036        services.AddAllCommandServices();
 37
 038        var registrar = new TypeRegistrar(services);
 039        var app = new CommandApp(registrar);
 40
 041        app.Configure(config =>
 042        {
 043            config.SetApplicationName("Orchestrator");
 044            config.SetApplicationVersion("1.0.0");
 045
 046            config.AddCommand<MatchdayCommand>("matchday")
 047                .WithDescription("Generate predictions for the current matchday")
 048                .WithExample("matchday", "gpt-4o-2024-08-06", "--community", "ehonda-test-buli");
 049
 050            config.AddBranch("analyze-match", analyzeMatch =>
 051            {
 052                analyzeMatch.SetDescription("Analyze prediction distributions for a single match without persisting resu
 053
 054                analyzeMatch.AddCommand<AnalyzeMatchDetailedCommand>("detailed")
 055                    .WithDescription("Detailed analysis with justification output and live estimates")
 056                    .WithExample(
 057                        "analyze-match",
 058                        "detailed",
 059                        "gpt-5-nano",
 060                        "--community-context",
 061                        "ehonda-test-buli",
 062                        "--home",
 063                        "FC Bayern München",
 064                        "--away",
 065                        "RB Leipzig",
 066                        "--matchday",
 067                        "1",
 068                        "--runs",
 069                        "5");
 070
 071                analyzeMatch.AddCommand<AnalyzeMatchComparisonCommand>("comparison")
 072                    .WithDescription("Compare predictions generated with and without justification")
 073                    .WithExample(
 074                        "analyze-match",
 075                        "comparison",
 076                        "gpt-5-nano",
 077                        "--community-context",
 078                        "ehonda-test-buli",
 079                        "--home",
 080                        "FC Bayern München",
 081                        "--away",
 082                        "RB Leipzig",
 083                        "--matchday",
 084                        "1",
 085                        "--runs",
 086                        "5");
 087            });
 088
 089            config.AddCommand<BonusCommand>("bonus")
 090                .WithDescription("Generate bonus predictions")
 091                .WithExample("bonus", "gpt-4o-2024-08-06", "--community", "ehonda-test-buli");
 092
 093            config.AddBranch<CollectContextSettings>("collect-context", collectContext =>
 094            {
 095                collectContext.SetDescription("Collect context documents and store them in database");
 096                collectContext.AddCommand<CollectContextKicktippCommand>("kicktipp")
 097                    .WithDescription("Collect context from Kicktipp")
 098                    .WithExample("collect-context", "kicktipp", "--community", "ehonda-test-buli", "--community-context"
 099            });
 0100
 0101            config.AddCommand<VerifyMatchdayCommand>("verify")
 0102                .WithDescription("Verify that database predictions have been successfully posted to Kicktipp")
 0103                .WithExample("verify", "--community", "ehonda-test-buli");
 0104
 0105            config.AddCommand<VerifyBonusCommand>("verify-bonus")
 0106                .WithDescription("Verify that database bonus predictions are valid and complete")
 0107                .WithExample("verify-bonus", "--community", "ehonda-test-buli");
 0108
 0109            config.AddCommand<UploadKpiCommand>("upload-kpi")
 0110                .WithDescription("Upload a KPI context document to Firebase")
 0111                .WithExample("upload-kpi", "team-data", "--community", "ehonda-test-buli");
 0112
 0113            config.AddCommand<UploadTransfersCommand>("upload-transfers")
 0114                .WithDescription("Upload a transfers context document to Firebase (team transfers CSV)")
 0115                .WithExample("upload-transfers", "fcb", "--community-context", "ehonda-test-buli");
 0116
 0117            config.AddCommand<ListKpiCommand>("list-kpi")
 0118                .WithDescription("List KPI context documents from Firebase")
 0119                .WithExample("list-kpi", "--community", "ehonda-test-buli");
 0120
 0121            config.AddCommand<ContextChangesCommand>("context-changes")
 0122                .WithDescription("Show changes between latest and previous versions of context documents")
 0123                .WithExample("context-changes", "--community-context", "ehonda-test-buli", "--count", "5")
 0124                .WithExample("context-changes", "--community-context", "ehonda-test-buli", "--seed", "42");
 0125
 0126            config.AddCommand<CostCommand>("cost")
 0127                .WithDescription("Calculate aggregate costs for predictions")
 0128                .WithExample("cost", "--all")
 0129                .WithExample("cost", "--matchdays", "1,2,3")
 0130                .WithExample("cost", "--models", "gpt-4o,o1-mini", "--bonus");
 0131
 0132            config.AddBranch("snapshots", snapshots =>
 0133            {
 0134                snapshots.SetDescription("Generate and encrypt HTML snapshots from Kicktipp for test fixtures");
 0135
 0136                snapshots.AddCommand<SnapshotsFetchCommand>("fetch")
 0137                    .WithDescription("Fetch HTML snapshots from Kicktipp")
 0138                    .WithExample("snapshots", "fetch", "--community", "ehonda-test-buli")
 0139                    .WithExample("snapshots", "fetch", "--community", "ehonda-test-buli", "--output", "my-snapshots");
 0140
 0141                snapshots.AddCommand<SnapshotsEncryptCommand>("encrypt")
 0142                    .WithDescription("Encrypt HTML snapshots for safe committing")
 0143                    .WithExample("snapshots", "encrypt")
 0144                    .WithExample("snapshots", "encrypt", "--input", "my-snapshots", "--output", "tests/KicktippIntegrati
 0145
 0146                snapshots.AddCommand<SnapshotsAllCommand>("all")
 0147                    .WithDescription("Fetch and encrypt snapshots in one step")
 0148                    .WithExample("snapshots", "all", "--community", "ehonda-test-buli")
 0149                    .WithExample("snapshots", "all", "--community", "ehonda-test-buli", "--keep-originals");
 0150            });
 0151        });
 152
 0153        return await app.RunAsync(args);
 0154    }
 155}

Methods/Properties

Main()