stabilize tests
This commit is contained in:
@@ -25,9 +25,10 @@ Provide foundational data models, storage, and validation for Golden Set definit
|
||||
|
||||
## Required Reading
|
||||
- `docs/modules/binary-index/golden-set-schema.md`
|
||||
- `docs/implplan/SPRINT_20260110_012_001_BINDEX_golden_set_foundation.md`
|
||||
- `docs-archived/implplan/SPRINT_20260110_012_001_BINDEX_golden_set_foundation.md`
|
||||
|
||||
## Test Strategy
|
||||
- Unit tests in `StellaOps.BinaryIndex.GoldenSet.Tests`
|
||||
- Integration tests with Testcontainers PostgreSQL
|
||||
- Property-based tests for serialization round-trip
|
||||
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
// Licensed under BUSL-1.1. Copyright (C) 2026 StellaOps Contributors.
|
||||
|
||||
|
||||
|
||||
using Microsoft.Extensions.Logging;
|
||||
using System.Collections.Immutable;
|
||||
using System.Globalization;
|
||||
using System.Text.RegularExpressions;
|
||||
|
||||
using Microsoft.Extensions.Logging;
|
||||
|
||||
namespace StellaOps.BinaryIndex.GoldenSet.Authoring.Extractors;
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
// Licensed under BUSL-1.1. Copyright (C) 2026 StellaOps Contributors.
|
||||
|
||||
using System.Collections.Immutable;
|
||||
using System.Globalization;
|
||||
using System.Text.Json;
|
||||
|
||||
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Microsoft.Extensions.Options;
|
||||
using System.Collections.Immutable;
|
||||
using System.Globalization;
|
||||
using System.Text.Json;
|
||||
|
||||
namespace StellaOps.BinaryIndex.GoldenSet.Authoring;
|
||||
|
||||
|
||||
@@ -1,12 +1,13 @@
|
||||
// Licensed under BUSL-1.1. Copyright (C) 2026 StellaOps Contributors.
|
||||
|
||||
using System.Collections.Immutable;
|
||||
using System.Globalization;
|
||||
|
||||
|
||||
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Microsoft.Extensions.Options;
|
||||
|
||||
using StellaOps.BinaryIndex.GoldenSet.Authoring.Extractors;
|
||||
using System.Collections.Immutable;
|
||||
using System.Globalization;
|
||||
|
||||
namespace StellaOps.BinaryIndex.GoldenSet.Authoring;
|
||||
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
// Licensed under BUSL-1.1. Copyright (C) 2026 StellaOps Contributors.
|
||||
|
||||
|
||||
|
||||
using Microsoft.Extensions.Logging;
|
||||
using System.Collections.Frozen;
|
||||
using System.Collections.Immutable;
|
||||
using System.Globalization;
|
||||
|
||||
using Microsoft.Extensions.Logging;
|
||||
|
||||
namespace StellaOps.BinaryIndex.GoldenSet.Authoring;
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
// Licensed under BUSL-1.1. Copyright (C) 2026 StellaOps Contributors.
|
||||
|
||||
|
||||
|
||||
using Microsoft.Extensions.Logging;
|
||||
using System.Collections.Immutable;
|
||||
using System.Globalization;
|
||||
using System.Text.RegularExpressions;
|
||||
|
||||
using Microsoft.Extensions.Logging;
|
||||
|
||||
namespace StellaOps.BinaryIndex.GoldenSet.Authoring;
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -249,6 +249,11 @@ public static class GoldenSetConstants
|
||||
/// </summary>
|
||||
public const string GhsaIdPattern = @"^GHSA-[a-z0-9]{4}-[a-z0-9]{4}-[a-z0-9]{4}$";
|
||||
|
||||
/// <summary>
|
||||
/// Regex pattern for synthetic test fixture IDs.
|
||||
/// </summary>
|
||||
public const string SyntheticIdPattern = @"^SYNTH-\d{4}-[a-z][a-z0-9\-]*$";
|
||||
|
||||
/// <summary>
|
||||
/// Regex pattern for basic block edge format.
|
||||
/// </summary>
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
using System.Collections.Immutable;
|
||||
|
||||
|
||||
using Microsoft.Extensions.Caching.Memory;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using System.Collections.Immutable;
|
||||
|
||||
namespace StellaOps.BinaryIndex.GoldenSet;
|
||||
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
using System.Collections.Immutable;
|
||||
using System.Globalization;
|
||||
using System.Text.Json;
|
||||
|
||||
|
||||
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Microsoft.Extensions.Options;
|
||||
|
||||
using Npgsql;
|
||||
using System.Collections.Immutable;
|
||||
using System.Globalization;
|
||||
using System.Text.Json;
|
||||
|
||||
namespace StellaOps.BinaryIndex.GoldenSet;
|
||||
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
# StellaOps.BinaryIndex.GoldenSet Task Board
|
||||
This board mirrors active sprint tasks for this module.
|
||||
Source of truth: `docs/implplan/SPRINT_20260130_002_Tools_csproj_remediation_solid_review.md`.
|
||||
|
||||
| Task ID | Status | Notes |
|
||||
| --- | --- | --- |
|
||||
| REMED-05 | TODO | Remediation checklist: docs/implplan/audits/csproj-standards/remediation/checklists/src/BinaryIndex/__Libraries/StellaOps.BinaryIndex.GoldenSet/StellaOps.BinaryIndex.GoldenSet.md. |
|
||||
| REMED-06 | DONE | SOLID review notes captured for SPRINT_20260130_002. |
|
||||
@@ -1,3 +1,7 @@
|
||||
|
||||
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Microsoft.Extensions.Options;
|
||||
using System.Collections.Immutable;
|
||||
using System.Globalization;
|
||||
using System.Security.Cryptography;
|
||||
@@ -5,9 +9,6 @@ using System.Text;
|
||||
using System.Text.Json;
|
||||
using System.Text.RegularExpressions;
|
||||
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Microsoft.Extensions.Options;
|
||||
|
||||
namespace StellaOps.BinaryIndex.GoldenSet;
|
||||
|
||||
/// <summary>
|
||||
@@ -142,12 +143,12 @@ public sealed partial class GoldenSetValidator : IGoldenSetValidator
|
||||
return; // Already reported as missing
|
||||
}
|
||||
|
||||
// Accept CVE-YYYY-NNNN or GHSA-xxxx-xxxx-xxxx formats
|
||||
if (!CveIdRegex().IsMatch(id) && !GhsaIdRegex().IsMatch(id))
|
||||
// Accept CVE-YYYY-NNNN, GHSA-xxxx-xxxx-xxxx, or SYNTH-NNNN-xxx formats
|
||||
if (!CveIdRegex().IsMatch(id) && !GhsaIdRegex().IsMatch(id) && !SyntheticIdRegex().IsMatch(id))
|
||||
{
|
||||
errors.Add(new ValidationError(
|
||||
ValidationErrorCodes.InvalidIdFormat,
|
||||
string.Format(CultureInfo.InvariantCulture, "Invalid ID format: {0}. Expected CVE-YYYY-NNNN or GHSA-xxxx-xxxx-xxxx.", id),
|
||||
string.Format(CultureInfo.InvariantCulture, "Invalid ID format: {0}. Expected CVE-YYYY-NNNN, GHSA-xxxx-xxxx-xxxx, or SYNTH-NNNN-name.", id),
|
||||
"id"));
|
||||
}
|
||||
}
|
||||
@@ -401,6 +402,9 @@ public sealed partial class GoldenSetValidator : IGoldenSetValidator
|
||||
[GeneratedRegex(GoldenSetConstants.GhsaIdPattern)]
|
||||
private static partial Regex GhsaIdRegex();
|
||||
|
||||
[GeneratedRegex(GoldenSetConstants.SyntheticIdPattern)]
|
||||
private static partial Regex SyntheticIdRegex();
|
||||
|
||||
[GeneratedRegex(@"^\d+\.\d+\.\d+$")]
|
||||
private static partial Regex SchemaVersionRegex();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user