sprints work
This commit is contained in:
@@ -66,6 +66,24 @@ public sealed record BudgetCheckResult
|
||||
public IReadOnlyDictionary<UnknownReasonCode, BudgetViolation> Violations { get; init; }
|
||||
= new Dictionary<UnknownReasonCode, BudgetViolation>();
|
||||
public string? Message { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// The budget configuration that was applied during evaluation.
|
||||
/// Required for attestation to capture the policy at decision time.
|
||||
/// </summary>
|
||||
public UnknownBudget? Budget { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// Breakdown of unknown counts by reason code.
|
||||
/// Required for attestation detail.
|
||||
/// </summary>
|
||||
public IReadOnlyDictionary<UnknownReasonCode, int> CountsByReason { get; init; }
|
||||
= new Dictionary<UnknownReasonCode, int>();
|
||||
|
||||
/// <summary>
|
||||
/// Cumulative uncertainty score across all unknowns.
|
||||
/// </summary>
|
||||
public double CumulativeUncertainty { get; init; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -92,6 +92,9 @@ public sealed class UnknownBudgetService : IUnknownBudgetService
|
||||
? null
|
||||
: budget.ExceededMessage ?? $"Unknown budget exceeded: {total} unknowns in {normalized}";
|
||||
|
||||
// Calculate cumulative uncertainty from unknown uncertainty factors
|
||||
var cumulativeUncertainty = safeUnknowns.Sum(u => (double)u.UncertaintyFactor);
|
||||
|
||||
return new BudgetCheckResult
|
||||
{
|
||||
IsWithinBudget = isWithinBudget,
|
||||
@@ -99,7 +102,10 @@ public sealed class UnknownBudgetService : IUnknownBudgetService
|
||||
TotalUnknowns = total,
|
||||
TotalLimit = budget.TotalLimit,
|
||||
Violations = violations,
|
||||
Message = message
|
||||
Message = message,
|
||||
Budget = budget,
|
||||
CountsByReason = byReason,
|
||||
CumulativeUncertainty = cumulativeUncertainty
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user