Fix build and code structure improvements. New but essential UI functionality. CI improvements. Documentation improvements. AI module improvements.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
using System.Security.Cryptography;
|
||||
using System.Security.Cryptography;
|
||||
using System.Text.Json;
|
||||
using FluentAssertions;
|
||||
using Xunit;
|
||||
@@ -74,7 +74,6 @@ public class CorpusFixtureTests
|
||||
File.Exists(truthPath).Should().BeTrue($"{id} missing ground-truth.json");
|
||||
|
||||
using var truthDoc = JsonDocument.Parse(File.ReadAllBytes(truthPath));
|
||||
using StellaOps.TestKit;
|
||||
truthDoc.RootElement.GetProperty("schema_version").GetString().Should().Be(expectedSchemaVersion, $"{id} ground-truth schema_version mismatch");
|
||||
truthDoc.RootElement.GetProperty("case_id").GetString().Should().Be(id, $"{id} ground-truth case_id must match manifest id");
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
using System.Text.Json;
|
||||
using System.Text.Json;
|
||||
using FluentAssertions;
|
||||
using Xunit;
|
||||
|
||||
@@ -52,7 +52,6 @@ public sealed class FixtureCoverageTests
|
||||
File.Exists(manifestPath).Should().BeTrue($"{manifestPath} should exist");
|
||||
|
||||
using var doc = JsonDocument.Parse(File.ReadAllBytes(manifestPath));
|
||||
using StellaOps.TestKit;
|
||||
return doc.RootElement.EnumerateArray()
|
||||
.Select(entry => $"{entry.GetProperty("language").GetString()}/{entry.GetProperty("id").GetString()}")
|
||||
.ToArray();
|
||||
|
||||
@@ -148,7 +148,7 @@ public sealed class ReachabilityLifterTests : IDisposable
|
||||
// Assert
|
||||
graph.Nodes.Should().Contain(n => n.Display == "express");
|
||||
graph.Nodes.Should().Contain(n => n.Display == "lodash");
|
||||
graph.Edges.Count(e => e.EdgeType == "import").Should().BeGreaterOrEqualTo(2);
|
||||
graph.Edges.Count(e => e.EdgeType == "import").Should().BeGreaterThanOrEqualTo(2);
|
||||
}
|
||||
|
||||
[Trait("Category", TestCategories.Unit)]
|
||||
@@ -191,7 +191,7 @@ public sealed class ReachabilityLifterTests : IDisposable
|
||||
graph.Nodes.Should().Contain(n => n.Kind == "namespace" && n.Display == "MyCompany.MyApp");
|
||||
|
||||
graph.Edges.Should().NotBeEmpty();
|
||||
graph.Edges.Count(e => e.EdgeType == "import").Should().BeGreaterOrEqualTo(2);
|
||||
graph.Edges.Count(e => e.EdgeType == "import").Should().BeGreaterThanOrEqualTo(2);
|
||||
}
|
||||
|
||||
[Trait("Category", TestCategories.Unit)]
|
||||
@@ -281,7 +281,7 @@ public sealed class ReachabilityLifterTests : IDisposable
|
||||
var graph = await registry.LiftAllAsync(context, CancellationToken.None);
|
||||
|
||||
// Assert
|
||||
registry.Lifters.Should().HaveCountGreaterOrEqualTo(2);
|
||||
registry.Lifters.Should().HaveCountGreaterThanOrEqualTo(2);
|
||||
graph.Nodes.Should().Contain(n => n.Lang == "node");
|
||||
graph.Nodes.Should().Contain(n => n.Lang == "dotnet");
|
||||
}
|
||||
@@ -397,7 +397,7 @@ public sealed class ReachabilityLifterTests : IDisposable
|
||||
edgeType: EdgeTypes.Call,
|
||||
confidence: EdgeConfidence.High,
|
||||
origin: "static",
|
||||
provenance: Provenance.Il,
|
||||
provenance: StellaOps.Scanner.Reachability.Provenance.Il,
|
||||
evidence: "file:src/main.cs:100");
|
||||
|
||||
var graph = builder.ToUnionGraph("test");
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
using System.Text.Json;
|
||||
using System.Text.Json;
|
||||
using FluentAssertions;
|
||||
using Xunit;
|
||||
|
||||
@@ -66,7 +66,6 @@ public class ReachbenchEvaluationHarnessTests
|
||||
File.Exists(truthPath).Should().BeTrue();
|
||||
|
||||
using var truthDoc = JsonDocument.Parse(File.ReadAllBytes(truthPath));
|
||||
using StellaOps.TestKit;
|
||||
var paths = truthDoc.RootElement.GetProperty("paths");
|
||||
paths.ValueKind.Should().Be(JsonValueKind.Array, $"{caseId}:{variant} should list truth paths as an array");
|
||||
return paths.GetArrayLength();
|
||||
|
||||
@@ -39,7 +39,7 @@ public class ReachbenchFixtureTests
|
||||
|
||||
found.Should().BeTrue($"INDEX.json should contain 'cases'. Properties present: {string.Join(",", names)}");
|
||||
casesElement.ValueKind.Should().Be(JsonValueKind.Array);
|
||||
casesElement.GetArrayLength().Should().BeGreaterOrEqualTo(20, "expanded pack should carry broad coverage");
|
||||
casesElement.GetArrayLength().Should().BeGreaterThanOrEqualTo(20, "expanded pack should carry broad coverage");
|
||||
|
||||
foreach (var entry in casesElement.EnumerateArray())
|
||||
{
|
||||
@@ -148,7 +148,6 @@ public class ReachbenchFixtureTests
|
||||
var manifestPath = Path.Combine(variantPath, "manifest.json");
|
||||
using var manifestStream = File.OpenRead(manifestPath);
|
||||
using var manifestDoc = JsonDocument.Parse(manifestStream);
|
||||
using StellaOps.TestKit;
|
||||
var files = manifestDoc.RootElement.GetProperty("files");
|
||||
|
||||
foreach (var file in requiredFiles.Where(f => f != "manifest.json"))
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
using System.Security.Cryptography;
|
||||
using System.Security.Cryptography;
|
||||
using System.Text.Json;
|
||||
using FluentAssertions;
|
||||
using Xunit;
|
||||
@@ -30,7 +30,6 @@ public class SamplesPublicFixtureTests
|
||||
|
||||
using var stream = File.OpenRead(manifestPath);
|
||||
using var doc = JsonDocument.Parse(stream);
|
||||
using StellaOps.TestKit;
|
||||
doc.RootElement.ValueKind.Should().Be(JsonValueKind.Array);
|
||||
|
||||
var keys = doc.RootElement.EnumerateArray()
|
||||
|
||||
@@ -7,14 +7,13 @@
|
||||
<IsPackable>false</IsPackable>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.10.0" />
|
||||
<PackageReference Include="xunit" Version="2.7.0" />
|
||||
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.8">
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" />
|
||||
<PackageReference Include="xunit" />
|
||||
<PackageReference Include="xunit.runner.visualstudio" >
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
</PackageReference>
|
||||
<PackageReference Include="FluentAssertions" Version="6.12.0" />
|
||||
<PackageReference Include="System.Text.Json" Version="10.0.0" />
|
||||
<PackageReference Include="FluentAssertions" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="..\\..\\fixtures\\**\\*">
|
||||
@@ -23,8 +22,8 @@
|
||||
</Content>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\Scanner\__Libraries\StellaOps.Scanner.Reachability\StellaOps.Scanner.Reachability.csproj" />
|
||||
<ProjectReference Include="..\..\__Libraries\StellaOps.Replay.Core\StellaOps.Replay.Core.csproj" />
|
||||
<ProjectReference Include="..\..\..\Scanner\__Libraries\StellaOps.Scanner.Reachability\StellaOps.Scanner.Reachability.csproj" />
|
||||
<ProjectReference Include="..\..\..\__Libraries\StellaOps.Replay.Core\StellaOps.Replay.Core.csproj" />
|
||||
<ProjectReference Include="../../../__Libraries/StellaOps.TestKit/StellaOps.TestKit.csproj" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using System.Text;
|
||||
using FluentAssertions;
|
||||
using StellaOps.Cryptography;
|
||||
using StellaOps.Replay.Core;
|
||||
using Xunit;
|
||||
|
||||
@@ -8,11 +9,13 @@ namespace StellaOps.Replay.Core.Tests;
|
||||
|
||||
public sealed class DeterministicHashTests
|
||||
{
|
||||
private readonly ICryptoHash _cryptoHash = DefaultCryptoHash.CreateForTests();
|
||||
|
||||
[Trait("Category", TestCategories.Unit)]
|
||||
[Fact]
|
||||
public void Sha256Hex_ComputesLowercaseDigest()
|
||||
{
|
||||
var digest = DeterministicHash.Sha256Hex("replay-core");
|
||||
var digest = DeterministicHash.Sha256Hex(_cryptoHash, "replay-core");
|
||||
|
||||
digest.Should().Be("a914f5ac6a57aab0189bb55bcb0ef6bcdbd86f77198c8669eab5ae38a325e41d");
|
||||
}
|
||||
@@ -25,9 +28,9 @@ public sealed class DeterministicHashTests
|
||||
.Select(Encoding.UTF8.GetBytes)
|
||||
.ToList();
|
||||
|
||||
var root = DeterministicHash.MerkleRootHex(leaves);
|
||||
var root = DeterministicHash.MerkleRootHex(_cryptoHash, leaves);
|
||||
|
||||
root.Should().Be("50298939464ed02cbf2b587250a55746b3422e133ac4f09b7e2b07869023bc9e");
|
||||
DeterministicHash.MerkleRootHex(leaves).Should().Be(root);
|
||||
DeterministicHash.MerkleRootHex(_cryptoHash, leaves).Should().Be(root);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using System;
|
||||
using System.Text;
|
||||
using FluentAssertions;
|
||||
using StellaOps.Cryptography;
|
||||
using StellaOps.Replay.Core;
|
||||
using Xunit;
|
||||
|
||||
@@ -31,6 +32,9 @@ public sealed class DsseEnvelopeTests
|
||||
var json = Encoding.UTF8.GetString(payload);
|
||||
|
||||
json.Should().Be("{\"reachability\":{\"graphs\":[],\"runtimeTraces\":[]},\"scan\":{\"id\":\"scan-123\",\"time\":\"1970-01-01T00:00:00+00:00\"},\"schemaVersion\":\"1.0\"}");
|
||||
envelope.DigestSha256.Should().Be(DeterministicHash.Sha256Hex(payload));
|
||||
|
||||
var cryptoHash = DefaultCryptoHash.CreateForTests();
|
||||
var expectedDigest = DeterministicHash.Sha256Hex(cryptoHash, payload);
|
||||
envelope.ComputeDigestSha256(cryptoHash).Should().Be(expectedDigest);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ using System.Collections.Generic;
|
||||
using System.Formats.Tar;
|
||||
using System.IO;
|
||||
using FluentAssertions;
|
||||
using StellaOps.Cryptography;
|
||||
using StellaOps.Replay.Core;
|
||||
using ZstdSharp;
|
||||
using Xunit;
|
||||
@@ -12,8 +13,10 @@ namespace StellaOps.Replay.Core.Tests;
|
||||
|
||||
public sealed class ReplayBundleWriterTests
|
||||
{
|
||||
private readonly ICryptoHash _cryptoHash = DefaultCryptoHash.CreateForTests();
|
||||
|
||||
[Trait("Category", TestCategories.Unit)]
|
||||
[Fact]
|
||||
[Fact]
|
||||
public async Task WriteTarZstAsync_IsDeterministicAndSorted()
|
||||
{
|
||||
var entries = new[]
|
||||
@@ -23,12 +26,12 @@ public sealed class ReplayBundleWriterTests
|
||||
};
|
||||
|
||||
await using var buffer = new MemoryStream();
|
||||
var first = await ReplayBundleWriter.WriteTarZstAsync(entries, buffer, compressionLevel: 3);
|
||||
var first = await ReplayBundleWriter.WriteTarZstAsync(_cryptoHash, entries, buffer, compressionLevel: 3);
|
||||
|
||||
var firstBytes = buffer.ToArray();
|
||||
|
||||
await using var buffer2 = new MemoryStream();
|
||||
var second = await ReplayBundleWriter.WriteTarZstAsync(entries.Reverse(), buffer2, compressionLevel: 3);
|
||||
var second = await ReplayBundleWriter.WriteTarZstAsync(_cryptoHash, entries.Reverse(), buffer2, compressionLevel: 3);
|
||||
|
||||
first.ZstSha256.Should().Be(second.ZstSha256);
|
||||
first.TarSha256.Should().Be(second.TarSha256);
|
||||
@@ -37,7 +40,7 @@ public sealed class ReplayBundleWriterTests
|
||||
// Decompress and verify ordering/content
|
||||
buffer.Position = 0;
|
||||
await using var decompressed = new MemoryStream();
|
||||
await using (var decompress = new DecompressionStream(buffer, 16 * 1024, leaveOpen: true, enableMultiThreaded: false))
|
||||
await using (var decompress = new DecompressionStream(buffer, 16 * 1024, leaveOpen: true))
|
||||
{
|
||||
await decompress.CopyToAsync(decompressed);
|
||||
}
|
||||
@@ -50,7 +53,6 @@ public sealed class ReplayBundleWriterTests
|
||||
{
|
||||
names.Add(entry.Name);
|
||||
using var ms = new MemoryStream();
|
||||
using StellaOps.TestKit;
|
||||
entry.DataStream!.CopyTo(ms);
|
||||
var text = System.Text.Encoding.UTF8.GetString(ms.ToArray());
|
||||
text.Should().Be(entry.Name.StartsWith("a") ? "alpha" : "beta");
|
||||
|
||||
@@ -7,16 +7,11 @@
|
||||
<IsPackable>false</IsPackable>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.10.0" />
|
||||
<PackageReference Include="xunit" Version="2.7.0" />
|
||||
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.8">
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
</PackageReference>
|
||||
<PackageReference Include="FluentAssertions" Version="6.12.0" />
|
||||
<PackageReference Include="FluentAssertions" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="../../__Libraries/StellaOps.Replay.Core/StellaOps.Replay.Core.csproj" />
|
||||
<ProjectReference Include="../../../__Libraries/StellaOps.Replay.Core/StellaOps.Replay.Core.csproj" />
|
||||
<ProjectReference Include="../../../__Libraries/StellaOps.Cryptography/StellaOps.Cryptography.csproj" />
|
||||
<ProjectReference Include="../../../__Libraries/StellaOps.TestKit/StellaOps.TestKit.csproj" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
</Project>
|
||||
@@ -1,4 +1,4 @@
|
||||
using System;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
@@ -330,7 +330,6 @@ public sealed class ScannerToSignalsReachabilityTests
|
||||
if (request.ManifestContent is not null)
|
||||
{
|
||||
await using var manifestBuffer = new MemoryStream();
|
||||
using StellaOps.TestKit;
|
||||
await request.ManifestContent.CopyToAsync(manifestBuffer, cancellationToken).ConfigureAwait(false);
|
||||
manifests[computedHash] = manifestBuffer.ToArray();
|
||||
}
|
||||
|
||||
@@ -7,19 +7,19 @@
|
||||
<IsPackable>false</IsPackable>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.10.0" />
|
||||
<PackageReference Include="xunit" Version="2.7.0" />
|
||||
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.8">
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" />
|
||||
<PackageReference Include="xunit" />
|
||||
<PackageReference Include="xunit.runner.visualstudio" >
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
</PackageReference>
|
||||
<PackageReference Include="FluentAssertions" Version="6.12.0" />
|
||||
<PackageReference Include="FluentAssertions" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="../../Signals/StellaOps.Signals/StellaOps.Signals.csproj" />
|
||||
<ProjectReference Include="../../Scanner/__Libraries/StellaOps.Scanner.Reachability/StellaOps.Scanner.Reachability.csproj" />
|
||||
<ProjectReference Include="../../Scanner/__Libraries/StellaOps.Scanner.ReachabilityDrift/StellaOps.Scanner.ReachabilityDrift.csproj" />
|
||||
<ProjectReference Include="../../Scanner/__Libraries/StellaOps.Scanner.CallGraph/StellaOps.Scanner.CallGraph.csproj" />
|
||||
<ProjectReference Include="../../../Signals/StellaOps.Signals/StellaOps.Signals.csproj" />
|
||||
<ProjectReference Include="../../../Scanner/__Libraries/StellaOps.Scanner.Reachability/StellaOps.Scanner.Reachability.csproj" />
|
||||
<ProjectReference Include="../../../Scanner/__Libraries/StellaOps.Scanner.ReachabilityDrift/StellaOps.Scanner.ReachabilityDrift.csproj" />
|
||||
<ProjectReference Include="../../../Scanner/__Libraries/StellaOps.Scanner.CallGraph/StellaOps.Scanner.CallGraph.csproj" />
|
||||
<ProjectReference Include="../../../__Libraries/StellaOps.TestKit/StellaOps.TestKit.csproj" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
using System;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
@@ -145,7 +145,6 @@ public sealed class ReachabilityScoringTests
|
||||
}
|
||||
|
||||
using var doc = JsonDocument.Parse(line);
|
||||
using StellaOps.TestKit;
|
||||
if (doc.RootElement.TryGetProperty("sid", out var sidProp))
|
||||
{
|
||||
runtimeHits.Add(sidProp.GetString()!);
|
||||
|
||||
@@ -5,6 +5,7 @@ using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using FluentAssertions;
|
||||
using StellaOps.Signals.Parsing;
|
||||
using StellaOps.TestKit;
|
||||
using Xunit;
|
||||
|
||||
namespace StellaOps.Signals.Reachability.Tests;
|
||||
@@ -42,7 +43,6 @@ public sealed class RuntimeFactsNdjsonReaderTests
|
||||
await using (var writer = new StreamWriter(gzip, Encoding.UTF8, leaveOpen: true))
|
||||
{
|
||||
await writer.WriteAsync(ndjson);
|
||||
using StellaOps.TestKit;
|
||||
}
|
||||
|
||||
compressed.Position = 0;
|
||||
|
||||
@@ -7,17 +7,10 @@
|
||||
<IsPackable>false</IsPackable>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.10.0" />
|
||||
<PackageReference Include="Microsoft.Extensions.TimeProvider.Testing" Version="8.6.0" />
|
||||
<PackageReference Include="xunit" Version="2.7.0" />
|
||||
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.8">
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
</PackageReference>
|
||||
<PackageReference Include="FluentAssertions" Version="6.12.0" />
|
||||
<PackageReference Include="FluentAssertions" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="../../Signals/StellaOps.Signals/StellaOps.Signals.csproj" />
|
||||
<ProjectReference Include="../../../Signals/StellaOps.Signals/StellaOps.Signals.csproj" />
|
||||
<ProjectReference Include="../../../__Libraries/StellaOps.TestKit/StellaOps.TestKit.csproj" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
@@ -26,4 +19,4 @@
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
</Project>
|
||||
Reference in New Issue
Block a user