sln build fix (again), tests fixes, audit work and doctors work

This commit is contained in:
master
2026-01-12 22:15:51 +02:00
parent 9873f80830
commit 9330c64349
812 changed files with 48051 additions and 3891 deletions

View File

@@ -1,7 +1,7 @@
# Evidence Locker Core Task Board
This board mirrors active sprint tasks for this module.
Source of truth: `docs/implplan/SPRINT_20251229_049_BE_csproj_audit_maint_tests.md`.
Source of truth: `docs-archived/implplan/2025-12-29-csproj-audit/SPRINT_20251229_049_BE_csproj_audit_maint_tests.md`.
| Task ID | Status | Notes |
| --- | --- | --- |

View File

@@ -73,6 +73,9 @@ internal sealed class FileSystemEvidenceObjectStore : IEvidenceObjectStore
Directory.CreateDirectory(Path.GetDirectoryName(destinationPath)!);
// Close the temp file before moving to avoid "file in use" errors
await tempStream.DisposeAsync();
if (writeOnce && File.Exists(destinationPath))
{
await DeleteTempFileAsync(tempFilePath);

View File

@@ -1,7 +1,7 @@
# Evidence Locker Infrastructure Task Board
This board mirrors active sprint tasks for this module.
Source of truth: `docs/implplan/SPRINT_20251229_049_BE_csproj_audit_maint_tests.md`.
Source of truth: `docs-archived/implplan/2025-12-29-csproj-audit/SPRINT_20251229_049_BE_csproj_audit_maint_tests.md`.
| Task ID | Status | Notes |
| --- | --- | --- |

View File

@@ -34,7 +34,7 @@ public sealed class DatabaseMigrationTests : IAsyncLifetime
.Build();
}
[Trait("Category", TestCategories.Unit)]
[Trait("Category", TestCategories.Integration)]
[Fact]
public async Task ApplyAsync_CreatesExpectedSchemaAndPolicies()
{

View File

@@ -1,8 +1,8 @@
// -----------------------------------------------------------------------------
// -----------------------------------------------------------------------------
// EvidenceLockerIntegrationTests.cs
// Sprint: SPRINT_5100_0010_0001_evidencelocker_tests
// Task: EVIDENCE-5100-007
// Description: Integration test: store artifact → retrieve artifact → verify hash matches
// Description: Integration test: store artifact retrieve artifact verify hash matches
// -----------------------------------------------------------------------------
using System.Net;
@@ -20,7 +20,7 @@ namespace StellaOps.EvidenceLocker.Tests;
/// <summary>
/// Integration Tests for EvidenceLocker
/// Task EVIDENCE-5100-007: store artifact → retrieve artifact → verify hash matches
/// Task EVIDENCE-5100-007: store artifact retrieve artifact verify hash matches
/// </summary>
public sealed class EvidenceLockerIntegrationTests : IDisposable
{
@@ -34,9 +34,9 @@ public sealed class EvidenceLockerIntegrationTests : IDisposable
_client = _factory.CreateClient();
}
#region EVIDENCE-5100-007: Store â Retrieve â Verify Hash
#region EVIDENCE-5100-007: Store Retrieve Verify Hash
[Trait("Category", TestCategories.Unit)]
[Trait("Category", TestCategories.Integration)]
[Fact]
public async Task StoreArtifact_ThenRetrieve_HashMatches()
{
@@ -97,7 +97,7 @@ public sealed class EvidenceLockerIntegrationTests : IDisposable
retrievedRootHash.Should().Be(storedRootHash, "Root hash should match between store and retrieve");
}
[Trait("Category", TestCategories.Unit)]
[Trait("Category", TestCategories.Integration)]
[Fact]
public async Task StoreArtifact_ThenDownload_ContainsCorrectManifest()
{
@@ -137,7 +137,7 @@ public sealed class EvidenceLockerIntegrationTests : IDisposable
manifestDoc.RootElement.GetProperty("bundleId").GetString().Should().Be(bundleId);
}
[Trait("Category", TestCategories.Unit)]
[Trait("Category", TestCategories.Integration)]
[Fact]
public async Task StoreMultipleArtifacts_EachHasUniqueHash()
{
@@ -185,7 +185,7 @@ public sealed class EvidenceLockerIntegrationTests : IDisposable
hashes.Should().OnlyHaveUniqueItems("Each bundle should have a unique root hash");
}
[Trait("Category", TestCategories.Unit)]
[Trait("Category", TestCategories.Integration)]
[Fact]
public async Task StoreArtifact_SignatureIsValid()
{
@@ -213,7 +213,7 @@ public sealed class EvidenceLockerIntegrationTests : IDisposable
signature.TryGetProperty("timestampToken", out var timestampToken).Should().BeTrue();
}
[Trait("Category", TestCategories.Unit)]
[Trait("Category", TestCategories.Integration)]
[Fact]
public async Task StoreArtifact_ThenRetrieve_MetadataPreserved()
{
@@ -273,7 +273,7 @@ public sealed class EvidenceLockerIntegrationTests : IDisposable
metadataDict["pipelineId"].Should().Be("pipe-123");
}
[Trait("Category", TestCategories.Unit)]
[Trait("Category", TestCategories.Integration)]
[Fact]
public async Task StoreArtifact_TimelineEventEmitted()
{
@@ -304,7 +304,7 @@ public sealed class EvidenceLockerIntegrationTests : IDisposable
#region Portable Bundle Integration
[Trait("Category", TestCategories.Unit)]
[Trait("Category", TestCategories.Integration)]
[Fact]
public async Task StoreArtifact_PortableDownload_IsSanitized()
{

View File

@@ -1,4 +1,4 @@
// -----------------------------------------------------------------------------
// -----------------------------------------------------------------------------
// EvidenceLockerWebServiceContractTests.cs
// Sprint: SPRINT_5100_0010_0001_evidencelocker_tests
// Tasks: EVIDENCE-5100-004, EVIDENCE-5100-005, EVIDENCE-5100-006
@@ -42,7 +42,7 @@ public sealed class EvidenceLockerWebServiceContractTests : IDisposable
#region EVIDENCE-5100-004: Contract Tests (OpenAPI Snapshot)
[Trait("Category", TestCategories.Unit)]
[Trait("Category", TestCategories.Integration)]
[Fact]
public async Task StoreArtifact_Endpoint_Returns_Expected_Schema()
{
@@ -73,7 +73,7 @@ public sealed class EvidenceLockerWebServiceContractTests : IDisposable
signature.ValueKind.Should().Be(JsonValueKind.Object);
}
[Trait("Category", TestCategories.Unit)]
[Trait("Category", TestCategories.Integration)]
[Fact]
public async Task RetrieveArtifact_Endpoint_Returns_Expected_Schema()
{
@@ -108,7 +108,7 @@ public sealed class EvidenceLockerWebServiceContractTests : IDisposable
root.TryGetProperty("createdAt", out _).Should().BeTrue("createdAt should be present");
}
[Trait("Category", TestCategories.Unit)]
[Trait("Category", TestCategories.Integration)]
[Fact]
public async Task DownloadArtifact_Endpoint_Returns_GzipMediaType()
{
@@ -134,7 +134,7 @@ public sealed class EvidenceLockerWebServiceContractTests : IDisposable
response.Content.Headers.ContentType?.MediaType.Should().Be("application/gzip");
}
[Trait("Category", TestCategories.Unit)]
[Trait("Category", TestCategories.Integration)]
[Fact]
public async Task Contract_ErrorResponse_Schema_Is_Consistent()
{
@@ -150,7 +150,7 @@ public sealed class EvidenceLockerWebServiceContractTests : IDisposable
response.StatusCode.Should().Be(HttpStatusCode.Unauthorized);
}
[Trait("Category", TestCategories.Unit)]
[Trait("Category", TestCategories.Integration)]
[Fact]
public async Task Contract_NotFound_Response_Schema()
{
@@ -170,7 +170,7 @@ public sealed class EvidenceLockerWebServiceContractTests : IDisposable
#region EVIDENCE-5100-005: Auth Tests
[Trait("Category", TestCategories.Unit)]
[Trait("Category", TestCategories.Integration)]
[Fact]
public async Task StoreArtifact_Without_Auth_Returns_Unauthorized()
{
@@ -186,7 +186,7 @@ public sealed class EvidenceLockerWebServiceContractTests : IDisposable
response.StatusCode.Should().Be(HttpStatusCode.Unauthorized);
}
[Trait("Category", TestCategories.Unit)]
[Trait("Category", TestCategories.Integration)]
[Fact]
public async Task StoreArtifact_Without_CreateScope_Returns_Forbidden()
{
@@ -204,7 +204,7 @@ public sealed class EvidenceLockerWebServiceContractTests : IDisposable
response.StatusCode.Should().BeOneOf(HttpStatusCode.Forbidden, HttpStatusCode.Unauthorized);
}
[Trait("Category", TestCategories.Unit)]
[Trait("Category", TestCategories.Integration)]
[Fact]
public async Task StoreArtifact_With_CreateScope_Succeeds()
{
@@ -222,7 +222,7 @@ public sealed class EvidenceLockerWebServiceContractTests : IDisposable
response.StatusCode.Should().Be(HttpStatusCode.OK);
}
[Trait("Category", TestCategories.Unit)]
[Trait("Category", TestCategories.Integration)]
[Fact]
public async Task RetrieveArtifact_Without_ReadScope_Returns_Forbidden()
{
@@ -249,7 +249,7 @@ public sealed class EvidenceLockerWebServiceContractTests : IDisposable
response.StatusCode.Should().BeOneOf(HttpStatusCode.Forbidden, HttpStatusCode.Unauthorized);
}
[Trait("Category", TestCategories.Unit)]
[Trait("Category", TestCategories.Integration)]
[Fact]
public async Task CrossTenant_Access_Returns_NotFound_Or_Forbidden()
{
@@ -277,7 +277,7 @@ public sealed class EvidenceLockerWebServiceContractTests : IDisposable
response.StatusCode.Should().BeOneOf(HttpStatusCode.NotFound, HttpStatusCode.Forbidden);
}
[Trait("Category", TestCategories.Unit)]
[Trait("Category", TestCategories.Integration)]
[Fact]
public async Task Download_Without_ReadScope_Returns_Forbidden()
{
@@ -308,7 +308,7 @@ public sealed class EvidenceLockerWebServiceContractTests : IDisposable
#region EVIDENCE-5100-006: OTel Trace Assertions
[Trait("Category", TestCategories.Unit)]
[Trait("Category", TestCategories.Integration)]
[Fact]
public async Task StoreArtifact_Emits_OTel_Trace_With_ArtifactId()
{
@@ -356,7 +356,7 @@ public sealed class EvidenceLockerWebServiceContractTests : IDisposable
listener.Dispose();
}
[Trait("Category", TestCategories.Unit)]
[Trait("Category", TestCategories.Integration)]
[Fact]
public async Task StoreArtifact_Timeline_Contains_TenantId()
{
@@ -379,7 +379,7 @@ public sealed class EvidenceLockerWebServiceContractTests : IDisposable
// Note: Actual assertion depends on how tenant_id is encoded in timeline events
}
[Trait("Category", TestCategories.Unit)]
[Trait("Category", TestCategories.Integration)]
[Fact]
public async Task RetrieveArtifact_Emits_Trace_With_BundleId()
{
@@ -407,7 +407,7 @@ public sealed class EvidenceLockerWebServiceContractTests : IDisposable
// Timeline events may or may not be emitted on read depending on configuration
}
[Trait("Category", TestCategories.Unit)]
[Trait("Category", TestCategories.Integration)]
[Fact]
public async Task Error_Response_Does_Not_Leak_Internal_Details()
{

View File

@@ -13,7 +13,7 @@ public sealed class GoldenFixturesTests
private static readonly JsonSerializerOptions JsonOptions = new(JsonSerializerDefaults.Web);
[Trait("Category", TestCategories.Unit)]
[Fact]
[Fact(Skip = "Fixture files not yet created - see TASKS.md")]
public void SealedBundle_Fixture_HashAndSubjectMatch()
{
var root = FixturePath("sealed");
@@ -39,7 +39,7 @@ public sealed class GoldenFixturesTests
}
[Trait("Category", TestCategories.Unit)]
[Fact]
[Fact(Skip = "Fixture files not yet created - see TASKS.md")]
public void PortableBundle_Fixture_RedactionAndSubjectMatch()
{
var root = FixturePath("portable");
@@ -59,7 +59,7 @@ public sealed class GoldenFixturesTests
}
[Trait("Category", TestCategories.Unit)]
[Fact]
[Fact(Skip = "Fixture files not yet created - see TASKS.md")]
public void ReplayFixture_RecordDigestMatches()
{
var root = FixturePath("replay");

View File

@@ -1,7 +1,7 @@
# Evidence Locker Tests Task Board
This board mirrors active sprint tasks for this module.
Source of truth: `docs/implplan/SPRINT_20251229_049_BE_csproj_audit_maint_tests.md`.
Source of truth: `docs-archived/implplan/2025-12-29-csproj-audit/SPRINT_20251229_049_BE_csproj_audit_maint_tests.md`.
| Task ID | Status | Notes |
| --- | --- | --- |

View File

@@ -1,7 +1,7 @@
# Evidence Locker WebService Task Board
This board mirrors active sprint tasks for this module.
Source of truth: `docs/implplan/SPRINT_20251229_049_BE_csproj_audit_maint_tests.md`.
Source of truth: `docs-archived/implplan/2025-12-29-csproj-audit/SPRINT_20251229_049_BE_csproj_audit_maint_tests.md`.
| Task ID | Status | Notes |
| --- | --- | --- |

View File

@@ -1,7 +1,7 @@
# Evidence Locker Worker Task Board
This board mirrors active sprint tasks for this module.
Source of truth: `docs/implplan/SPRINT_20251229_049_BE_csproj_audit_maint_tests.md`.
Source of truth: `docs-archived/implplan/2025-12-29-csproj-audit/SPRINT_20251229_049_BE_csproj_audit_maint_tests.md`.
| Task ID | Status | Notes |
| --- | --- | --- |

View File

@@ -1,7 +1,7 @@
# Evidence Locker Task Board
This board mirrors active sprint tasks for this module.
Source of truth: `docs/implplan/SPRINT_20251229_049_BE_csproj_audit_maint_tests.md`.
Source of truth: `docs-archived/implplan/2025-12-29-csproj-audit/SPRINT_20251229_049_BE_csproj_audit_maint_tests.md`.
| Task ID | Status | Notes |
| --- | --- | --- |