sprints work

This commit is contained in:
StellaOps Bot
2025-12-25 12:19:12 +02:00
parent 223843f1d1
commit 2a06f780cf
224 changed files with 41796 additions and 1515 deletions

View File

@@ -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>

View File

@@ -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
};
}