fix(admin): complete processing diagnostics and failure evidence

This commit is contained in:
cesnimda
2026-10-29 07:24:49 +01:00
parent 0dd788bdfc
commit 3255da9fc6
15 changed files with 450 additions and 36 deletions
+7 -5
View File
@@ -14,11 +14,13 @@ public static class OperationEventLog
public static string? SafeStage(string? value) => value is "cv_validating_file" or "cv_extracting" or "cv_identifying_sections"
or "cv_analysing" or "cv_validating_details" or "cv_preparing_review" or "cv_review_ready" ? value : null;
public static string? SafeFailure(string? value) => value is null ? null : value is
"timeout" or "lease_expired" or "deadline_exceeded" or "entitlement_changed" or "document_unavailable"
or "sidecar_unavailable" or "upstream_unavailable" or "invalid_response" or "circuit_open" or "rate_limited"
or "permission_denied" or "cancelled" or "upload_rejected" or "parser_failed" or "malformed_output" or "provider_unavailable"
? value : "processing_failed";
public static IReadOnlyList<string> FailureCodes { get; } = Array.AsReadOnly(new[]
{
"timeout", "lease_expired", "deadline_exceeded", "entitlement_changed", "document_unavailable",
"sidecar_unavailable", "upstream_unavailable", "invalid_response", "circuit_open", "rate_limited",
"permission_denied", "cancelled", "upload_rejected", "parser_failed", "malformed_output", "provider_unavailable",
});
public static string? SafeFailure(string? value) => value is null ? null : FailureCodes.Contains(value, StringComparer.Ordinal) ? value : "processing_failed";
public static UserOperationEvent Create(UserOperation operation, OperationEventKind kind, DateTime now,
string? status = null, string? stage = null, string? failure = null, int? attempt = null) => new()