audit, advisories and doctors/setup work
This commit is contained in:
@@ -2,6 +2,7 @@ using System.Globalization;
|
||||
using System.Text.Json;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using StellaOps.Canonical.Json;
|
||||
using StellaOps.Determinism;
|
||||
using StellaOps.Provcache.Entities;
|
||||
|
||||
@@ -16,7 +17,11 @@ public sealed class PostgresProvcacheRepository : IProvcacheRepository
|
||||
private readonly ILogger<PostgresProvcacheRepository> _logger;
|
||||
private readonly TimeProvider _timeProvider;
|
||||
private readonly IGuidProvider _guidProvider;
|
||||
private readonly JsonSerializerOptions _jsonOptions;
|
||||
private static readonly JsonSerializerOptions ReplaySeedJsonOptions = new()
|
||||
{
|
||||
PropertyNamingPolicy = JsonNamingPolicy.CamelCase,
|
||||
PropertyNameCaseInsensitive = true
|
||||
};
|
||||
|
||||
public PostgresProvcacheRepository(
|
||||
ProvcacheDbContext context,
|
||||
@@ -28,11 +33,6 @@ public sealed class PostgresProvcacheRepository : IProvcacheRepository
|
||||
_logger = logger ?? throw new ArgumentNullException(nameof(logger));
|
||||
_timeProvider = timeProvider ?? TimeProvider.System;
|
||||
_guidProvider = guidProvider ?? SystemGuidProvider.Instance;
|
||||
_jsonOptions = new JsonSerializerOptions
|
||||
{
|
||||
PropertyNamingPolicy = JsonNamingPolicy.CamelCase,
|
||||
WriteIndented = false
|
||||
};
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
@@ -295,7 +295,7 @@ public sealed class PostgresProvcacheRepository : IProvcacheRepository
|
||||
|
||||
private ProvcacheEntry MapToEntry(ProvcacheItemEntity entity)
|
||||
{
|
||||
var replaySeed = JsonSerializer.Deserialize<ReplaySeed>(entity.ReplaySeed, _jsonOptions)
|
||||
var replaySeed = JsonSerializer.Deserialize<ReplaySeed>(entity.ReplaySeed, ReplaySeedJsonOptions)
|
||||
?? new ReplaySeed { FeedIds = [], RuleIds = [] };
|
||||
|
||||
return new ProvcacheEntry
|
||||
@@ -330,7 +330,7 @@ public sealed class PostgresProvcacheRepository : IProvcacheRepository
|
||||
DigestVersion = entry.Decision.DigestVersion,
|
||||
VerdictHash = entry.Decision.VerdictHash,
|
||||
ProofRoot = entry.Decision.ProofRoot,
|
||||
ReplaySeed = JsonSerializer.Serialize(entry.Decision.ReplaySeed, _jsonOptions),
|
||||
ReplaySeed = CanonJson.Serialize(entry.Decision.ReplaySeed, ReplaySeedJsonOptions),
|
||||
PolicyHash = entry.PolicyHash,
|
||||
SignerSetHash = entry.SignerSetHash,
|
||||
FeedEpoch = entry.FeedEpoch,
|
||||
|
||||
@@ -7,4 +7,4 @@ Source of truth: `docs-archived/implplan/2025-12-29-csproj-audit/SPRINT_20251229
|
||||
| --- | --- | --- |
|
||||
| AUDIT-0099-M | DONE | Revalidated 2026-01-08; maintainability audit for Provcache.Postgres. |
|
||||
| AUDIT-0099-T | DONE | Revalidated 2026-01-08; test coverage audit for Provcache.Postgres. |
|
||||
| AUDIT-0099-A | TODO | Pending approval (revalidated 2026-01-08). |
|
||||
| AUDIT-0099-A | DONE | Applied 2026-01-13 (CanonJson replay seeds; test gaps tracked). |
|
||||
|
||||
Reference in New Issue
Block a user