Fix build and code structure improvements. New but essential UI functionality. CI improvements. Documentation improvements. AI module improvements.
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
using System.Collections.Concurrent;
|
||||
using System.Diagnostics;
|
||||
using System.Text.Json;
|
||||
using System.Text.Json.Nodes;
|
||||
using StellaOps.Findings.Ledger.Domain;
|
||||
@@ -32,7 +34,6 @@ public sealed class HarnessRunner
|
||||
var hashesValid = true;
|
||||
DateTimeOffset? earliest = null;
|
||||
DateTimeOffset? latest = null;
|
||||
var latencies = new List<double>();
|
||||
var leafHashes = new List<string>();
|
||||
string? expectedMerkleRoot = null;
|
||||
var latencies = new ConcurrentBag<double>();
|
||||
@@ -139,8 +140,7 @@ public sealed class HarnessRunner
|
||||
{
|
||||
await using var stream = File.OpenRead(path);
|
||||
using var reader = new StreamReader(stream);
|
||||
string? line;
|
||||
while (!reader.EndOfStream && !cancellationToken.IsCancellationRequested && (line = await reader.ReadLineAsync()) is not null)
|
||||
while (!cancellationToken.IsCancellationRequested && await reader.ReadLineAsync() is { } line)
|
||||
{
|
||||
yield return line;
|
||||
}
|
||||
|
||||
@@ -9,6 +9,6 @@
|
||||
<ProjectReference Include="..\\..\\StellaOps.Findings.Ledger\\StellaOps.Findings.Ledger.csproj" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="System.CommandLine" Version="2.0.0-beta4.22272.1" />
|
||||
<PackageReference Include="System.CommandLine" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
|
||||
@@ -1,22 +1,47 @@
|
||||
using System.CommandLine;
|
||||
using LedgerReplayHarness;
|
||||
|
||||
var fixtureOption = new Option<string[]>("--fixture", "NDJSON fixture path(s)") { IsRequired = true, AllowMultipleArgumentsPerToken = true };
|
||||
var tenantOption = new Option<string>("--tenant", () => "default", "Tenant identifier");
|
||||
var reportOption = new Option<string>("--report", () => "harness-report.json", "Path to write JSON report");
|
||||
var parallelOption = new Option<int>("--maxParallel", () => 4, "Maximum parallelism when sending events");
|
||||
var fixtureOption = new Option<string[]>("--fixture")
|
||||
{
|
||||
Description = "NDJSON fixture path(s)",
|
||||
Required = true,
|
||||
AllowMultipleArgumentsPerToken = true
|
||||
};
|
||||
|
||||
var tenantOption = new Option<string>("--tenant")
|
||||
{
|
||||
Description = "Tenant identifier",
|
||||
DefaultValueFactory = _ => "default"
|
||||
};
|
||||
|
||||
var reportOption = new Option<string>("--report")
|
||||
{
|
||||
Description = "Path to write JSON report",
|
||||
DefaultValueFactory = _ => "harness-report.json"
|
||||
};
|
||||
|
||||
var parallelOption = new Option<int>("--maxParallel")
|
||||
{
|
||||
Description = "Maximum parallelism when sending events",
|
||||
DefaultValueFactory = _ => 4
|
||||
};
|
||||
|
||||
var root = new RootCommand("Findings Ledger replay & determinism harness");
|
||||
root.AddOption(fixtureOption);
|
||||
root.AddOption(tenantOption);
|
||||
root.AddOption(reportOption);
|
||||
root.AddOption(parallelOption);
|
||||
root.Add(fixtureOption);
|
||||
root.Add(tenantOption);
|
||||
root.Add(reportOption);
|
||||
root.Add(parallelOption);
|
||||
|
||||
root.SetHandler(async (fixtures, tenant, report, maxParallel) =>
|
||||
root.SetAction(async (parseResult, ct) =>
|
||||
{
|
||||
var runner = new HarnessRunner(new InMemoryLedgerClient(), maxParallel);
|
||||
var exitCode = await runner.RunAsync(fixtures, tenant, report, CancellationToken.None);
|
||||
Environment.Exit(exitCode);
|
||||
}, fixtureOption, tenantOption, reportOption, parallelOption);
|
||||
var fixtures = parseResult.GetValue(fixtureOption)!;
|
||||
var tenant = parseResult.GetValue(tenantOption)!;
|
||||
var report = parseResult.GetValue(reportOption)!;
|
||||
var maxParallel = parseResult.GetValue(parallelOption);
|
||||
|
||||
return await root.InvokeAsync(args);
|
||||
var runner = new HarnessRunner(new InMemoryLedgerClient(), maxParallel);
|
||||
var exitCode = await runner.RunAsync(fixtures, tenant, report, ct);
|
||||
return exitCode;
|
||||
});
|
||||
|
||||
return await root.Parse(args).InvokeAsync();
|
||||
|
||||
Reference in New Issue
Block a user