feat(audit-log): surface partition-purge failure as health event + counter

This commit is contained in:
Joseph Doherty
2026-07-09 06:49:28 -04:00
parent b59aa2d717
commit 14c4df54f9
9 changed files with 202 additions and 5 deletions
@@ -212,6 +212,12 @@ public static class ServiceCollectionExtensions
// redaction-failure counters.
services.TryAddSingleton<IAuditInboundCeilingHitsCounter, NoOpAuditInboundCeilingHitsCounter>();
// AuditLog purge-failure counter — NoOp default for site/test
// composition roots. AddAuditLogCentralMaintenance below replaces this binding
// with the AuditCentralHealthSnapshot implementation so partition/channel purge
// failures surface on the central dashboard alongside the write-failure counter.
services.TryAddSingleton<IAuditPurgeFailureCounter, NoOpAuditPurgeFailureCounter>();
// Central direct-write audit writer used by
// NotificationOutboxActor and Inbound API to
// emit AuditLog rows that originate ON central, not via site telemetry.
@@ -419,6 +425,11 @@ public static class ServiceCollectionExtensions
// ICentralAuditWriteFailureCounter above.
services.Replace(ServiceDescriptor.Singleton<IAuditInboundCeilingHitsCounter>(
sp => sp.GetRequiredService<AuditCentralHealthSnapshot>()));
// Replace the NoOp IAuditPurgeFailureCounter with the AuditCentralHealthSnapshot so
// partition/channel purge failures surface on the central dashboard. Same
// singleton-forward pattern as ICentralAuditWriteFailureCounter above (arch-review 04, S2).
services.Replace(ServiceDescriptor.Singleton<IAuditPurgeFailureCounter>(
sp => sp.GetRequiredService<AuditCentralHealthSnapshot>()));
return services;
}